/* ==========================================================================
   怀德 ACM 在线评卷平台 · 设计系统 v2「Ember Aurora」
   极光背景 + 玻璃导航 + 渐变强调；深浅双主题只换变量不换结构
   无外链字体 / 图片，全部本地可用（CSP: default-src 'self'）
   ========================================================================== */

/* ------------------------------------------------------------ 主题变量：深色 */
:root,
html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #06060b;
  --bg-2: #0c0c16;
  --surface: rgba(18, 18, 30, 0.78);
  --surface-solid: #12121e;
  --surface-2: #0d0d17;
  --surface-3: rgba(255, 255, 255, 0.04);
  --surface-4: rgba(255, 255, 255, 0.08);
  --card-bg: linear-gradient(180deg, rgba(24, 24, 40, 0.86), rgba(14, 14, 24, 0.86));
  --card-hi: rgba(255, 255, 255, 0.06);
  --zebra: rgba(255, 255, 255, 0.018);
  --hover: rgba(255, 255, 255, 0.055);
  --hover-strong: rgba(255, 255, 255, 0.1);

  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-3: rgba(255, 255, 255, 0.24);

  --text: #f2f1f8;
  --text-2: #cbc9da;
  --muted: #918fa8;
  --muted-2: #74728a;

  --accent: #ff8a3d;
  --accent-2: #ffb469;
  --accent-3: #ff5c8a;
  --violet: #8f7bff;
  --cyan: #48cae4;
  --accent-ink: #1c0d02;
  --accent-dim: rgba(255, 138, 61, 0.13);
  --accent-line: rgba(255, 138, 61, 0.42);
  --grad: linear-gradient(120deg, #ffc27a 0%, #ff8a3d 40%, #ff5c8a 100%);
  --grad-cool: linear-gradient(120deg, #8f7bff, #48cae4);
  --btn-grad: linear-gradient(120deg, #ffbe73 0%, #ff8a3d 50%, #ff6a5c 100%);
  --btn-ink: #1c0d02;

  --ok: #3ddc97;
  --ok-ink: #8ff3c8;
  --ok-bg: rgba(61, 220, 151, 0.12);
  --ok-bd: rgba(61, 220, 151, 0.34);

  --warn: #f5c451;
  --warn-ink: #ffdc8f;
  --warn-bg: rgba(245, 196, 81, 0.12);
  --warn-bd: rgba(245, 196, 81, 0.34);

  --bad: #ff6b7a;
  --bad-ink: #ffb3bb;
  --bad-bg: rgba(255, 107, 122, 0.12);
  --bad-bd: rgba(255, 107, 122, 0.36);

  --info: #6aa8ff;
  --info-ink: #b0d0ff;
  --info-bg: rgba(106, 168, 255, 0.12);
  --info-bd: rgba(106, 168, 255, 0.34);

  --topbar: rgba(12, 12, 22, 0.66);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-bg-focus: rgba(255, 255, 255, 0.06);

  --code-bg: #08080f;
  --code-text: #d7e2ff;
  --gutter: #45445c;

  --aurora-a: rgba(255, 122, 51, 0.34);
  --aurora-b: rgba(128, 104, 255, 0.3);
  --aurora-c: rgba(46, 180, 222, 0.2);
  --aurora-d: rgba(255, 82, 132, 0.2);
  --grid-line: rgba(255, 255, 255, 0.035);
  --fx-dot: 255, 190, 140;
  --fx-link: 150, 140, 255;

  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 50px 120px -40px rgba(0, 0, 0, 0.95);
  --glow: 0 18px 50px -18px rgba(255, 122, 51, 0.55);
  --skeleton-a: rgba(255, 255, 255, 0.04);
  --skeleton-b: rgba(255, 255, 255, 0.1);

  --md-pre-bg: #08080f;
  --md-code-bg: rgba(255, 138, 61, 0.1);
  --md-code-bd: rgba(255, 138, 61, 0.2);
  --md-code-ink: #ffc99e;

  --trk: rgba(255, 255, 255, 0.08);
  --ring-a: #ffc27a;
  --ring-b: #ff5c8a;

  --tk-comment: #636180;
  --tk-string: #9be3a8;
  --tk-pre: #d59bff;
  --tk-key: #ff9d66;
  --tk-type: #74c7ff;
  --tk-num: #ffd580;
  --tk-fn: #9ad8ff;
  --tk-punct: #8f8da6;

  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", ui-monospace, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "HarmonyOS Sans SC", "MiSans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --max: 1200px;

  --r-xs: 10px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px;
  --e1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --e2: 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ------------------------------------------------------------ 主题变量：浅色 */
html[data-theme="light"] {
  color-scheme: light;

  --bg: #f5f2ee;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-2: #faf8f5;
  --surface-3: rgba(28, 22, 40, 0.04);
  --surface-4: rgba(28, 22, 40, 0.075);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.84));
  --card-hi: rgba(255, 255, 255, 0.9);
  --zebra: rgba(28, 22, 40, 0.022);
  --hover: rgba(28, 22, 40, 0.05);
  --hover-strong: rgba(28, 22, 40, 0.09);

  --line: rgba(28, 22, 40, 0.1);
  --line-2: rgba(28, 22, 40, 0.17);
  --line-3: rgba(28, 22, 40, 0.3);

  --text: #16141f;
  --text-2: #3b3849;
  --muted: #646176;
  --muted-2: #716e83;

  --accent: #e2651a;
  --accent-2: #b34a08;
  --accent-3: #cf2f68;
  --violet: #5b49e0;
  --cyan: #0a85a5;
  --accent-ink: #ffffff;
  --accent-dim: rgba(226, 101, 26, 0.1);
  --accent-line: rgba(226, 101, 26, 0.4);
  --grad: linear-gradient(120deg, #ef8a26 0%, #df5416 42%, #cf2f68 100%);
  --grad-cool: linear-gradient(120deg, #5b49e0, #0a85a5);
  --btn-grad: linear-gradient(120deg, #dd640f 0%, #cf4a12 50%, #c22f5c 100%);
  --btn-ink: #ffffff;

  --ok: #0c7a53;
  --ok-ink: #0a6646;
  --ok-bg: rgba(12, 122, 83, 0.09);
  --ok-bd: rgba(12, 122, 83, 0.28);

  --warn: #955a05;
  --warn-ink: #875005;
  --warn-bg: rgba(196, 121, 16, 0.11);
  --warn-bd: rgba(196, 121, 16, 0.32);

  --bad: #b3261e;
  --bad-ink: #a01d16;
  --bad-bg: rgba(179, 38, 30, 0.07);
  --bad-bd: rgba(179, 38, 30, 0.27);

  --info: #1a5fd0;
  --info-ink: #154f9f;
  --info-bg: rgba(26, 95, 208, 0.08);
  --info-bd: rgba(26, 95, 208, 0.27);

  --topbar: rgba(255, 255, 255, 0.72);
  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;

  --code-bg: #fbfaf8;
  --code-text: #1f2433;
  --gutter: #a09db0;

  --aurora-a: rgba(255, 150, 80, 0.42);
  --aurora-b: rgba(150, 130, 255, 0.3);
  --aurora-c: rgba(80, 200, 235, 0.26);
  --aurora-d: rgba(255, 120, 160, 0.26);
  --grid-line: rgba(28, 22, 40, 0.045);
  --fx-dot: 214, 96, 30;
  --fx-link: 91, 73, 224;

  --shadow: 0 20px 50px -28px rgba(40, 28, 70, 0.4);
  --shadow-lg: 0 50px 110px -50px rgba(40, 28, 70, 0.5);
  --glow: 0 16px 40px -18px rgba(214, 90, 20, 0.6);
  --skeleton-a: rgba(28, 22, 40, 0.05);
  --skeleton-b: rgba(28, 22, 40, 0.11);

  --md-pre-bg: #fbfaf8;
  --md-code-bg: rgba(226, 101, 26, 0.09);
  --md-code-bd: rgba(226, 101, 26, 0.22);
  --md-code-ink: #96460a;

  --trk: rgba(28, 22, 40, 0.09);
  --ring-a: #f08a2e;
  --ring-b: #cf2f68;

  --tk-comment: #8b889c;
  --tk-string: #0a7d3f;
  --tk-pre: #7c3aed;
  --tk-key: #b3261e;
  --tk-type: #154f9f;
  --tk-num: #9c5a07;
  --tk-fn: #74480a;
  --tk-punct: #666378;

  --e1: 0 1px 2px rgba(40, 28, 70, 0.08);
  --e2: 0 16px 40px -22px rgba(40, 28, 70, 0.35);
}

/* ------------------------------------------------------------ 基础 */

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

html { scroll-behavior: smooth; scrollbar-color: var(--line-2) transparent; scrollbar-width: thin; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(255, 138, 61, 0.32); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--accent-2); text-decoration: none; transition: color .18s; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { margin: 0; font-weight: 750; letter-spacing: -0.015em; line-height: 1.28; }
p { margin: 0; }
button { font: inherit; color: inherit; }
svg { flex-shrink: 0; }

/* ------------------------------------------------------------ 背景：极光 + 粒子 + 网格 */

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-aurora { position: absolute; inset: -20%; filter: blur(90px); opacity: .9; }
.bg-aurora i { position: absolute; border-radius: 50%; will-change: transform; }
.bg-aurora i:nth-child(1) { width: 46vw; height: 46vw; left: 2%; top: 4%; background: var(--aurora-a); animation: drift1 26s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(2) { width: 42vw; height: 42vw; right: 4%; top: 0; background: var(--aurora-b); animation: drift2 32s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(3) { width: 40vw; height: 40vw; left: 30%; bottom: 0; background: var(--aurora-c); animation: drift3 38s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(4) { width: 30vw; height: 30vw; right: 16%; bottom: 12%; background: var(--aurora-d); animation: drift1 30s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(9vw, 7vh, 0) scale(1.18); } }
@keyframes drift2 { to { transform: translate3d(-10vw, 10vh, 0) scale(.86); } }
@keyframes drift3 { to { transform: translate3d(7vw, -9vh, 0) scale(1.12); } }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 75%);
}
.bg-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, transparent 30%, var(--bg) 82%),
    linear-gradient(180deg, transparent 40%, var(--bg) 100%);
  opacity: .88;
}
#fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ------------------------------------------------------------ 布局骨架 */

.app {
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px 24px 100px;
  min-height: calc(100vh - 230px);
}

/* 换页入场：一层层浮上来 */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
@keyframes grow { from { width: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--pulse, rgba(61, 220, 151, .55)); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes gradShift { to { background-position: 200% 50%; } }

.app.view-in > * { animation: rise .6s var(--ease) backwards; }
.app.view-in > *:nth-child(1) { animation-delay: .02s; }
.app.view-in > *:nth-child(2) { animation-delay: .08s; }
.app.view-in > *:nth-child(3) { animation-delay: .14s; }
.app.view-in > *:nth-child(4) { animation-delay: .2s; }
.app.view-in > *:nth-child(5) { animation-delay: .26s; }
.app.view-in > *:nth-child(6) { animation-delay: .32s; }
.app.view-in > *:nth-child(n+7) { animation-delay: .38s; }

/* 滚动显现：仅在 fx.js 成功启动（html.fx）时才先隐藏，脚本挂了也看得见内容 */
html.fx [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
html.fx [data-reveal="scale"] { transform: scale(.94); }
html.fx [data-reveal].in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ 顶栏（悬浮玻璃岛） */

#topbar { position: sticky; top: 0; z-index: 40; padding: 12px 16px 0; }
.scroll-progress {
  position: fixed; left: 0; top: 0; height: 2px; width: 100%;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--sp, 0));
  z-index: 45; opacity: .9;
}
.topbar-in {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 10px 8px 12px;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: box-shadow .3s, border-color .3s;
}
/* 模糊层放在伪元素上：避免 backdrop-filter 把移动端底部导航的 fixed 定位“关”在顶栏里 */
.topbar-in::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--topbar);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
}
#topbar.scrolled .topbar-in { box-shadow: var(--shadow); border-color: var(--line-2); }

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand-mark { position: relative; width: 40px; height: 40px; border-radius: 50%; padding: 2px; background: var(--grad); display: grid; }
.brand-mark::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: var(--grad); filter: blur(9px); opacity: .45; z-index: -1; transition: opacity .3s; }
.brand:hover .brand-mark::after { opacity: .9; }
.brand-mark img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; transition: transform .6s var(--spring); }
.brand:hover .brand-mark img { transform: rotate(-12deg) scale(1.06); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt b { font-size: 15px; letter-spacing: .01em; }
.brand-txt span { font-size: 10px; color: var(--muted); letter-spacing: .2em; font-family: var(--mono); }

.nav { position: relative; display: flex; gap: 2px; margin-left: 8px; padding: 4px; border-radius: 14px; background: var(--surface-3); }
.nav a {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); padding: 7px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 550; white-space: nowrap;
  transition: color .2s;
}
.nav a svg { width: 18px; height: 18px; display: none; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); }
.nav-ind {
  position: absolute; z-index: 0; top: 4px; left: 0; height: calc(100% - 8px); width: 0;
  border-radius: 10px; opacity: 0;
  background: var(--surface-solid);
  box-shadow: var(--e1), inset 0 1px 0 var(--card-hi), 0 0 0 1px var(--line);
  transition: transform .45s var(--ease), width .45s var(--ease), opacity .25s;
}
.nav-ind::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.clock {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-3); white-space: nowrap;
}
.clock b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; animation: pulse 2s infinite; }

