/* 天黑以后 —— 全站样式 */
:root {
  --bg: #12141f;
  --panel: #171b2b;
  --ink: #e8e6df;
  --dim: #9aa0b5;
  --faint: rgba(255, 255, 255, .07);
  --amber: #f0b45d;
  --mint: #7fd6a8;
  --danger: #ff8a80;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 78% -8%, #1d2135 0%, transparent 62%),
    radial-gradient(900px 500px at -10% 110%, #171a2b 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

::selection { background: rgba(240, 180, 93, .3); }

a { color: var(--amber); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 6px;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 24px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 1px;
}

.brand svg { width: 18px; height: 18px; color: var(--amber); flex: none; }
.brand:hover { color: var(--amber); }

.today { font-size: 13px; color: var(--dim); }

/* ---------- 页面导航条 ---------- */
.pagenav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chipnav {
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--dim);
  font-size: 13px;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.chipnav:hover { color: var(--ink); border-color: rgba(255, 255, 255, .24); }

.chipnav.on {
  background: rgba(240, 180, 93, .13);
  color: var(--amber);
  border-color: rgba(240, 180, 93, .38);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.btn.solid { background: var(--amber); color: #1b1812; font-weight: 600; }
.btn.solid:hover { background: #f7c176; }
.btn.ghost { border-color: rgba(255, 255, 255, .16); color: var(--dim); }
.btn.ghost:hover { border-color: rgba(255, 255, 255, .35); color: var(--ink); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.mint { background: var(--mint); color: #10231a; font-weight: 600; }
.btn.mint:hover { background: #96e2bb; }

/* ---------- 首页 hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 30px;
  align-items: center;
  padding: 40px 0 30px;
}

.kicker {
  margin: 0 0 10px;
  font-size: 12.5px;
  letter-spacing: 3px;
  color: rgba(240, 180, 93, .75);
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5.6vw, 54px);
  font-weight: 750;
  letter-spacing: 2px;
  line-height: 1.12;
}

.lead {
  margin: 16px 0 0;
  font-size: 15px;
  color: var(--dim);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* ---------- 夜景插画 ---------- */
.scene {
  position: relative;
  aspect-ratio: 11 / 9;
  max-height: 330px;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .07);
  background:
    radial-gradient(420px 300px at 80% 16%, rgba(255, 214, 138, .14), transparent 62%),
    linear-gradient(180deg, #242c55 0%, #161b31 46%, #0d101e 100%);
  box-shadow: 0 26px 60px -34px rgba(0, 0, 0, .9);
}

.sky { position: absolute; inset: 0; }

.moon {
  position: absolute;
  top: 11%;
  right: 17%;
  width: clamp(58px, 8vw, 90px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff7df, #f3dda6 58%, #e4c688);
  box-shadow:
    0 0 64px 12px rgba(243, 211, 140, .22),
    inset -8px -10px 22px rgba(206, 160, 82, .5);
}

.star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, .55);
  animation: twinkle var(--d, 3s) ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: .15; transform: scale(var(--s, 1)) translateY(0); }
  to   { opacity: .95; transform: scale(calc(var(--s, 1) * 1.5)) translateY(-1px); }
}

.skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 58%;
  display: block;
}

.cat {
  position: absolute;
  left: 7%;
  bottom: 0;
  width: 84px;
  height: auto;
  z-index: 2;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .55));
}

/* ---------- 工具菜单（首页） ---------- */
.toolhead { margin: 26px 0 0; }

.toolhead h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}

.toolhead p { margin: 6px 0 0; font-size: 13.5px; color: var(--dim); }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.tile {
  --ac: var(--amber);
  --ac-soft: rgba(240, 180, 93, .13);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0));
  border: 1px solid var(--faint);
  border-radius: 18px;
  padding: 20px;
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--ac);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0));
}

.tile .icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--ac-soft);
  color: var(--ac);
}

.tile svg { width: 23px; height: 23px; }

.tile h3 { margin: 2px 0 0; font-size: 16px; font-weight: 650; }

.tile p { margin: 0; font-size: 13px; color: var(--dim); line-height: 1.7; }

.tile .go {
  margin-top: auto;
  padding-top: 8px;
  font-size: 12.5px;
  color: #7c829a;
  transition: color .15s ease;
}

.tile:hover .go { color: var(--ac); }

