/* ==========================================================================
   问答测试 · 设计系统
   纯手写 CSS，无任何外部依赖（不加载 CDN / 字体 / 图标库）
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量
   -------------------------------------------------------------------------- */

:root {
    color-scheme: dark;

    --bg: #06080f;
    --bg-elevated: #0b1020;
    --panel: rgba(255, 255, 255, 0.045);
    --panel-hover: rgba(255, 255, 255, 0.075);
    --panel-solid: #0d1222;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.2);

    --text: #eef1ff;
    --text-muted: #9aa4bf;
    --text-faint: #6b7592;

    --accent: #8b5cf6;
    --accent-2: #22d3ee;
    --accent-soft: rgba(139, 92, 246, 0.16);

    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.12);
    --success-border: rgba(52, 211, 153, 0.35);

    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, 0.12);
    --danger-border: rgba(251, 113, 133, 0.38);

    --warning: #fbbf24;

    --header-bg: rgba(6, 8, 15, 0.72);
    --input-bg: rgba(255, 255, 255, 0.035);

    --shadow-lg: 0 30px 80px -40px rgba(0, 0, 0, 0.95);
    --ring: 0 0 0 4px rgba(139, 92, 246, 0.22);

    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 28px;
    --maxw: 1120px;

    --font: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui,
        -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
    --ease: cubic-bezier(0.22, 0.68, 0, 1);
}

html[data-theme="light"] {
    color-scheme: light;

    --bg: #f4f5fb;
    --bg-elevated: #ffffff;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-hover: #ffffff;
    --panel-solid: #ffffff;
    --border: rgba(15, 23, 42, 0.09);
    --border-strong: rgba(15, 23, 42, 0.2);

    --text: #0e1326;
    --text-muted: #55607a;
    --text-faint: #7b849c;

    --accent: #6d28d9;
    --accent-2: #0891b2;
    --accent-soft: rgba(109, 40, 217, 0.08);

    --success: #047857;
    --success-soft: rgba(4, 120, 87, 0.09);
    --success-border: rgba(4, 120, 87, 0.3);

    --danger: #be123c;
    --danger-soft: rgba(190, 18, 60, 0.08);
    --danger-border: rgba(190, 18, 60, 0.28);

    --warning: #b45309;

    --header-bg: rgba(244, 245, 251, 0.78);
    --input-bg: #ffffff;

    --shadow-lg: 0 24px 60px -40px rgba(15, 23, 42, 0.4);
    --ring: 0 0 0 4px rgba(109, 40, 217, 0.16);
}

/* --------------------------------------------------------------------------
   2. 基础
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

::selection {
    background: rgba(139, 92, 246, 0.35);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
}

img,
svg {
    display: block;
    max-width: 100%;
}

.icon {
    flex: 0 0 auto;
}

a {
    color: var(--accent-2);
    text-underline-offset: 3px;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    color: var(--text);
}

hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--panel-solid);
    border: 1px solid var(--border-strong);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: top 0.2s var(--ease);
}

.skip-link:focus {
    top: 12px;
}

/* --------------------------------------------------------------------------
   3. 背景装饰
   -------------------------------------------------------------------------- */

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

.aurora span {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: drift 26s var(--ease) infinite alternate;
}

.aurora span:nth-child(1) {
    width: 46vw;
    height: 46vw;
    min-width: 380px;
    min-height: 380px;
    left: -8vw;
    top: -16vw;
    background: rgba(124, 58, 237, 0.55);
}

.aurora span:nth-child(2) {
    width: 38vw;
    height: 38vw;
    min-width: 320px;
    min-height: 320px;
    right: -8vw;
    top: -10vw;
    background: rgba(34, 211, 238, 0.3);
    animation-delay: -8s;
}

.aurora span:nth-child(3) {
    width: 44vw;
    height: 44vw;
    min-width: 340px;
    min-height: 340px;
    left: 34%;
    top: 46%;
    background: rgba(236, 72, 153, 0.18);
    animation-delay: -15s;
}

html[data-theme="light"] .aurora span {
    opacity: 0.3;
    filter: blur(110px);
}

