/* =====================================================
   人生能量仪表盘 - 全局样式
   设计风格：深色科技感 / 玻璃拟态 / 霓虹渐变
   ===================================================== */

/* CSS 变量：统一色彩与尺寸 */
:root {
    --bg-deep: #050b14;
    --bg-card: rgba(13, 22, 40, 0.72);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-cyan: #00f2ff;
    --accent-purple: #7000ff;
    --accent-pink: #ff2a8a;
    --accent-green: #00ffa3;
    --accent-orange: #ffaa00;
    --shadow-glow: 0 0 40px rgba(0, 242, 255, 0.15);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

/* 基础重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 动态渐变背景 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(112, 0, 255, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(0, 242, 255, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(255, 42, 138, 0.06) 0%, transparent 60%);
    animation: bgPulse 12s ease-in-out infinite alternate;
    z-index: -2;
}

@keyframes bgPulse {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* 背景粒子层 */
.particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-cyan);
    border-radius: 50%;
    opacity: 0.4;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    20% { opacity: 0.6; }
    80% { opacity: 0.4; }
    100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* 主容器 */
.app-container {
    width: 100%;
    max-width: 720px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* 页面切换容器 */
.screen {
    display: none;
    animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 玻璃卡片 */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 48px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 242, 255, 0.5), transparent);
}

/* 欢迎页 */
.welcome-card {
    text-align: center;
}

.logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 28px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent-cyan);
    border-bottom-color: var(--accent-purple);
    animation: spin 4s linear infinite;
}

.logo-ring::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1px solid transparent;
    border-left-color: var(--accent-pink);
    border-right-color: var(--accent-cyan);
    animation: spinReverse 3s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes spinReverse {
    to { transform: rotate(-360deg); }
}

.logo-core {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(0, 242, 255, 0.6));
}

.main-title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 50%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.welcome-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 40px;
}

/* 按钮 */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 242, 255, 0.25);
    font-family: inherit;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 242, 255, 0.35);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary span,
.btn-primary svg {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* 答题页 */
.quiz-card {
    padding: 40px;
}

.quiz-header {
    margin-bottom: 32px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.dimension-label {
    color: var(--accent-cyan);
    font-weight: 700;
    letter-spacing: 1px;
}

.progress-text {
    color: var(--text-muted);
    font-family: 'Orbitron', sans-serif;
}

.progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 12px rgba(0, 242, 255, 0.4);
}

.question-area {
    text-align: center;
    margin-bottom: 32px;
}

.dimension-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: rgba(0, 242, 255, 0.08);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 0 24px rgba(0, 242, 255, 0.12);
}

.question-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
}

.question-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 选项网格 */
.options-grid {
    display: grid;
    gap: 14px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 242, 255, 0.4);
    transform: translateX(6px);
}

.option-btn:hover::before {
    opacity: 1;
}

.option-letter {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-cyan);
    background: rgba(0, 242, 255, 0.1);
    border-radius: 50%;
    transition: all 0.25s ease;
}

.option-btn:hover .option-letter {
    background: var(--accent-cyan);
    color: var(--bg-deep);
    box-shadow: 0 0 16px rgba(0, 242, 255, 0.5);
}

.option-text {
    position: relative;
    z-index: 1;
    line-height: 1.5;
}

/* 得分提示 */
.score-hint {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding: 14px 24px;
    background: rgba(0, 242, 255, 0.06);
    border: 1px solid rgba(0, 242, 255, 0.15);
    border-radius: var(--radius-md);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.score-hint.show {
    opacity: 1;
    transform: translateY(0);
}

.score-hint-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.score-hint-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent-cyan);
    text-shadow: 0 0 12px rgba(0, 242, 255, 0.4);
}

/* 结果页 */
.result-card {
    text-align: center;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text-secondary);
}

/* 能量环 */
.energy-ring-wrapper {
    width: 220px;
    height: 220px;
    margin: 0 auto 28px;
    position: relative;
}

.energy-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 12;
}

.ring-progress {
    fill: none;
    stroke: url(#ringGradient);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 534; /* 2 * PI * 85 */
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.5));
}

.ring-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.total-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fff, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.total-score-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
    letter-spacing: 2px;
}

/* 状态徽章 */
.status-badge {
    margin-bottom: 32px;
    padding: 20px 28px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-title {
    display: block;
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--accent-cyan);
}

.status-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* 维度得分明细 */
.dimensions-breakdown {
    display: grid;
    gap: 16px;
    margin-bottom: 32px;
    text-align: left;
}

.dimension-row {
    display: grid;
    grid-template-columns: 80px 1fr 48px;
    align-items: center;
    gap: 14px;
}

.dimension-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dimension-bar-track {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.dimension-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.dimension-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

/* 重新测评按钮 */
.btn-restart {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    box-shadow: 0 8px 24px rgba(255, 42, 138, 0.25);
}

.btn-restart:hover {
    box-shadow: 0 12px 32px rgba(255, 42, 138, 0.35);
}

/* 人生形象 */
.life-avatar {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.25) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

.life-avatar.show .avatar-glow {
    opacity: 1;
    transform: scale(1);
    animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0.4; }
}

.avatar-svg {
    position: relative;
    z-index: 1;
    width: 140px;
    height: 140px;
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.life-avatar.show .avatar-svg {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.avatar-svg svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 16px currentColor);
}

.avatar-caption {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
}

.life-avatar.show .avatar-caption {
    opacity: 1;
}

/* 响应式适配 */
@media (max-width: 640px) {
    .app-container {
        padding: 16px;
    }

    .glass-card {
        padding: 32px 24px;
    }

    .main-title {
        font-size: 1.9rem;
    }

    .question-title {
        font-size: 1.2rem;
    }

    .option-btn {
        padding: 14px 16px;
    }

    .energy-ring-wrapper {
        width: 180px;
        height: 180px;
    }

    .total-score {
        font-size: 3.2rem;
    }

    .dimension-row {
        grid-template-columns: 64px 1fr 40px;
        gap: 10px;
    }
}
