/* ============================================
   心灵测径 — Premium CSS
   ============================================ */

/* ---------- 基础 ---------- */
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- 导航栏玻璃态 ---------- */
.nav-glass {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.dark .nav-glass {
    background: rgba(10, 10, 20, 0.75);
}

/* ---------- 导航链接 ---------- */
.nav-link {
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}
.nav-link:hover {
    color: #1f2937;
    background: rgba(0, 0, 0, 0.04);
}
.dark .nav-link:hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.06);
}
.nav-link-active {
    color: #3490fc !important;
    background: rgba(52, 144, 252, 0.08) !important;
}
.dark .nav-link-active {
    color: #5ab0ff !important;
    background: rgba(52, 144, 252, 0.12) !important;
}

/* ---------- Hero背景 ---------- */
.hero-bg {
    background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(52, 144, 252, 0.08), transparent),
                radial-gradient(ellipse 60% 50% at 80% 80%, rgba(168, 85, 247, 0.06), transparent),
                radial-gradient(ellipse 50% 40% at 20% 60%, rgba(29, 201, 96, 0.05), transparent);
}
.dark .hero-bg {
    background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(52, 144, 252, 0.06), transparent),
                radial-gradient(ellipse 60% 50% at 80% 80%, rgba(168, 85, 247, 0.04), transparent),
                radial-gradient(ellipse 50% 40% at 20% 60%, rgba(29, 201, 96, 0.03), transparent);
}

/* ---------- 优质卡片 ---------- */
.card-premium {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    border-color: rgba(52, 144, 252, 0.2);
}
.dark .card-premium {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}
.dark .card-premium:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(52, 144, 252, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(52, 144, 252, 0.05);
}

/* ---------- 玻璃卡片 ---------- */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.dark .glass-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ---------- 按钮 ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 14px;
    background: linear-gradient(135deg, #3490fc, #7e22ce);
    color: white;
    box-shadow: 0 4px 14px rgba(52, 144, 252, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(52, 144, 252, 0.4);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-radius: 14px;
    color: #4b5563;
    background: rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}
.btn-ghost:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
}
.dark .btn-ghost {
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.06);
}
.dark .btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

/* ---------- 选项按钮（MMPI 是/否） ---------- */
.option-btn {
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    font-weight: 500;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.2s;
    text-align: center;
}
.option-btn:hover {
    border-color: #93c5fd;
    color: #1f2937;
}
.dark .option-btn {
    border-color: #374151;
    color: #9ca3af;
}
.dark .option-btn:hover {
    border-color: #60a5fa;
    color: #e5e7eb;
}
.option-btn-selected {
    border-color: #3490fc !important;
    background: rgba(52, 144, 252, 0.08) !important;
    color: #3490fc !important;
}
.dark .option-btn-selected {
    border-color: #5ab0ff !important;
    background: rgba(90, 176, 255, 0.1) !important;
    color: #5ab0ff !important;
}

/* ---------- "不清楚"按钮（MMPI 第三选项） ---------- */
.option-btn-skip-idle {
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    font-weight: 500;
    font-size: 14px;
    color: #9ca3af;
    transition: all 0.2s;
    text-align: center;
}
.option-btn-skip-idle:hover {
    border-color: #d1d5db;
    color: #6b7280;
    background: rgba(0, 0, 0, 0.02);
}
.dark .option-btn-skip-idle {
    border-color: #374151;
    color: #6b7280;
}
.dark .option-btn-skip-idle:hover {
    border-color: #4b5563;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.03);
}

.option-btn-skip-active {
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid #f59e0b !important;
    background: rgba(245, 158, 11, 0.08) !important;
    font-weight: 500;
    font-size: 14px;
    color: #d97706 !important;
    transition: all 0.2s;
    text-align: center;
}
.dark .option-btn-skip-active {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.12) !important;
    color: #fbbf24 !important;
}

/* ---------- 选项按钮（SDS/SAS/SCL-90大按钮） ---------- */
.option-btn-large {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 16px;
    border: 2px solid #e5e7eb;
    font-size: 15px;
    color: #4b5563;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
}
.option-btn-large:hover {
    border-color: #93c5fd;
    transform: translateX(4px);
}
.dark .option-btn-large {
    border-color: #374151;
    color: #d1d5db;
}
.dark .option-btn-large:hover {
    border-color: #60a5fa;
}
.option-btn-large-selected {
    border-color: #3490fc !important;
    background: linear-gradient(135deg, rgba(52, 144, 252, 0.08), rgba(126, 34, 206, 0.05)) !important;
    color: #3490fc !important;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(52, 144, 252, 0.15);
}
.dark .option-btn-large-selected {
    border-color: #5ab0ff !important;
    background: linear-gradient(135deg, rgba(90, 176, 255, 0.1), rgba(168, 85, 247, 0.06)) !important;
    color: #5ab0ff !important;
}

.option-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: #f3f4f6;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.dark .option-number {
    background: rgba(255, 255, 255, 0.06);
}
.option-btn-large-selected .option-number {
    background: rgba(52, 144, 252, 0.15);
    color: #3490fc;
}
.dark .option-btn-large-selected .option-number {
    background: rgba(90, 176, 255, 0.15);
    color: #5ab0ff;
}

/* ---------- 工具提示 ---------- */
[x-cloak] { display: none !important; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #374151; }

/* ---------- 动画 ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* ---------- 条状得分分布图 ---------- */
.gauge-bar-container {
    position: relative;
    padding: 16px 0 8px;
}

.gauge-bar-track {
    display: flex;
    height: 28px;
    border-radius: 100px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.gauge-bar-segment {
    height: 100%;
    transition: opacity 0.2s;
    position: relative;
}

.gauge-bar-segment:hover {
    opacity: 0.8;
}

/* 指针三角 */
.gauge-bar-needle {
    position: absolute;
    top: 2px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 10px solid;
    transform: translateX(-7px);
    transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* 指针竖线 */
.gauge-bar-needle-line {
    position: absolute;
    top: 12px;
    width: 3px;
    height: 36px;
    border-radius: 2px;
    transform: translateX(-1.5px);
    transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}

/* 分值标签行 */
.gauge-bar-labels {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #9ca3af;
    height: 18px;
}

.gauge-bar-label-tick {
    position: absolute;
    transform: translateX(-50%);
    font-variant-numeric: tabular-nums;
}

.gauge-bar-label-edge {
    font-variant-numeric: tabular-nums;
}

/* 图例 */
.gauge-bar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
    justify-content: center;
}

.gauge-bar-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.dark .gauge-bar-legend-item {
    color: #9ca3af;
}

.dark .gauge-bar-labels {
    color: #6b7280;
}

.gauge-bar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