html[data-theme="light"] .aurora span:nth-child(1) {
    background: rgba(167, 139, 250, 0.55);
}

html[data-theme="light"] .aurora span:nth-child(2) {
    background: rgba(125, 211, 252, 0.5);
}

html[data-theme="light"] .aurora span:nth-child(3) {
    background: rgba(251, 207, 232, 0.6);
}

@keyframes drift {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(4vw, 3vh, 0) scale(1.12);
    }
}

.mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

html[data-theme="light"] .mesh {
    background-image: linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
}

/* --------------------------------------------------------------------------
   4. 布局
   -------------------------------------------------------------------------- */

.container {
    width: min(var(--maxw), calc(100% - 40px));
    margin-inline: auto;
}

.site-main {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    padding-bottom: 64px;
}

.section {
    padding: clamp(48px, 7vw, 88px) 0 0;
}

.section--tight {
    padding-top: 36px;
}

.section-head {
    max-width: 60ch;
    margin: 0 auto 32px;
    text-align: center;
}

.section-head h2 {
    margin: 0 0 10px;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    letter-spacing: -0.025em;
}

.section-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14.5px;
}

.hide-sm {
    display: inline-flex;
}

.inline-form {
    display: inline-flex;
}

.text-muted {
    color: var(--text-muted);
}

.mono {
    font-family: var(--mono);
}

/* --------------------------------------------------------------------------
   5. 顶部导航
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.brand:hover {
    text-decoration: none;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
    box-shadow: 0 8px 20px -10px rgba(139, 92, 246, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.brand__mark--sm {
    width: 26px;
    height: 26px;
    border-radius: 9px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
}

.site-nav__link {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.18s, background 0.18s;
}

.site-nav__link:hover {
    color: var(--text);
    background: var(--panel);
    text-decoration: none;
}

.site-nav__link.is-active {
    color: var(--text);
    background: var(--panel);
}

.site-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* --------------------------------------------------------------------------
   6. 按钮
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s,
        box-shadow 0.18s, color 0.18s;
}

.btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

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

.btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.btn[disabled],
.btn.is-busy {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    box-shadow: 0 12px 28px -16px rgba(124, 58, 237, 1),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--primary:hover {
    box-shadow: 0 18px 36px -16px rgba(124, 58, 237, 1),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

html[data-theme="light"] .btn--primary {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.btn--ghost {
    border-color: var(--border);
    background: var(--panel);
    color: var(--text);
}

.btn--ghost:hover {
    border-color: var(--border-strong);
    background: var(--panel-hover);
}

.btn--danger {
    color: #fff;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 12px 28px -18px rgba(225, 29, 72, 1);
}

.btn--quiet {
    background: transparent;
    color: var(--text-muted);
}

.btn--quiet:hover {
    background: var(--panel);
    color: var(--text);
}

.btn--sm {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 10px;
}

.btn--lg {
    padding: 14px 24px;
    font-size: 15px;
    border-radius: 14px;
}

.btn--block {
    width: 100%;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--panel-hover);
}

.icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.icon-btn--danger:hover {
    color: var(--danger);
    border-color: var(--danger-border);
    background: var(--danger-soft);
}

.icon-btn--sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

.theme-icon {
    display: inline-flex;
}

.theme-icon--moon {
    display: none;
}

html[data-theme="light"] .theme-icon--sun {
    display: none;
}

html[data-theme="light"] .theme-icon--moon {
    display: inline-flex;
}

/* --------------------------------------------------------------------------
   7. 提示 / 弹层
   -------------------------------------------------------------------------- */

.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 20px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    font-size: 14px;
    animation: rise 0.35s var(--ease) both;
}

.alert > span {
    flex: 1;
}

.alert--success {
    border-color: var(--success-border);
    background: var(--success-soft);
}

.alert--success > .icon {
    color: var(--success);
}

.alert--error {
    border-color: var(--danger-border);
    background: var(--danger-soft);
}

.alert--error > .icon {
    color: var(--danger);
}

.alert--info > .icon {
    color: var(--accent-2);
}