.identity-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 9px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface-3); font-size: 12.5px; max-width: 300px; min-width: 0;
}
.identity-pill .who { color: var(--text); font-weight: 650; white-space: nowrap; }
.identity-pill .meta { color: var(--muted); font-family: var(--mono); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-pill .lock { color: var(--ok); display: flex; flex-shrink: 0; }

.icon-btn {
  width: 36px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-3);
  color: var(--muted); cursor: pointer; flex-shrink: 0;
  transition: color .18s, background .18s, border-color .18s, transform .18s;
}
.icon-btn:hover { color: var(--text); background: var(--hover); border-color: var(--line-2); transform: translateY(-1px); }
.icon-btn svg { width: 16px; height: 16px; transition: transform .5s var(--spring); }
#theme-btn:hover svg { transform: rotate(40deg); }
.top-link { font-size: 12.5px; color: var(--muted); padding: 6px; white-space: nowrap; }
.top-link:hover { color: var(--text); }

/* ------------------------------------------------------------ 按钮 */

.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .25s, color .2s;
}
.btn:hover { background: var(--hover-strong); border-color: var(--line-3); color: var(--text); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--btn-grad); background-size: 160% 100%;
  border-color: transparent; color: var(--btn-ink); font-weight: 750;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { background: var(--btn-grad); background-size: 160% 100%; background-position: 100% 0; color: var(--btn-ink); box-shadow: 0 22px 50px -16px rgba(255, 110, 60, .75), inset 0 1px 0 rgba(255, 255, 255, .4); }
/* 主按钮扫光 */
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-20deg); transition: left .7s var(--ease);
}
.btn-primary:hover::after { left: 120%; }
.btn-ghost { background: transparent; }
.btn-soft { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent-2); }
.btn-soft:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-2); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 13px 24px; font-size: 15.5px; border-radius: 14px; }
.btn-danger { border-color: var(--bad-bd); color: var(--bad-ink); background: var(--bad-bg); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad-ink); }
.btn-block { width: 100%; }
.btn .arr { display: inline-block; transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn.loading { pointer-events: none; }
.btn.loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
  background: currentColor; opacity: .22; transform: scale(0);
  animation: ripple .6s ease-out forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ------------------------------------------------------------ 卡片 / 通用原子 */

.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: inset 0 1px 0 var(--card-hi), var(--e1);
}
.card-tight { padding: 16px 18px; border-radius: var(--r-md); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; }
.card-head .spacer { margin-left: auto; }

/* 光标聚光：fx.js 写入 --mx / --my */
.spot { position: relative; isolation: isolate; }
.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 150, 90, .16), transparent 65%);
  opacity: 0; transition: opacity .35s;
}
.spot:hover::after { opacity: 1; }
.spot > * { position: relative; z-index: 1; }
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0)); transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; will-change: transform; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--grad); }

