/* ============================================================
   视觉精修层
   在不改动原有结构的前提下，统一暗色质感、卡片层次与交互反馈
   ============================================================ */

:root[data-theme="dark"] {
  --bg: #0b0805;
  --bg-deep: #070503;
  --surface: #15100b;
  --surface-2: #1b1510;
  --surface-3: #241c13;
  --surface-hover: #201810;
  --line: #302519;
  --line-2: #46351f;
  --gold: #dfb96a;
  --gold-bright: #f2d99f;
  --shadow-card: 0 26px 54px -42px rgba(0, 0, 0, .95);
  --shadow-pop: 0 34px 80px -34px rgba(0, 0, 0, .95);
}

:root[data-theme="light"] {
  --surface: #fffaf0;
  --surface-2: #f8f1e2;
  --line: #e3d7c0;
  --gold: #a17324;
  --shadow-card: 0 22px 48px -38px rgba(80, 55, 20, .45);
}

/* ---------- 外壳 ---------- */
.site-head {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(22px) saturate(125%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.site-head.scrolled {
  border-bottom-color: var(--line-2);
  box-shadow: 0 14px 40px -34px rgba(0, 0, 0, .9);
}
.head-inner { height: 70px; gap: 24px; }

.site-brand { position: relative; padding-left: 45px; gap: 0; }
.site-brand::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 38px; height: 38px;
  transform: translateY(-50%);
  border-radius: 11px;
  background:
    radial-gradient(120% 120% at 30% 0%, rgba(223, 185, 106, .20), transparent 60%),
    linear-gradient(150deg, rgba(223, 185, 106, .10), rgba(223, 185, 106, .02));
  border: 1px solid var(--gold-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 24px -18px rgba(223, 185, 106, .55);
}
.site-brand .mark {
  position: absolute; left: 4px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  color: var(--gold);
  z-index: 1;
}
.site-brand .name { font-size: 17px; letter-spacing: .015em; }
.site-brand .sub { font-size: 7.5px; letter-spacing: .28em; }

.nav-link {
  height: 70px;
  padding: 0 10px;
  font-size: 12.5px;
  letter-spacing: .01em;
}
.nav-link.active { color: var(--ink); }
.nav-link.active::after {
  left: 10px; right: 10px; bottom: 19px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-deep));
  box-shadow: 0 0 14px rgba(223, 185, 106, .45);
}
.ghost-pill {
  background: color-mix(in srgb, var(--surface-2) 62%, transparent);
  backdrop-filter: blur(10px);
}
.ghost-pill:hover { background: var(--gold-soft); }

/* ---------- 页面骨架 ---------- */
.view { padding-top: 38px; }
.page-head { margin-bottom: 24px; }
.page-title {
  font-size: clamp(31px, 3vw, 38px);
  letter-spacing: .01em;
  line-height: 1.16;
}
.page-sub { margin-top: 9px; line-height: 1.75; }

/* ---------- 卡片与表头 ---------- */
.card {
  border-radius: 16px;
  background: var(--surface);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, var(--surface-2)), var(--surface));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .022), var(--shadow-card);
}
.card-head { padding: 16px 22px; }
.card-head .title { font-size: 16px; letter-spacing: .015em; }
.card-head .hint { letter-spacing: .02em; }
.card-body { padding: 20px 22px; }

/* ---------- 按钮 ---------- */
.btn {
  border-radius: 9px;
  letter-spacing: .01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
.btn-primary {
  --btn-bg: linear-gradient(180deg, #e8c77f, #b5852d);
  --btn-fg: #181006;
  box-shadow: 0 12px 28px -16px rgba(223, 185, 106, .65), inset 0 1px 0 rgba(255, 255, 255, .40);
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 18px 34px -18px rgba(223, 185, 106, .75), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: color-mix(in srgb, var(--surface-2) 86%, transparent); }
.btn-ghost:hover { border-color: var(--line-strong); }

:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 60%, transparent);
  outline-offset: 2px;
}

/* ---------- 首页 ---------- */
.home-hero { padding: 18px 0 34px; }
.home-title {
  font-size: clamp(34px, 3.6vw, 48px);
  line-height: 1.14;
  letter-spacing: .015em;
}
.home-sub { max-width: 620px; line-height: 1.9; margin-top: 14px; }

.daily-band {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border-color: color-mix(in srgb, var(--gold-line) 75%, var(--line));
  background:
    radial-gradient(90% 160% at 0% 0%, rgba(223, 185, 106, .15), transparent 58%),
    linear-gradient(110deg, color-mix(in srgb, var(--gold-soft) 70%, transparent), var(--surface) 58%);
  box-shadow: 0 28px 56px -44px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .035);
}
.daily-band::after {
  content: "";
  position: absolute; right: -90px; top: -120px;
  width: 280px; height: 280px; border-radius: 50%;
  border: 1px solid var(--gold-line);
  box-shadow: 0 0 0 34px rgba(223, 185, 106, .025), 0 0 0 68px rgba(223, 185, 106, .018);
  pointer-events: none;
}
.daily-copy, .daily-problem, .daily-streak { position: relative; z-index: 1; }

.goal-grid { gap: 18px; }
.goal-card {
  min-height: 372px;
  padding: 22px 22px 0;
  border-radius: 16px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(223, 185, 106, .06), transparent 55%),
    linear-gradient(180deg, var(--surface-2), var(--surface) 58%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), var(--shadow-card);
}
.goal-card::before {
  content: "";
  position: absolute; top: 0; left: 22px; right: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
  opacity: .8;
}
.goal-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold-line);
  box-shadow: 0 34px 64px -42px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.goal-ico {
  width: 42px; height: 42px;
  border-radius: 12px;
  color: var(--gold);
  border-color: var(--gold-line);
  background: linear-gradient(150deg, rgba(223, 185, 106, .14), rgba(223, 185, 106, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.goal-card:nth-child(2) .goal-ico { color: var(--teal); border-color: rgba(111, 179, 164, .3); background: linear-gradient(150deg, rgba(111, 179, 164, .12), transparent); }
.goal-card:nth-child(3) .goal-ico { color: var(--violet); border-color: rgba(183, 155, 214, .3); background: linear-gradient(150deg, rgba(183, 155, 214, .12), transparent); }
.goal-card:nth-child(4) .goal-ico { color: var(--blue); border-color: rgba(131, 168, 207, .3); background: linear-gradient(150deg, rgba(131, 168, 207, .12), transparent); }
.goal-no { font-size: 46px; color: color-mix(in srgb, var(--gold) 26%, transparent); }
.goal-title { font-size: 22px; }
.goal-desc { line-height: 1.9; }

.quick-grid { gap: 12px; }
.quick-card {
  padding: 15px 15px 14px;
  border-radius: 13px;
  background: var(--surface);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-2) 72%, var(--surface)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}
.quick-card:hover {
  border-color: var(--gold-line);
  transform: translateY(-3px);
  box-shadow: 0 22px 44px -34px rgba(0, 0, 0, .9);
}
.quick-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--gold);
  border-color: var(--gold-line);
  background: var(--gold-soft);
}
.quick-card:nth-child(2) .quick-ico { color: var(--green); border-color: rgba(133, 178, 110, .3); background: rgba(133, 178, 110, .08); }
.quick-card:nth-child(3) .quick-ico { color: var(--teal); border-color: rgba(111, 179, 164, .3); background: rgba(111, 179, 164, .08); }
.quick-card:nth-child(4) .quick-ico { color: var(--blue); border-color: rgba(131, 168, 207, .3); background: rgba(131, 168, 207, .08); }
.quick-card:nth-child(5) .quick-ico { color: var(--violet); border-color: rgba(183, 155, 214, .3); background: rgba(183, 155, 214, .08); }
.quick-card:nth-child(6) .quick-ico { color: var(--amber); border-color: rgba(217, 164, 91, .3); background: rgba(217, 164, 91, .08); }

