/* 每日一关 · 全球同题 — 观测台视觉系统 */

:root {
  --bg: #05070f;
  --ink: #e9f1ff;
  --ink-2: #c6d3ec;
  --dim: #8d9cc2;
  --dim-2: #5f6d92;
  --gold: #f2d19b;
  --gold-2: #d9a962;
  --cyan: #8ee9ff;
  --line: rgba(150, 200, 255, 0.12);
  --line-soft: rgba(150, 200, 255, 0.07);
  --panel: rgba(12, 20, 40, 0.72);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 720px at 12% -12%, #16274f 0%, transparent 58%),
    radial-gradient(1000px 620px at 96% 2%, #2a1b4a 0%, transparent 52%),
    radial-gradient(900px 700px at 50% 108%, #0a2b38 0%, transparent 55%),
    linear-gradient(170deg, #05070f 0%, #080d1c 52%, #05080f 100%);
  background-repeat: no-repeat;
  background-size: cover;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body.locked { overflow: hidden; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .55;
  background-image:
    radial-gradient(1px 1px at 9% 14%, rgba(255,255,255,.7), transparent 100%),
    radial-gradient(1px 1px at 24% 62%, rgba(190,225,255,.5), transparent 100%),
    radial-gradient(1.4px 1.4px at 41% 8%, rgba(255,255,255,.55), transparent 100%),
    radial-gradient(1px 1px at 63% 38%, rgba(210,235,255,.45), transparent 100%),
    radial-gradient(1.6px 1.6px at 82% 18%, rgba(255,236,200,.6), transparent 100%),
    radial-gradient(1px 1px at 91% 71%, rgba(200,230,255,.45), transparent 100%),
    radial-gradient(1px 1px at 33% 88%, rgba(255,255,255,.4), transparent 100%),
    radial-gradient(1.2px 1.2px at 72% 92%, rgba(190,225,255,.5), transparent 100%);
  background-repeat: no-repeat;
}

.veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(130% 100% at 50% 0%, transparent 42%, rgba(0, 0, 0, .55) 100%);
}

.app {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 20% 10%, rgba(126, 216, 255, .16), rgba(9, 15, 30, .8));
  border: 1px solid rgba(150, 210, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 24px -14px rgba(90, 160, 255, .8);
}
.mark svg { width: 32px; height: 32px; }

.brand-text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.25;
  white-space: nowrap;
}
.brand-text h1 .dot { color: var(--gold); margin: 0 4px; }
.brand-text p {
  margin: 3px 0 0;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--dim-2);
}
.top-actions { display: flex; align-items: center; gap: 8px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-2);
  background: linear-gradient(180deg, rgba(44, 64, 110, .5), rgba(16, 25, 48, .78));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(142, 233, 255, .38); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.ghost { background: rgba(255, 255, 255, .028); }
.btn.sm { padding: 8px 11px; font-size: 12.5px; border-radius: 10px; }
.btn.lg { padding: 14px 30px; font-size: 14.5px; border-radius: 13px; letter-spacing: .04em; }
.btn.full { width: 100%; }
.btn.icon { width: 39px; height: 39px; padding: 0; border-radius: 11px; }
.btn.gold {
  color: #2a1c06;
  font-weight: 800;
  border-color: rgba(255, 235, 190, .55);
  background: linear-gradient(180deg, #f9e6bc 0%, #eccd95 45%, #d7a962 100%);
  box-shadow: 0 10px 26px -12px rgba(242, 209, 155, .75), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.btn.gold:hover { color: #1d1303; border-color: #fff0cc; }
.btn .badge {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: rgba(242, 209, 155, .18);
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 800;
}
.btn .ic-off { display: none; }
.btn.muted .ic-on { display: none; }
.btn.muted .ic-off { display: block; }

/* ---------------- 主体布局 ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(302px, .9fr);
  gap: 18px;
  align-items: start;
}

.stage-card {
  position: relative;
  border-radius: 26px;
  padding: 22px 22px 16px;
  background:
    linear-gradient(168deg, rgba(22, 34, 66, .74) 0%, rgba(10, 16, 33, .88) 52%, rgba(7, 11, 23, .94) 100%);
  border: 1px solid rgba(150, 200, 255, .14);
  box-shadow: 0 38px 90px -38px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(14px);
  animation: rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
.stage-card::before {
  content: "";
  position: absolute;
  left: 22px; right: 22px; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 209, 155, .55), transparent);
  opacity: .8;
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--gold);
  text-transform: uppercase;
}
.eyebrow .sep { color: var(--dim-2); letter-spacing: 0; }
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(142, 233, 255, .7);
  animation: pulse 2.4s infinite;
}
.stage-head h2 {
  margin: 7px 0 4px;
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 31px);
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.2;
}
.stage-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--dim);
  letter-spacing: .02em;
}
.countdown {
  flex: 0 0 auto;
  text-align: center;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .022);
}
.cd-label { display: block; font-size: 9.5px; letter-spacing: .16em; color: var(--dim-2); }
.countdown b {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.cd-unlock {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-size: 9.5px;
  letter-spacing: .06em;
  cursor: pointer;
}
.cd-unlock:hover { color: #ffe6bb; }
.future-links { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; }
.future-link {
  display: block;
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--cyan);
  font: inherit;
  font-size: 9.5px;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
}
.future-link:hover { color: #fff; }
.future-link.active { color: var(--gold); }

/* ---------------- 画布 ---------------- */
.frame {
  position: relative;
  margin: 15px 0 15px;
  border-radius: 22px;
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 90% at 50% 0%, #0c1730 0%, #060a14 55%, #04060d 100%);
  border: 1px solid rgba(140, 190, 255, .13);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .06), 0 26px 50px -30px #000;
  overflow: hidden;
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}
.frame-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image: linear-gradient(rgba(140, 200, 255, .05) 1px, transparent 1px);
  background-size: 100% 4px;
  mix-blend-mode: overlay;
}
#board {
  display: block;
  width: min(100%, 58vh, 540px);
  aspect-ratio: 1 / 1;
  border-radius: 15px;
  touch-action: none;
  cursor: default;
  outline: none;
}
.start-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(180deg, rgba(4, 8, 20, .42), rgba(3, 6, 14, .72));
  backdrop-filter: blur(1.5px);
  transition: opacity .4s ease, visibility .4s ease;
  z-index: 3;
}
.start-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.so-inner {
  text-align: center;
  width: min(330px, 100%);
  padding: 26px 22px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(10, 18, 38, .9), rgba(5, 9, 20, .93));
  border: 1px solid rgba(150, 200, 255, .15);
  box-shadow: 0 34px 70px -30px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(10px);
  animation: rise .6s .1s both;
}
.so-kicker {
  margin: 0 0 10px;
  font-size: 9.5px;
  letter-spacing: .34em;
  color: rgba(242, 209, 155, .8);
}
.so-kicker::before,
.so-kicker::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background: rgba(242, 209, 155, .45);
  vertical-align: middle;
  margin: 0 8px 2px;
}
.so-inner h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .05em;
}
.so-desc { margin: 0 0 20px; font-size: 12.5px; line-height: 1.85; color: var(--dim); }
.so-note { margin: 14px 0 0; font-size: 10.5px; letter-spacing: .06em; color: var(--dim-2); }