.alert__close {
    display: grid;
    place-items: center;
    margin-left: auto;
    padding: 4px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text-faint);
    cursor: pointer;
}

.alert__close:hover {
    color: var(--text);
    background: var(--panel);
}

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 340px;
    padding: 12px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--panel-solid);
    color: var(--text);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 0.3s var(--ease);
}

.toast .icon {
    color: var(--success);
}

.toast--error .icon {
    color: var(--danger);
}

.toast.is-leaving {
    animation: toast-out 0.25s var(--ease) forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
}

dialog.modal {
    width: min(440px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-solid);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

dialog.modal::backdrop {
    background: rgba(3, 6, 16, 0.66);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.modal__body {
    padding: 26px;
}

.modal__title {
    margin: 0 0 10px;
    font-size: 19px;
    letter-spacing: -0.01em;
}

.modal__text {
    margin: 0 0 22px;
    color: var(--text-muted);
    font-size: 14px;
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --------------------------------------------------------------------------
   8. 首屏
   -------------------------------------------------------------------------- */

.hero {
    padding: clamp(48px, 8vw, 104px) 0 clamp(32px, 5vw, 56px);
    text-align: center;
}

.hero > * {
    animation: rise 0.6s var(--ease) both;
}

.hero > *:nth-child(2) {
    animation-delay: 0.06s;
}

.hero > *:nth-child(3) {
    animation-delay: 0.12s;
}

.hero > *:nth-child(4) {
    animation-delay: 0.18s;
}

.hero > *:nth-child(5) {
    animation-delay: 0.24s;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.eyebrow .icon {
    color: var(--accent-2);
}

.hero h1 {
    max-width: 18ch;
    margin: 24px auto 0;
    font-size: clamp(2.1rem, 6vw, 4.1rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.035em;
}

.gradient-text {
    background: linear-gradient(100deg, #c4b5fd 0%, #a78bfa 38%, #67e8f9 78%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

html[data-theme="light"] .gradient-text {
    background: linear-gradient(100deg, #6d28d9, #7c3aed 42%, #0891b2 92%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__lead {
    max-width: 58ch;
    margin: 22px auto 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 1.7vw, 1.15rem);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 34px;
}

.hero__hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    color: var(--text-faint);
    font-size: 13px;
}

.hero__hint .dot {
    opacity: 0.5;
}

/* --------------------------------------------------------------------------
   9. 功能卡片 / 步骤
   -------------------------------------------------------------------------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.feature {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}

.feature:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    background: var(--panel-hover);
}

.feature__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(34, 211, 238, 0.8));
    box-shadow: 0 12px 26px -16px rgba(139, 92, 246, 1);
}

.feature h3 {
    margin: 0 0 8px;
    font-size: 16.5px;
    letter-spacing: -0.01em;
}

.feature p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    counter-reset: step;
}

.step {
    position: relative;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
}

.step__num {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-family: var(--mono);
    font-size: 13px;
}

.step h3 {
    margin: 0 0 6px;
    font-size: 15.5px;
}

.step p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13.5px;
}

.cta-band {
    margin-top: clamp(48px, 7vw, 88px);
    padding: clamp(30px, 4vw, 52px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.08));
    text-align: center;
}

html[data-theme="light"] .cta-band {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(34, 211, 238, 0.1));
}

.cta-band h2 {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 2.6vw, 1.8rem);
    letter-spacing: -0.025em;
}

.cta-band p {
    margin: 0 auto 24px;
    max-width: 50ch;
    color: var(--text-muted);
    font-size: 14.5px;
}

/* --------------------------------------------------------------------------
   10. 表单
   -------------------------------------------------------------------------- */

.auth {
    display: grid;
    place-items: center;
    padding: clamp(32px, 6vw, 72px) 0;
}

.auth__card {
    width: min(460px, 100%);
    padding: clamp(24px, 4vw, 36px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--panel);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
    animation: rise 0.5s var(--ease) both;
}

.auth__title {
    margin: 0 0 8px;
    font-size: clamp(1.3rem, 3vw, 1.55rem);
    letter-spacing: -0.025em;
}

.auth__sub {
    margin: 0 0 26px;
    color: var(--text-muted);
    font-size: 14px;
}

.field {
    margin-bottom: 16px;
}

.field__label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.field__hint {
    margin-top: 6px;
    color: var(--text-faint);
    font-size: 12px;
}

.input,
.textarea,
.select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 14.5px;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.textarea {
    min-height: 96px;
    line-height: 1.6;
    resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-faint);
}

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.input--mono {
    font-family: var(--mono);
    font-size: 15px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.input-affix {
    position: relative;
}

.input-affix .input {
    padding-right: 48px;
}

.input-affix__btn {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transform: translateY(-50%);
}

.input-affix__btn:hover {
    color: var(--text);
    background: var(--panel);
}

.form-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    padding: 11px 14px;
    border: 1px solid var(--danger-border);
    border-radius: 12px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 13.5px;
}

.form-error > span {
    color: var(--text);
}

.auth__alt {
    margin-top: 22px;
    color: var(--text-muted);
    font-size: 13.5px;
    text-align: center;
}

.auth__alt a {
    color: var(--accent-2);
    font-weight: 600;
}

.meter {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.meter span {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    transition: background 0.25s;
}

.meter[data-score="1"] span:nth-child(1) {
    background: var(--danger);
}

.meter[data-score="2"] span:nth-child(-n + 2) {
    background: var(--warning);
}

.meter[data-score="3"] span:nth-child(-n + 3) {
    background: var(--success);
}

.meter-label {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-faint);
}

.id-card {
    padding: 18px;
    border: 1px dashed var(--border-strong);
    border-radius: 16px;
    background: var(--accent-soft);
    text-align: center;
}

.id-card__label {
    color: var(--text-muted);
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.id-card__value {
    margin: 8px 0 12px;
    color: var(--text);
    font-family: var(--mono);
    font-size: clamp(1rem, 2.8vw, 1.3rem);
    letter-spacing: 0.18em;
    word-break: break-all;
}

.id-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   11. 个人空间
   -------------------------------------------------------------------------- */

.dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding-top: clamp(28px, 4vw, 44px);
}

.page-title {
    margin: 0;
    font-size: clamp(1.6rem, 3.2vw, 2.1rem);
    letter-spacing: -0.03em;
}

.page-sub {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.welcome {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(34, 211, 238, 0.06));
}

.welcome__text {
    flex: 1 1 260px;
    min-width: 220px;
}

.welcome__text h2 {
    margin: 0 0 6px;
    font-size: 16px;
}

.welcome__text p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13.5px;
}

.welcome .id-card {
    flex: 0 1 380px;
    min-width: 220px;
    background: var(--panel-solid);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin: 24px 0 32px;
}

.stat {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
}

.stat__value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat__value--accent {
    background: linear-gradient(120deg, #c4b5fd, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

html[data-theme="light"] .stat__value--accent {
    background: linear-gradient(120deg, #6d28d9, #0891b2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat__label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12.5px;
}

.section-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-bar h2 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -0.01em;
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.test-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.test-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}

.test-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.test-card__title {
    margin: 0;
    font-size: 16.5px;
    line-height: 1.35;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}

.test-card__desc {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 13.5px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.test-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--text-faint);
    font-size: 12.5px;
}

.test-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.share {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
}

.share__input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 11.5px;
    text-overflow: ellipsis;
}

.share__input:focus {
    outline: none;
    color: var(--text);
}

.test-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 2px;
}

.empty {
    padding: 56px 24px;
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    color: var(--text-muted);
    text-align: center;
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: var(--accent-soft);
    color: var(--accent-2);
}

.empty h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.empty p {
    margin: 0 auto 20px;
    max-width: 42ch;
    font-size: 13.5px;
}

.attempt-list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
}

.attempt-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
    transition: background 0.18s;
}

.attempt-row + .attempt-row {
    border-top: 1px solid var(--border);
}

.attempt-row:hover {
    background: var(--panel-hover);
    text-decoration: none;
}

.attempt-row__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attempt-row__score {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
}

.attempt-row__time {
    color: var(--text-faint);
    font-size: 12.5px;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   12. 编辑器
   -------------------------------------------------------------------------- */

.editor {
    display: grid;
    gap: 18px;
    padding-top: clamp(28px, 4vw, 44px);
}

.editor__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.editor__panel {
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.q-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.q-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-solid);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.q-card.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-soft);
}