.grad-text { background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { margin-left: auto; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 18px 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accent-num { color: var(--accent-2); font-weight: 700; }
.ok-num { color: var(--ok); font-size: 22px; font-weight: 700; margin-top: 2px; }
.warn-text { color: var(--warn-ink); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-family: var(--mono);
  border: 1px solid var(--line-2); color: var(--text-2); background: var(--surface-3); white-space: nowrap;
}
.chip.simple, .chip.ok { color: var(--ok-ink); border-color: var(--ok-bd); background: var(--ok-bg); }
.chip.medium, .chip.warn { color: var(--warn-ink); border-color: var(--warn-bd); background: var(--warn-bg); }
.chip.challenge { color: var(--accent-2); border-color: var(--accent-line); background: var(--accent-dim); }
.chip.bad { color: var(--bad-ink); border-color: var(--bad-bd); background: var(--bad-bg); }
.chip.info { color: var(--info-ink); border-color: var(--info-bd); background: var(--info-bg); }

.section-head { display: flex; align-items: flex-end; gap: 14px; margin: 56px 0 20px; }
.section-head:first-child { margin-top: 8px; }
.section-head h2 { font-size: 26px; letter-spacing: -0.02em; margin-top: 8px; }
.section-head > p { color: var(--muted); font-size: 13.5px; margin-left: auto; text-align: right; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.progress-wrap { display: flex; align-items: center; gap: 14px; }
.progress { flex: 1; height: 8px; border-radius: 99px; background: var(--trk); overflow: hidden; }
.progress > i {
  display: block; height: 100%; border-radius: 99px;
  background: var(--grad); background-size: 200% 100%;
  animation: grow 1.1s var(--ease) backwards .15s, gradShift 4s linear infinite;
  box-shadow: 0 0 14px rgba(255, 138, 61, .5);
}

/* ------------------------------------------------------------ 首页 Hero */

.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 24px; align-items: center;
  padding: 34px 4px 30px;
  min-height: min(640px, calc(100vh - 150px));
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface-3);
  font-size: 12.5px; color: var(--text-2); letter-spacing: .04em;
  animation: rise .7s var(--ease) backwards;
}
.hero-title {
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 850; letter-spacing: -0.04em; line-height: 1.06;
  margin: 22px 0 20px;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.hero-title .line > span { display: inline-block; animation: lineUp 1s var(--ease) backwards; }
.hero-title .line:nth-child(2) > span { animation-delay: .14s; }
@keyframes lineUp { from { transform: translateY(105%) rotate(4deg); opacity: 0; } }
.hero-title .grad {
  background: var(--grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: lineUp 1s var(--ease) backwards .14s, gradShift 6s linear infinite alternate;
}
.hero .lede { color: var(--text-2); font-size: 17px; max-width: 560px; line-height: 1.8; animation: rise .8s var(--ease) backwards .3s; }
.typed-line {
  margin-top: 18px; font-family: var(--mono); font-size: 14px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; min-height: 24px;
  animation: rise .8s var(--ease) backwards .4s;
}
.typed-line .prompt { color: var(--accent); }
.typed-line #typed { color: var(--text); }
.caret { display: inline-block; width: 8px; height: 17px; background: var(--accent); border-radius: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; animation: rise .8s var(--ease) backwards .5s; }
.hero-cd { margin-top: 34px; animation: rise .8s var(--ease) backwards .6s; }

.countdown { display: flex; gap: 10px; }
.cd-cell {
  position: relative; min-width: 82px; padding: 12px 12px 9px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--card-bg); text-align: center; overflow: hidden;
  box-shadow: inset 0 1px 0 var(--card-hi);
}
.cd-cell::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); opacity: .7; }
.cd-cell b { display: block; font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cd-cell b.tick { animation: tick .45s var(--ease); }
@keyframes tick { from { transform: translateY(-60%); opacity: 0; filter: blur(3px); } }
.cd-cell span { font-size: 10.5px; color: var(--muted); letter-spacing: .2em; font-family: var(--mono); }
.cd-label { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-family: var(--mono); letter-spacing: .14em; display: flex; align-items: center; gap: 8px; }

/* Hero 右侧：徽章 + 轨道 + 浮动卡片（fx.js 写入 --px / --py 做视差） */
.hero-art {
  position: relative; height: 480px; display: grid; place-items: center;
  animation: pop 1.1s var(--ease) backwards .2s;
  --px: 0; --py: 0;
}
.orbit {
  position: absolute; left: 50%; top: 50%; border-radius: 50%;
  border: 1px dashed var(--line-2);
  width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  animation: spin var(--t, 30s) linear infinite;
}
.orbit i {
  position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--c, var(--accent)); box-shadow: 0 0 18px 2px var(--c, var(--accent));
}
.orbit.o1 { --d: 310px; --t: 18s; --c: var(--accent); }
.orbit.o2 { --d: 400px; --t: 28s; --c: var(--violet); animation-direction: reverse; border-style: solid; border-color: var(--line); }
.orbit.o3 { --d: 490px; --t: 40s; --c: var(--cyan); }
.badge-halo {
  position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: conic-gradient(from 0deg, #ff8a3d, #ff5c8a, #8f7bff, #48cae4, #ff8a3d);
  filter: blur(42px); opacity: .5; animation: spin 16s linear infinite;
}
.hero-badge {
  position: relative; width: 236px; height: 236px; border-radius: 50%; object-fit: cover; background: #fff;
  border: 4px solid rgba(255, 255, 255, .9);
  box-shadow: 0 30px 80px -24px rgba(255, 122, 51, .7), 0 0 0 10px rgba(255, 255, 255, .05);
  transform: translate(calc(var(--px) * 10px), calc(var(--py) * 10px));
  animation: floaty 7s ease-in-out infinite;
  transition: transform .3s ease-out;
}
.float-chip {
  position: absolute; z-index: 2;
  padding: 8px 13px; border-radius: 14px; font-size: 12.5px; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--surface);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 7px;
  transform: translate(calc(var(--px) * var(--depth, 20) * 1px), calc(var(--py) * var(--depth, 20) * 1px));
  transition: transform .3s ease-out;
}
.float-chip > span { display: inline-flex; align-items: center; gap: 7px; animation: floaty var(--ft, 6s) ease-in-out infinite; }
.float-chip.fc1 { top: 9%; right: 4%; --depth: 26; --ft: 5s; color: var(--ok-ink); border-color: var(--ok-bd); }
.float-chip.fc2 { top: 30%; left: -2%; --depth: -22; --ft: 7s; font-family: var(--mono); }
.float-chip.fc3 { bottom: 31%; right: -1%; --depth: 34; --ft: 6.4s; color: var(--accent-2); border-color: var(--accent-line); }
.float-chip .tk-fn { color: var(--tk-fn); } .float-chip .tk-str { color: var(--tk-string); }

.term {
  position: absolute; left: 0; bottom: 4%; z-index: 3; width: 236px;
  border-radius: 16px; border: 1px solid var(--line-2); overflow: hidden;
  background: var(--surface); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  transform: translate(calc(var(--px) * -30px), calc(var(--py) * -30px)) rotate(-3deg);
  transition: transform .3s ease-out;
}
.term-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--muted); }
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff6b7a; }
.term-bar i:nth-child(2) { background: #f5c451; } .term-bar i:nth-child(3) { background: #3ddc97; margin-right: 6px; }
.term-body { padding: 11px 13px 13px; font-family: var(--mono); font-size: 11.8px; line-height: 1.75; color: var(--text-2); }
.term-line { display: flex; justify-content: space-between; gap: 12px; white-space: nowrap; opacity: 0; animation: termLine 9s infinite; animation-delay: calc(var(--l) * .55s); }
.term-line .ok { color: var(--ok); } .term-line .t-dim { color: var(--muted); } .term-line .hl { color: var(--accent-2); font-weight: 700; }
@keyframes termLine { 0% { opacity: 0; transform: translateX(-6px); } 4%, 84% { opacity: 1; transform: none; } 92%, 100% { opacity: 0; } }

.scroll-cue { display: flex; justify-content: center; margin: -6px 0 18px; color: var(--muted-2); }
.scroll-cue span { width: 22px; height: 36px; border: 1.5px solid var(--line-3); border-radius: 12px; position: relative; }
.scroll-cue span::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 3px; background: var(--accent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70%, 100% { transform: translateY(12px); opacity: 0; } }

/* 统计 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card-bg);
  box-shadow: inset 0 1px 0 var(--card-hi);
  transition: transform .3s var(--ease), border-color .3s;
}
.stat:hover { transform: translateY(-3px); border-color: var(--line-2); }
.stat-ico {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 30%, transparent);
}
.stat-ico svg { width: 21px; height: 21px; }
.stat b { display: block; font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat > div > span { font-size: 12.5px; color: var(--muted); }

/* 闯关地图 */
.lvmap { padding: 30px 24px 22px; }
.lvmap-scroll { overflow-x: auto; padding: 6px 0 10px; scrollbar-width: none; }
.lvmap-scroll::-webkit-scrollbar { display: none; }
.lvmap-track { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); min-width: calc(var(--n) * 100px); }
.lvmap-line { position: absolute; top: 27px; left: calc(50% / var(--n)); right: calc(50% / var(--n)); height: 4px; border-radius: 9px; background: var(--trk); }
.lvmap-line i {
  display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: inherit;
  background: var(--grad); box-shadow: 0 0 16px rgba(255, 138, 61, .7);
  animation: grow 1.6s var(--ease) backwards .5s;
}
.lv { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; padding: 0 5px; color: var(--text); }
.lv:hover { color: var(--text); }
.lv-node {
  position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  font: 750 17px var(--mono); color: var(--muted);
  background: var(--surface-solid); border: 2px solid var(--line-2);
  transition: transform .35s var(--spring), border-color .25s, box-shadow .25s, color .25s;
}
.lv-node svg { width: 24px; height: 24px; }
.lv:hover .lv-node { transform: translateY(-5px) scale(1.12); border-color: var(--accent); color: var(--text); box-shadow: 0 14px 30px -10px rgba(255, 138, 61, .6); }
.lv.partial .lv-node { border-color: var(--accent); color: var(--accent-2); background: color-mix(in srgb, var(--accent) 14%, var(--surface-solid)); }
.lv.done .lv-node { border-color: transparent; color: #06281a; background: linear-gradient(135deg, #7df0bd, #2fc98a); box-shadow: 0 10px 26px -10px rgba(61, 220, 151, .8); }
.lv.next .lv-node { border-color: var(--accent); color: var(--text); --pulse: rgba(255, 138, 61, .55); animation: pulse 1.8s infinite; }
.lv-title { font-size: 12.8px; font-weight: 650; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.lv-pts { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.lv-pts::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dc, var(--muted)); }
.lv.simple { --dc: var(--ok); } .lv.medium { --dc: var(--warn); } .lv.challenge { --dc: var(--accent-3); }
.lv-tip {
  position: absolute; top: calc(100% + 12px); left: 50%; width: 200px; margin-left: -100px; z-index: 5;
  padding: 12px 14px; border-radius: 14px; text-align: left;
  border: 1px solid var(--line-2); background: var(--surface-solid); box-shadow: var(--shadow-lg);
  font-size: 12.3px; line-height: 1.6; color: var(--muted);
  opacity: 0; transform: translateY(-6px) scale(.97); pointer-events: none; display: none;
  transition: opacity .2s, transform .25s var(--ease);
}
.lv-tip b { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 3px; }
.lv-tip em { display: block; font-style: normal; margin-top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); }
.lvmap-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.lvmap-foot .progress { min-width: 120px; }
.legend { display: inline-flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--c); }
@media (min-width: 1100px) {
  .lvmap:not(.many) .lvmap-scroll { overflow: visible; }
  .lvmap:not(.many) .lv-tip { display: block; }
  .lvmap:not(.many) .lv:hover .lv-tip { opacity: 1; transform: none; }
}