/* ---------------- HUD ---------------- */
.hud {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 13px;
}
.stats,
.hud-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stat { text-align: center; min-width: 0; }
.stat span {
  display: block;
  font-size: 9.5px;
  letter-spacing: .18em;
  color: var(--dim-2);
  margin-bottom: 3px;
}
.stat b {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .02em;
  color: #f2f8ff;
  font-variant-numeric: tabular-nums;
}
.hud-actions .btn {
  width: 100%;
  gap: 4px;
  padding-left: 4px;
  padding-right: 4px;
}
.hud-actions .btn .badge { min-width: 15px; padding: 0 3px; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 74px;
  transform: translate(-50%, 8px);
  padding: 9px 16px;
  border-radius: 99px;
  background: rgba(18, 28, 54, .96);
  border: 1px solid rgba(150, 200, 255, .2);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  box-shadow: 0 14px 34px -14px #000;
  opacity: 0;
  pointer-events: none;
  transition: .24s ease;
  z-index: 6;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 软性激励入口（替代自动弹窗） */
.ad-pill {
  display: none;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 9px 8px 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(242, 209, 155, .26);
  background: linear-gradient(180deg, rgba(242, 209, 155, .1), rgba(18, 28, 54, .55));
  cursor: pointer;
  user-select: none;
  transition: border-color .2s ease, background .2s ease;
}
.ad-pill.on { display: flex; animation: pillIn .32s cubic-bezier(.22,.9,.24,1) both; }
.ad-pill:hover { border-color: rgba(242, 209, 155, .5); }
.pill-ic {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: rgba(242, 209, 155, .16);
  color: var(--gold);
}
.pill-text { flex: 1 1 auto; font-size: 12px; letter-spacing: .02em; color: #cdd9f0; }
.pill-text b { color: #fbeed2; font-weight: 700; }
.pill-x {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.pill-x:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
@keyframes pillIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}
.btn:disabled { opacity: .62; cursor: default; transform: none; }

/* 撤销按钮（HUD 内） */
#btnUndo.empty .badge { background: rgba(255, 255, 255, .06); color: var(--dim-2); }

/* 首次进入的引导 */
.coach {
  position: absolute;
  left: 50%;
  top: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 99px;
  background: rgba(11, 19, 38, .94);
  border: 1px solid rgba(242, 209, 155, .3);
  color: #e8eefb;
  font-size: 11.5px;
  letter-spacing: .02em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -6px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
  pointer-events: none;
}
.coach.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.coach-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--gold);
  animation: coachPulse 1.7s infinite;
}
@keyframes coachPulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 209, 155, .55); }
  70% { box-shadow: 0 0 0 7px rgba(242, 209, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 209, 155, 0); }
}