.q-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.q-card__index {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-family: var(--mono);
    font-size: 12px;
}

.q-card__toolbar {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.option-row .input {
    flex: 1;
}

.pick {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    transition: border-color 0.18s;
}

.pick:hover {
    border-color: var(--accent);
}

.pick:checked {
    border-color: var(--accent);
}

.pick:checked::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--accent);
}

.pick:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.editor__bar {
    position: sticky;
    bottom: 16px;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-solid);
    box-shadow: var(--shadow-lg);
}

.editor__bar-note {
    color: var(--text-faint);
    font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   13. 答题
   -------------------------------------------------------------------------- */

.quiz {
    max-width: 820px;
    margin: 0 auto;
    padding-top: clamp(28px, 4vw, 44px);
}

.quiz__head {
    margin-bottom: 8px;
}

.quiz__title {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 3.4vw, 2rem);
    letter-spacing: -0.03em;
}

.quiz__desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 14.5px;
}

.quiz-progress {
    position: sticky;
    top: 80px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 22px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.progress {
    flex: 1;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(127, 127, 160, 0.22);
}

.progress__bar {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.35s var(--ease);
}

.quiz-progress__text {
    color: var(--text-muted);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.q-block {
    margin-bottom: 14px;
    padding: clamp(18px, 3vw, 26px);
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
}

.q-block.is-unanswered {
    border-color: var(--warning);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
}

.q-block__title {
    display: flex;
    gap: 12px;
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
}

.q-block__num {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-family: var(--mono);
    font-size: 12.5px;
}

.opt {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}

.opt:hover {
    border-color: var(--border-strong);
    background: var(--panel-hover);
}

.opt input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.opt__dot {
    position: relative;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    transition: border-color 0.18s;
}

.opt.is-selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.opt.is-selected .opt__dot {
    border-color: var(--accent);
}

.opt.is-selected .opt__dot::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--accent);
}