.route-banner {
  border-radius: 20px;
  border-color: color-mix(in srgb, var(--gold-line) 60%, var(--line));
  background:
    radial-gradient(100% 140% at 100% 0%, rgba(223, 185, 106, .10), transparent 55%),
    linear-gradient(135deg, var(--surface-2), var(--surface) 62%);
  box-shadow: var(--shadow-card);
}

/* ---------- 表格 / 表单 ---------- */
.table th {
  padding: 13px 16px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-3);
}
.table td { padding: 13px 16px; }
.table tbody tr:hover { background: color-mix(in srgb, var(--gold-soft) 55%, transparent); }
.input, .select, .textarea {
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line-strong));
  box-shadow: 0 0 0 3px rgba(223, 185, 106, .13);
}

/* ---------- 画像页细节 ---------- */
.profile-unrated {
  border-radius: 22px;
  border-color: color-mix(in srgb, var(--gold-line) 55%, var(--line));
  box-shadow: 0 40px 80px -64px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.stage-section { border-radius: 20px; box-shadow: var(--shadow-card); }
.stage-detail { border-radius: 14px; }
.stage-card { border-radius: 12px; }
.stage-card .sc-title { font-size: 10px; line-height: 1.45; letter-spacing: 0; }
.stage-card.active { box-shadow: 0 0 0 1px rgba(92, 201, 184, .26), 0 14px 30px -22px rgba(0, 0, 0, .9); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--line-2) 82%, transparent);
  border-width: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

@media (max-width: 1180px) {
  .head-inner { padding: 0 20px; }
}
@media (max-width: 720px) {
  .view { padding-top: 26px; }
  .home-title { font-size: 32px; }
  .goal-card { padding: 20px 20px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 登录页在暗色下的统一 ---------- */
:root[data-theme="dark"] .auth-form-side {
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(223, 185, 106, .10), transparent 58%),
    radial-gradient(80% 80% at 0% 100%, rgba(139, 31, 42, .07), transparent 62%),
    var(--bg-deep);
  color: var(--ink);
}
:root[data-theme="dark"] .auth-form-side::before {
  background-image: radial-gradient(circle at 1px 1px, rgba(223, 185, 106, .10) 1px, transparent 0);
}
:root[data-theme="dark"] .auth-subtitle { color: var(--ink-3); }
:root[data-theme="dark"] .auth-tabs { background: var(--surface-2); }
:root[data-theme="dark"] .auth-tabs button { color: var(--ink-3); }
:root[data-theme="dark"] .auth-tabs button.active {
  background: var(--surface-3);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .35);
}
:root[data-theme="dark"] .auth-label { color: var(--ink-3); }
:root[data-theme="dark"] .auth-input,
:root[data-theme="dark"] .auth-code-btn {
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  border-color: var(--line-2);
  color: var(--ink);
}
:root[data-theme="dark"] .auth-input::placeholder { color: var(--ink-4); }
:root[data-theme="dark"] .auth-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(223, 185, 106, .14);
}
:root[data-theme="dark"] .auth-eye { color: var(--ink-3); }
:root[data-theme="dark"] .auth-eye:hover { background: var(--surface-3); color: var(--ink); }
:root[data-theme="dark"] .auth-code-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
:root[data-theme="dark"] .auth-submit {
  background: linear-gradient(180deg, #e8c77f, #b5852d);
  color: #181006;
  box-shadow: 0 14px 30px -18px rgba(223, 185, 106, .65), inset 0 1px 0 rgba(255, 255, 255, .38);
}
:root[data-theme="dark"] .auth-links { color: var(--ink-3); }
:root[data-theme="dark"] .auth-links a:hover { color: var(--gold); }
:root[data-theme="dark"] .auth-links .reg { color: var(--gold); }
:root[data-theme="dark"] .auth-demo {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, .018);
  color: var(--ink-3);
}
:root[data-theme="dark"] .auth-demo b { color: var(--gold); }
:root[data-theme="dark"] .auth-demo code { background: var(--surface-3); color: var(--ink-2); }
:root[data-theme="dark"] .auth-terms { color: var(--ink-4); }



/* ============================================================
   代码编辑器 / 评测面板
   ============================================================ */
.editor {
  --ed-font-size: 13.5px;
  border-radius: 14px;
  border-color: color-mix(in srgb, var(--line-2) 82%, transparent);
  box-shadow: 0 26px 60px -46px rgba(0, 0, 0, .95);
}
.editor-bar {
  height: 46px;
  padding: 0 12px;
  gap: 8px;
  background: linear-gradient(180deg, #17110b, #100c08);
  border-bottom-color: #2c2216;
}
.editor-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.editor-bar .mini {
  min-width: 24px; height: 24px;
  padding: 0 5px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.editor-bar .mini:hover { background: rgba(217, 183, 103, .10); color: var(--gold); }
.editor-bar .draft-state { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-body { height: 600px; }
.editor-pre, .editor-input { font-size: var(--ed-font-size); }
.editor-gutter { font-size: calc(var(--ed-font-size) - 1px); line-height: 1.7; }
.editor-status {
  display: flex; align-items: center; gap: 12px;
  height: 28px; padding: 0 13px;
  border-top: 1px solid #221a10;
  background: #0c0906;
  color: #6f614a;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .02em;
}
.editor-status .spacer { flex: 1; }
.editor-status .ed-sel { color: var(--gold); }
.editor-focus {
  position: fixed; inset: 18px; z-index: 80;
  height: auto;
  background: #0b0805;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .58), 0 40px 100px rgba(0, 0, 0, .85);
}
.editor-focus .editor-body { height: calc(100vh - 128px); }
body:has(.editor-focus) { overflow: hidden; }

.solve-actions .kbd-hint {
  margin-left: auto;
  margin-right: 2px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-4);
  letter-spacing: .02em;
  white-space: nowrap;
}
.solve-actions .btn-submit { margin-left: 0; }

.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.shortcut-grid > div { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 12px; color: var(--ink-3); }
.shortcut-grid kbd {
  min-width: 92px;
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

/* ---------- 评测面板 ---------- */
.judge-panel {
  border-top: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  background: var(--surface);
  overflow: hidden;
}
.judge-summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 15px 16px;
  background:
    radial-gradient(100% 160% at 0% 0%, rgba(217, 183, 103, .09), transparent 60%),
    var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.judge-panel.ac .judge-summary { background: linear-gradient(180deg, rgba(133, 178, 110, .10), transparent 70%), var(--surface-2); }
.judge-panel.wa .judge-summary { background: linear-gradient(180deg, rgba(216, 87, 98, .08), transparent 70%), var(--surface-2); }
.judge-verdict { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; }
.judge-verdict .big { font-family: var(--font-serif); font-size: 26px; font-weight: 600; letter-spacing: .04em; line-height: 1; }
.judge-verdict.ac .big { color: var(--green); }
.judge-verdict.wa .big { color: var(--ruby); }
.judge-verdict .small { color: var(--ink-2); font-size: 12px; }
.judge-verdict .tiny { margin-top: 3px; }
.judge-metrics { display: flex; align-items: center; gap: 18px; flex: none; }
.judge-metrics > div { text-align: right; }
.judge-metrics b { display: block; font-family: var(--font-mono); font-size: 16px; font-weight: 500; color: var(--ink); line-height: 1.2; }
.judge-metrics span { font-size: 9.5px; color: var(--ink-4); letter-spacing: .04em; }
.judge-progress { height: 3px; background: var(--surface-3); }
.judge-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--green)); transition: width .3s var(--ease); }
.judge-panel.wa .judge-progress i { background: linear-gradient(90deg, var(--amber), var(--ruby)); }
.judge-panel.running .judge-progress i { background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-deep)); animation: judge-shimmer 1.2s linear infinite; background-size: 200% 100%; }
@keyframes judge-shimmer { to { background-position: 200% 0; } }
.judge-tests {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px; padding: 12px 14px; max-height: 260px;
}
.judge-test {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
}
.judge-test .jt-index { color: var(--ink-4); font-size: 10px; }
.judge-test .res { justify-self: start; white-space: nowrap; }
.judge-test .time { text-align: right; color: var(--ink-4); font-size: 10px; }
.judge-test.pass { border-color: rgba(133, 178, 110, .26); background: rgba(133, 178, 110, .055); }
.judge-test.fail { border-color: rgba(216, 87, 98, .26); background: rgba(216, 87, 98, .045); }
.judge-test.running { border-color: var(--gold-line); background: var(--gold-soft); }
.judge-test.pending { opacity: .72; }

