:root {
    --ink: #16201a;
    --muted: #647066;
    --paper: #f6f1e6;
    --panel: rgba(255, 252, 243, 0.88);
    --line: rgba(22, 32, 26, 0.14);
    --shadow: 0 30px 80px rgba(45, 54, 44, 0.16);
    --accent: #4f8cff;
    --accent-deep: #1a3a6e;
}

* { 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(79, 140, 255, 0.18), transparent 28%),
        radial-gradient(circle at 82% 12%, rgba(26, 58, 110, 0.12), transparent 30%),
        linear-gradient(135deg, #f8f0df 0%, #edf3e6 52%, #e7efe8 100%);
}

body::before {
    position: fixed;
    inset: 0;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(22, 32, 26, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 32, 26, 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(820px, 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: var(--accent-deep);
    border: 1px solid var(--accent-deep);
    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 { background: rgba(79, 140, 255, 0.1); }

.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(79, 140, 255, 0.12);
}

.hidden { display: none !important; }

.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-desc .highlight { color: var(--accent-deep); font-weight: 700; }

.info-section {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: rgba(79, 140, 255, 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: var(--muted); line-height: 2; }
.info-list b { color: var(--ink); }

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

.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(79, 140, 255, 0.12);
}

.prompt-text {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    margin: 0 0 20px;
    font-weight: 600;
}

.matrix-display {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.matrix-grid {
    display: inline-flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line);
}

.matrix-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.matrix-cell {
    width: 82px;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: background 180ms ease;
}

.matrix-cell svg { display: block; }

.matrix-cell:hover { background: rgba(79, 140, 255, 0.05); }

.matrix-cell.empty {
    background: repeating-linear-gradient(45deg, #edf0ec, #edf0ec 8px, #dde2de 8px, #dde2de 16px);
    border-style: dashed;
}

.matrix-cell.empty svg text {
    fill: #96a49b;
}

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

.option-item {
    position: relative;
    padding: 10px 10px 12px;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 180ms ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    color: var(--ink);
}

.option-item:hover {
    border-color: var(--accent);
    background: rgba(79, 140, 255, 0.08);
}

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

.option-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-deep);
}

.option-svg {
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.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(26, 58, 110, 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-ring-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
}

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

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

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

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

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

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

.score-info { text-align: left; }

.result-title {
    font-size: 28px;
    font-weight: 900;
    margin: 0 0 8px;
    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: 14px;
    line-height: 1.7;
    color: var(--muted);
    margin: 0 0 8px;
    max-width: 280px;
}

.result-percentile {
    font-size: 13px;
    color: var(--accent-deep);
    font-weight: 700;
    margin: 0;
}

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

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

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

.section-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(22, 32, 26, 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: 60px; text-align: right; }

.result-advice {
    padding: 18px;
    border-radius: 14px;
    background: rgba(79, 140, 255, 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-ring-wrap { flex-direction: column; gap: 16px; }
    .score-section { grid-template-columns: 1fr 1.5fr auto; gap: 8px; }
    .option-svg { width: 62px; height: 62px; }
    .matrix-cell { width: 64px; height: 64px; }
    .matrix-row { gap: 6px; }
    .matrix-grid { gap: 6px; padding: 10px; }
}