/* 流水线：机器 → AI → 人 */
.pipeline { display: grid; grid-template-columns: 1fr 56px 1fr 56px 1fr; align-items: stretch; }
.pipe { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card-bg); box-shadow: inset 0 1px 0 var(--card-hi); transition: transform .3s var(--ease), border-color .3s; }
.pipe:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.pipe-ico {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  transition: transform .5s var(--spring);
}
.pipe:hover .pipe-ico { transform: rotate(-8deg) scale(1.1); }
.pipe-ico svg { width: 25px; height: 25px; }
.pipe .num { font-family: var(--mono); font-size: 11px; color: var(--c); letter-spacing: .2em; }
.pipe h4 { margin: 6px 0 8px; font-size: 18px; }
.pipe p { color: var(--muted); font-size: 13.5px; }
.pipe-link { position: relative; align-self: center; height: 2px; margin: 0 6px; background: repeating-linear-gradient(90deg, var(--line-3) 0 6px, transparent 6px 12px); }
.pipe-link::after {
  content: ""; position: absolute; top: -4px; left: 0; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: flow 2.2s ease-in-out infinite;
}
.pipe-link:nth-of-type(4)::after { animation-delay: 1.1s; }
@keyframes flow { 0% { left: 0; opacity: 0; } 15%, 85% { opacity: 1; } 100% { left: calc(100% - 10px); opacity: 0; } }

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.rules li { display: flex; gap: 10px; align-items: flex-start; }
.rules li::before {
  content: ""; flex: 0 0 18px; height: 18px; margin-top: 3px; border-radius: 50%;
  background: var(--accent-dim) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff8a3d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.notice-text { font-size: 15px; color: var(--text); white-space: pre-wrap; line-height: 1.8; }

/* ------------------------------------------------------------ 关卡列表 */

.filter-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.problem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.problem-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px 20px 16px; min-height: 196px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card-bg); color: var(--text); overflow: hidden;
  box-shadow: inset 0 1px 0 var(--card-hi);
  animation: rise .55s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms);
}
.problem-card:hover { color: var(--text); border-color: var(--accent-line); box-shadow: var(--shadow), 0 0 0 1px var(--accent-dim); --ty: -4px; }
.problem-card::before {
  content: attr(data-no); position: absolute; right: 8px; top: -18px; z-index: 0;
  font: 850 104px/1 var(--mono); letter-spacing: -0.06em; color: var(--text); opacity: .045;
  transition: opacity .3s, transform .5s var(--ease);
}
.problem-card:hover::before { opacity: .09; transform: translateY(6px) scale(1.04); }
.problem-card.done { border-color: var(--ok-bd); }
.problem-card.done::before { color: var(--ok); opacity: .1; }
.problem-card.partial { border-color: var(--accent-line); }
.pc-top { display: flex; align-items: center; gap: 8px; }
.pc-id { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.pc-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; }
.pc-sum { font-size: 13px; color: var(--muted); line-height: 1.6; }
.pc-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); }
.pc-score { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.pc-arrow {
  margin-left: auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  color: var(--muted); border: 1px solid var(--line-2);
  transition: transform .3s var(--ease), color .2s, background .2s, border-color .2s;
}
.problem-card:hover .pc-arrow { transform: translateX(3px) rotate(-45deg); color: var(--btn-ink); background: var(--btn-grad); border-color: transparent; }
.pc-bar { height: 3px; border-radius: 3px; background: var(--trk); overflow: hidden; }
.pc-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); animation: grow 1s var(--ease) backwards .3s; }
.problem-card.done .pc-bar i { background: linear-gradient(90deg, #2fc98a, #7df0bd); }

/* 环形进度（通用） */
.ring { position: relative; width: var(--size, 120px); height: var(--size, 120px); flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring .ring-fg { animation: ringIn 1.5s var(--ease) backwards .2s; filter: drop-shadow(0 0 8px rgba(255, 122, 80, .55)); }
@keyframes ringIn { from { stroke-dashoffset: var(--c); } }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; font-family: var(--mono); text-align: center; }
.ring .val b { font-size: calc(var(--size, 120px) * .26); line-height: 1; letter-spacing: -0.04em; font-weight: 750; }
.ring .val span { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ------------------------------------------------------------ 身份信息条 */

.identity-bar {
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--card-bg); box-shadow: inset 0 1px 0 var(--card-hi);
  padding: 14px 18px; margin-bottom: 14px;
}
.identity-bar.is-locked { display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap; padding: 11px 16px; }
.identity-bar .ib-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.identity-bar.is-locked .ib-head { margin-bottom: 0; }
.identity-bar .ib-fields { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(120px, 1fr) minmax(150px, 1.25fr); gap: 12px; align-items: start; max-width: 780px; }
.identity-bar .ib-field label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.identity-bar .ib-field .req { color: var(--bad); font-weight: 700; }
.identity-bar input { padding: 8px 11px; font-size: 13.5px; }
.locked-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.locked-item { display: inline-flex; align-items: baseline; gap: 8px; border: 1px solid var(--line); background: var(--surface-3); border-radius: 10px; padding: 5px 12px; }
.locked-item span { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.locked-item b { font-size: 14px; font-weight: 650; word-break: break-all; }
.locked-item.mono b { font-family: var(--mono); font-size: 13px; }

.err { display: none; font-size: 11.5px; line-height: 1.5; color: var(--bad-ink); margin-top: 5px; }
.err.show { display: block; animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

/* ------------------------------------------------------------ 题目页 */

.pbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pbar .steps { display: inline-flex; gap: 4px; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 16px; align-items: start; }
.problem-hero { display: flex; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.problem-no {
  flex-shrink: 0; width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center;
  font: 800 22px var(--mono); color: var(--btn-ink); background: var(--btn-grad); box-shadow: var(--glow);
}
.problem-hero h1 { font-size: 26px; margin: 0 0 9px; letter-spacing: -0.02em; }
.problem-badges { display: flex; gap: 7px; flex-wrap: wrap; }

.md { font-size: 14.8px; color: var(--text-2); }
.md h2 { font-size: 15.5px; color: var(--text); margin: 26px 0 10px; display: flex; align-items: center; gap: 9px; }
.md h2::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--grad); }
.md h2:first-child { margin-top: 4px; }
.md h3 { font-size: 14.5px; color: var(--text); margin: 18px 0 8px; }
.md h4 { font-size: 14px; color: var(--text); margin: 14px 0 6px; }
.md p { margin: 9px 0; }
.md ul, .md ol { margin: 9px 0; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--accent); }
.md strong { color: var(--text); font-weight: 700; }
.md code {
  font-family: var(--mono); font-size: 12.8px;
  background: var(--md-code-bg); border: 1px solid var(--md-code-bd); color: var(--md-code-ink);
  padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}
.md pre { margin: 12px 0; padding: 14px 16px; border-radius: 12px; background: var(--md-pre-bg); border: 1px solid var(--line); overflow: auto; font-size: 12.8px; line-height: 1.65; }
.md pre code { background: none; border: 0; padding: 0; color: var(--code-text); white-space: pre; }
.md blockquote { margin: 14px 0; padding: 11px 15px; border-left: 3px solid var(--accent); background: var(--accent-dim); border-radius: 0 10px 10px 0; color: var(--text-2); font-size: 13.8px; }
.md table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.4px; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.md th { background: var(--surface-3); color: var(--text); font-weight: 650; }

/* ------------------------------------------------------------ 编辑器 */

.editor-panel { position: sticky; top: 88px; padding: 0; overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.editor-panel:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-dim), var(--shadow); }
.editor-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-3); flex-wrap: wrap; }
.editor-head .dot { width: 11px; height: 11px; border-radius: 50%; }
.editor-head .dot.r { background: #ff6b7a; } .editor-head .dot.y { background: #f5c451; } .editor-head .dot.g { background: #3ddc97; }
.editor-title { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); margin: 0 4px 0 6px; padding: 3px 10px; border-radius: 8px; background: var(--surface-4); }
.editor-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.editor-tools .mini { border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; padding: 4px 10px; border-radius: 8px; cursor: pointer; transition: color .18s, border-color .18s, background .18s; }
.editor-tools .mini:hover { color: var(--text); border-color: var(--line-3); background: var(--hover); }

.editor-body { position: relative; display: flex; height: min(56vh, 540px); background: var(--code-bg); }
.gutter {
  width: 46px; flex-shrink: 0; padding: 14px 10px 14px 0;
  text-align: right; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  color: var(--gutter); border-right: 1px solid var(--line); overflow: hidden; user-select: none;
}
.code-area { position: relative; flex: 1; overflow: hidden; background: var(--code-bg); }
.code-hl, .code-input {
  position: absolute; inset: 0; margin: 0; padding: 14px 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.65; tab-size: 4;
  white-space: pre; word-wrap: normal; overflow: auto; border: 0; background: transparent;
}
.code-hl { pointer-events: none; color: var(--code-text); }
/* textarea 默认自己显示文字；高亮层画好后（.ready）才把文字设为透明，绝不出现“写了看不见” */
.code-input { color: var(--code-text); caret-color: var(--accent); resize: none; outline: none; }
.code-area.ready .code-input { color: transparent; }
.code-area .code-input, .code-area .code-input:focus, .code-area .code-input:hover { background: transparent; border: 0; border-radius: 0; box-shadow: none; width: auto; }
.code-input::placeholder { color: var(--muted-2); }
.code-input::selection { background: rgba(255, 138, 61, .3); }

.tk-cmt { color: var(--tk-comment); font-style: italic; }
.tk-str { color: var(--tk-string); }
.tk-pre { color: var(--tk-pre); }
.tk-key { color: var(--tk-key); font-weight: 600; }
.tk-typ { color: var(--tk-type); }
.tk-num { color: var(--tk-num); }
.tk-fn, .tk-dec { color: var(--tk-fn); }
.tk-punc { color: var(--tk-punct); }