.opt__text {
    font-size: 14.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.quiz__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 22px;
}

/* --------------------------------------------------------------------------
   14. 结果
   -------------------------------------------------------------------------- */

.result {
    max-width: 860px;
    margin: 0 auto;
    padding-top: clamp(28px, 4vw, 48px);
}

.result__hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(20px, 4vw, 44px);
    padding: clamp(24px, 4vw, 36px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--panel);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    animation: rise 0.5s var(--ease) both;
}

.result__meta {
    flex: 1 1 300px;
    min-width: 240px;
}

.result__meta h1 {
    margin: 0 0 6px;
    font-size: clamp(1.4rem, 3.2vw, 1.9rem);
    letter-spacing: -0.03em;
}

.result__meta p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.result__numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 22px;
}

.result__number strong {
    display: block;
    font-size: 24px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.result__number span {
    color: var(--text-faint);
    font-size: 12.5px;
}

.score-ring {
    position: relative;
    flex: 0 0 auto;
    width: 156px;
    height: 156px;
    margin-inline: auto;
}

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

.score-ring__bg {
    fill: none;
    stroke: rgba(127, 127, 160, 0.18);
    stroke-width: 10;
}

.score-ring__fg {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dasharray 1.1s var(--ease);
}

.score-ring__label {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
}

.score-ring__value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.score-ring__cap {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11.5px;
}

.review {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 22px;
}

.review-item {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
}

.review-item--ok {
    border-color: var(--success-border);
}

.review-item--bad {
    border-color: var(--danger-border);
}

.review-item__head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.review-item__status {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    color: #fff;
}

.review-item--ok .review-item__status {
    background: var(--success);
}

.review-item--bad .review-item__status {
    background: var(--danger);
}

.review-item__text {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.review-opt {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.review-opt + .review-opt {
    margin-top: 4px;
}

.review-opt--correct {
    background: var(--success-soft);
    color: var(--success);
}

.review-opt--chosen-wrong {
    background: var(--danger-soft);
    color: var(--danger);
}

.review-opt__tag {
    margin-left: auto;
    padding: 2px 8px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0.9;
}

.result__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

/* --------------------------------------------------------------------------
   15. 页脚
   -------------------------------------------------------------------------- */

.site-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding: 28px 0 34px;
    border-top: 1px solid var(--border);
    background: var(--header-bg);
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-faint);
    font-size: 13px;
    text-align: center;
}

.site-footer__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.site-footer__note,
.site-footer__meta {
    margin: 0;
}

.site-footer__meta .dot {
    opacity: 0.6;
}

/* --------------------------------------------------------------------------
   15.5 首页背景 / 编辑器辅助 / 安装自检
   -------------------------------------------------------------------------- */

.home-bg {
    position: fixed;
    inset: 0;
    /* 必须位于 main 的层叠上下文最底层，否则会盖住正文内容 */
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.home-bg picture,
.home-bg img {
    display: block;
    width: 100%;
    height: 100%;
}

.home-bg img {
    object-fit: cover;
    opacity: 0.38;
    filter: saturate(1.05) contrast(1.03);
    transform: scale(1.02);
}

.home-bg img.is-missing {
    display: none;
}

.home-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(70% 55% at 50% 0%, rgba(6, 8, 15, 0) 0%, rgba(6, 8, 15, 0.5) 100%),
        linear-gradient(
            180deg,
            rgba(6, 8, 15, 0.66) 0%,
            rgba(6, 8, 15, 0.76) 42%,
            rgba(6, 8, 15, 0.93) 76%,
            var(--bg) 100%
        );
}

html[data-theme="light"] .home-bg img {
    opacity: 0.58;
}

html[data-theme="light"] .home-bg::after {
    background: radial-gradient(70% 55% at 50% 0%, rgba(244, 245, 251, 0) 0%, rgba(244, 245, 251, 0.45) 100%),
        linear-gradient(
            180deg,
            rgba(244, 245, 251, 0.5) 0%,
            rgba(244, 245, 251, 0.7) 45%,
            rgba(244, 245, 251, 0.93) 80%,
            var(--bg) 100%
        );
}

/* 有照片背景时弱化极光，避免颜色互相打架 */
body.page-home .aurora span {
    opacity: 0.28;
}

body.page-home .mesh {
    opacity: 0.65;
}

/* 编辑器 */
.q-card__subhead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 16px 0 6px;
}

