/* =============================================================
 * main.css —— 问卷样式
 * -------------------------------------------------------------
 * 视觉参考：明日方舟官方活动站（ak.hypergryph.com）的黑底线稿风格
 *   · 纯黑底 + 1px 白色线稿几何（细描边圆环、刻度、十字定位线）
 *   · 零圆角、细边框、等宽字体小标签、大写字母 + 宽字距
 *   · 主色为白，青色 #20b0e3 只用在"当前状态"上
 * 想换配色 / 点缀色，改下面 :root 里的变量即可。
 * ============================================================= */

:root {
    --bg: #000000;
    --card: rgba(9, 9, 9, 0.86);
    --card-revealed: rgba(0, 0, 0, 0.8);
    --line: rgba(255, 255, 255, 0.17);        /* 细边框（官方站实测值） */
    --line-soft: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.45);
    --fg: #ffffff;
    --fg-dim: #999999;
    --fg-mute: #6b6b6b;
    --accent: #20b0e3;
    --warn: #e0483c;
    --whisper: #383838;
    --stage-art: rgba(255, 255, 255, 0.9);
    --glow: rgba(32, 176, 227, 0.55);          /* 私货文字的光晕 */
    --glow-strong: rgba(32, 176, 227, 1);

    /* 官方站用的是 SourceHanSerifCN-Light（中文正文）+ AcuminPro / Oswald-ExtraLight（拉丁与数字）。
       AcuminPro 是商业字体，不能自带；这里用系统里气质最接近的字体顶上。
       想换成真字体，把 woff2 放进 assets/ 再用 @font-face 覆盖这两个变量即可。 */
    --serif: 'Source Han Serif SC', 'Noto Serif SC', 'Songti SC', 'STSong', SimSun, 'Noto Sans SC', 'Microsoft YaHei', serif;
    --cond: 'Oswald', 'Bahnschrift SemiCondensed', 'Bahnschrift Light', 'Bahnschrift', 'DIN Alternate', 'Arial Narrow', 'Segoe UI', sans-serif;
    --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
    --sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

.hidden {
    display: none !important;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: var(--serif);
    background-color: var(--bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
}

/* =============================================================
 * 背景舞台
 * ============================================================= */

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

.stage-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.stage-spin-a {
    animation: spin 180s linear infinite;
}

.stage-spin-b {
    animation: spin 260s linear infinite reverse;
}

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

/* 淡淡的网格，四周渐隐 */
.stage-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 96px 96px;
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 10%, transparent 70%);
    mask-image: radial-gradient(circle at 50% 45%, #000 10%, transparent 70%);
    opacity: 0.5;
}

.stage-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0.75) 100%);
}

/* =============================================================
 * 卡片
 * ============================================================= */

.survey-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 660px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    transition: background 0.6s ease, border-color 0.3s ease;
}

/* 四角的青色直角标记 */
.survey-container::after {
    content: '';
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background:
        linear-gradient(var(--accent), var(--accent)) 0 0 / 16px 2px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 0 0 / 2px 16px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 100% 0 / 16px 2px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 100% 0 / 2px 16px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 0 100% / 16px 2px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 0 100% / 2px 16px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 100% 100% / 16px 2px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 100% 100% / 2px 16px no-repeat;
    opacity: 0.9;
}

/* 结尾揭晓时卡片变透一点，让背景图透出来 */
.survey-container.is-revealed {
    background: var(--card-revealed);
}

/* 被"接管"时整卡强调色变红 */
.survey-container.is-hijacked {
    --accent: var(--warn);
}

/* ---------- 顶栏 ---------- */

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 28px;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.2em;
    color: var(--fg-mute);
    text-transform: uppercase;
    /* 注意：这里不能写 overflow:hidden —— 会把登录后的下拉菜单裁掉。
       防溢出改成让左边的品牌文字自己缩。 */
}

.card-top .brand {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-top .brand i {
    font-style: normal;
    color: var(--accent);
    padding: 0 2px;
}

.card-top .top-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
}

.card-top .brand-code {
    color: var(--fg-dim);
}