.editor-status { display: flex; align-items: center; gap: 14px; padding: 5px 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--muted-2); background: var(--surface-3); }
.editor-status .saved { display: inline-flex; align-items: center; gap: 6px; }
.editor-status .saved::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.editor-status .saved.flash::before { animation: pulse .8s; }
.editor-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.submit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.submit-hint { font-size: 12px; color: var(--muted); }
.kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--text-2); background: var(--surface-3); }

.lang-select {
  appearance: none; -webkit-appearance: none; width: auto; min-width: 92px; flex: 0 0 auto;
  border: 1px solid var(--line-2); background-color: var(--surface-3); color: var(--text-2);
  font-family: var(--mono); font-size: 12px; padding: 4px 24px 4px 10px; border-radius: 8px; cursor: pointer;
}

/* ------------------------------------------------------------ 结果页 */

.result-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 34px; padding: 30px 34px;
  --tone: var(--accent);
}
.result-hero::before {
  content: ""; position: absolute; width: 420px; height: 420px; left: -120px; top: -160px; border-radius: 50%;
  background: var(--tone); filter: blur(110px); opacity: .22; pointer-events: none;
}
.result-hero.ac { --tone: var(--ok); border-color: var(--ok-bd); }
.result-hero.fail { --tone: var(--bad); }
.result-hero.wait { --tone: var(--info); }
.rh-main { position: relative; min-width: 0; flex: 1; }
.rh-title { font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -0.03em; margin: 10px 0 6px; line-height: 1.15; }
.result-hero.ac .rh-title { background: linear-gradient(120deg, #7df0bd, #2fc98a 60%, #48cae4); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-theme="light"] .result-hero.ac .rh-title { background: linear-gradient(120deg, #0c7a53, #0a85a5); -webkit-background-clip: text; background-clip: text; }
.rh-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.rh-stat { padding: 9px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-3); min-width: 96px; }
.rh-stat b { display: block; font-family: var(--mono); font-size: 17px; font-weight: 700; line-height: 1.3; }
.rh-stat span { font-size: 11.5px; color: var(--muted); }
.rh-stat.hl { border-color: var(--ok-bd); background: var(--ok-bg); } .rh-stat.hl b { color: var(--ok-ink); }
.rh-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.dots i { display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: currentColor; animation: dots 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-7px); opacity: 1; } }

/* 排队 / 判题中的雷达 */
.radar { position: relative; width: 168px; height: 168px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--info-bd); background: radial-gradient(circle, var(--info-bg), transparent 70%); display: grid; place-items: center; overflow: hidden; }
.radar::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 78%, var(--info) 100%); opacity: .55; animation: spin 1.6s linear infinite; }
.radar::after { content: ""; position: absolute; inset: 26%; border-radius: 50%; border: 1px dashed var(--info-bd); }
.radar b { position: relative; font: 750 15px var(--mono); color: var(--info-ink); letter-spacing: .1em; }

.receipt {
  position: relative; display: flex; align-items: center; gap: 10px 26px; flex-wrap: wrap;
  margin-top: 14px; padding: 13px 20px;
  border: 1px dashed var(--accent-line); border-radius: 14px; background: var(--accent-dim);
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
}
.receipt::before, .receipt::after { content: ""; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--bg); border: 1px dashed var(--accent-line); }
.receipt::before { left: -9px; } .receipt::after { right: -9px; }
.receipt b { color: var(--accent-2); font-weight: 700; }

.result-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; margin-top: 16px; }
.score-card { text-align: center; padding: 24px 20px; }
.score-ring { position: relative; width: 168px; height: 168px; margin: 6px auto 4px; }

.test-list { display: flex; flex-direction: column; gap: 7px; }
.test-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 13px;
  border: 1px solid var(--line); border-radius: 12px; font-size: 13px; background: var(--surface-3);
  animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 55ms);
  transition: transform .2s, border-color .2s;
}
.test-row:hover { transform: translateX(3px); border-color: var(--line-2); }
.test-row .no { font-family: var(--mono); color: var(--muted); font-size: 12px; width: 34px; flex-shrink: 0; }
.test-row .note { color: var(--muted); font-size: 12.5px; margin-left: auto; text-align: right; }
.test-row.bad { border-color: var(--bad-bd); background: var(--bad-bg); }
.test-row .got { font-family: var(--mono); font-size: 11.5px; color: var(--bad-ink); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.verdict { font-family: var(--mono); font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); letter-spacing: .06em; flex-shrink: 0; }
.verdict.AC { color: var(--ok-ink); background: var(--ok-bg); border-color: var(--ok-bd); }
.verdict.WA { color: var(--bad-ink); background: var(--bad-bg); border-color: var(--bad-bd); }
.verdict.TLE, .verdict.RE, .verdict.CE, .verdict.BAN, .verdict.SE { color: var(--warn-ink); background: var(--warn-bg); border-color: var(--warn-bd); }

.dims { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.dim { display: grid; grid-template-columns: 110px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; }
.dim .bar { height: 6px; border-radius: 99px; background: var(--trk); overflow: hidden; }
.dim .bar > i { display: block; height: 100%; background: var(--grad-cool); border-radius: 99px; animation: grow 1s var(--ease) backwards .2s; }
.dim .num { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }

.code-view {
  margin: 0; padding: 16px 18px; border-radius: 14px; background: var(--code-bg);
  border: 1px solid var(--line); overflow: auto; max-height: 440px;
  font-family: var(--mono); font-size: 12.8px; line-height: 1.65; color: var(--code-text); tab-size: 4;
}
.msg-box {
  margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--bad-bd); background: var(--bad-bg); border-radius: 12px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--bad-ink);
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto;
}
.msg-box code { font: inherit; color: inherit; }

/* ------------------------------------------------------------ 页面说明条 */

.guide {
  display: flex; gap: 12px; padding: 14px 18px; margin: 0 0 18px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(100deg, var(--accent-dim), transparent 60%), var(--surface-3);
}
.guide .gi { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); margin-top: 1px; }
.guide .gi svg { width: 16px; height: 16px; }
.guide .gbody { min-width: 0; }
.guide h4 { font-size: 14px; font-weight: 700; margin: 2px 0 4px; }
.guide p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 0; }
.guide ul { margin: 6px 0 0; padding-left: 17px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.guide li { margin: 3px 0; }
.guide li::marker { color: var(--accent); }
.guide b, .guide strong { color: var(--text-2); font-weight: 650; }
.guide.tip { background: linear-gradient(100deg, var(--info-bg), transparent 60%), var(--surface-3); }
.guide.tip .gi { background: var(--info-bg); color: var(--info); }
.guide.warn { background: linear-gradient(100deg, var(--warn-bg), transparent 60%), var(--surface-3); }
.guide.warn .gi { background: var(--warn-bg); color: var(--warn); }
.guide.slim { padding: 9px 14px; margin-bottom: 14px; align-items: center; }
.guide.slim .gi { width: 22px; height: 22px; border-radius: 7px; margin-top: 0; }
.guide.slim .gi svg { width: 12px; height: 12px; }
.guide.slim h4 { display: none; }
.guide.slim p { font-size: 12.5px; line-height: 1.55; }

/* ------------------------------------------------------------ 表格 */

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card-bg); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 12px 16px; font-size: 11.5px; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; text-transform: uppercase;
  background: var(--surface-3); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; white-space: nowrap; z-index: 1;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); font-variant-numeric: tabular-nums; transition: background .15s; }
table.data td.mono, table.data th.mono { font-family: var(--mono); font-size: 12.5px; }
table.data tbody tr:nth-child(even) td { background: var(--zebra); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--hover); }
table.data tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.data tbody tr.me td { background: var(--accent-dim); }
table.data tbody tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.data tr.row-click { cursor: pointer; }
table.data.lb td { vertical-align: middle; }
table.data.lb tbody tr { animation: rise .45s var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 16) * 35ms); }
.lb-who { white-space: nowrap; }
.lb-who .who { display: inline-flex; align-items: center; gap: 10px; vertical-align: middle; }
.lb-bar { display: block; height: 4px; border-radius: 4px; background: var(--trk); margin-top: 5px; min-width: 70px; overflow: hidden; }
.lb-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); animation: grow 1s var(--ease) backwards .2s; }
.show-sm { display: none; }