/* 结算页文本按钮 */
.res-link {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 5px;
  border: 0;
  background: none;
  color: var(--dim-2);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: .04em;
  cursor: pointer;
}
.res-link:hover { color: var(--gold); }
.res-link.hidden, .res-actions .hidden { display: none; }
.res-actions.promote #resAgain { order: -1; }
.so-link {
  display: inline-block;
  margin-top: 12px;
  border: 0;
  background: none;
  color: var(--dim-2);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: .04em;
  cursor: pointer;
}
.so-link:hover { color: var(--gold); }
.so-link.hidden { display: none; }

/* ---------------- 侧栏 ---------------- */
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel {
  position: relative;
  border-radius: 20px;
  padding: 16px 16px 15px;
  background: linear-gradient(168deg, rgba(18, 29, 55, .68), rgba(8, 13, 26, .84));
  border: 1px solid rgba(150, 200, 255, .11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 46px -34px #000;
  animation: rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
.panel:nth-child(2) { animation-delay: .06s; }
.panel:nth-child(3) { animation-delay: .12s; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.panel-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #f1f6ff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-head h3::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--gold);
  opacity: .7;
}
.panel-meta { font-size: 9.5px; letter-spacing: .16em; color: var(--dim-2); }
.live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  letter-spacing: .18em;
  color: #7ff0c8;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid rgba(127, 240, 200, .28);
  background: rgba(127, 240, 200, .08);
}
.live i {
  width: 5px; height: 5px; border-radius: 50%;
  background: #7ff0c8;
  box-shadow: 0 0 8px rgba(127, 240, 200, .9);
  animation: pulse 2s infinite;
}

.today-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.today-stats > div {
  padding: 10px 6px 9px;
  border-radius: 13px;
  text-align: center;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line-soft);
}
.today-stats b {
  display: block;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  color: #f4f9ff;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.today-stats span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--dim-2);
}
.today-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--dim);
}

.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rules li { display: flex; gap: 10px; align-items: flex-start; font-size: 12.2px; line-height: 1.65; color: var(--dim); }
.rules i {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1px solid rgba(242, 209, 155, .35);
  color: var(--gold);
  font-style: normal;
  font-size: 10px;
  display: grid;
  place-items: center;
  background: rgba(242, 209, 155, .06);
}