/* 顶栏上的背景音乐音量滑块 */
.vol {
    display: flex;
    align-items: center;
    gap: 7px;
}

.vol i {
    font-style: normal;
    color: var(--fg-mute);
    font-size: 10px;
    letter-spacing: 0.16em;
}

/* 被浏览器拦下自动播放时（正在等第一次交互）淡一点 */
.vol.is-pending {
    opacity: 0.55;
}

.bgm-range {
    -webkit-appearance: none;
    appearance: none;
    width: 78px;
    height: 18px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

/* 1px 细轨道 + 方形滑块，和整体零圆角的线稿风格保持一致 */
.bgm-range::-webkit-slider-runnable-track {
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.bgm-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 9px;
    height: 9px;
    margin-top: -4px;
    background: #fff;
    border: none;
    border-radius: 0;
    transition: background 0.15s;
}

.bgm-range:hover::-webkit-slider-thumb,
.bgm-range:active::-webkit-slider-thumb {
    background: var(--accent);
}

.bgm-range::-moz-range-track {
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.bgm-range::-moz-range-thumb {
    width: 9px;
    height: 9px;
    background: #fff;
    border: none;
    border-radius: 0;
}

.bgm-range:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 3px;
}

/* "点一下才有声音"的提示条（尺寸和圆角照搬官方站的提示条） */
.sound-hint {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 5;
    padding: 1em 2em;
    max-width: 50%;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 0.4em;
    color: #fff;
    font-size: 13px;
    letter-spacing: 0.08em;
    pointer-events: none;
    animation: hint-in 0.4s ease both;
}

@keyframes hint-in {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 题头 ---------- */

.q-head {
    padding: 30px 28px 22px;
}

.q-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--fg-mute);
    text-transform: uppercase;
}

.q-meta .q-no em {
    font-style: normal;
    color: var(--fg);
}

.q-meta .q-type {
    color: var(--accent);
    letter-spacing: 0.14em;
}

.question-text {
    font-size: 21px;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: 0.02em;
    color: var(--fg);
    margin-top: 16px;
}

.question-hint {
    margin-top: 10px;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    color: var(--fg-mute);
}

/* 题面里被标红的词（比如「知晓」） */
.question-text .hl {
    font-style: normal;
    color: var(--warn);
}

/* ---------- 选项 ---------- */

.options-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 28px;
}

/* 选项多的时候用的网格布局：桌面多列、手机两列，一屏尽量看完 */
.options-area.is-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.options-area.is-grid .option-btn {
    min-height: 46px;
    padding: 8px 14px;
    gap: 10px;
}

/* 网格里不显示 A/B/C 序号（二十多个字母反而添乱） */
.options-area.is-grid .option-idx {
    display: none;
}

.options-area.is-grid .option-label {
    font-size: 14px;
    letter-spacing: 0.02em;
}

/* 多选上限的实时计数 */
.pick-count {
    padding: 0 28px;
    margin-bottom: 12px;
    text-align: right;
    font-family: var(--cond);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--fg-mute);
    transition: color 0.2s;
}

.pick-count em {
    font-style: normal;
    color: var(--fg);
    font-size: 13px;
    padding: 0 1px;
}

.pick-count.is-warn,
.pick-count.is-warn em {
    color: var(--warn);
}

.option-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 54px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.68);
    font-family: inherit;
    font-size: 15px;
    letter-spacing: 0.03em;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

/* 左侧状态条 */
.option-btn::before {
    content: '';
    position: absolute;
    left: -1px;
    top: -1px;
    bottom: -1px;
    width: 2px;
    background: transparent;
    transition: background 0.15s;
}

.option-btn:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.option-btn.selected {
    border-color: var(--accent);
    background: rgba(32, 176, 227, 0.1);
    color: #fff;
}

.option-btn.selected::before {
    background: var(--accent);
}

/* 彩蛋：选了"不知道"之后这个框变红（写在 selected 后面，好盖住青色） */
.option-btn.is-warn {
    border-color: var(--warn);
    background: rgba(224, 72, 60, 0.1);
    color: #fff;
}