.avatar {
  --h: 24;
  width: var(--sz, 30px); height: var(--sz, 30px); border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center;
  font-size: calc(var(--sz, 30px) * .44); font-weight: 750; color: #fff; font-family: var(--sans);
  background: linear-gradient(135deg, hsl(var(--h) 85% 62%), hsl(calc(var(--h) + 50) 75% 48%));
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.rank-n { display: inline-block; min-width: 28px; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-family: var(--mono); font-size: 12.5px; font-weight: 800; border: 1px solid transparent; }
.medal.m1 { color: #6b4700; background: linear-gradient(145deg, #ffe89a, #f2b632); border-color: #e0a91f; box-shadow: 0 4px 14px -4px rgba(242, 182, 50, .8); }
.medal.m2 { color: #3b4656; background: linear-gradient(145deg, #f3f6fa, #c3ccd8); border-color: #b3bdca; }
.medal.m3 { color: #5c3215; background: linear-gradient(145deg, #f6cba6, #d08a57); border-color: #c27a46; }

/* 领奖台 */
.podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 16px; align-items: end; margin: 6px 0 26px; }
.pod {
  position: relative; text-align: center; padding: 22px 16px 20px;
  border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--card-bg);
  box-shadow: inset 0 1px 0 var(--card-hi); overflow: hidden;
  animation: podUp .9s var(--ease) backwards; animation-delay: var(--d, 0s);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.pod:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
@keyframes podUp { from { opacity: 0; transform: translateY(60px); } }
.pod::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--mc); }
.pod.p1 { order: 2; padding-top: 34px; padding-bottom: 30px; --mc: linear-gradient(90deg, #ffe89a, #f2b632); --d: .1s; border-color: rgba(242, 182, 50, .45); }
.pod.p1::after { content: ""; position: absolute; left: 50%; top: -90px; width: 260px; height: 200px; margin-left: -130px; background: radial-gradient(closest-side, rgba(242, 182, 50, .28), transparent); pointer-events: none; z-index: 0; opacity: 1; }
.pod.p2 { order: 1; --mc: linear-gradient(90deg, #f3f6fa, #aab4c2); --d: .25s; }
.pod.p3 { order: 3; --mc: linear-gradient(90deg, #f6cba6, #c27a46); --d: .4s; }
.pod-crown { display: block; width: 34px; height: 34px; margin: 0 auto 4px; color: #f2b632; animation: floaty 3.4s ease-in-out infinite; filter: drop-shadow(0 4px 10px rgba(242, 182, 50, .6)); }
.pod .avatar { --sz: 62px; margin: 4px auto 10px; display: grid; box-shadow: 0 0 0 4px var(--surface-solid), 0 0 0 6px var(--line-2); }
.pod.p1 .avatar { --sz: 78px; box-shadow: 0 0 0 4px var(--surface-solid), 0 0 0 7px #f2b632; }
.pod-rank { position: absolute; left: 14px; top: 14px; }
.pod-name { display: block; font-size: 17px; font-weight: 750; }
.pod.p1 .pod-name { font-size: 20px; }
.pod-cls { display: block; font-size: 12px; color: var(--muted); }
.pod-score { margin-top: 12px; font-family: var(--mono); }
.pod-score b { font-size: 30px; letter-spacing: -0.03em; }
.pod.p1 .pod-score b { font-size: 40px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pod-score span { font-size: 12px; color: var(--muted); }
.pod-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------ 表单 */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; letter-spacing: .02em; font-weight: 550; }
.field .hint { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; }
.field .req { color: var(--bad); font-weight: 700; margin-left: 2px; }

input[type=text], input[type=password], input[type=number], input[type=datetime-local],
input[type=tel], input[type=email], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line-2); background-color: var(--input-bg); color: var(--text);
  font: inherit; font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); background-color: var(--input-bg-focus); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad) !important; box-shadow: 0 0 0 4px var(--bad-bg); }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px;
}
select.lang-select { background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%; background-size: 4px 4px; padding: 4px 24px 4px 10px; font-size: 12px; border-radius: 8px; }
select option { background: var(--surface-solid); color: var(--text); }
textarea { resize: vertical; }
input[type=file] {
  width: 100%; font: inherit; font-size: 13px; color: var(--muted); padding: 7px;
  border: 1px dashed var(--line-3); border-radius: 12px; background: var(--input-bg); cursor: pointer;
}
input[type=file]:hover { border-color: var(--accent-line); }
input[type=file]::file-selector-button {
  font: inherit; font-size: 12.5px; font-weight: 650; margin-right: 10px; padding: 6px 12px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-4); color: var(--text); cursor: pointer;
}

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 6px 0 4px; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--trk); position: relative; cursor: pointer; transition: background .25s; flex: 0 0 42px; margin: 0; border: 0; padding: 0; }
.switch input::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .3s var(--spring); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--btn-grad); }
.switch input:checked::after { transform: translateX(18px); }

/* 分段控件（带滑块由 fx 无关，纯 CSS 高亮） */
.seg, .auth-tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-3);
  max-width: 100%; overflow-x: auto;
}
.seg button, .auth-tabs button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 16px; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s;
}
.seg button:hover, .auth-tabs button:hover { color: var(--text); }
.seg button.on, .auth-tabs button.on { background: var(--surface-solid); color: var(--text); box-shadow: var(--e1), 0 0 0 1px var(--line), inset 0 1px 0 var(--card-hi); }
.seg-n { font-family: var(--mono); font-size: 11px; padding: 0 7px; border-radius: 99px; background: var(--surface-4); color: var(--muted); }
.seg button.on .seg-n { background: var(--accent-dim); color: var(--accent-2); }
.auth-tabs { display: flex; }
.auth-tabs button { flex: 1; }

/* ------------------------------------------------------------ 我的 */

.profile { display: flex; align-items: center; gap: 28px; padding: 30px 32px; overflow: hidden; }
.profile::before { content: ""; position: absolute; right: -80px; top: -120px; width: 380px; height: 380px; border-radius: 50%; background: var(--grad); filter: blur(100px); opacity: .16; pointer-events: none; }
.profile .avatar { --sz: 84px; box-shadow: 0 0 0 4px var(--surface-solid), 0 0 0 6px var(--accent-line); }
.profile-main { flex: 1; min-width: 0; position: relative; }
.profile-main h1 { font-size: 32px; letter-spacing: -0.02em; margin: 6px 0 2px; }
.profile .kpi-row { margin-top: 18px; max-width: 520px; }
.lvwall { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.lvtile {
  position: relative; padding: 12px 12px 10px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background: var(--card-bg); color: var(--text);
  transition: transform .3s var(--spring), border-color .2s;
  animation: pop .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms);
}
.lvtile:hover { transform: translateY(-4px) scale(1.03); color: var(--text); border-color: var(--accent-line); }
.lvtile .no { font: 750 12px var(--mono); color: var(--muted); letter-spacing: .08em; display: flex; align-items: center; justify-content: space-between; }
.lvtile b { display: block; font: 750 22px var(--mono); letter-spacing: -0.03em; margin-top: 4px; }
.lvtile b small { font-size: 12px; color: var(--muted); font-weight: 500; }
.lvtile .pc-bar { margin-top: 8px; }
.lvtile.done { border-color: var(--ok-bd); background: linear-gradient(180deg, var(--ok-bg), transparent), var(--card-bg); }
.lvtile.done b { color: var(--ok-ink); }
.lvtile.done .pc-bar i { background: linear-gradient(90deg, #2fc98a, #7df0bd); }
.lvtile.partial { border-color: var(--accent-line); }
.lvtile.todo b { color: var(--muted-2); }
.lvtile .st { width: 16px; height: 16px; color: var(--ok); }

/* ------------------------------------------------------------ 管理端 */

.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.side-nav { position: sticky; top: 88px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; background: var(--card-bg); box-shadow: inset 0 1px 0 var(--card-hi); }
.side-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; background: transparent; color: var(--muted);
  border-radius: 12px; cursor: pointer; font-size: 13.5px; font-weight: 550; text-align: left;
  transition: color .18s, background .18s, transform .18s;
}
.side-nav button:hover { color: var(--text); background: var(--hover); transform: translateX(2px); }
.side-nav button.on { color: var(--text); background: linear-gradient(90deg, var(--accent-dim), transparent); box-shadow: inset 3px 0 0 var(--accent); }
.side-nav .sep { height: 1px; background: var(--line); margin: 8px 4px; }
.side-nav .ni { width: 17px; height: 17px; flex: 0 0 17px; display: inline-flex; align-items: center; justify-content: center; opacity: .75; }
.side-nav .ni svg { width: 17px; height: 17px; }
.side-nav button.on .ni { opacity: 1; color: var(--accent); }
.side-who { padding: 10px 12px 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.side-name { font-size: 15px; font-weight: 700; color: var(--text); }
.side-who .chip { margin-top: 4px; font-family: var(--sans); }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kpi {
  position: relative; padding: 16px 18px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card-bg); box-shadow: inset 0 1px 0 var(--card-hi);
  transition: border-color .2s, transform .3s var(--ease);
}
.kpi:hover { transform: translateY(-2px); border-color: var(--line-2); }
.kpi b { display: block; font-family: var(--mono); font-size: 30px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.kpi.primary { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-dim), transparent), var(--card-bg); }
.kpi.primary b, .kpi.accent b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi.good b { color: var(--ok); }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 210px 1fr 96px; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .track { height: 9px; border-radius: 99px; background: var(--trk); overflow: hidden; }
.bar-row .track > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); animation: grow 1.1s var(--ease) backwards .2s; }
.bar-row .v { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ 抽屉 / 弹层 / 提示 */

.drawer-mask, .modal-mask { position: fixed; inset: 0; background: rgba(4, 4, 10, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s ease; }
html[data-theme="light"] .drawer-mask, html[data-theme="light"] .modal-mask { background: rgba(30, 24, 50, .35); }
.drawer-mask { z-index: 60; }
.drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 61; width: min(780px, calc(100vw - 20px));
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  animation: slideIn .4s var(--ease);
}
@keyframes slideIn { from { transform: translateX(60px); opacity: 0; } }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer-body { padding: 20px 22px 40px; overflow: auto; }

.modal-mask { z-index: 70; display: grid; place-items: center; padding: 20px; }
.modal {
  width: min(560px, 100%); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-lg);
  animation: pop .35s var(--spring);
}
.modal h3 { font-size: 20px; }

.toast-root { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 14px; border-radius: 14px; font-size: 13.5px;
  background: var(--surface-solid); border: 1px solid var(--line-2); color: var(--text);
  box-shadow: var(--shadow); max-width: 380px;
  animation: toastIn .45s var(--spring);
  transition: opacity .25s, transform .25s;
}
.toast.out { opacity: 0; transform: translateX(24px) scale(.96); }
.toast .ti { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-4); color: var(--text-2); }
.toast .ti svg { width: 12px; height: 12px; }
.toast.ok { border-color: var(--ok-bd); } .toast.ok .ti { background: var(--ok-bg); color: var(--ok); }
.toast.err { border-color: var(--bad-bd); } .toast.err .ti { background: var(--bad-bg); color: var(--bad); }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--grad); transform-origin: 0 50%; animation: toastBar 2.6s linear forwards; }
@keyframes toastBar { to { transform: scaleX(0); } }
@keyframes toastIn { from { transform: translateX(40px) scale(.9); opacity: 0; } }