.discuss-list {
  max-height: 352px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -4px 12px;
  padding: 0 4px;
}
.disc-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.disc-item:last-child { border-bottom: none; }
.disc-item.mine { background: linear-gradient(90deg, rgba(242, 209, 155, .07), transparent 80%); border-radius: 10px; padding-left: 8px; }
.disc-av {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(6, 10, 20, .82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 4px 10px -6px #000;
}
.disc-body { min-width: 0; flex: 1; }
.disc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.disc-name { font-size: 12px; font-weight: 600; color: #dbe7ff; }
.disc-badge {
  font-size: 9px;
  padding: 1.5px 6px;
  border-radius: 99px;
  color: var(--gold);
  background: rgba(242, 209, 155, .1);
  border: 1px solid rgba(242, 209, 155, .22);
}
.disc-time { margin-left: auto; font-size: 10px; color: var(--dim-2); }
.disc-text { margin-top: 4px; font-size: 12.3px; line-height: 1.62; color: #b9c7e2; word-break: break-word; }
.disc-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.disc-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: none;
  border: none;
  color: var(--dim-2);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
  transition: color .15s;
}
.disc-like:hover, .disc-like.liked { color: #ff9fb1; }
.disc-mine-tag { font-size: 9.5px; color: var(--gold); letter-spacing: .08em; }

.discuss-compose { display: flex; gap: 8px; }
.discuss-compose input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: rgba(4, 9, 20, .6);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
}
.discuss-compose input::placeholder { color: var(--dim-2); }
.discuss-compose input:focus { border-color: rgba(142, 233, 255, .45); }
.discuss-compose .btn { flex: 0 0 auto; }

.footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 20px 4px 4px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--dim-2);
}
.footer .sep { opacity: .5; }
.footer-right { margin-left: auto; letter-spacing: .12em; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 6, 14, .76);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .26s ease, visibility .26s ease;
}
.modal.on { opacity: 1; visibility: visible; }

.result-card {
  position: relative;
  width: min(432px, 100%);
  border-radius: 24px;
  padding: 30px 26px 20px;
  text-align: center;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(242, 209, 155, .12), transparent 60%),
    linear-gradient(170deg, #16223f 0%, #0b1224 58%, #070c18 100%);
  border: 1px solid rgba(242, 209, 155, .3);
  box-shadow: 0 48px 100px -32px #000, inset 0 1px 0 rgba(255, 255, 255, .1);
  transform: translateY(16px) scale(.975);
  transition: transform .42s cubic-bezier(.16, .84, .24, 1);
  overflow: hidden;
}
.result-card::before {
  content: "";
  position: absolute;
  top: -60px; left: 50%;
  width: 240px; height: 140px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(242, 209, 155, .35), transparent);
  pointer-events: none;
}
.modal.on .result-card { transform: none; }

.ad-card {
  position: relative;
  width: min(388px, 100%);
  border-radius: 24px;
  padding: 30px 24px 18px;
  text-align: center;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(242, 209, 155, .14), transparent 60%),
    linear-gradient(170deg, #16223f 0%, #0b1224 58%, #070c18 100%);
  border: 1px solid rgba(242, 209, 155, .32);
  box-shadow: 0 48px 100px -32px #000, inset 0 1px 0 rgba(255, 255, 255, .1);
  transform: translateY(16px) scale(.975);
  transition: transform .42s cubic-bezier(.16, .84, .24, 1);
  overflow: hidden;
}
.ad-card::before {
  content: "";
  position: absolute;
  top: -64px; left: 50%;
  width: 220px; height: 130px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(242, 209, 155, .32), transparent);
  pointer-events: none;
}
.modal.on .ad-card { transform: none; }
.ad-title {
  margin: 8px 0 9px;
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: .05em;
  color: var(--ink);
}
.ad-body { margin: 0 0 16px; font-size: 12.2px; line-height: 1.7; color: var(--dim); }
.ad-reward {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 18px;
  padding: 7px 13px;
  border-radius: 99px;
  font-size: 11.5px;
  color: #ffe6bb;
  background: rgba(242, 209, 155, .1);
  border: 1px solid rgba(242, 209, 155, .26);
}
.ad-card .btn + .btn { margin-top: 8px; }
.ad-foot { margin: 12px 0 0; font-size: 9.5px; letter-spacing: .08em; color: var(--dim-2); }

