:root {
    --ink: #162033;
    --muted: #647086;
    --panel: rgba(255, 252, 243, 0.88);
    --line: rgba(22, 32, 51, 0.14);
    --shadow: 0 30px 80px rgba(126, 34, 206, 0.16);
    --accent: #a855f7;
    --accent-deep: #7e22ce;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    background:
        radial-gradient(circle at 12% 18%, rgba(168, 85, 247, 0.18), transparent 28%),
        radial-gradient(circle at 82% 12%, rgba(126, 34, 206, 0.12), transparent 30%),
        linear-gradient(135deg, #f3e8ff 0%, #ede9fe 52%, #faf5ff 100%);
}

body::before {
    position: fixed;
    inset: 0;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(22, 32, 51, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 32, 51, 0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 82%);
}

.page-shell {
    width: min(800px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 100px;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.back-link {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    color: #6b21a8;
    border: 1px solid #6b21a8;
    border-radius: 999px;
    background: rgba(255, 252, 243, 0.72);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}

.back-link:hover,
.back-link:focus-visible {
    background: rgba(255, 252, 243, 0.92);
    outline: none;
}

.page-title {
    flex: 1;
    margin: 0;
    font-size: 1.8em;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
}

.progress-indicator {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-deep);
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.12);
}

.hidden { display: none !important; }

.quiz-container { position: relative; }

.info-card,
.question-card,
.result-card {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.info-card h2 { margin: 0 0 16px; font-size: 24px; font-weight: 800; }

.info-desc {
    font-size: 16px;
    line-height: 1.8;
    margin: 0 0 16px;
}

.info-section {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: rgba(168, 85, 247, 0.08);
    border-left: 3px solid var(--accent);
}

.info-section-title { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--accent-deep); }
.info-text { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 0; }

.info-list { padding-left: 20px; margin: 0 0 28px; color: #5a6678; line-height: 2; }
.info-list b { color: var(--ink); }

.question-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.question-num {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
}

.question-category {
    font-size: 13px;
    color: var(--accent-deep);
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.12);
}

.question-text {
    font-size: 20px;
    line-height: 1.7;
    margin: 0 0 24px;
    font-weight: 600;
    text-align: center;
}

.options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 28px;
}

.option-item {
    padding: 14px 12px;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 180ms ease;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
    text-align: center;
    font-family: inherit;
    font-weight: 600;
}

.option-item:hover {
    border-color: var(--accent);
    background: rgba(168, 85, 247, 0.08);
}

.option-item.selected {
    border-color: var(--accent);
    background: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.nav-row { display: flex; justify-content: space-between; gap: 12px; }
.nav-row.center { justify-content: center; }

.primary-btn {
    display: block;
    margin: 24px auto 0;
    padding: 12px 32px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 160ms ease;
    font-family: inherit;
}

.primary-btn:hover {
    background: var(--accent-deep);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(126, 34, 206, 0.28);
}

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

.ghost-btn {
    padding: 12px 28px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 160ms ease;
    font-family: inherit;
}

.ghost-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.9); border-color: var(--accent); }
.ghost-btn:disabled { opacity: 0.4; cursor: not-allowed; }

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

.score-display { display: flex; justify-content: center; margin-bottom: 20px; }

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

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

.ring-bg { fill: none; stroke: rgba(22, 32, 51, 0.08); stroke-width: 12; }
.ring-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transition: stroke-dashoffset 1.2s ease;
}

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

.score-value {
    font-size: 48px;
    font-weight: 900;
    color: var(--accent-deep);
    line-height: 1;
}

.score-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 700;
    margin-top: 4px;
}

.result-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-desc {
    font-size: 15px;
    line-height: 1.8;
    color: var(--muted);
    margin: 0 auto 24px;
    max-width: 420px;
}

.score-breakdown { margin-bottom: 24px; text-align: left; }

.score-section {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.section-name { font-size: 13px; font-weight: 700; }

.section-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(22, 32, 51, 0.1);
    overflow: hidden;
}

.section-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-deep));
    transition: width 800ms ease;
    width: 0;
}

.section-score { font-size: 13px; font-weight: 700; color: var(--accent-deep); min-width: 50px; text-align: right; }

.result-advice {
    padding: 18px;
    border-radius: 14px;
    background: rgba(168, 85, 247, 0.08);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 24px;
    text-align: left;
}

.result-advice b { color: var(--accent-deep); }

@media (max-width: 640px) {
    .page-shell { width: min(100% - 28px, 640px); padding: 36px 0; }
    .info-card, .question-card, .result-card { padding: 24px 18px; }
    .options { grid-template-columns: repeat(2, 1fr); }
    .score-section { grid-template-columns: 80px 1fr auto; gap: 8px; }
    .question-text { font-size: 18px; }
}