:root {
    --bg: #05070a;
    --bg-soft: #0b0f17;
    --card: rgba(16, 22, 34, 0.72);
    --card-border: rgba(94, 234, 255, 0.18);
    --primary: #5eeaff;
    --primary-dim: rgba(94, 234, 255, 0.15);
    --accent: #ff5e9a;
    --accent-dim: rgba(255, 94, 154, 0.15);
    --text: #e8f4f8;
    --text-dim: #8aa0b3;
    --success: #5effa8;
    --warning: #ffd05e;
    --danger: #ff5e5e;
    --radius: 24px;
    --shadow: 0 0 40px rgba(94, 234, 255, 0.08);
    --transition: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.grid {
    position: absolute;
    inset: -50%;
    background-image:
        linear-gradient(rgba(94, 234, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(94, 234, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
}

.glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80vh;
    height: 80vh;
    background: radial-gradient(circle, rgba(94, 234, 255, 0.12) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    animation: pulseGlow 6s ease-in-out infinite;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(60px); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

.app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.screen {
    display: none;
    width: 100%;
    max-width: 720px;
    animation: fadeIn 0.6s ease forwards;
}

.screen.active {
    display: block;
}

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

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #3aa8ff 100%);
    color: #001018;
    box-shadow: 0 8px 32px rgba(94, 234, 255, 0.25);
}

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

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--card-border);
    box-shadow: inset 0 0 20px rgba(94, 234, 255, 0.05);
}

.btn-secondary:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 卡片 */
.card {
    border-radius: var(--radius);
    padding: 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
}

.glass {
    background: linear-gradient(145deg, rgba(16, 22, 34, 0.8), rgba(10, 14, 22, 0.85));
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}

.step {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--primary-dim);
}

.card-body {
    margin-bottom: 28px;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

/* 开场 */
.intro-content {
    text-align: center;
    padding: 40px 0;
}

.logo-pulse {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 40px;
}

.ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0;
    animation: ripple 2.5s ease-out infinite;
}

.ring-2 { animation-delay: 0.5s; }
.ring-3 { animation-delay: 1s; }

@keyframes ripple {
    0% { transform: scale(0.6); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}

.core {
    position: absolute;
    inset: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary) 0%, #3aa8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 0 40px rgba(94, 234, 255, 0.4);
    animation: corePulse 2s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(94, 234, 255, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(94, 234, 255, 0.6); }
}

.title {
    font-size: clamp(32px, 8vw, 56px);
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--primary);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(20px, 9999px, 15px, 0); }
    20% { clip: rect(50px, 9999px, 80px, 0); }
    40% { clip: rect(10px, 9999px, 60px, 0); }
    60% { clip: rect(70px, 9999px, 30px, 0); }
    80% { clip: rect(30px, 9999px, 90px, 0); }
    100% { clip: rect(60px, 9999px, 20px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(60px, 9999px, 20px, 0); }
    20% { clip: rect(10px, 9999px, 70px, 0); }
    40% { clip: rect(40px, 9999px, 10px, 0); }
    60% { clip: rect(80px, 9999px, 50px, 0); }
    80% { clip: rect(20px, 9999px, 80px, 0); }
    100% { clip: rect(50px, 9999px, 30px, 0); }
}

.subtitle {
    font-size: 18px;
    color: var(--text-dim);
    margin-bottom: 48px;
    letter-spacing: 1px;
}

/* 输入 */
.input-label {
    display: block;
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text);
}

.input-field {
    width: 100%;
    padding: 16px 20px;
    font-size: 18px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-dim);
    background: rgba(255, 255, 255, 0.07);
}

.input-field::placeholder {
    color: var(--text-dim);
}

.hint {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-dim);
}

/* 测评进度 */
.quiz-header {
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width 0.5s ease;
    box-shadow: 0 0 12px rgba(94, 234, 255, 0.4);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-dim);
}

#dimension-name {
    color: var(--primary);
    font-weight: 600;
}

.quiz-card {
    text-align: center;
}

.dimension-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dim), var(--accent-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border: 1px solid var(--card-border);
    box-shadow: 0 0 30px rgba(94, 234, 255, 0.1);
}

.question-text {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 32px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}

.option:hover {
    background: rgba(94, 234, 255, 0.08);
    border-color: var(--primary);
    transform: translateX(6px);
}

.option.selected {
    background: var(--primary-dim);
    border-color: var(--primary);
}

.option-index {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.option-text {
    font-size: 16px;
    line-height: 1.5;
}

/* 加载 */
.loading-content {
    text-align: center;
    padding: 60px 0;
}

.spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 32px;
    border-radius: 50%;
    border: 3px solid rgba(94, 234, 255, 0.1);
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    animation: spin 1s linear infinite;
}

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

.loading-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.loading-content p {
    color: var(--text-dim);
}

/* 报告 */
.report-container {
    width: 100%;
    max-width: 840px;
}

.report-header {
    text-align: center;
    margin-bottom: 32px;
}

.report-header h2 {
    font-size: clamp(22px, 5vw, 30px);
    margin-bottom: 24px;
}

.report-header h2 span {
    color: var(--primary);
}

.score-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.score-ring {
    position: relative;
    width: 180px;
    height: 180px;
}

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

.score-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 10;
}

.score-value {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1.5s ease-out;
}

.score-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
}

.score-status {
    font-size: 20px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 999px;
    background: var(--primary-dim);
    color: var(--primary);
    border: 1px solid var(--card-border);
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card, .detail-card {
    padding: 24px;
}

.chart-card h3, .detail-card h3, .advice-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text);
}

#radar-chart {
    width: 100%;
    height: auto;
    max-width: 320px;
    margin: 0 auto;
    display: block;
}

.dimension-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dimension-item {
    display: grid;
    grid-template-columns: 70px 1fr 40px;
    align-items: center;
    gap: 12px;
}

.dim-label {
    font-size: 14px;
    color: var(--text-dim);
}

.dim-bar-wrap {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.dim-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 1s ease-out;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.dim-score {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

.advice-card {
    margin-bottom: 24px;
}

.advice-card p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dim);
}

.report-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* 响应式 */
@media (max-width: 640px) {
    .app {
        padding: 16px;
        justify-content: flex-start;
        padding-top: 40px;
    }

    .card {
        padding: 24px;
    }

    .report-grid {
        grid-template-columns: 1fr;
    }

    .question-text {
        font-size: 18px;
    }

    .option {
        padding: 14px 16px;
    }

    .score-ring {
        width: 150px;
        height: 150px;
    }

    .score-number {
        font-size: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