.option-btn.is-warn::before {
    background: var(--warn);
}

.option-btn.is-warn .option-idx {
    color: var(--warn);
}

.option-btn.is-warn .option-mark {
    background: var(--warn);
    border-color: var(--warn);
}

.option-idx {
    flex: none;
    min-width: 16px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--fg-mute);
    transition: color 0.15s;
}

.option-btn.selected .option-idx {
    color: var(--accent);
}

.option-label {
    flex: 1;
}

/* 右侧标记：单选是菱形，多选是方块 */
.option-mark {
    flex: none;
    width: 9px;
    height: 9px;
    border: 1px solid var(--fg-mute);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.options-area:not(.is-multi) .option-mark {
    transform: rotate(45deg);
}

.option-btn.selected .option-mark {
    background: var(--accent);
    border-color: var(--accent);
}

/* 超出多选上限的行内提示 */
.option-tip {
    min-height: 16px;
    margin-top: 12px;
    padding: 0 28px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--warn);
}

.shake {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* 彩蛋：被点掉的选项（淡出后从 DOM 移除） */
.option-btn.fading {
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
}

/* ---------- 填空 ---------- */

.text-field {
    padding: 0 28px;
}

.text-input {
    width: 100%;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: 0;
    color: var(--fg);
    font-family: inherit;
    font-size: 15px;
    letter-spacing: 0.03em;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.text-input::placeholder {
    color: #4a4a4a;
}

.text-input:focus {
    border-color: var(--accent);
    background: rgba(32, 176, 227, 0.05);
}

textarea.text-input {
    min-height: 128px;
}

.char-count {
    margin-top: 8px;
    text-align: right;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--fg-mute);
}

/* 彩蛋：输入框被"接管"后的样子 */
.text-input.hacked {
    color: var(--warn);
    border-color: var(--warn);
    background: rgba(224, 72, 60, 0.08);
    font-weight: 700;
}

/* =============================================================
 * 页脚：进度 + 上一题 / 下一题
 * ============================================================= */

.card-foot {
    margin-top: 26px;
    padding: 20px 28px 26px;
    border-top: 1px solid var(--line);
}

.progress-track {
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--fg-mute), var(--accent));
    /* 官方站的进度条是用 transform 从一端"长"出来的，这里用横向的等价做法 */
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--fg-mute);
}

.actions {
    display: grid;
    grid-template-columns: minmax(104px, auto) 1fr;
    gap: 10px;
    margin-top: 18px;
}

.btn-prev,
.btn-next {
    height: 50px;
    border-radius: 0;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 0.18em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-prev {
    background: transparent;
    border: 1px solid var(--line);
    color: rgba(255, 255, 255, 0.6);
    padding: 0 20px;
}

.btn-prev:hover:not(:disabled) {
    border-color: var(--line-strong);
    color: var(--fg);
}

.btn-prev:disabled {
    color: rgba(255, 255, 255, 0.35);
    border-color: var(--line-soft);
    cursor: not-allowed;
}

.btn-next {
    background: transparent;
    border: 1px solid var(--fg);
    color: var(--fg);
    font-weight: 500;
    padding: 0 20px;
}

.btn-next:hover:not(:disabled) {
    background: var(--fg);
    border-color: var(--fg);
    color: #000;
}

.btn-next:disabled {
    background: transparent;
    border-color: var(--line);
    color: rgba(255, 255, 255, 0.35);
    cursor: not-allowed;
}

/* =============================================================
 * 结果页
 * ============================================================= */

.result-page {
    padding: 34px 28px 30px;
    text-align: center;
}

.check-icon {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 22px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--accent);
    overflow: hidden;
}

/* 外圈缓慢自转的虚线环 */
.check-icon::after {
    content: '';
    position: absolute;
    inset: -7px;
    border: 1px dashed rgba(32, 176, 227, 0.5);
    border-radius: 50%;
    animation: spin 24s linear infinite;
}

.check-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.result-page h2 {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.34em;
    text-indent: 0.34em;      /* 抵消字距造成的视觉偏移 */
    color: var(--fg);
    margin-bottom: 26px;
}