.judge-diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 14px 14px; }
.judge-diff > div { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.judge-diff .h { padding: 6px 9px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: var(--ink-4); }
.judge-diff pre { margin: 0; padding: 9px 10px; max-height: 130px; overflow: auto; font-family: var(--font-mono); font-size: 11px; line-height: 1.6; white-space: pre-wrap; color: var(--ink-2); }
.judge-diff .got pre { color: #e0adaf; }
.judge-tip { padding: 10px 15px 13px; font-size: 11.5px; color: var(--ink-4); }
.judge-tip.err { color: var(--ruby); }

@media (max-width: 1280px) {
  .editor-body { height: 560px; }
  .editor-focus .editor-body { height: calc(100vh - 128px); }
}
@media (max-width: 900px) {
  .editor-body { height: 480px; }
  .editor-focus .editor-body { height: calc(100vh - 128px); }
}
@media (max-width: 720px) {
  .editor-dots { display: none; }
  .editor-bar #fileName { display: none; }
  .editor-bar .draft-state { display: none; }
  .editor-bar { padding: 0 8px; gap: 5px; }
  .editor-bar .judge-state { max-width: 62px; font-size: 8.5px; }
  .editor-bar .mini { min-width: 22px; padding: 0 4px; }
  .editor-status span:nth-last-child(2), .editor-status span:nth-last-child(3) { display: none; }
}

@media (max-width: 620px) {
  .editor-body { height: 400px; }
  .editor-status { gap: 8px; font-size: 9px; }
  .judge-summary { align-items: flex-start; flex-direction: column; }
  .judge-metrics { width: 100%; justify-content: space-between; }
  .judge-metrics > div { text-align: left; }
  .judge-diff { grid-template-columns: 1fr; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .solve-actions .kbd-hint { display: none; }
}



/* ---------- 题库：精简题单与页码 ---------- */
.plan-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(90% 140% at 0% 0%, rgba(111, 179, 164, .10), transparent 62%),
    var(--surface-2);
}
.plan-banner .plan-mark {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid rgba(111, 179, 164, .34); border-radius: 11px;
  color: var(--teal); background: rgba(111, 179, 164, .08);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
}
.plan-banner .plan-copy { min-width: 0; }
.plan-banner .eyebrow { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); }
.plan-banner b { display: block; margin-top: 3px; font-size: 13px; color: var(--ink); font-weight: 600; }
.plan-banner p { margin: 3px 0 0; font-size: 10.5px; line-height: 1.6; color: var(--ink-4); }
.plan-banner .plan-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.plan-banner .plan-count { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); white-space: nowrap; }

.pager { flex-wrap: wrap; gap: 10px 16px; }
.pager .info { line-height: 1.8; }
.pager-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.pager-jump { display: flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4); white-space: nowrap; }
.pg-input {
  width: 50px; height: 26px; padding: 0 5px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--surface-2); color: var(--ink);
  font-family: var(--font-mono); font-size: 10px; text-align: center;
}
.pg-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 183, 103, .12); }
.pg-go {
  height: 26px; padding: 0 9px; border-radius: 6px;
  border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--ink-2); font-size: 10px; cursor: pointer;
}
.pg-go:hover { border-color: var(--gold-line); color: var(--gold); }
.pg-gap { min-width: 22px; text-align: center; color: var(--ink-4); font-family: var(--font-mono); font-size: 11px; }
.pager .pages .pg.nav { color: var(--ink-3); font-size: 13px; }

/* ---------- GESP：精简训练说明 ---------- */
.gesp-plan-note {
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  padding: 22px 24px; margin-top: 18px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(111, 179, 164, .10), transparent 58%),
    linear-gradient(135deg, var(--surface-2), var(--surface) 64%);
}
.gesp-plan-note .eyebrow { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .18em; color: var(--teal); text-transform: uppercase; }
.gesp-plan-note h2 { margin-top: 6px; font-family: var(--font-display); font-size: 21px; font-weight: 500; }
.gesp-plan-note p { margin: 8px 0 0; max-width: 560px; font-size: 11.5px; line-height: 1.8; color: var(--ink-3); }
.gesp-plan-side { flex: none; text-align: right; }
.gesp-plan-total b { display: block; font-family: var(--font-serif); font-size: 38px; line-height: 1; color: var(--gold); font-weight: 500; }
.gesp-plan-total span { font-size: 10px; color: var(--ink-4); }
.gesp-plan-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; max-width: 300px; margin-top: 12px; }
.gesp-plan-chips span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); }
.gesp-plan-chips b { color: var(--teal); font-weight: 500; }
.gesp-plan-tip { margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 10px; line-height: 1.7; color: var(--ink-4); }

@media (max-width: 900px) {
  .plan-banner { align-items: flex-start; flex-wrap: wrap; }
  .plan-banner .plan-actions { margin-left: 54px; width: calc(100% - 54px); justify-content: space-between; }
  .gesp-plan-note { align-items: flex-start; flex-direction: column; gap: 18px; }
  .gesp-plan-side { text-align: left; }
  .gesp-plan-chips { justify-content: flex-start; max-width: none; }
}
@media (max-width: 620px) {
  .pager-right { width: 100%; justify-content: space-between; }
  .pager-jump { font-size: 9px; }
  .plan-banner .plan-actions { margin-left: 0; width: 100%; }
}