.modal-x {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--dim-2);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: .16s;
}
.modal-x:hover { color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, .04); }
.modal-x.static { position: static; }

.res-kicker {
  margin: 0;
  font-size: 9px;
  letter-spacing: .3em;
  color: rgba(242, 209, 155, .75);
}
.res-title {
  margin: 8px 0 2px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .1em;
}
.res-stars { display: flex; justify-content: center; gap: 9px; margin: 12px 0 2px; }
.res-stars svg {
  fill: rgba(255, 255, 255, .06);
  stroke: rgba(242, 209, 155, .25);
  stroke-width: 1;
  transition: .2s;
}
.res-stars svg.on {
  fill: url(#none);
  fill: #f4d79f;
  stroke: #fff0cc;
  filter: drop-shadow(0 0 10px rgba(242, 209, 155, .65));
  animation: star-pop .6s cubic-bezier(.2, 1.4, .4, 1) both;
}
.res-score { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 2px 0 14px; }
.res-score b {
  font-family: var(--serif);
  font-size: 62px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  background: linear-gradient(180deg, #fff7e6 0%, #f4d79f 48%, #d3a259 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 6px 18px rgba(242, 209, 155, .22));
}
.res-score em { font-style: normal; font-size: 12px; color: var(--gold); letter-spacing: .1em; }

.res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(242, 209, 155, .16);
  border-bottom: 1px solid rgba(242, 209, 155, .16);
  padding: 12px 0;
  margin-bottom: 14px;
}
.res-grid > div + div { border-left: 1px solid rgba(255, 255, 255, .06); }
.res-grid span { display: block; font-size: 9.5px; letter-spacing: .14em; color: var(--dim-2); }
.res-grid b {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: #eef6ff;
}
.res-line { margin: 0 0 18px; font-size: 12.2px; line-height: 1.7; color: var(--dim); min-height: 34px; white-space: pre-line; }
.res-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.res-actions .btn { padding: 11px 14px; }
#resShare { flex: 1 1 100%; }
#resRankBtn, #resAgain { flex: 1 1 0; }
.res-foot { margin: 14px 0 0; font-size: 10px; letter-spacing: .08em; color: var(--dim-2); }

.rank-card {
  width: min(462px, 100%);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  padding: 20px 20px 18px;
  background:
    radial-gradient(110% 50% at 50% 0%, rgba(242, 209, 155, .08), transparent 55%),
    linear-gradient(170deg, #141f3a 0%, #0a1122 60%, #070c17 100%);
  border: 1px solid rgba(242, 209, 155, .22);
  box-shadow: 0 48px 100px -32px #000, inset 0 1px 0 rgba(255, 255, 255, .08);
  transform: translateY(16px) scale(.985);
  transition: transform .4s cubic-bezier(.16, .84, .24, 1);
}
.modal.on .rank-card { transform: none; }
.rank-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rank-head h3 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .08em;
}
.rank-date { margin: 8px 0 10px; font-size: 11px; letter-spacing: .06em; color: var(--dim); }
.rank-list { overflow-y: auto; flex: 1; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.rank-list.fade { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent 100%); mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent 100%); }
.rank-row {
  display: grid;
  grid-template-columns: 24px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 11px;
  border: 1px solid transparent;
}
.rank-row.mine {
  background: rgba(242, 209, 155, .08);
  border-color: rgba(242, 209, 155, .24);
  margin: 4px 0;
}
.rank-no {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--dim-2);
  text-align: center;
}
.rank-row:nth-child(1) .rank-no { color: #ffd98a; }
.rank-row:nth-child(2) .rank-no { color: #dfe8f7; }
.rank-row:nth-child(3) .rank-no { color: #e3b184; }
.rank-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(6, 10, 20, .8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.rank-name { font-size: 12.5px; color: #d5e2f8; display: flex; align-items: center; gap: 6px; min-width: 0; }
.me-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(242, 209, 155, .18);
  color: var(--gold);
}
.rank-score {
  font-family: var(--mono);
  font-size: 14px;
  color: #f2f8ff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rank-time { font-size: 9.5px; color: var(--dim-2); margin-top: 1px; }
.rank-empty { padding: 26px 10px; text-align: center; font-size: 12px; color: var(--dim); }
.rank-meta { margin: 10px 0 12px; font-size: 10.5px; letter-spacing: .05em; color: var(--dim-2); text-align: center; }

/* ---------------- 滚动条 ---------------- */
.discuss-list::-webkit-scrollbar, .rank-list::-webkit-scrollbar { width: 4px; }
.discuss-list::-webkit-scrollbar-thumb, .rank-list::-webkit-scrollbar-thumb {
  background: rgba(150, 200, 255, .18);
  border-radius: 99px;
}
.discuss-list::-webkit-scrollbar-track, .rank-list::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 动效 ---------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(142, 233, 255, .55); }
  70% { box-shadow: 0 0 0 7px rgba(142, 233, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(142, 233, 255, 0); }
}
@keyframes star-pop {
  0% { transform: scale(.4) rotate(-18deg); opacity: 0; }
  60% { transform: scale(1.16) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .side .discuss { grid-column: 1 / -1; }
  .discuss-list { max-height: 300px; }
  #board { width: min(100%, 58vh, 560px); }
}

@media (max-width: 700px) {
  .app { padding: calc(52px + env(safe-area-inset-top, 0px)) 12px calc(20px + env(safe-area-inset-bottom)); }
  .topbar { align-items: flex-start; margin-bottom: 14px; gap: 10px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-text { min-width: 0; flex: 1; }
  .brand-text h1 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .brand-text p { font-size: 10px; letter-spacing: .06em; }
  .mark { width: 38px; height: 38px; border-radius: 11px; }
  .mark svg { width: 26px; height: 26px; }
  .top-actions { flex: 0 0 auto; }
  .top-actions .btn { padding: 8px 10px; font-size: 11.5px; gap: 5px; }
  .top-actions .btn svg { width: 14px; height: 14px; }
  .btn.icon { width: 33px; height: 33px; }

  .stage-card { border-radius: 20px; padding: 16px 13px 12px; }
  .stage-head { gap: 10px; }
  .stage-title-wrap { flex: 1 1 auto; min-width: 0; }
  .stage-head h2 { font-size: 23px; }
  .stage-sub { font-size: 11.5px; }
  .countdown { align-self: flex-start; padding: 6px 9px; }
  .cd-label { font-size: 8.5px; letter-spacing: .1em; }
  .countdown b { font-size: 13.5px; }
  .frame { margin: 12px 0; padding: 6px; border-radius: 17px; }
  #board { width: 100%; border-radius: 12px; }
  .so-inner { padding: 22px 16px 19px; }
  .so-inner h3 { font-size: 22px; }
  .so-desc { font-size: 11.5px; margin-bottom: 16px; }
  .so-desc br { display: none; }
  .so-kicker::before, .so-kicker::after { width: 12px; margin: 0 6px 2px; }

  .hud { gap: 9px; }
  .stat b { font-size: 17px; }

  .side { grid-template-columns: 1fr; }
  .panel { border-radius: 17px; padding: 14px; }
  .today-stats b { font-size: 18px; }
  .footer { font-size: 10px; padding-top: 16px; }
  .footer-right { display: none; }

  .result-card { padding: 26px 18px 18px; }
  .res-score b { font-size: 54px; }
  .toast { bottom: 64px; font-size: 11.5px; }
}

@media (max-width: 430px) {
  .brand-text p { display: none; }
  .top-actions .btn-label { display: none; }
  .top-actions .btn { padding: 8px 9px; }
  .brand-text h1 { font-size: 15.5px; }
  .stats, .hud-actions { gap: 6px; }
  .stat b { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