/* 每块磁贴的配色 */
.tile-a  { --ac: var(--amber); --ac-soft: rgba(240, 180, 93, .13); }
.tile-p  { --ac: #f5a97f;     --ac-soft: rgba(245, 169, 127, .13); }
.tile-s  { --ac: #8ab4f8;     --ac-soft: rgba(138, 180, 248, .13); }
.tile-l  { --ac: #b7a6f5;     --ac-soft: rgba(183, 166, 245, .13); }
.tile-m  { --ac: var(--mint); --ac-soft: rgba(127, 214, 168, .13); }
.tile-r  { --ac: #ef9db2;     --ac-soft: rgba(239, 157, 178, .13); }
.tile-x  { --ac: #ef8383;     --ac-soft: rgba(239, 131, 131, .13); }
.tile-teal { --ac: #5fcbbf;   --ac-soft: rgba(95, 203, 191, .14); }
.tile-gold { --ac: #eec66a;   --ac-soft: rgba(238, 198, 106, .14); }
.tile-fast { --ac: #f2746f;   --ac-soft: rgba(242, 116, 111, .14); }
.tile-purple { --ac: #a48ff0; --ac-soft: rgba(164, 143, 240, .14); }

/* ---------- 功能页骨架 ---------- */
.page-head { margin: 34px 0 0; }

.page-head h1 { font-size: clamp(26px, 4vw, 34px); letter-spacing: 1px; }

.page-head .desc { margin: 8px 0 0; font-size: 14px; color: var(--dim); }

.stage { max-width: 840px; margin: 22px auto 0; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 22px;
  padding: 26px 28px 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 24px 60px -40px rgba(0, 0, 0, .95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

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

.card-head h2 { margin: 0; font-size: 16px; font-weight: 650; }

.card-head .note-txt { margin: 0; font-size: 13px; color: var(--dim); }

.chip {
  font-size: 12px;
  color: var(--dim);
  background: rgba(255, 255, 255, .05);
  padding: 3px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.hint { margin: 16px 0 0; font-size: 12px; color: #6f7590; }
.hint.center { text-align: center; }
.hint strong { color: var(--amber); font-weight: 600; }

/* ---------- 输入 ---------- */
.addrow { display: flex; gap: 10px; flex-wrap: wrap; }

.addrow input[type="text"],
.addrow input[type="date"],
.addrow .grow {
  flex: 1;
  min-width: 150px;
}

.field {
  background: rgba(10, 12, 20, .55);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}

.field::placeholder { color: #6f7590; }

.field:focus { border-color: rgba(240, 180, 93, .55); outline: none; }

input[type="date"].field { color-scheme: dark; }

textarea.field {
  display: block;
  width: 100%;
  min-height: 170px;
  line-height: 1.8;
  resize: vertical;
}

/* ---------- 列表行（待办 / 倒数日共用） ---------- */
.tlist { list-style: none; margin: 14px 0 0; padding: 0; }

.tlist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px dashed rgba(255, 255, 255, .06);
  animation: rise .18s ease;
}

.tlist li:last-child { border-bottom: none; }

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

.tick {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .25);
  background: transparent;
  color: transparent;
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  padding: 0;
}

li.done .tick {
  background: var(--amber);
  border-color: var(--amber);
  color: #17191f;
}

.tlist .txt {
  flex: 1;
  font-size: 14.5px;
  word-break: break-word;
  min-width: 0;
}

li.done .txt { color: var(--dim); text-decoration: line-through; }

.del {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 18px;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease;
}

.tlist li:hover .del, .del:focus-visible { opacity: 1; }
.del:hover { color: var(--danger); }

.count-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.count-main .nm { font-size: 14.5px; word-break: break-word; }
.count-main .dt { font-size: 12px; color: var(--dim); }

.bad {
  flex: none;
  font-size: 12px;
  padding: 3px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.bad.up   { background: rgba(127, 214, 168, .12); color: var(--mint); }
.bad.today { background: rgba(240, 180, 93, .16); color: var(--amber); font-weight: 600; }
.bad.past { background: rgba(255, 255, 255, .05); color: #8b91a6; }

.empty { margin: 16px 0 0; font-size: 13.5px; color: #6f7590; }
.empty.hidden { display: none; }
.hidden { display: none !important; }

/* ---------- 番茄钟 ---------- */
.segs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 18px;
}

.seg {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .05);
  color: var(--dim);
  font-size: 12.5px;
  font-family: inherit;
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}

.seg.on {
  background: rgba(240, 180, 93, .14);
  color: var(--amber);
  border-color: rgba(240, 180, 93, .4);
}

.ring {
  --accent: var(--amber);
  position: relative;
  width: 172px;
  height: 172px;
  margin: 0 auto;
}

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

.ring circle { fill: none; stroke-width: 8; }

.ring-bg { stroke: rgba(255, 255, 255, .07); }

.ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 414.7;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .3s linear, stroke .3s ease;
}

.ring-core {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.time {
  font-size: 34px;
  font-weight: 650;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  transition: color .3s ease;
}

.phase { font-size: 12px; color: var(--dim); letter-spacing: 2px; }

.note {
  min-height: 1.4em;
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
}

.timer-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

#timer[data-phase="break"] .ring { --accent: var(--mint); }
#timer[data-phase="break"] .seg.on {
  background: rgba(127, 214, 168, .13);
  color: var(--mint);
  border-color: rgba(127, 214, 168, .4);
}

/* ---------- 拿主意 ---------- */
.picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}

.result {
  min-height: 90px;
  margin-top: 18px;
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 16px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--amber);
  transition: opacity .12s ease;
}

.result.idle { font-size: 13.5px; font-weight: 400; color: #6f7590; letter-spacing: 0; }

.result.rolling { opacity: .35; }

/* ---------- 呼吸练习 ---------- */
.breath {
  position: relative;
  width: min(320px, 72vw);
  aspect-ratio: 1;
  margin: 10px auto 0;
}

.halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(127, 214, 168, .22);
  animation: spin 60s linear infinite;
}

.halo.in { animation-duration: 24s; animation-direction: reverse; }

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

.breath .core {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #203f33, #152a21 72%);
  border: 1px solid rgba(127, 214, 168, .4);
  box-shadow: 0 0 64px rgba(127, 214, 168, .16);
  display: grid;
  place-items: center;
  text-align: center;
  transform: scale(.8);
  will-change: transform;
}

.breath .core .in { font-size: 21px; font-weight: 650; color: #c9f0dd; letter-spacing: 2px; }
.breath .core .sec {
  font-size: 15px;
  color: rgba(201, 240, 221, .75);
  font-variant-numeric: tabular-nums;
}

.breath-actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }

/* ---------- 随手记 ---------- */
.notebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: #6f7590;
}

.notebar .saved { transition: color .2s ease; }
.notebar .saved.ok { color: var(--mint); }

/* ---------- 页脚 ---------- */
.foot {
  margin-top: auto;
  padding-top: 40px;
  text-align: center;
  font-size: 12.5px;
  color: #6f7590;
}

.foot p { margin: 0; }

/* 打字机光标 */
.typed-cursor {
  display: inline-block;
  width: 3px;
  margin-left: 5px;
  color: var(--amber);
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* 扫雷 */
.mine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.mine-stats {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 13px;
  color: var(--dim);
}

.mine-stats b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

.mine-btns { display: flex; gap: 8px; }

.mine-board-wrap {
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.mine-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  gap: 3px;
  justify-content: start;
  width: max-content;
}

.mcell {
  width: var(--cell);
  height: var(--cell);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: calc(var(--cell) * .5);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
  border: 0;
  padding: 0;
  line-height: 1;
}

.mcell.s-hidden {
  background: #242b46;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .06);
}

.mcell.s-hidden:hover { background: #2d3654; }

.mcell.s-open {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .05);
  cursor: default;
}

.mcell.s-zero { background: rgba(255, 255, 255, .025); }

.mcell.s-flag { background: #2c2742; color: var(--amber); }

.mcell.s-flag.wrong { color: #ff9aa5; }

.mcell.s-mine { background: #4a2430; color: #ffd9d9; }
.mcell.s-mine.boom { background: #8b2f3c; color: #ffe9e9; }

.mcell.n1 { color: #6fa8dc; }
.mcell.n2 { color: #7fd6a8; }
.mcell.n3 { color: #f2746f; }
.mcell.n4 { color: #9bb0f5; }
.mcell.n5 { color: #d8846b; }
.mcell.n6 { color: #4fd0c4; }
.mcell.n7 { color: #efe3c1; }
.mcell.n8 { color: #f0b45d; }

/* 反应速度 */
.gstats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  font-size: 13px;
  color: var(--dim);
  margin-top: 4px;
}

.gstats b { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 15px; }

.reaction-pad {
  min-height: 250px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  padding: 20px;
  border: 1px solid var(--faint);
  transition: background .18s ease, color .18s ease;
  margin-top: 16px;
}

.reaction-pad p { margin: 0; font-size: 20px; font-weight: 650; }

.reaction-pad #sub { font-size: 13px; font-weight: 400; color: #8b91a6; margin-top: 8px; }

.reaction-pad.idle { background: #1b2036; }
.reaction-pad.waiting { background: #2c2742; }
.reaction-pad.go { background: #2f6b4f; color: #0e2b1f; }
.reaction-pad.done { background: #24503c; }
.reaction-pad.early { background: #5a2532; color: #ffd9d9; }

/* 井字棋 */
.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 360px;
  margin: 6px auto 0;
}

.ttt-cell {
  aspect-ratio: 1;
  border-radius: 16px;
  background: #1c2135;
  border: 1px solid rgba(255, 255, 255, .07);
  color: transparent;
  font-size: 52px;
  font-weight: 700;
  font-family: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.ttt-cell:hover { border-color: rgba(255, 255, 255, .25); }
.ttt-cell.on { background: #242b46; cursor: default; }
.ttt-cell[data-mark="X"] { color: var(--amber); }
.ttt-cell[data-mark="O"] { color: var(--mint); }

/* 记忆翻牌 */
.mem-wrap { margin-top: 16px; overflow-x: auto; padding-bottom: 4px; }

.mem-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  gap: 10px;
  justify-content: center;
}

.mem-card {
  position: relative;
  width: var(--cell);
  height: var(--cell);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 14px;
  transform-style: preserve-3d;
  transition: transform .35s ease;
}

.mem-card.flip { transform: rotateY(180deg); }

.mem-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: grid;
  place-items: center;
  font-size: calc(var(--cell) * .5);
}

.mem-face.back {
  background: #242b46;
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--amber);
  font-size: calc(var(--cell) * .3);
}

.mem-face.front {
  transform: rotateY(180deg);
  background: #1c2135;
  border: 1px solid rgba(255, 255, 255, .07);
}

.mem-card.matched .mem-face.front {
  border-color: var(--mint);
  box-shadow: 0 0 18px rgba(127, 214, 168, .3);
}

/* 2048 */
.board2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 360px;
  margin: 16px auto 0;
  aspect-ratio: 1;
}

.gc {
  background: rgba(255, 255, 255, .05);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 26px;
  color: #e8e6df;
}

.gc.t2 { background: #2b3350; }
.gc.t4 { background: #33405f; }
.gc.t8 { background: #7a5a33; color: #ffe9cf; }
.gc.t16 { background: #9a6b35; color: #ffe9cf; }
.gc.t32 { background: #c07d3a; color: #fff3e0; }
.gc.t64 { background: #d98a34; color: #fff3e0; }
.gc.t128 { background: #d9a23b; color: #3a2a12; }
.gc.t256 { background: #d7b13c; color: #3a2a12; }
.gc.t512 { background: #cbb43d; color: #3a2a12; }
.gc.t1024 { background: #b7d24d; color: #2c3a10; font-size: 21px; }
.gc.t2048 { background: #a4d84f; color: #243708; font-size: 21px; }

.gdir {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* 抽屉菜单 */
.menu-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 40px;
  padding: 0 11px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s ease, opacity .25s ease, background .15s ease;
}

.menu-btn:hover { border-color: rgba(255, 255, 255, .28); }
.menu-btn:hover span { background: var(--amber); }

/* 三条杠 → × */
body.menu-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .menu-btn span:nth-child(2) { transform: scaleX(0); opacity: 0; }
body.menu-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
body.menu-open .menu-btn { border-color: rgba(240, 180, 93, .45); }

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, .45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 50;
}

body.menu-open .menu-backdrop { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }

.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(304px, 84vw);
  background: rgba(20, 24, 42, .72);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-left: 1px solid rgba(255, 255, 255, .12);
  box-shadow: -28px 0 70px rgba(0, 0, 0, .5);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.22, .8, .26, 1);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}

body.menu-open .menu-drawer { transform: translateX(0); }

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.menu-close {
  background: transparent;
  border: 0;
  color: var(--dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.menu-close:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }

.menu-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}

.menu-good { display: flex; flex-direction: column; gap: 2px; }

.menu-glabel {
  padding: 2px 12px 6px;
  font-size: 11px;
  letter-spacing: 3px;
  color: #6f7590;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 11px;
  color: var(--dim);
  text-decoration: none;
  font-size: 14.5px;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity .25s ease, transform .25s ease, color .15s ease, background .15s ease;
}

body.menu-open .menu-link {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 40ms);
}

.menu-link:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }

.menu-link.on {
  color: var(--amber);
  background: rgba(240, 180, 93, .12);
  font-weight: 600;
}

.menu-link .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
  flex: none;
}

.menu-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #6f7590;
}

.menu-foot-link {
  color: #6f7590;
  text-decoration: none;
  font-weight: 600;
  transition: color .15s ease;
}

.menu-foot-link:hover { color: var(--amber); }

/* 首页提示 */
.menu-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 8px 15px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  font-size: 13px;
  color: #9aa0b5;
}

/* 首页氛围 */
.aurora {
  position: fixed;
  inset: -18%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(38% 38% at 28% 18%, rgba(120, 140, 255, .14), transparent 62%),
    radial-gradient(34% 34% at 76% 24%, rgba(190, 120, 255, .12), transparent 62%),
    radial-gradient(46% 46% at 62% 82%, rgba(80, 200, 180, .10), transparent 62%);
  filter: blur(42px);
  animation: aurora 18s ease-in-out infinite alternate;
}

@keyframes aurora {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

.hero { min-height: clamp(460px, calc(100vh - 180px), 720px); }

.hero h1 {
  background: linear-gradient(120deg, #f3c77f, #fff3de 48%, #f0b45d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.btn { transition: background .15s ease, color .15s ease, border-color .15s ease, transform .18s ease, box-shadow .18s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; }
.btn.solid:hover { box-shadow: 0 14px 30px -14px rgba(240, 180, 93, .55); }

/* 聊天室 */
#count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(127, 214, 168, .12);
  border: 1px solid rgba(127, 214, 168, .28);
  color: var(--mint);
  font-size: 12.5px;
  margin-bottom: 14px;
}

#count::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  animation: chatDot 1.8s ease-out infinite;
}

@keyframes chatDot {
  0% { box-shadow: 0 0 0 0 rgba(127, 214, 168, .45); }
  70% { box-shadow: 0 0 0 7px rgba(127, 214, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 214, 168, 0); }
}

.chat-box {
  height: min(56vh, 520px);
  overflow-y: auto;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .02), transparent 40%),
    rgba(10, 12, 20, .5);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.chat-box::-webkit-scrollbar { width: 8px; }
.chat-box::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 999px; }
.chat-box::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .26); }

.chat-line { display: flex; align-items: flex-start; }

.chat-bubble {
  width: fit-content;
  max-width: 62%;
  min-width: 0;
  padding: 11px 14px 9px;
  border-radius: 16px;
  background: #20263b;
  border: 1px solid rgba(255, 255, 255, .07);
  border-left: 3px solid var(--amber);
  box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .6);
}

.chat-bubble.c1 { border-left-color: #f0b45d; }
.chat-bubble.c2 { border-left-color: #7fd6a8; }
.chat-bubble.c3 { border-left-color: #8ab4f8; }
.chat-bubble.c4 { border-left-color: #f5a97f; }
.chat-bubble.c5 { border-left-color: #b7a6f5; }
.chat-bubble.c6 { border-left-color: #ef9db2; }

.bubble {
  font-size: 14.5px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.meta {
  margin: 5px 2px 0;
  font-size: 11px;
  color: #7c829a;
  letter-spacing: .3px;
}

.chat-input {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 6px 6px 6px 16px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  transition: border-color .15s ease, background .15s ease;
}

.chat-input:focus-within { border-color: rgba(240, 180, 93, .5); background: rgba(240, 180, 93, .05); }

.chat-input .field {
  flex: 1;
  min-width: 0;
  background: transparent !important;
  border: 0;
  padding: 9px 6px;
}

.chat-input .btn { flex: none; }

#status { margin-top: 12px; text-align: center; font-size: 12px; color: #6f7590; }

/* 聊天图片 */
.chat-input .icon-btn { width: 34px; height: 34px; font-size: 15px; flex: none; }

.pending {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(240, 180, 93, .06);
  border: 1px solid rgba(240, 180, 93, .2);
  font-size: 12.5px;
  color: var(--dim);
}

.pending[hidden] { display: none !important; }

.pending img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
}

.pending-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pending-x { border: 0; background: transparent; color: var(--dim); font-size: 18px; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; }
.pending-x:hover { color: var(--danger); background: rgba(255, 255, 255, .06); }

.chat-img {
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 2px 0 6px;
  cursor: zoom-in;
  border: 1px solid rgba(255, 255, 255, .08);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 8, 14, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.lightbox.open { opacity: 1; visibility: visible; }

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}

/* 放映室 */
.player-wrap {
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 24px 60px -40px rgba(0, 0, 0, .9);
}

.player-wrap video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.ptitle { margin: 12px 4px 0; font-size: 14px; color: var(--dim); }

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

.listhead h2 { margin: 0; font-size: 15px; font-weight: 650; }

.vlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.vitem {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .09);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 14px 30px -22px rgba(0, 0, 0, .8);
  transition: border-color .15s ease, transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.vitem:hover { border-color: var(--amber); transform: translateY(-2px); }

.vname { font-size: 14px; font-weight: 600; word-break: break-all; }
.vsize { font-size: 12px; color: #8b91a6; }

/* 首页今日卡 */
.today-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 20px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 60px -40px rgba(0, 0, 0, .95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.today-left { display: flex; flex-direction: column; gap: 4px; }
.today-hi { font-size: 21px; font-weight: 700; color: var(--ink); }
.today-day { font-size: 13px; color: var(--dim); letter-spacing: .5px; }
.today-right { display: flex; gap: 8px; flex-wrap: wrap; }

.tchip {
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: 12.5px;
  color: var(--dim);
}

.tchip b { color: var(--amber); font-weight: 700; }

/* 顶栏右侧按钮 + 白噪音控制 */
.topbar-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 42px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.icon-btn:hover { border-color: rgba(255, 255, 255, .28); }

.noise-ctr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.vol-label { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); }

.vol-label input[type="range"] { width: 150px; accent-color: var(--amber); }
input[type="range"] { accent-color: var(--amber); }

/* ================= 浅色主题 ================= */
:root[data-theme="light"] {
  --bg: #eef1f7;
  --panel: rgba(255, 255, 255, .8);
  --ink: #1e2434;
  --dim: #5c6478;
  --faint: rgba(30, 50, 90, .12);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(1100px 620px at 78% -8%, #e6eaf5 0%, transparent 62%),
    radial-gradient(900px 500px at -10% 110%, #e9edf6 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
}

:root[data-theme="light"] ::selection { background: rgba(240, 180, 93, .35); }
:root[data-theme="light"] .topbar { border-bottom-color: rgba(30, 50, 90, .08); }
:root[data-theme="light"] .icon-btn { border-color: rgba(30, 50, 90, .14); background: rgba(255, 255, 255, .5); }
:root[data-theme="light"] .icon-btn:hover { border-color: rgba(30, 50, 90, .3); }
:root[data-theme="light"] .menu-btn { border-color: rgba(30, 50, 90, .14); background: rgba(255, 255, 255, .5); }
:root[data-theme="light"] .menu-btn span { background: var(--ink); }
:root[data-theme="light"] .menu-btn:hover span { background: var(--amber); }
:root[data-theme="light"] .card { background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .6)); border: 1px solid rgba(30, 50, 90, .1); box-shadow: inset 0 1px 0 #fff, 0 24px 60px -40px rgba(60, 80, 120, .5); }
:root[data-theme="light"] .chip { background: rgba(30, 50, 90, .08); }
:root[data-theme="light"] .field { background: rgba(255, 255, 255, .8); color: var(--ink); }
:root[data-theme="light"] .field::placeholder { color: #9aa0b5; }
:root[data-theme="light"] .tlist li { border-bottom-color: rgba(30, 50, 90, .08); }
:root[data-theme="light"] .tick { border-color: rgba(30, 50, 90, .25); }
:root[data-theme="light"] .btn.ghost { border-color: rgba(30, 50, 90, .2); color: var(--dim); }
:root[data-theme="light"] .btn.ghost:hover { border-color: rgba(30, 50, 90, .4); color: var(--ink); }
:root[data-theme="light"] .seg { background: rgba(30, 50, 90, .06); }
:root[data-theme="light"] .ring-bg { stroke: rgba(30, 50, 90, .12); }
:root[data-theme="light"] .menu-hint { background: rgba(30, 50, 90, .06); border-color: rgba(30, 50, 90, .12); color: var(--dim); }
:root[data-theme="light"] .foot { color: #8a90a3; }
:root[data-theme="light"] .ttt-cell { background: #fff; border: 1px solid rgba(30, 50, 90, .12); }
:root[data-theme="light"] .ttt-cell:hover { border-color: rgba(30, 50, 90, .3); }
:root[data-theme="light"] .ttt-cell.on { background: #f2f4fb; }
:root[data-theme="light"] .ttt-cell[data-mark="X"] { color: #c9922f; }
:root[data-theme="light"] .ttt-cell[data-mark="O"] { color: #2f9d7a; }
:root[data-theme="light"] .mem-face.back { background: #eef1f7; border: 1px solid rgba(30, 50, 90, .1); color: #c9922f; }
:root[data-theme="light"] .mem-face.front { background: #fff; border: 1px solid rgba(30, 50, 90, .1); }
:root[data-theme="light"] .gc { background: rgba(30, 50, 90, .07); }
:root[data-theme="light"] .gc.t2 { background: #d9dff0; color: #1e2434; }
:root[data-theme="light"] .gc.t4 { background: #cdd6ec; color: #1e2434; }
:root[data-theme="light"] .reaction-pad { border: 1px solid rgba(30, 50, 90, .1); }
:root[data-theme="light"] .reaction-pad.idle { background: #fff; }
:root[data-theme="light"] .reaction-pad.waiting { background: #f2f0ff; }
:root[data-theme="light"] .reaction-pad.done { background: #e7f4ec; }
:root[data-theme="light"] .reaction-pad.early { background: #fbe6e6; color: #8a3333; }
:root[data-theme="light"] .reaction-pad.go { background: #2f8f5f; color: #0e2b1f; }
:root[data-theme="light"] .reaction-pad #sub { color: #7a8092; }
:root[data-theme="light"] #count { background: rgba(47, 157, 122, .1); border-color: rgba(47, 157, 122, .3); color: #2f9d7a; }
:root[data-theme="light"] .chat-box { background: linear-gradient(180deg, rgba(255, 255, 255, .4), transparent 45%), rgba(255, 255, 255, .72); border-color: rgba(30, 50, 90, .1); }
:root[data-theme="light"] .chat-box::-webkit-scrollbar-thumb { background: rgba(30, 50, 90, .2); }
:root[data-theme="light"] .chat-bubble { background: #fff; border: 1px solid rgba(30, 50, 90, .1); box-shadow: 0 8px 20px -14px rgba(60, 80, 120, .35); }
:root[data-theme="light"] .bubble { color: var(--ink); }
:root[data-theme="light"] .meta { color: #9aa0b5; }
:root[data-theme="light"] .chat-input { background: rgba(255, 255, 255, .7); border-color: rgba(30, 50, 90, .12); }
:root[data-theme="light"] .chat-input:focus-within { border-color: rgba(185, 121, 31, .5); }
:root[data-theme="light"] .chat-input .field { color: var(--ink); }
:root[data-theme="light"] #status { color: #8a90a3; }
:root[data-theme="light"] .pending { background: rgba(185, 121, 31, .06); border-color: rgba(185, 121, 31, .2); }
:root[data-theme="light"] .chat-img { border-color: rgba(30, 50, 90, .1); }
:root[data-theme="light"] .menu-backdrop { background: rgba(40, 50, 70, .35); }
:root[data-theme="light"] .menu-drawer { background: rgba(255, 255, 255, .8); border-left-color: rgba(30, 50, 90, .12); box-shadow: -28px 0 60px rgba(60, 80, 120, .25); }
:root[data-theme="light"] .menu-close { color: #8a90a3; }
:root[data-theme="light"] .menu-close:hover { color: var(--ink); background: rgba(30, 50, 90, .06); }
:root[data-theme="light"] .menu-link { color: var(--dim); }
:root[data-theme="light"] .menu-link:hover { color: var(--ink); background: rgba(30, 50, 90, .06); }
:root[data-theme="light"] .menu-link.on { color: #b9791f; background: rgba(240, 180, 93, .18); }
:root[data-theme="light"] .menu-glabel { color: #9aa0b5; }
:root[data-theme="light"] .menu-foot { border-top-color: rgba(30, 50, 90, .1); color: #8a90a3; }
:root[data-theme="light"] .hero h1 {
  background: linear-gradient(120deg, #c9882a, #f2b45d 48%, #c9882a);
  -webkit-background-clip: text;
  background-clip: text;
}
:root[data-theme="light"] .aurora { opacity: .6; }
:root[data-theme="light"] .stat { background: rgba(30, 50, 90, .05); border-color: rgba(30, 50, 90, .1); }
:root[data-theme="light"] .menu-foot-link { color: #8a90a3; }
:root[data-theme="light"] .menu-foot-link:hover { color: #b9791f; }
:root[data-theme="light"] .popup { background: #fff; border-color: rgba(30, 50, 90, .12); box-shadow: 0 24px 60px rgba(60, 80, 120, .35); }
:root[data-theme="light"] .popup-body { color: #414b61; }
:root[data-theme="light"] .notice-box { background: rgba(30, 50, 90, .04); }
:root[data-theme="light"] .player-wrap { border-color: rgba(30, 50, 90, .1); box-shadow: 0 24px 60px -40px rgba(60, 80, 120, .5); }
:root[data-theme="light"] .vitem { background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .6)); border-color: rgba(30, 50, 90, .1); }
:root[data-theme="light"] .vsize { color: #9aa0b5; }
:root[data-theme="light"] .today-card { background: linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .6)); border-color: rgba(30, 50, 90, .1); box-shadow: inset 0 1px 0 #fff, 0 24px 60px -40px rgba(60, 80, 120, .5); }
:root[data-theme="light"] .tchip { background: rgba(30, 50, 90, .05); border-color: rgba(30, 50, 90, .12); }

/* 管理员 */
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0 4px; }
.admin-body { max-width: 560px; margin: 26px auto 0; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.stat {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--faint);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat span { font-size: 12px; color: var(--dim); }
.stat b { font-size: 20px; color: var(--ink); font-weight: 700; }

.admin-actions { display: flex; gap: 8px; }

.sect { margin-top: 22px; }
.sect h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 650; color: var(--dim); letter-spacing: .5px; }

.sess-row, .ban-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--faint);
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.sess-row .tok { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--ink); }
.sess-row .smeta { flex: 1; min-width: 0; color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ban-row .bip { flex: 1; font-family: ui-monospace, Consolas, monospace; }

.btnxs {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 8px;
  white-space: nowrap;
}

.btnxs:hover { background: rgba(255, 138, 128, .12); text-decoration: underline; }

.empty2 { color: #6f7590; font-size: 13px; margin: 6px 2px; }

/* 管理员弹窗（聊天端收到） */
.popup {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 90;
  width: min(340px, 90vw);
  background: #1a1f31;
  border: 1px solid rgba(255, 255, 255, .14);
  border-left: 4px solid #8ab4f8;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  padding: 14px 16px;
  transform: translateX(22px);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}

.popup.open { opacity: 1; transform: none; }

.popup-info { border-left-color: #8ab4f8; }
.popup-warn { border-left-color: #f0b45d; }
.popup-danger { border-left-color: #ef8383; }
.popup-critical { border-left-color: #e0564f; }

.popup-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.popup-lv { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: #8ab4f8; }
.popup-warn .popup-lv { color: #f0b45d; }
.popup-danger .popup-lv { color: #ef8383; }
.popup-critical .popup-lv { color: #e0564f; }

.popup-x { border: 0; background: transparent; color: var(--dim); font-size: 20px; line-height: 1; cursor: pointer; width: 28px; height: 28px; border-radius: 8px; }
.popup-x:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.popup-title { font-weight: 700; font-size: 15px; margin: 2px 0 6px; color: var(--ink); }
.popup-body { font-size: 13.5px; line-height: 1.7; color: #cdd2e0; word-break: break-word; margin-bottom: 12px; }
.popup-ok { width: 100%; justify-content: center; }

/* 控制台-提示表单 */
.notice-box {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--faint);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, .03);
}

.notice-row { display: flex; align-items: center; gap: 12px; }
.notice-lab { flex: 0 0 66px; font-size: 12.5px; color: var(--dim); }
select.field { color: var(--ink); }
select.field option { background: #161b2e; color: #e8e6df; }
.btnxs.ok { color: var(--amber); }
.btnxs.ok:hover { background: rgba(240, 180, 93, .12); text-decoration: underline; }

/* 全体通知横幅（从右往左飘过） */
.marquee {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 85;
  background: linear-gradient(90deg, #f0b45d, #f7d08a, #f0b45d);
  color: #241c0d;
  padding: 11px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
}

.marquee-inner {
  display: inline-block;
  white-space: nowrap;
  padding-right: 40px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .5px;
  will-change: transform;
  animation: r2l linear 12s;
}

@keyframes r2l {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}

.marquee.out { opacity: 0; transition: opacity .35s ease; }

/* ---------- 窄屏 ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 18px; padding: 22px 0 14px; }
  .scene { max-height: 240px; aspect-ratio: 16 / 7; }
  .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .tile { padding: 16px 14px; }
  .toolhead { margin: 16px 0 0; }
  .toolhead p { display: none; }
  h1 { font-size: clamp(32px, 8vw, 44px); }
}

@media (max-width: 560px) {
  .page { padding: 18px 16px 36px; }
  .card { padding: 20px 18px 16px; }
  .addrow { flex-direction: column; }
  .addrow .grow { width: 100%; flex: none; }
  .del { opacity: .5; }
  .topbar { align-items: center; }
  .hero { padding: 6px 0 4px; gap: 12px; }
  .kicker { margin-bottom: 6px; }
  h1 { font-size: clamp(30px, 10vw, 40px); letter-spacing: 1px; }
  .hero-actions { margin-top: 14px; }

  /* 功能变成紧凑的应用网格：4 列小方块，一屏内基本看完 */
  .menu-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
  .tile {
    gap: 8px;
    padding: 12px 8px;
    aspect-ratio: 1;
    justify-content: center;
    text-align: center;
    border-radius: 14px;
  }
  .tile .icon { width: 38px; height: 38px; border-radius: 12px; }
  .tile svg { width: 20px; height: 20px; }
  .tile h3 { font-size: 13px; margin: 0; letter-spacing: 0; }
  .tile p, .tile .go { display: none; }
  .toolhead { margin: 14px 0 0; }
  .toolhead h2 { font-size: 18px; }

  /* 触屏友好 */
  .btn { min-height: 44px; }
  .field { min-height: 44px; }
  .card { padding: 18px 16px 14px; }
  .today-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 18px; }
  .popup { top: 12px; right: 12px; width: min(92vw, 340px); }
  .mem-wrap, .mine-board-wrap { -webkit-overflow-scrolling: touch; }
  .notice-row { flex-wrap: wrap; }
  .notice-lab { flex: 0 0 auto; width: 52px; }
}

/* 关闭动画偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .star, .halo, .aurora { animation: none; }
  .star { opacity: .8; }
  * { transition: none !important; }
}