/* ---------- 题单训练 ---------- */
.training-plan-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  padding: 22px 24px; margin-bottom: 22px;
  background:
    radial-gradient(90% 150% at 100% 0%, rgba(111, 179, 164, .12), transparent 58%),
    radial-gradient(70% 130% at 0% 100%, rgba(217, 183, 103, .09), transparent 60%),
    linear-gradient(135deg, var(--surface-2), var(--surface) 64%);
}
.training-plan-copy { min-width: 0; }
.training-plan-copy .eyebrow { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .18em; color: var(--teal); text-transform: uppercase; }
.training-plan-copy h2 { margin-top: 6px; font-family: var(--font-display); font-size: 23px; font-weight: 500; letter-spacing: .01em; }
.training-plan-copy p { max-width: 620px; margin: 7px 0 0; font-size: 11.5px; line-height: 1.8; color: var(--ink-3); }
.training-plan-actions { display: flex; align-items: center; gap: 20px; flex: none; }
.training-plan-actions > div { text-align: right; }
.training-plan-actions b { display: block; font-family: var(--font-serif); font-size: 34px; line-height: 1; font-weight: 500; color: var(--gold); }
.training-plan-actions span { font-size: 9.5px; color: var(--ink-4); }
.list-body .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-body .d { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 900px) {
  .training-plan-banner { align-items: flex-start; flex-direction: column; gap: 18px; }
  .training-plan-actions { width: 100%; justify-content: space-between; }
  .training-plan-actions > div { text-align: left; }
}

/* ---------- 品牌与顶部导航精修 ---------- */
.head-inner { height: 74px; }
.site-brand { padding-left: 48px; }
.site-brand::before {
  width: 42px; height: 42px;
  border-radius: 12px;
  background:
    radial-gradient(120% 120% at 28% 0%, rgba(223, 185, 106, .24), transparent 62%),
    linear-gradient(150deg, rgba(223, 185, 106, .13), rgba(223, 185, 106, .025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 12px 28px -18px rgba(223, 185, 106, .65);
}
.site-brand .mark {
  width: 32px; height: 32px;
  left: 5px;
  color: var(--gold);
  filter: drop-shadow(0 0 7px rgba(223, 185, 106, .26));
}
.site-brand .wordmark { position: relative; margin-left: 9px; padding-left: 13px; }
.site-brand .wordmark::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-line) 28%, var(--gold-line) 72%, transparent);
}
.site-brand .name {
  font-size: 18.5px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.08;
}
.site-brand .sub {
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: .22em;
  color: color-mix(in srgb, var(--gold) 62%, var(--ink-4));
}
.main-nav { gap: 1px; }
.nav-link {
  height: 74px;
  padding: 0 8px;
  font-size: 14px;
  letter-spacing: .015em;
}
.nav-link.active { font-weight: 600; }
.nav-link.active::after {
  left: 7px; right: 7px; bottom: 21px;
  height: 2px;
}
.ghost-pill { font-size: 12.5px; }

.auth-logo .logo-mark {
  width: 52px; height: 52px;
  border-radius: 13px;
  color: #e9ce83;
}
.auth-logo .logo-mark .brand-glyph { width: 37px; height: 37px; }
.auth-logo .name { font-size: 19px; }
.auth-logo .sub { font-size: 8px; letter-spacing: .22em; }

@media (max-width: 1180px) {
  .head-inner { height: 66px; }
  .nav-link { height: 66px; }
  .site-brand .name { font-size: 17px; }
}
@media (max-width: 480px) {
  .site-brand .wordmark { margin-left: 4px; padding-left: 8px; }
  .site-brand .name { font-size: 14.5px; letter-spacing: .02em; }
  .site-brand .sub { display: none; }
}
@media (max-width: 720px) {
  .head-inner { height: 60px; }
  .site-brand { padding-left: 42px; }
  .site-brand::before { width: 36px; height: 36px; }
  .site-brand .mark { width: 28px; height: 28px; left: 4px; }
  .site-brand .name { font-size: 15.5px; }
  .site-brand .sub { font-size: 7px; }
}





@media (max-width: 480px) {
  .site-brand .wordmark { margin-left: 4px; padding-left: 8px; }
  .site-brand .name { font-size: 14.5px; letter-spacing: .02em; }
  .site-brand .sub { display: none; }
}


.app-main { min-height: calc(100vh - 74px); }
@media (max-width: 720px) { .app-main { min-height: calc(100vh - 60px); } }


/* ---------- GESP 等级画像 ---------- */
.gesp-profile { padding: 22px 24px 20px; margin-bottom: 18px; }
.gp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.gp-head-copy { min-width: 0; }
.gp-head-copy .eyebrow { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .18em; color: var(--teal); text-transform: uppercase; }
.gp-head-copy h2 { margin-top: 6px; font-family: var(--font-display); font-size: 24px; font-weight: 500; letter-spacing: .01em; }
.gp-head-copy p { max-width: 600px; margin: 6px 0 0; font-size: 11.5px; line-height: 1.75; color: var(--ink-3); }
.gp-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.gp-infer { font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); letter-spacing: .04em; }
.gp-tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.gp-tab {
  min-width: 30px; height: 26px; padding: 0 7px;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--ink-3); font-family: var(--font-mono); font-size: 10px; cursor: pointer;
  transition: .18s var(--ease);
}
.gp-tab:hover { color: var(--ink); background: var(--surface-3); }
.gp-tab.active { color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold-line); font-weight: 600; }

.gp-summary { display: flex; align-items: center; gap: 26px; margin-top: 18px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.gp-summary > div { flex: none; }
.gp-summary b { display: block; font-family: var(--font-mono); font-size: 18px; font-weight: 500; color: var(--ink); line-height: 1.2; }
.gp-summary span { font-size: 9.5px; color: var(--ink-4); letter-spacing: .04em; }
.gp-progress { flex: 1 !important; min-width: 120px; }
.gp-progress .bar { height: 4px; margin-bottom: 5px; }

.gp-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 20px; }
.gp-radar { display: flex; flex-direction: column; align-items: center; }
.gp-legend { display: flex; gap: 14px; margin-top: 2px; font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); }
.gp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gp-legend i { width: 13px; height: 2px; display: block; border-radius: 2px; }
.gp-legend i.gold { background: var(--gold); }
.gp-legend i.teal { background: var(--teal); opacity: .7; }
.gp-bars { display: flex; flex-direction: column; gap: 13px; }
.gp-bar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; font-size: 11.5px; color: var(--ink-2); }
.gp-bar-top .mono { font-family: var(--font-mono); font-size: 10px; color: var(--gold); }
.gp-bar-top .mono i { font-style: normal; color: var(--ink-4); }
.gp-track { position: relative; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: visible; }
.gp-track > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.gp-track > b { position: absolute; top: -3px; width: 1px; height: 12px; background: var(--teal); box-shadow: 0 0 0 2px color-mix(in srgb, var(--surface) 55%, transparent); }
.gp-track.small { height: 4px; }
.gp-track.small > b { top: -2px; height: 8px; }
.gp-bar-foot { display: flex; justify-content: space-between; margin-top: 4px; font-family: var(--font-mono); font-size: 8.5px; color: var(--ink-4); }