/* 快速跳转（Ctrl+K） */
.cmdk-mask { align-items: start; padding-top: 14vh; }
.cmdk { width: min(580px, 100%); padding: 0; overflow: hidden; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk-in svg { width: 18px; height: 18px; }
.cmdk-in input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 4px 0; font-size: 16px; }
.cmdk-list { max-height: 360px; overflow: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.cmdk-item .k { font-family: var(--mono); font-size: 11.5px; color: var(--muted); min-width: 34px; }
.cmdk-item .s { margin-left: auto; font-size: 12px; color: var(--muted); }
.cmdk-item.on { background: var(--accent-dim); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13.5px; }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------ 空态 / 骨架 / 404 */

.empty { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty .big { font: 850 clamp(64px, 14vw, 140px)/1 var(--mono); letter-spacing: -0.06em; margin-bottom: 14px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .9; animation: floaty 5s ease-in-out infinite; }
.empty h3 { color: var(--text); font-size: 20px; }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--skeleton-a), var(--skeleton-b), var(--skeleton-a)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }

/* ------------------------------------------------------------ 页脚 */

#footer { border-top: 1px solid var(--line); padding: 30px 24px 38px; color: var(--muted); font-size: 12.5px; background: linear-gradient(180deg, transparent, var(--surface-3)); }
.footer-in { max-width: var(--max); margin: 0 auto; display: flex; gap: 14px 28px; align-items: center; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 34px; height: 34px; border-radius: 50%; background: #fff; }
.footer-brand b { display: block; color: var(--text-2); font-size: 13px; }
.footer-links { display: flex; gap: 18px; margin-left: auto; }
.footer-link { color: var(--muted); position: relative; }
.footer-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .3s var(--ease); }
.footer-link:hover { color: var(--text); }
.footer-link:hover::after { transform: scaleX(1); }
.footer-motto { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; color: var(--muted-2); }

/* ------------------------------------------------------------ 复赛 */

.final-entry {
  position: relative; display: flex; align-items: center; gap: 18px; overflow: hidden;
  margin: 0 0 26px; padding: 22px 26px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card-bg); color: var(--text); box-shadow: inset 0 1px 0 var(--card-hi);
  transition: border-color .25s, transform .3s var(--ease), box-shadow .3s;
}
.final-entry:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); color: var(--text); }
.final-entry.open { border-color: var(--accent-line); background: linear-gradient(110deg, var(--accent-dim), transparent 60%), var(--card-bg); }
.final-entry.open::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .09), transparent);
  transform: skewX(-20deg); animation: sweep 4.5s ease-in-out infinite;
}
@keyframes sweep { 0%, 55% { left: -40%; } 100% { left: 130%; } }
.fe-body { flex: 1; min-width: 0; position: relative; }
.fe-eyebrow { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.final-entry.open .fe-eyebrow { color: var(--accent); }
.fe-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); }
.final-entry.open .fe-dot { background: var(--accent); --pulse: rgba(255, 138, 61, .6); animation: pulse 1.6s infinite; }
.fe-body h3 { margin: 6px 0 4px; font-size: 22px; letter-spacing: -.02em; }
.fe-body p { margin: 0; font-size: 13px; color: var(--muted); }
.fe-side { flex: 0 0 auto; text-align: right; position: relative; }
.fe-cd { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.fe-cd b { font-size: 26px; letter-spacing: -.02em; color: var(--accent-2); }
.final-entry.locked .fe-cd b { color: var(--text-2); }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; }
.topic-card { padding: 20px 22px; transition: transform .3s var(--ease), border-color .25s; }
.topic-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.pt-group { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.pt-group summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 8px; transition: color .2s; }
.pt-group summary:hover { color: var(--text); }
.pt-group summary::-webkit-details-marker { display: none; }
.pt-group summary::before { content: "+"; font-family: var(--mono); color: var(--accent); width: 18px; height: 18px; border-radius: 6px; background: var(--accent-dim); display: grid; place-items: center; transition: transform .3s var(--spring); }
.pt-group[open] summary::before { content: "−"; transform: rotate(180deg); }
.pt-group[open] > :not(summary) { animation: rise .35s var(--ease); }
.pt-list { margin: 10px 0 0; padding-left: 20px; font-size: 12.8px; color: var(--text-2); line-height: 1.75; }
.pt-list li { margin: 2px 0; }
.pt-list li::marker { color: var(--muted-2); }

.locked-panel { text-align: center; padding: 64px 24px; overflow: hidden; }
.locked-panel::before { content: ""; position: absolute; left: 50%; top: -180px; width: 520px; height: 420px; margin-left: -260px; background: radial-gradient(closest-side, var(--accent-dim), transparent); pointer-events: none; }
.locked-panel > * { position: relative; }
.lock-ring {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line-2); color: var(--accent);
  --pulse: rgba(255, 138, 61, .35); animation: pulse 2.4s infinite;
}
.lock-ring svg { width: 30px; height: 30px; }
.locked-panel h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -0.02em; }
.locked-panel .countdown { justify-content: center; }
.locked-panel .cd-label { justify-content: center; }

/* ------------------------------------------------------------ 登录 / 注册 */