.result-list {
    text-align: left;
    border-top: 1px solid var(--line-soft);
}

.result-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
}

.result-q {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--fg-mute);
    margin-bottom: 6px;
}

.result-a {
    font-size: 15px;
    letter-spacing: 0.03em;
    color: var(--fg);
}

.result-actions {
    margin-top: 26px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--fg-mute);
}

/* 结尾的「欢迎加群」：一直闪烁，把注意力拉过去 */
.result-actions a.is-blink {
    animation: join-blink 1.15s ease-in-out infinite;
}

@keyframes join-blink {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--glow); }
    50% { opacity: 0.3; text-shadow: none; }
}

/* 加群弹窗 */
.join-body {
    text-align: center;
    gap: 10px;
}

.join-label {
    font-family: var(--cond);
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--fg-mute);
}

.join-number {
    font-family: var(--cond);
    font-weight: 300;
    font-size: 36px;
    line-height: 1.2;
    letter-spacing: 0.1em;
    color: #fff;
    user-select: all;
}

.join-hint {
    font-size: 12px;
    color: var(--fg-mute);
}

/* 结尾那两句"私货"：终端故障式的闪烁 */
.love {
    display: inline-block;
    margin-top: 8px;
    font-size: 13.5px;
    letter-spacing: 0.06em;
    color: var(--fg);
    animation: flicker 2.4s steps(1, end) infinite;
}

@keyframes flicker {
    0%, 100% { color: var(--fg); opacity: 1; text-shadow: 0 0 10px var(--glow); }
    46% { color: var(--fg); opacity: 1; }
    48% { color: var(--accent); opacity: 0.45; text-shadow: 0 0 18px var(--glow-strong); }
    50% { color: var(--fg); opacity: 1; }
    72% { color: var(--fg); opacity: 1; }
    74% { color: var(--warn); opacity: 0.5; }
    76% { color: var(--fg); opacity: 1; }
}

a {
    position: relative;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.35s;
}

/* 官方站那种"下划线从左往右展开"的 hover 效果 */
a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.5em;
    width: 100%;
    border-bottom: 1px solid #fff;
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.25s;
}

a:hover {
    color: #fff;
}

a:hover::after {
    transform: scaleX(1);
}

/* =============================================================
 * 背景爬字（彩蛋）
 * ============================================================= */

#whisper {
    position: fixed;
    inset: 0;
    z-index: -1;             /* 关键：压在卡片后面、页面底色之上 */
    overflow: hidden;
    padding: 18px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.9;
    letter-spacing: 0.14em;
    color: var(--whisper);
    word-break: break-all;
    pointer-events: none;
    user-select: none;
    white-space: pre-wrap;
}

#mediaHost {
    display: none;
}

/* =============================================================
 * 官方站的几个标志性细节
 * ============================================================= */

/* 标签 / 编号统一用窄体无衬线（对应官方站的 AcuminPro / Oswald-ExtraLight），
   中文正文用宋体（对应 SourceHanSerifCN-Light） */
.card-top,
.q-meta,
.progress-meta,
.option-idx,
.char-count,
.result-q,
.vol,
.sound-hint,
#whisper {
    font-family: var(--cond);
    font-weight: 300;
}

/* 打字机式光标：0.3s 交替闪烁（官方站的加载 / 叙述界面用的就是这个） */
.caret {
    display: inline-block;
    height: 0.95em;
    margin-left: 0.45em;
    border-left: 1px solid #fff;
    vertical-align: -0.12em;
    animation: caret-blink 0.3s linear infinite alternate-reverse;
}

@keyframes caret-blink {
    0% { opacity: 0; }
    to { opacity: 1; }
}

/* 背景里的 2×2 呼吸圆点 */
.stage-dots {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 98vmin;
    height: 98vmin;
    margin: -49vmin 0 0 -49vmin;
    display: flex;
    flex-wrap: wrap;
    align-content: space-between;
    justify-content: space-between;
}

.stage-dots i {
    position: relative;
    width: 48%;
    height: 48%;
    border-radius: 50%;
    background: #fff;
    opacity: 0.02;
    animation: dot-breathe 2.4s linear infinite;
}