.q-card__subhead .field__label,
.q-card__subhead .field__hint {
    margin: 0;
}

.add-option-btn {
    margin-top: 10px;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 安装自检 */
.check-list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 14px;
}

.check-row + .check-row {
    border-top: 1px solid var(--border);
}

.check-row__label {
    flex: 1 1 220px;
    color: var(--text-muted);
}

.check-row__value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.check-ok {
    color: var(--success);
}

.check-bad {
    color: var(--danger);
}

.code-inline {
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    font-family: var(--mono);
    font-size: 12.5px;
    word-break: break-all;
}

/* --------------------------------------------------------------------------
   16. 动画
   -------------------------------------------------------------------------- */

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

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

/* --------------------------------------------------------------------------
   17. 响应式
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
    .site-nav {
        display: none;
    }

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

@media (max-width: 640px) {
    .container {
        width: calc(100% - 28px);
    }

    .site-header__inner {
        height: 60px;
        gap: 10px;
    }

    .hide-sm {
        display: none !important;
    }

    .hero {
        padding-top: 40px;
    }

    .quiz-progress {
        top: 68px;
    }

    .result__hero {
        justify-content: center;
        text-align: center;
    }

    .result__numbers {
        justify-content: center;
        gap: 22px;
    }

    .editor__bar {
        bottom: 10px;
    }

    .toast-stack {
        right: 14px;
        left: 14px;
        bottom: 14px;
    }

    .toast {
        max-width: none;
    }

    .welcome {
        text-align: left;
    }
}