.auth-wrap {
  max-width: 920px; margin: 3vh auto 0;
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden;
  background: var(--card-bg); box-shadow: var(--shadow-lg), inset 0 1px 0 var(--card-hi);
}
.auth-art {
  position: relative; overflow: hidden; padding: 40px 34px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 30px; min-height: 520px;
  background: linear-gradient(160deg, #1b1030 0%, #2a1240 45%, #3d1a2e 100%); color: #fff;
}
.auth-art::before { content: ""; position: absolute; width: 380px; height: 380px; right: -140px; top: -120px; border-radius: 50%; background: #ff8a3d; filter: blur(90px); opacity: .55; animation: drift2 14s ease-in-out infinite alternate; }
.auth-art::after { content: ""; position: absolute; width: 320px; height: 320px; left: -120px; bottom: -120px; border-radius: 50%; background: #7b68ff; filter: blur(90px); opacity: .5; animation: drift1 16s ease-in-out infinite alternate; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .aa-badge { width: 92px; height: 92px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .9); background: #fff; box-shadow: 0 20px 50px -14px rgba(0, 0, 0, .6); animation: floaty 6s ease-in-out infinite; }
.auth-art h2 { font-size: 34px; line-height: 1.2; letter-spacing: -0.03em; color: #fff; }
.auth-art h2 em { font-style: normal; background: linear-gradient(120deg, #ffd08f, #ff8a3d 50%, #ff6f9c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: rgba(255, 255, 255, .72); font-size: 13.5px; margin-top: 12px; }
.aa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .86); }
.aa-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: rise .6s var(--ease) backwards; animation-delay: calc(var(--i) * 120ms + .2s); }
.aa-list li b { font-family: var(--mono); font-size: 11px; color: #ffc27a; letter-spacing: .1em; }
.auth-card { padding: 40px 36px; border: 0; border-radius: 0; background: transparent; box-shadow: none; display: flex; flex-direction: column; justify-content: center; }
.auth-head { margin-bottom: 22px; }
.auth-head img { display: none; }
.auth-head h2 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.02em; }
.auth-regtip { font-size: 12.5px; line-height: 1.55; color: var(--accent-2); background: var(--accent-dim); border: 1px solid var(--accent-line); border-radius: 12px; padding: 10px 12px; margin: 2px 0 14px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn-block { padding: 12px 18px; margin-top: 4px; }
.auth-steps { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.auth-steps span { opacity: .55; white-space: nowrap; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); transition: all .3s; }
.auth-steps span.on { opacity: 1; color: var(--accent-2); border-color: var(--accent-line); background: var(--accent-dim); }
.auth-steps i { flex: 1; height: 1px; background: var(--line-2); }

/* ------------------------------------------------------------ 可访问性 / 动效偏好 */

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus { outline: none; }
button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* 主题切换：从按钮位置圆形扩散 */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: vtReveal .6s ease-out; }
@keyframes vtReveal { from { clip-path: circle(0 at var(--vt-x, 90%) var(--vt-y, 30px)); } to { clip-path: circle(150vmax at var(--vt-x, 90%) var(--vt-y, 30px)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  html.fx [data-reveal] { opacity: 1; transform: none; }
  .term-line { opacity: 1; }
}

/* ------------------------------------------------------------ 响应式 */

@media (max-width: 1160px) {
  .identity-pill .sid, .identity-pill .dot { display: none; }
  .identity-pill { max-width: 210px; }
  .clock { display: none; }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 10px; }
  .hero-art { order: -1; height: 330px; transform: scale(.82); margin: -20px 0; }
  .float-chip.fc2 { left: 4%; } .float-chip.fc3 { right: 4%; } .term { left: 6%; }
  .workbench { grid-template-columns: 1fr; }
  .editor-panel { position: static; }
  .result-grid { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav button { width: auto; white-space: nowrap; }
  .side-nav button:hover { transform: none; }
  .side-nav .sep, .side-who { display: none; }
  .pipeline { grid-template-columns: 1fr; gap: 12px; }
  .pipe-link { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .identity-bar .ib-fields { grid-template-columns: 1fr 1fr; }
  .identity-bar .ib-fields .ib-field:last-child { grid-column: span 2; }
  .auth-wrap { grid-template-columns: 1fr; max-width: 460px; }
  .auth-art { min-height: 0; padding: 26px 26px 22px; flex-direction: row; align-items: center; gap: 18px; }
  .auth-art .aa-badge { width: 62px; height: 62px; flex-shrink: 0; }
  .auth-art h2 { font-size: 22px; } .auth-art p, .aa-list { display: none; }
}

@media (max-width: 760px) {
  .app { padding: 18px 14px 120px; }
  #topbar { padding: 8px 10px 0; }
  .topbar-in { padding: 7px 8px 7px 10px; gap: 8px; border-radius: 16px; }
  .brand-txt span { display: none; }
  .top-right { gap: 6px; }
  .top-right .btn { padding: 6px 10px; font-size: 12.5px; }
  .top-link { display: none; }
  .identity-pill { max-width: 132px; padding: 4px 9px; }
  .identity-pill .meta { display: none; }

  /* 导航沉到底部，拇指够得着 */
  .nav {
    position: fixed; z-index: 50; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
    margin: 0; padding: 6px; gap: 0; justify-content: space-around;
    border: 1px solid var(--line-2); border-radius: 22px;
    background: var(--topbar); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
    box-shadow: var(--shadow-lg);
  }
  .nav a { flex: 1; flex-direction: column; gap: 2px; padding: 7px 4px 5px; font-size: 11px; border-radius: 16px; justify-content: center; }
  .nav a svg { display: block; width: 20px; height: 20px; }
  .nav a.on { color: var(--accent-2); }
  .nav-ind { top: 6px; height: calc(100% - 12px); border-radius: 16px; }
  .nav-ind::after { display: none; }
  .toast-root { right: 12px; left: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }

  .hero-title { font-size: clamp(40px, 13vw, 60px); margin: 16px 0 14px; }
  .hero .lede { font-size: 15px; }
  .hero-art { height: 270px; transform: scale(.66); margin: -46px 0 -40px; }
  .scroll-cue { display: none; }
  .countdown { gap: 7px; }
  .cd-cell { min-width: 0; flex: 1; padding: 9px 6px 7px; border-radius: 13px; }
  .cd-cell b { font-size: 23px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .stat b { font-size: 24px; }
  .section-head { flex-wrap: wrap; margin: 40px 0 16px; }
  .section-head h2 { font-size: 22px; }
  .section-head > p { margin-left: 0; text-align: left; width: 100%; }
  .card { padding: 18px; border-radius: 18px; }
  .lvmap { padding: 22px 14px 16px; }
  .dim { grid-template-columns: 84px 1fr 48px; }
  .switch-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 104px 1fr 84px; }
  .identity-bar .ib-fields { grid-template-columns: 1fr; }
  .identity-bar .ib-fields .ib-field:last-child { grid-column: auto; }
  .problem-meta { display: none; }
  .problem-no { width: 48px; height: 48px; font-size: 18px; border-radius: 14px; }
  .problem-hero h1 { font-size: 21px; }
  .editor-body { height: 46vh; }
  .result-hero { flex-direction: column; text-align: center; padding: 26px 18px; gap: 18px; }
  .result-hero .eyebrow, .rh-stats, .rh-actions { justify-content: center; }
  .rh-stat { min-width: 0; flex: 1 1 40%; }
  .podium { grid-template-columns: 1fr; gap: 10px; }
  .pod.p1 { order: 1; } .pod.p2 { order: 2; } .pod.p3 { order: 3; }
  .pod { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px; text-align: left; padding: 16px 16px 16px 52px !important; }
  .pod .avatar, .pod.p1 .avatar { --sz: 46px; margin: 0; grid-row: span 2; }
  .pod-crown { display: none; }
  .pod-rank { top: 50%; margin-top: -14px; }
  .pod-score { grid-row: 1 / span 2; grid-column: 3; margin: 0; text-align: right; }
  .pod-score b, .pod.p1 .pod-score b { font-size: 24px; }
  .pod-meta { display: none; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 8px; }
  .hide-sm { display: none !important; }
  .show-sm { display: block; margin-top: 1px; }
  table.data th, table.data td { padding: 10px 11px; }
  .lb-who .avatar { display: none; }
  .profile { flex-direction: column; text-align: center; padding: 26px 18px; gap: 16px; }
  .profile .kpi-row { margin-inline: auto; }
  .final-entry { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
  .fe-side, .fe-cd { align-items: flex-start; text-align: left; }
  .topic-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; }
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
  .footer-links { margin-left: 0; }
  #footer { padding-bottom: 110px; }
  .guide { padding: 12px 14px; }
}

/* 管理端总览：窄卡片里的条形图与表格不折行 */
.grid-2 .bar-row { grid-template-columns: 84px 1fr 44px; }
.grid-2 > .card table.data td { white-space: nowrap; padding: 10px; }

/* 手机端 Hero：只留徽章与轨道，去掉示意终端和代码气泡，避免挤作一团 */
@media (max-width: 760px) {
  .term, .float-chip.fc2 { display: none; }
  .hero-art { height: 250px; transform: scale(.7); margin: -30px 0 -34px; }
  .float-chip.fc1 { top: 6%; right: 8%; }
  .float-chip.fc3 { bottom: 12%; right: auto; left: 6%; }
}

/* ==========================================================================
   v2.0：管理端入口、复赛线上复评、AI 接入、账号管理
   ========================================================================== */

/* 右下角的管理端入口：平时只是一个小圆钮，悬停才展开文字，学生不会误点 */
.admin-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 45;
  display: inline-flex; align-items: center; gap: 0;
  height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow);
  transition: color .2s, border-color .2s, transform .25s var(--ease), box-shadow .25s, gap .25s;
}
.admin-fab svg { width: 19px; height: 19px; }
.admin-fab span { max-width: 0; overflow: hidden; opacity: 0; transition: max-width .3s var(--ease), opacity .2s; }
.admin-fab:hover, .admin-fab:focus-visible, .admin-fab.in-admin { color: var(--text); border-color: var(--accent-line); gap: 8px; transform: translateY(-2px); }
.admin-fab:hover span, .admin-fab:focus-visible span, .admin-fab.in-admin span { max-width: 90px; opacity: 1; }
.admin-fab.in-admin { color: var(--accent-2); }
/* 提示条让出右下角 */
.toast-root { bottom: 76px; }

.mini-link { border: 0; background: none; padding: 2px 6px; font-size: 12px; color: var(--accent-2); cursor: pointer; border-radius: 6px; }
.mini-link:hover { background: var(--accent-dim); }
.mini-link.danger { color: var(--bad-ink); }
.mini-link.danger:hover { background: var(--bad-bg); }

.verdict.SKIP { color: var(--muted); }

/* 复评抽屉：左材料、右打分 */
.drawer.drawer-wide { width: min(1180px, calc(100vw - 20px)); }
.review-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; flex: 1; padding-bottom: 20px; }
.drawer-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-3); }
.total-box { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--accent-line); background: var(--accent-dim); }
.total-box b { font-size: 26px; letter-spacing: -0.03em; color: var(--accent-2); }

.mat { display: grid; gap: 12px; }
.mat-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; align-items: start; }
.mat-k { font-size: 12px; color: var(--muted); padding-top: 5px; white-space: nowrap; }
.mat-text { white-space: pre-wrap; word-break: break-word; margin-top: 4px; color: var(--text-2); line-height: 1.7; }

.pt-check summary .spacer { margin-left: auto; }
.pt-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 10px; }
.pt-box {
  display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); font-size: 12.8px; line-height: 1.5; color: var(--text-2);
  transition: border-color .15s, background .15s;
}
.pt-box:hover { border-color: var(--line-3); }
.pt-box:has(input:checked) { border-color: var(--ok-bd); background: var(--ok-bg); color: var(--text); }
.pt-box input { width: 16px; height: 16px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--ok); cursor: pointer; }
.pt-box b { color: var(--muted); margin-right: 2px; }

.score-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(90px, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line); }
.score-row:first-of-type { border-top: 0; }
.score-row b { font-size: 14px; }
.score-num { display: inline-flex; align-items: center; gap: 6px; }
.score-num input { width: 74px; padding: 7px 8px; text-align: center; font-family: var(--mono); }
input[type=range] { width: 100%; accent-color: var(--accent); cursor: pointer; padding: 0; border: 0; background: none; }
input[type=range]:focus { box-shadow: none; }

.review-quote { padding: 8px 12px; margin-top: 6px; border-left: 3px solid var(--ok); background: var(--surface-3); border-radius: 0 10px 10px 0; color: var(--text-2); }

@media (max-width: 980px) {
  .review-grid { grid-template-columns: 1fr; }
  .pt-boxes { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .admin-fab { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); height: 40px; }
  .toast-root { bottom: calc(136px + env(safe-area-inset-bottom)); }
  .score-row { grid-template-columns: 1fr auto; }
  .score-row input[type=range] { grid-column: 1 / -1; order: 3; }
  .drawer-foot { padding: 12px 14px; }
}
/* 管理端表格：姓名、时间这类短字段不折行 */
#admin-body table.data .who, #admin-body table.data .tiny.muted.mono { white-space: nowrap; }
.drawer table.data td { padding: 9px 10px; }
.drawer table.data td:first-child, .drawer table.data td:nth-child(2) { white-space: nowrap; }
/* 抽屉打开时提示条再抬高一点，别盖住底部的保存按钮 */
body:has(.drawer) .toast-root { bottom: 100px; }
.mini-link { white-space: nowrap; }