.stage-dots i::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14%;
    height: 14%;
    margin: -7% 0 0 -7%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
}

.stage-dots i:nth-child(2) { animation-delay: 0.6s; }
.stage-dots i:nth-child(3) { animation-delay: 1.2s; }
.stage-dots i:nth-child(4) { animation-delay: 1.8s; }

@keyframes dot-breathe {
    0% { opacity: 0.02; }
    25% { opacity: 0.07; }
    50% { opacity: 0.02; }
}

/* =============================================================
 * 背景线稿：描边统一由 CSS 控制，这样结算页能整套换主题
 * ============================================================= */

.art-ring   { stroke: #1e1e1e; stroke-width: 1; }
.art-dash   { stroke: #2a2a2a; stroke-width: 1; }
.art-accent { stroke: var(--accent); stroke-width: 1.2; }
.art-cross  { stroke: #222222; stroke-width: 1; }
.art-ticks  { stroke: #1c1c1c; stroke-width: 1; }

/* =============================================================
 * 结算页主题
 *   · 及格 → 蓝色（官方站线上样式里的 #0006ff）
 *   · 不及格 → 同一套结构换成红色（就是第 10 题那个 warn 红）
 * ============================================================= */

body.is-result {
    /* 把"灰字"整套换成半透明白，蓝底 / 红底上都读得清 */
    --fg-dim: #ffffff;
    --fg-mute: rgba(255, 255, 255, 0.72);
    --line: rgba(255, 255, 255, 0.4);
    --line-soft: rgba(255, 255, 255, 0.22);
    --line-strong: #ffffff;
    --glow: rgba(255, 255, 255, 0.55);
    --glow-strong: rgba(255, 255, 255, 0.95);
    --result-ink: #00003a;
    --result-ink-soft: rgba(0, 0, 45, 0.7);
    background-color: #0006ff;
}

body.is-result.is-fail {
    --result-ink: rgba(90, 0, 0, 0.6);
    --result-ink-soft: rgba(90, 0, 0, 0.5);
    background-color: var(--warn);
}

body.is-result .art-ring,
body.is-result .art-cross,
body.is-result .art-ticks { stroke: var(--result-ink); }
body.is-result .art-dash { stroke: var(--result-ink-soft); }
body.is-result .art-accent { stroke: rgba(255, 255, 255, 0.45); }
body.is-result .stage-grid { opacity: 0.16; }
body.is-result .stage-dots i { background: rgba(255, 255, 255, 0.5); }
body.is-result .stage-dots i::after { background: rgba(255, 255, 255, 0.18); }
body.is-result .stage-vignette {
    background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 25, 0.4) 100%);
}

body.is-result .survey-container {
    --accent: #ffffff;
    background: rgba(0, 0, 30, 0.22);
    box-shadow: none;
}

body.is-result.is-fail .survey-container {
    background: rgba(70, 0, 0, 0.18);
}

body.is-result .progress-track { background: rgba(255, 255, 255, 0.25); }
body.is-result .bgm-range::-webkit-slider-runnable-track { background: rgba(255, 255, 255, 0.5); }
body.is-result .bgm-range::-moz-range-track { background: rgba(255, 255, 255, 0.5); }
body.is-result .result-page h2 { color: #ffffff; }

/* ---------- 评分 ---------- */

.score-box {
    margin-bottom: 22px;
}

.score-num {
    font-family: var(--cond);
    font-weight: 300;
    font-size: 46px;
    line-height: 1;
    letter-spacing: 0.04em;
    color: #ffffff;
}

.score-num em {
    font-style: normal;
    font-size: 13px;
    letter-spacing: 0.18em;
    opacity: 0.65;
    margin-left: 8px;
}

.score-label {
    margin-top: 10px;
    font-family: var(--cond);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.24em;
    color: rgba(255, 255, 255, 0.8);
}

.score-box.is-fail .score-label {
    color: #ffffff;
}

/* =============================================================
 * 登录入口 / 弹层 / 答卷面板
 * ============================================================= */

.auth {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: none;      /* 账号名保持原样，别被顶栏的 uppercase 带上天 */
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.auth-btn:hover {
    color: #fff;
    border-bottom-color: currentColor;
}

.auth-btn em {
    font-style: normal;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-btn i {
    font-style: normal;
    font-size: 9px;
    opacity: 0.7;
}

.auth-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 9px);
    z-index: 30;
    min-width: 158px;
    background: rgba(6, 6, 6, 0.97);
    border: 1px solid var(--line);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65);
    text-align: left;
    font-family: var(--cond);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-who {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-soft);
    color: #fff;
    text-transform: none;
    letter-spacing: 0.06em;
}

.auth-who b {
    font-weight: 400;
    color: var(--accent);
    font-size: 10px;
}

.auth-menu button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    color: var(--fg-dim);
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-menu button:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

/* ---------- 弹层 ---------- */

.mask {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 380px;
    max-height: 100%;
    background: #050505;
    border: 1px solid var(--line-strong);
    box-shadow: 0 0 70px rgba(0, 0, 0, 0.9);
}

.panel.is-wide {
    max-width: 760px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    font-family: var(--cond);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #fff;
}

.panel-head i {
    font-style: normal;
    color: var(--accent);
}

.panel-head-act {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-x {
    padding: 2px 4px;
    background: transparent;
    border: 0;
    color: var(--fg-mute);
    font-size: 13px;
    cursor: pointer;
}

.panel-x:hover {
    color: #fff;
}

.panel-note {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
    line-height: 1.65;
    color: var(--fg-mute);
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow: auto;
}

.panel-body.is-list {
    padding: 0;
    gap: 0;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field span {
    font-family: var(--cond);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--fg-mute);
}

.field input {
    width: 100%;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 0;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    outline: none;
}

.field input:focus {
    border-color: var(--accent);
}

.panel-msg {
    min-height: 16px;
    font-size: 12px;
    color: var(--warn);
}

.panel-foot {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
}

.btn-flat,
.btn-solid {
    height: 42px;
    padding: 0 16px;
    border-radius: 0;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.14em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.panel-foot .btn-flat,
.panel-foot .btn-solid {
    flex: 1;
}

.btn-flat {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--fg-dim);
}

.btn-flat:hover {
    border-color: var(--line-strong);
    color: #fff;
}

.btn-solid {
    background: #fff;
    border: 1px solid #fff;
    color: #000;
    font-weight: 500;
}

.btn-solid:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* ---------- 答卷列表 ---------- */

.reply {
    border-bottom: 1px solid var(--line-soft);
}

.reply-head {
    display: grid;
    grid-template-columns: 26px 1fr auto auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    border: 0;
    color: var(--fg-dim);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.reply-head:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.reply-i {
    font-family: var(--cond);
    font-weight: 300;
    font-size: 11px;
    color: var(--fg-mute);
}

.reply-user {
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户名下面那行小字：来源 IP */
.reply-ip {
    display: block;
    margin-top: 2px;
    font-family: var(--cond);
    font-weight: 300;
    font-style: normal;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--fg-mute);
}

.reply-ip-big {
    font-family: var(--cond);
    font-weight: 300;
    letter-spacing: 0.08em;
}

/* 展开后的「来源地区」 */
.reply-geo {
    font-family: var(--cond);
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.06em;
    color: #fff;
}

.reply-time {
    font-family: var(--cond);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--fg-mute);
}

.reply-score {
    padding: 1px 8px;
    border: 1px solid;
    font-family: var(--cond);
    font-weight: 300;
    font-size: 15px;
}

.reply-score.is-pass {
    color: #4fd1a5;
    border-color: rgba(79, 209, 165, 0.5);
}

.reply-score.is-fail {
    color: #ff8a7d;
    border-color: rgba(255, 138, 125, 0.55);
}

.reply-body {
    padding: 4px 16px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--line-soft);
}

.reply-row {
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.reply-row:last-child {
    border-bottom: 0;
}

.reply-q {
    margin-bottom: 4px;
    font-family: var(--cond);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--fg-mute);
}

.reply-a {
    font-size: 14px;
    line-height: 1.6;
    color: #fff;
    white-space: pre-wrap;
    word-break: break-word;
}

.review-empty {
    padding: 28px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--fg-mute);
}

.review-empty.is-warn {
    color: #ff8a7d;
}

/* ---------- 页签 ---------- */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--line-soft);
}