.gp-knowledge { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.gp-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.gp-subhead span { font-family: var(--font-serif); font-size: 16px; font-weight: 600; }
.gp-subhead em { font-style: normal; font-size: 9.5px; color: var(--ink-4); }
.gp-k-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 34px; align-items: center; gap: 12px; padding: 6px 0; }
.gp-k-name { font-size: 11.5px; color: var(--ink-3); }
.gp-k-val { text-align: right; font-size: 10px; color: var(--gold); }
.gp-foot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 9.5px; line-height: 1.7; color: var(--ink-4); }

.chart .radar-target { stroke-dasharray: 4 4; }

/* ---------- AC 流星加分 ---------- */
.rating-fx { position: fixed; inset: 0; z-index: 130; pointer-events: none; overflow: hidden; }
.fx-meteor {
  position: absolute; left: 100%; top: -8%;
  width: 250px; height: 2px;
  transform-origin: right center;
  animation: fx-meteor 1.15s cubic-bezier(.16, .8, .3, 1) forwards;
  filter: drop-shadow(0 0 8px rgba(223, 185, 106, .8));
}
.fx-tail { position: absolute; right: 0; top: -1px; width: 240px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(223, 185, 106, .3) 35%, #f7e3b0); }
.fx-core { position: absolute; right: -4px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #fff8e6; box-shadow: 0 0 12px 4px rgba(223, 185, 106, .8), 0 0 30px 10px rgba(223, 185, 106, .35); }
@keyframes fx-meteor {
  0% { opacity: 0; transform: translate(0, 0) rotate(32deg); }
  12% { opacity: 1; }
  72% { opacity: 1; transform: translate(-57vw, 45vh) rotate(32deg); }
  100% { opacity: 0; transform: translate(-63vw, 51vh) rotate(32deg); }
}
.fx-burst { position: absolute; inset: 0; }
.fx-burst i {
  position: absolute; left: 50%; top: 50%;
  width: 2px; height: 11px; border-radius: 99px;
  background: linear-gradient(var(--gold-bright), transparent);
  opacity: 0;
  transform-origin: 50% 0;
  animation: fx-spark .85s .7s cubic-bezier(.16, .7, .3, 1) forwards;
}
@keyframes fx-spark {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scale(.9); }
}
.fx-card {
  position: absolute; left: 50%; top: 50%;
  width: min(310px, 82vw);
  padding: 22px 24px 18px;
  transform: translate(-50%, -44%) scale(.92);
  opacity: 0;
  text-align: center;
  border: 1px solid var(--gold-line);
  border-radius: 18px;
  background:
    radial-gradient(100% 120% at 50% 0%, rgba(223, 185, 106, .18), transparent 62%),
    color-mix(in srgb, var(--surface) 94%, #000);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
  animation: fx-card .55s .66s cubic-bezier(.16, 1, .3, 1) forwards;
}
.fx-card.promote { border-color: rgba(111, 179, 164, .5); }
@keyframes fx-card {
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.fx-eyebrow { font-family: var(--font-mono); font-size: 8px; letter-spacing: .18em; color: var(--gold); }
.fx-plus { margin: 6px 0 2px; font-family: var(--font-serif); font-size: 54px; line-height: 1; font-weight: 500; color: var(--gold-bright); text-shadow: 0 0 24px rgba(223, 185, 106, .35); }
.fx-rating { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.fx-rating i { font-style: normal; margin: 0 7px; color: var(--ink-4); }
.fx-rating b { color: var(--ink); font-weight: 500; }
.fx-dan { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--teal); }
.fx-note { margin-top: 4px; font-size: 9px; color: var(--ink-4); }
.rating-fx.out { opacity: 0; transition: opacity .24s ease; }

@media (max-width: 900px) {
  .gp-head { flex-direction: column; }
  .gp-head-side { width: 100%; align-items: flex-start; }
  .gp-body { grid-template-columns: 1fr; }
  .gp-radar { order: 0; }
  .gp-bars { order: 1; }
  .gp-summary { flex-wrap: wrap; gap: 12px 20px; }
  .gp-progress { flex-basis: 100%; }
  .gp-k-row { grid-template-columns: 125px minmax(0, 1fr) 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-meteor, .fx-burst { display: none; }
  .fx-card { animation: none; opacity: 1; transform: translate(-50%, -50%); }
}

.nav-link.nav-special { color: var(--gold); }
.nav-link.nav-special:hover { color: var(--gold-bright); }
.nav-link.nav-special.active { color: var(--gold-bright); }
.nav-link[data-menu="more"] .caret { color: var(--ink-4); }
.nav-link[data-menu="more"]:hover .caret { color: var(--gold); }
.guide-icon { flex: none; }

/* ---------- 首页 GESP 画像摘要 ---------- */
.home-profile {
  margin-bottom: 18px;
  padding: 18px 22px 16px;
  border: 1px solid color-mix(in srgb, var(--gold-line) 56%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(90% 140% at 0% 0%, rgba(111, 179, 164, .09), transparent 55%),
    linear-gradient(120deg, var(--surface-2), var(--surface) 64%);
  box-shadow: var(--shadow-card);
}
.hp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.hp-copy .eyebrow { font-family: var(--font-mono); font-size: 8px; letter-spacing: .18em; color: var(--teal); text-transform: uppercase; }
.hp-copy h2 { margin-top: 3px; font-family: var(--font-display); font-size: 21px; font-weight: 500; letter-spacing: .01em; }
.hp-copy p { max-width: 620px; margin: 5px 0 0; font-size: 11px; line-height: 1.65; color: var(--ink-4); }
.hp-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; padding-top: 2px; }
.hp-badge { padding: 4px 9px; border: 1px solid var(--gold-line); border-radius: 99px; background: var(--gold-soft); font-family: var(--font-mono); font-size: 9.5px; color: var(--gold); white-space: nowrap; }
.hp-dan { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); white-space: nowrap; }
.hp-count { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4); white-space: nowrap; }

.hp-body { display: grid; grid-template-columns: 215px minmax(0, 1fr) 205px; gap: 22px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.hp-radar { display: flex; flex-direction: column; align-items: center; }
.hp-radar .chart { max-width: 210px; }
.hp-legend { display: flex; gap: 12px; margin-top: -2px; font-family: var(--font-mono); font-size: 8px; color: var(--ink-4); }
.hp-legend span { display: inline-flex; align-items: center; gap: 4px; }
.hp-legend i { width: 11px; height: 2px; display: block; border-radius: 2px; }
.hp-legend i.gold { background: var(--gold); }
.hp-legend i.teal { background: var(--teal); opacity: .7; }

.hp-bars { display: flex; flex-direction: column; gap: 10px; }
.hp-bar-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; font-size: 10.5px; color: var(--ink-3); }
.hp-bar-top .mono { font-size: 9px; color: var(--gold); white-space: nowrap; }
.hp-track { position: relative; height: 5px; border-radius: 99px; background: var(--surface-3); }
.hp-track > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.hp-track > b { position: absolute; top: -2px; width: 1px; height: 9px; background: var(--teal); }

.hp-side { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding-left: 18px; border-left: 1px solid var(--line); }
.hp-progress { display: flex; align-items: center; gap: 8px; width: 100%; }
.hp-progress .bar { flex: 1; height: 4px; }
.hp-progress em { font-style: normal; font-family: var(--font-mono); font-size: 8.5px; color: var(--ink-4); white-space: nowrap; }
.hp-weak-label { margin-top: 2px; font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; color: var(--ruby); text-transform: uppercase; }
.hp-weak { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.hp-weak span { font-size: 10px; color: var(--ink-3); }
.hp-weak b { font-weight: 500; color: var(--ruby); font-family: var(--font-mono); font-size: 9px; }
.hp-side .btn { margin-top: 3px; }
.hp-link { border: 0; background: transparent; padding: 0; color: var(--gold); font-size: 10px; cursor: pointer; }
.hp-link:hover { color: var(--gold-bright); }

@media (max-width: 980px) {
  .hp-body { grid-template-columns: 180px minmax(0, 1fr); }
  .hp-side { grid-column: 1 / -1; padding-left: 0; padding-top: 10px; border-left: 0; border-top: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; }
  .hp-side .hp-progress { width: 180px; }
  .hp-weak-label { display: none; }
  .hp-side .btn, .hp-link { margin-left: auto; }
}
@media (max-width: 620px) {
  .home-profile { padding: 16px; }
  .hp-head { flex-direction: column; gap: 8px; }
  .hp-meta { width: 100%; justify-content: space-between; }
  .hp-body { grid-template-columns: 1fr; gap: 10px; }
  .hp-radar { display: none; }
  .hp-side { border-top: 1px solid var(--line); }
  .hp-side .hp-progress { width: 140px; }
}

/* ---------- 流星 2.0：飞向头像 ---------- */
.fx-meteor {
  left: 0; top: 0;
  width: 0; height: 0;
  animation: fx-meteor-v2 2.1s cubic-bezier(.16, .8, .3, 1) forwards;
  transform-origin: 0 0;
}
.fx-tail {
  right: 0; top: -1px;
  width: 620px;
  background: linear-gradient(90deg, transparent 0%, rgba(223, 185, 106, .22) 18%, rgba(223, 185, 106, .62) 62%, rgba(247, 227, 176, .98) 100%);
}
.fx-core { right: -5px; top: -6px; width: 13px; height: 13px; }
@keyframes fx-meteor-v2 {
  0% { opacity: 0; transform: translate(-18vw, 84vh) rotate(24deg) scale(.7); }
  10% { opacity: 1; }
  72% { opacity: 1; transform: translate(92vw, 7vh) rotate(24deg) scale(1); }
  88% { opacity: .7; transform: translate(94vw, 5vh) rotate(24deg) scale(.9); }
  100% { opacity: 0; transform: translate(95vw, 4vh) rotate(24deg) scale(.7); }
}
.fx-burst { inset: auto; right: 43px; top: 35px; width: 0; height: 0; }
.fx-burst i { left: 0; top: 0; }
.fx-burst i { transform-origin: 50% 0; }
.fx-card {
  left: auto; right: 22px; top: 84px;
  width: min(306px, calc(100vw - 28px));
  text-align: left;
  transform: translateY(-8px) scale(.96);
  animation: fx-card-v2 .55s 1.85s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes fx-card-v2 {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.fx-card .fx-eyebrow { color: var(--gold); }
.fx-card .fx-plus { font-size: 48px; margin: 5px 0 0; }
.fx-card .fx-rating { margin-top: 1px; }
.fx-card .fx-dan { margin-top: 9px; padding-top: 8px; }
.fx-card .fx-note { margin-top: 2px; }
.fx-link { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--gold); font-size: 10px; cursor: pointer; pointer-events: auto; }
.fx-link:hover { color: var(--gold-bright); }

.user-chip.rating-pulse .avatar { animation: avatar-hit .9s cubic-bezier(.16, 1, .3, 1); }
@keyframes avatar-hit {
  0%, 100% { box-shadow: 0 0 0 0 rgba(223, 185, 106, 0); transform: scale(1); }
  30% { box-shadow: 0 0 0 7px rgba(223, 185, 106, .18), 0 0 24px rgba(223, 185, 106, .45); transform: scale(1.1); }
  60% { box-shadow: 0 0 0 3px rgba(223, 185, 106, .1), 0 0 16px rgba(223, 185, 106, .25); transform: scale(1.03); }
}

@media (max-width: 720px) {
  .fx-burst { right: 25px; top: 31px; }
  .fx-card { right: 12px; top: 70px; width: min(286px, calc(100vw - 24px)); padding: 18px 18px 15px; }
  .fx-card .fx-plus { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-meteor, .fx-burst { display: none; }
  .fx-card { animation: none; opacity: 1; transform: translateY(0) scale(1); }
}





/* ---------- 流星效果：固定居中 ---------- */
.fx-meteor {
  left: 0; top: 0;
  width: 0; height: 0;
  transform-origin: 0 0;
  animation: fx-meteor-center 2.05s cubic-bezier(.16, .8, .3, 1) forwards;
}
@keyframes fx-meteor-center {
  0% { opacity: 0; transform: translate(-14vw, 84vh) rotate(24deg) scale(.72); }
  10% { opacity: 1; }
  78% { opacity: 1; transform: translate(50vw, 50vh) rotate(24deg) scale(1); }
  92% { opacity: .55; transform: translate(50vw, 50vh) rotate(24deg) scale(.94); }
  100% { opacity: 0; transform: translate(50vw, 50vh) rotate(24deg) scale(.78); }
}
.fx-burst { inset: auto; left: 50%; top: 50%; right: auto; bottom: auto; width: 0; height: 0; }
.fx-burst i { left: 0; top: 0; }
.fx-card {
  left: 50%; right: auto; top: 50%;
  width: min(340px, 86vw);
  padding: 24px 26px 20px;
  text-align: center;
  transform: translate(-50%, -46%) scale(.94);
  animation: fx-card-center .55s 2.02s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes fx-card-center {
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.fx-card .fx-eyebrow { font-size: 9px; letter-spacing: .16em; }
.fx-card .fx-plus { margin: 7px 0 3px; font-size: 56px; line-height: 1; }
.fx-card .fx-rating { font-size: 12px; }
.fx-card .fx-rating i { margin: 0 8px; }
.fx-card .fx-dan { margin-top: 11px; padding-top: 9px; font-size: 12px; line-height: 1.55; }
.fx-card .fx-note { margin-top: 4px; font-size: 9.5px; line-height: 1.5; }
.fx-link {
  display: block;
  margin-top: 12px; padding: 7px 10px;
  border: 1px solid var(--gold-line); border-radius: 7px;
  background: var(--gold-soft);
  font-size: 12px; line-height: 1.4; text-align: center;
}
.fx-link:hover { background: color-mix(in srgb, var(--gold-soft) 70%, var(--gold)); color: var(--gold-bright); }

/* ---------- 首页画像摘要：字号与阅读节奏 ---------- */
.home-profile { padding: 20px 24px 18px; }
.hp-copy h2 { font-size: 22px; }
.hp-copy p { font-size: 11.5px; line-height: 1.7; }
.hp-meta { gap: 4px; }
.hp-badge { font-size: 10px; padding: 4px 10px; }
.hp-dan { font-size: 10.5px; }
.hp-count { font-size: 10px; }
.hp-body { grid-template-columns: 215px minmax(0, 1fr) 225px; gap: 24px; padding-top: 14px; }
.hp-bar-top { font-size: 11.5px; margin-bottom: 5px; }
.hp-bar-top .mono { font-size: 10px; }
.hp-progress em { font-size: 9.5px; }
.hp-weak-label { font-size: 9px; letter-spacing: .14em; }
.hp-weak span { font-size: 11.5px; line-height: 1.5; }
.hp-weak b { font-size: 10px; }
.hp-side { gap: 8px; padding-left: 20px; }
.hp-side .btn { font-size: 12px; }
.hp-link { font-size: 14px; font-weight: 500; line-height: 1.4; }
.hp-link:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 720px) {
  .fx-card { width: min(320px, 88vw); padding: 20px 20px 17px; }
  .fx-card .fx-plus { font-size: 50px; }
  .fx-link { font-size: 12.5px; }
  .hp-body { grid-template-columns: 1fr; }
  .hp-side { padding-left: 0; }
  .hp-weak span { font-size: 12px; }
  .hp-link { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-meteor, .fx-burst { display: none; }
  .fx-card { animation: none; opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 980px) and (min-width: 721px) {
  .hp-body { grid-template-columns: 180px minmax(0, 1fr); }
}


@media (max-width: 620px) {
  .hp-side { flex-direction: column; align-items: flex-start; gap: 7px; }
  .hp-side .hp-progress { width: 100%; }
  .hp-side .btn, .hp-side .hp-link { margin-left: 0; text-align: left; }
}

/* ---------- 烟花加分效果 ---------- */
.fx-fireworks { position: absolute; inset: 0; overflow: hidden; }
.fx-fw { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.fx-rocket {
  position: absolute; left: -2px; top: -2px;
  width: 4px; height: 4px; border-radius: 50%;
  background: #fff6df;
  box-shadow: 0 0 10px 3px var(--c), 0 0 26px 8px color-mix(in srgb, var(--c) 45%, transparent);
  opacity: 0;
  transform: translateY(74vh) scale(.5);
  animation: fw-rise 1.06s var(--delay) cubic-bezier(.2, .7, .25, 1) forwards;
}
.fx-rocket::after {
  content: ""; position: absolute; left: 1px; top: 5px;
  width: 2px; height: 44px; border-radius: 2px;
  background: linear-gradient(180deg, var(--c), transparent);
  opacity: .5;
}
@keyframes fw-rise {
  0% { opacity: 0; transform: translateY(74vh) scale(.4); }
  10% { opacity: 1; }
  72% { opacity: 1; transform: translateY(0) scale(1); }
  78% { opacity: .9; transform: translateY(-3px) scale(.6); }
  100% { opacity: 0; transform: translateY(-4px) scale(.2); }
}
.fx-sparks { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.fx-sparks i {
  position: absolute; left: 0; top: 0;
  width: 3px; height: 14px; border-radius: 99px;
  background: linear-gradient(180deg, #fff8e4, var(--c) 38%, transparent);
  box-shadow: 0 0 7px color-mix(in srgb, var(--c) 72%, transparent);
  opacity: 0;
  transform-origin: 50% 100%;
  animation: fw-spark 1.08s calc(var(--delay) + .96s + var(--sd)) cubic-bezier(.15, .7, .3, 1) forwards;
}
.fx-flash {
  position: absolute; left: 0; top: 0;
  width: 190px; height: 190px; border-radius: 50%;
  transform: translate(-50%, -50%) scale(.2);
  background: radial-gradient(circle, #fff8e6 0%, var(--c) 14%, color-mix(in srgb, var(--c) 30%, transparent) 44%, transparent 68%);
  opacity: 0;
  pointer-events: none;
  animation: fw-flash .72s calc(var(--delay) + .92s) ease-out forwards;
}
@keyframes fw-flash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  16% { opacity: .95; transform: translate(-50%, -50%) scale(.72); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.45); }
}
.fx-fw:nth-child(2) .fx-flash { animation-delay: 1.13s; }
.fx-fw:nth-child(3) .fx-flash { animation-delay: 1.04s; }
@keyframes fw-spark {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scaleY(.35); }
  12% { opacity: 1; }
  55% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scaleY(1); }
}
.fx-fw:nth-child(2) .fx-rocket { animation-delay: .21s; }
.fx-fw:nth-child(3) .fx-rocket { animation-delay: .12s; }
.fx-fw:nth-child(2) .fx-sparks i { animation-delay: calc(.21s + 1.02s + var(--sd)); }
.fx-fw:nth-child(3) .fx-sparks i { animation-delay: calc(.12s + .96s + var(--sd)); }

@media (prefers-reduced-motion: reduce) {
  .fx-fireworks { display: none; }
  .fx-card { animation: none; opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* =========================================================
   响应式精修：手机 / 平板
   1) 顶部导航在窄屏可收缩，不再撑出横向滚动
   2) 触控目标、抽屉滚动、iOS 输入框缩放
   3) 100dvh 与安全区
   ========================================================= */
.head-inner { min-width: 0; }
.site-brand { min-width: 0; }
.site-brand .wordmark { min-width: 0; }
.site-brand .name,
.site-brand .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-actions { min-width: 0; flex-wrap: nowrap; }

/* 图标按钮：视觉 32px，热区扩到 40px（不影响布局） */
.head-icon { position: relative; }
.head-icon::after { content: ""; position: absolute; inset: -5px; border-radius: 10px; }

@media (max-width: 1180px) {
  .head-inner { gap: 12px; }
}

@media (max-width: 720px) {
  .head-inner { height: 58px; padding: 0 14px; gap: 8px; }
  .site-brand { padding-left: 38px; }
  .site-brand::before { width: 32px; height: 32px; border-radius: 9px; }
  .site-brand .name { font-size: 14.5px; }
  .site-brand .sub { font-size: 7px; letter-spacing: .18em; margin-top: 2px; }

  .head-actions { gap: 2px; }
  .guide-icon { display: none; }          /* 页脚与抽屉内仍可打开操作指引 */
  .user-chip { padding: 3px 4px 3px 3px; gap: 6px; }
  .user-chip .caret { display: none; }

  .btn-sm { height: 32px; }
  .view { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .toast-layer { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
}

@media (max-width: 430px) {
  .head-inner { padding: 0 12px; gap: 6px; }
  .site-brand { padding-left: 34px; }
  .site-brand::before { width: 28px; height: 28px; border-radius: 8px; }
  .site-brand .name { font-size: 13.5px; }
  .site-brand .sub { display: none; }

  /* 320–430px：一行放不下的按钮组改为换行，分段控件可横向滚动 */
  .row, .row-between { flex-wrap: wrap; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { padding: 0 9px; font-size: 11.5px; }
}

/* 画像卡 / 等级卡的头部在窄屏竖排，避免右侧徽章被裁掉 */
@media (max-width: 760px) {
  .hp-head, .gp-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .hp-meta, .gp-head-side {
    flex-direction: row; flex-wrap: wrap; align-items: center;
    justify-content: flex-start; gap: 8px; padding-top: 0;
  }
  .gp-tabs { align-self: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .gp-tabs::-webkit-scrollbar { display: none; }

  /* 数据表：手机上改为横向滚动，避免每列被压成一字一行 */
  .table-problems { min-width: 820px; }
  .table-problems th, .table-problems td { padding: 11px 12px; }
  .table-problems td.num, .table-problems th:first-child + th { white-space: nowrap; }
  .table-problems .problem-title-cell .t { white-space: normal; }
}

/* 统计条：窄屏 2×2，四项都不用横向滚动 */
@media (max-width: 560px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip .cell { padding: 11px 14px; }
  .stat-strip .cell:nth-child(2n) { border-right: 0; }
  .stat-strip .cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stat-strip .v { font-size: 18px; }
}

/* 做题页：编辑器工具条换行、提交按钮独占一行 */
@media (max-width: 560px) {
  .editor { min-width: 0; }
  .editor-bar { flex-wrap: wrap; height: auto; row-gap: 6px; padding: 8px 10px; }
  .editor-bar .spacer { display: none; }
  .editor-bar .draft-state { display: none; }
  .editor-bar .lang { margin-left: 0; }
  .editor-tools { gap: 4px; }

  .solve-actions { flex-wrap: wrap; row-gap: 8px; }
  .solve-actions .kbd-hint { display: none; }
  .solve-actions #btnSubmit { flex: 1 1 100%; justify-content: center; }

  .editor-bar .judge-state { max-width: none; }
  .editor-scroll { min-width: 0; }
  .editor-gutter { width: 34px; }
}

/* 触控与滚动 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: contain; }
.table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.drawer-nav .panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
@media (pointer: coarse) {
  .btn, .btn-sm, .ghost-pill, .chip, .nav-link, .head-icon, .user-chip { touch-action: manipulation; }
}

/* iOS 上 <16px 的输入框聚焦会自动放大页面 */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 720px) {
    input, select, textarea { font-size: 16px !important; }
  }
}

/* 长标题、题面与代码在窄屏不撑破容器 */
@media (max-width: 720px) {
  .problem-body, .prose, .card, .panel, .dd-menu { overflow-wrap: anywhere; }
  pre, code { word-break: break-word; }
  h1, h2, .page-title, .hero-title { text-wrap: balance; }
  .list-foot span, .list-foot .mono { white-space: nowrap; }
}

/* 320–430px：筛选下拉两个一行，避免整列铺满 */
@media (max-width: 430px) {
  .toolbar select { flex: 1 1 44%; min-width: 0; width: auto; }
}

/* 移动浏览器地址栏导致 100vh 抖动 */
.auth-form-side { min-height: 100vh; min-height: 100dvh; }
.app-main { min-height: calc(100vh - 66px); min-height: calc(100dvh - 66px); }


/* ---------- 账号注册 ---------- */
.auth-form-side { overflow-y: auto; }
.auth-card { margin: auto 0; }
.auth-field { margin-bottom: 13px; }
.auth-label em {
  font-style: normal; font-family: var(--font-mono);
  font-size: 9.5px; color: #9a8b73; letter-spacing: 0;
}
.auth-mini-link { font-size: 11.5px; color: #8b6118; cursor: pointer; font-weight: 500; }
.auth-mini-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-alert {
  margin: 0 0 14px; padding: 9px 12px;
  border: 1px solid rgba(160, 62, 43, .26); border-radius: 8px;
  background: rgba(160, 62, 43, .07);
  color: #8d3427; font-size: 12px; line-height: 1.6;
}
.auth-alert.info { border-color: #d8c9ac; background: #f3ead8; color: #7a6b56; }
.auth-input.invalid { border-color: #a84a38; box-shadow: 0 0 0 3px rgba(168, 74, 56, .10); }

.auth-strength { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.auth-strength > span { flex: 1; height: 3px; border-radius: 99px; background: #e6dbc5; overflow: hidden; }
.auth-strength > span i { display: block; width: 0; height: 100%; border-radius: inherit; background: #b27b36; transition: width .25s var(--ease), background .25s var(--ease); }
.auth-strength em { flex: none; font-style: normal; font-family: var(--font-mono); font-size: 9px; color: #9a8b73; }
.auth-strength[data-level="2"] > span i { background: #c68b3e; }
.auth-strength[data-level="3"] > span i { background: #8d8a44; }
.auth-strength[data-level="4"] > span i { background: #4f7e6c; }

.auth-check { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 14px; cursor: pointer; }
.auth-check input { accent-color: #a8792a; margin-top: 2px; flex: none; }
.auth-check span { font-size: 11.5px; line-height: 1.6; color: #7a6b56; }
.auth-check a { color: #8b6118; }

#authRegisterView .auth-submit { margin-top: 2px; }
#authRegisterView .auth-field { margin-bottom: 11px; }
#authRegisterView .auth-input { height: 42px; }

:root[data-theme="dark"] .auth-label em { color: var(--ink-4); }
:root[data-theme="dark"] .auth-mini-link { color: var(--gold); }
:root[data-theme="dark"] .auth-alert { border-color: rgba(220, 120, 100, .26); background: rgba(220, 100, 80, .07); color: #e6a99a; }
:root[data-theme="dark"] .auth-alert.info { border-color: var(--line-2); background: var(--surface-2); color: var(--ink-3); }
:root[data-theme="dark"] .auth-strength > span { background: var(--surface-3); }
:root[data-theme="dark"] .auth-strength em { color: var(--ink-4); }
:root[data-theme="dark"] .auth-check span { color: var(--ink-3); }
:root[data-theme="dark"] .auth-check a { color: var(--gold); }
:root[data-theme="dark"] .auth-input.invalid { border-color: #c56a58; box-shadow: 0 0 0 3px rgba(197, 106, 88, .13); }

@media (max-height: 780px) {
  .auth-form-side { align-items: flex-start; padding-top: 30px; padding-bottom: 30px; }
}
@media (max-width: 720px) {
  .auth-form-side { padding: 28px 20px; }
  .auth-card { width: 100%; }
}

.auth-tabs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.auth-phone-note {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 10.5px; line-height: 1.65; color: var(--ink-4);
}
#authPhoneView .auth-code-row { grid-template-columns: minmax(0, 1fr) 124px; }
:root[data-theme="dark"] .auth-phone-note { color: var(--ink-4); }
@media (max-width: 420px) {
  .auth-tabs.three button { font-size: 12px; padding-left: 0; padding-right: 0; }
  #authPhoneView .auth-code-row { grid-template-columns: 1fr 112px; }
}

.auth-tabs.one { grid-template-columns: 1fr; }

/* ============================================================
   登录页品牌区：去掉底部信息条后，内容在剩余空间里垂直居中
   ============================================================ */
.auth-brand { justify-content: flex-start; }
.auth-brand .auth-hero { margin-top: auto; margin-bottom: auto; }

.auth-check a,
.auth-terms a { color: var(--gold); text-decoration: none; }
.auth-check a:hover,
.auth-terms a:hover { text-decoration: underline; }

.auth-hero .brand-title { white-space: nowrap; }
.auth-hero .brand-subline.en {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(232, 210, 154, .52);
  margin: -6px 0 26px;
}