.tabs button {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid transparent;
    color: var(--fg-mute);
    font-family: var(--cond);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tabs button:hover {
    color: #fff;
}

.tabs button.is-on {
    color: #fff;
    border-bottom-color: var(--accent);
}

/* ---------- 未登录时的闸门 ---------- */

.gate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 28px;
}

.gate-actions .btn-next,
.gate-actions .btn-prev {
    height: 50px;
    margin-top: 0;
}

/* ---------- 用户列表里那一行不是可点的 ---------- */

.reply-head.is-plain {
    cursor: default;
    grid-template-columns: 18px 1fr auto auto;
}

.reply-head.is-plain:hover {
    background: transparent;
    color: var(--fg-dim);
}

.btn-flat.is-tiny {
    height: 26px;
    padding: 0 10px;
    font-size: 11px;
    letter-spacing: 0.1em;
    margin-top: 8px;
}

/* 危险操作（删答卷 / 删用户） */
.btn-flat.is-danger {
    color: #ff8a7d;
    border-color: rgba(255, 138, 125, 0.45);
}

.btn-flat.is-danger:hover {
    color: #fff;
    background: rgba(224, 72, 60, 0.25);
    border-color: #ff8a7d;
}

/* =============================================================
 * 移动端
 * ============================================================= */

@media (max-width: 620px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .survey-container {
        max-width: none;
        min-height: 100vh;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(0, 0, 0, 0.92);
    }

    .survey-container::after {
        display: none;        /* 满屏时不需要四角标记 */
    }

    .card-top,
    .q-head,
    .card-foot,
    .result-page {
        padding-left: 20px;
        padding-right: 20px;
    }

    .options-area,
    .text-field,
    .option-tip,
    .pick-count {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* 窄屏自动降到 2~3 列 */
    .options-area.is-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

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

    .card-top {
        font-size: 9px;
        letter-spacing: 0.1em;
        gap: 8px;
    }

    /* 窄屏时把品牌文字收短一点，给音量滑块腾地方 */
    .card-top .brand {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .card-top .top-right {
        gap: 8px;
    }

    .vol i {
        display: none;
    }

    .bgm-range {
        width: 62px;
    }

    /* 窄屏给登录入口腾地方 */
    .card-top .brand-code {
        display: none;
    }

    /* 弹层在手机上直接铺满 */
    .mask {
        padding: 0;
        align-items: stretch;
    }

    .panel,
    .panel.is-wide {
        max-width: none;
        max-height: 100vh;
        height: 100%;
        border: none;
    }

    .reply-head {
        grid-template-columns: 20px 1fr auto auto;
        gap: 8px;
        padding: 10px 14px;
        font-size: 12px;
    }

    .reply-body,
    .panel-note {
        padding-left: 14px;
        padding-right: 14px;
    }

    /* 满屏布局下按钮贴在屏幕底部，提示条要往上让开，别压住主按钮 */
    .sound-hint {
        bottom: 112px;
        font-size: 12px;
        padding: 0.7em 1.2em;
    }

    /* 内容没占满整屏时，把进度和按钮压到屏幕底部 */
    .card-foot {
        margin-top: auto;
    }

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

    .btn-prev,
    .btn-next {
        font-size: 13px;
        letter-spacing: 0.1em;
    }
}

/* =============================================================
 * 无障碍：跟随系统"减少动态效果"
 * ============================================================= */

@media (prefers-reduced-motion: reduce) {
    .stage-spin-a,
    .stage-spin-b,
    .stage-dots i,
    .caret,
    .result-actions a.is-blink,
    .check-icon::after {
        animation: none !important;
    }

    .caret {
        opacity: 1;
    }

    .love {
        animation: none;
        color: var(--accent);
        text-shadow: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
    }
}
