/* ============================================================
   计数排序扑克牌课堂 — 样式
   深色桌布 + 拟物白卡 + 黄光计数 + 完成弱绿光
   ============================================================ */

:root {
  --felt-0: #07100e;
  --felt-1: #0c1a17;
  --felt-2: #102521;
  --line: rgba(255, 255, 255, .10);
  --text: #e8efec;
  --muted: rgba(232, 239, 236, .52);
  --gold: #ffd454;
  --gold-soft: rgba(255, 212, 84, .55);
  --red: #c8352f;
  --ink: #1b1b22;
  --green: #6ee1a0;
  --card-w: 76px;
  --card-h: 104px;
  --radius: 14px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(1200px 700px at 50% -10%, #16302a 0%, var(--felt-1) 45%, var(--felt-0) 100%);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::after {
  /* 桌布细纹 */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

/* ---------------- 登录 ---------------- */

.login-screen {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 380px;
  padding: 34px 30px 28px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(24, 44, 39, .92), rgba(11, 22, 19, .96));
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: rise .5s cubic-bezier(.2, .8, .2, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.login-brand .spade {
  font-size: 26px;
  color: var(--gold);
  text-shadow: 0 0 18px var(--gold-soft);
}

.login-brand h1 {
  font-size: 21px;
  margin: 0;
  letter-spacing: .04em;
  font-weight: 700;
}

.login-sub {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .02em;
}

.field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px 2px;
  letter-spacing: .08em;
}

.name-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.name-input:focus {
  border-color: rgba(255, 212, 84, .55);
  box-shadow: 0 0 0 3px rgba(255, 212, 84, .10);
}

.code-boxes {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.code-boxes input {
  width: 56px;
  height: 62px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  background: rgba(0, 0, 0, .30);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  caret-color: var(--gold);
}

.code-boxes input:focus {
  border-color: rgba(255, 212, 84, .6);
  box-shadow: 0 0 0 3px rgba(255, 212, 84, .10);
  background: rgba(255, 212, 84, .05);
}

.login-submit {
  width: 100%;
  height: 50px;
  border-radius: 13px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #211a06;
  background: linear-gradient(180deg, #ffe07a, #f5c33c);
  box-shadow: 0 8px 22px rgba(245, 195, 60, .25), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .12s, box-shadow .18s;
}

.login-submit:hover { box-shadow: 0 10px 28px rgba(245, 195, 60, .35); }
.login-submit:active { transform: translateY(1px) scale(.995); }
.login-submit[disabled] { opacity: .55; cursor: default; }

.login-error {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13px;
  color: #ff8f7d;
  text-align: center;
}

.login-hint {
  margin: 18px 0 0;
  font-size: 11.5px;
  color: rgba(232, 239, 236, .32);
  text-align: center;
  line-height: 1.7;
}

/* ---------------- 主壳 ---------------- */

.shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.topbar {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 14, 12, .45);
  backdrop-filter: blur(6px);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: .04em;
}

.topbar .brand .spade { color: var(--gold); font-size: 17px; text-shadow: 0 0 14px var(--gold-soft); }

.topbar .spacer { flex: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
  white-space: nowrap;
}

.chip b { color: var(--text); font-weight: 600; }

.chip.live::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6ee1a0;
  box-shadow: 0 0 10px rgba(110, 225, 160, .8);
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

.btn-ghost {
  height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: color .16s, border-color .16s, background .16s;
}

.btn-ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .04); }

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  overflow: hidden;
}

.page-enter { animation: pageIn .34s cubic-bezier(.2, .8, .2, 1); }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px) scale(.995); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 学生准备页 ---------------- */

.ready-wrap { display: grid; place-items: center; width: 100%; }

.ready-card {
  width: 460px;
  padding: 42px 40px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(26, 48, 42, .9), rgba(10, 21, 18, .95));
  border: 1px solid var(--line);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .5);
}

.ready-avatar {
  width: 84px; height: 84px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 700;
  color: #1e1808;
  background: linear-gradient(180deg, #ffe487, #eec23c);
  box-shadow: 0 10px 30px rgba(238, 194, 60, .28);
}

.ready-card h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: .03em; }
.ready-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.8; }

.ready-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: #bfefd3;
  background: rgba(110, 225, 160, .08);
  border: 1px solid rgba(110, 225, 160, .22);
}

.ready-dot i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #6ee1a0;
  box-shadow: 0 0 10px rgba(110, 225, 160, .9);
  animation: breathe 1.6s ease-in-out infinite;
  font-style: normal;
}

/* ---------------- 牌桌 ---------------- */

.board {
  width: 1180px;
  padding: 20px 24px 22px;
  border-radius: 20px;
  background:
    radial-gradient(900px 400px at 50% 0%, rgba(52, 110, 92, .22), transparent 70%),
    linear-gradient(180deg, #14302a, #0d211d);
  border: 1px solid rgba(120, 200, 170, .13);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
  user-select: none;
}

.board.mirror { box-shadow: none; }

.slots {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.slot {
  width: var(--card-w);
  flex: 0 0 var(--card-w);
  position: relative;
}

.slot-cap {
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
}

.slot-rank {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .50);
  letter-spacing: .06em;
  line-height: 1.35;
  transition: color .25s;
}

.slot.done .slot-rank { color: rgba(255, 212, 84, .9); }

.slot-count {
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 212, 84, .85), 0 0 26px rgba(255, 212, 84, .35);
  transition: transform .18s cubic-bezier(.3, 1.7, .5, 1), opacity .25s;
  font-variant-numeric: tabular-nums;
}

.slot-count.zero { opacity: .22; text-shadow: none; color: rgba(255, 255, 255, .6); }
.slot-count.bump { transform: scale(1.55); }

.slot-pocket {
  position: relative;
  width: var(--card-w);
  height: 132px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, .15);
  background: rgba(0, 0, 0, .16);
  transition: border-color .18s, background .18s, box-shadow .18s;
}

.slot-pocket.hover {
  border-color: rgba(255, 212, 84, .75);
  background: rgba(255, 212, 84, .07);
  box-shadow: 0 0 0 1px rgba(255, 212, 84, .35), 0 0 26px rgba(255, 212, 84, .18);
}

.slot-pocket.wrong {
  border-color: rgba(255, 110, 90, .8);
  background: rgba(255, 90, 70, .08);
}

.board-bottom {
  display: flex;
  align-items: flex-end;
  gap: 46px;
  margin-top: 26px;
  padding-left: 6px;
  min-height: 214px;
}

.deck-wrap { position: relative; }

.deck {
  position: relative;
  width: var(--card-w);
}

.deck-label {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .04em;
  text-align: center;
  width: var(--card-w);
}

.deck-label b { color: var(--gold); font-weight: 700; }

.board-notes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;
}

.note-line {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .02em;
  line-height: 1.7;
}

.note-line b { color: rgba(255, 212, 84, .9); font-weight: 600; }

.rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 640px;
}

.rule-pill {
  font-size: 12px;
  color: rgba(232, 239, 236, .62);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  letter-spacing: .02em;
}

/* ---------------- 扑克牌 ---------------- */

.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 9px;
  position: relative;
  background: linear-gradient(168deg, #fffefa 0%, #f6f3e8 62%, #ece8da 100%);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, .45),
    inset 0 0 0 1px rgba(30, 30, 30, .14),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  color: var(--ink);
  font-weight: 800;
  overflow: hidden;
  will-change: transform;
}

.card.red { color: var(--red); }
.card.black { color: var(--ink); }

.card .corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: .96;
  font-size: 15px;
  letter-spacing: -.02em;
}

.card .corner i { font-style: normal; font-size: 12px; margin-top: 1px; }
.card .corner.tl { top: 7px; left: 7px; }
.card .corner.br { bottom: 7px; right: 7px; transform: rotate(180deg); }

.card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 38px;
  opacity: .92;
}

.card.ten .corner { font-size: 13px; }
.card.ten .pip { font-size: 33px; }

.card.top { cursor: grab; }
.card.top:active { cursor: grabbing; }

.card.dragging {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform-origin: center;
  box-shadow: 0 26px 50px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .12);
  filter: drop-shadow(0 0 18px rgba(255, 212, 84, .25));
}

.card.back {
  background: linear-gradient(180deg, #1b4438 0%, #14352c 62%, #2a6152 100%);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(140, 210, 180, .18), inset 0 -1px 0 rgba(190, 235, 215, .38);
}

/* 槽内堆叠 */
.slot-pocket .card {
  position: absolute;
  left: 0;
}

/* 牌堆 */
.deck .card {
  position: absolute;
  left: 0;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .5),
    inset 0 0 0 1px rgba(30, 30, 30, .14),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}

.deck::after {
  content: "";
  position: absolute;
  left: 2px; right: 2px; bottom: -8px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
  pointer-events: none;
}

/* ---------------- 学生游戏页 ---------------- */

.student-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.stat-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stat b { font-size: 16px; color: var(--text); font-weight: 700; }
.stat.warn b { color: #ff9a86; }
.stat.done b { color: var(--green); }

/* ---------------- 老师工具栏 ---------------- */

.teacher-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.view-body {
  width: 100%;
  display: flex;
  justify-content: center;
  min-height: 0;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
}

.view-tabs button {
  height: 32px;
  padding: 0 15px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  transition: color .16s, background .16s;
}

.view-tabs button:hover { color: var(--text); }

.view-tabs button.on {
  color: #211a06;
  background: linear-gradient(180deg, #ffe07a, #f0bf38);
  font-weight: 700;
}

.view-tabs select {
  height: 32px;
  max-width: 150px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

/* ---------------- 总览四宫格 ---------------- */

.overview { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 1560px;
  height: min(74vh, 760px);
}

.panel {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: linear-gradient(180deg, rgba(22, 42, 37, .85), rgba(9, 19, 16, .92));
  overflow: hidden;
  transition: border-color .3s, box-shadow .3s;
}

.panel-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font-size: 13px;
  background: linear-gradient(180deg, rgba(6, 14, 12, .85), rgba(6, 14, 12, 0));
  z-index: 3;
  pointer-events: none;
}

.panel-head .pname { font-weight: 700; letter-spacing: .02em; }
.panel-head .pmeta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.panel-head .pspacer { flex: 1; }

.panel-head .pdone {
  color: #a6f0c4;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(110, 225, 160, .12);
  border: 1px solid rgba(110, 225, 160, .3);
}

.panel.offline { opacity: .55; }

.panel.done {
  border-color: rgba(110, 225, 160, .5);
  animation: completeGlow 2.6s ease-in-out infinite;
}

@keyframes completeGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(110, 225, 160, .30), 0 0 28px rgba(110, 225, 160, .14); }
  50% { box-shadow: 0 0 0 3px rgba(110, 225, 160, .55), 0 0 44px rgba(110, 225, 160, .30); }
}

.panel-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .16);
  font-size: 13px;
  letter-spacing: .1em;
}

.panel-body {
  position: absolute;
  inset: 40px 10px 10px 10px;
  overflow: hidden;
}

.panel-solo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(72vh, 720px);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 42, 37, .7), rgba(9, 19, 16, .85));
  position: relative;
  overflow: hidden;
}

.panel-solo .board-scale { position: absolute; transform-origin: center center; left: 50%; top: 50%; }

.panel-solo-stats {
  position: absolute;
  top: 16px; left: 18px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.group-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.group-tabs button {
  height: 26px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
}

.group-tabs button.on { color: #211a06; background: var(--gold); font-weight: 700; border-color: transparent; }

/* ---------------- 老师准备页 ---------------- */

.roster {
  width: 720px;
  max-height: 70vh;
  overflow: auto;
  padding: 26px 28px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 42, 37, .78), rgba(9, 19, 16, .9));
  box-shadow: 0 26px 70px rgba(0, 0, 0, .45);
}

.roster h2 { margin: 0 0 4px; font-size: 19px; }
.roster .sub { margin: 0 0 20px; color: var(--muted); font-size: 12.5px; }

.roster-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }

.roster-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .022);
  font-size: 14px;
}

.roster-row .idx {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 12px;
  color: #211a06;
  background: var(--gold);
  font-weight: 700;
}

.roster-row .rname { font-weight: 600; }
.roster-row .rstate { margin-left: auto; font-size: 12px; color: var(--muted); }
.roster-row .rstate.on { color: #9fe8bd; }

.roster-empty {
  padding: 30px 0 36px;
  text-align: center;
  color: rgba(255, 255, 255, .28);
  font-size: 13px;
  line-height: 2;
}

.primary-btn {
  height: 46px;
  padding: 0 30px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #211a06;
  background: linear-gradient(180deg, #ffe07a, #f2c13a);
  box-shadow: 0 10px 26px rgba(242, 193, 58, .22);
  transition: transform .12s, box-shadow .18s, opacity .2s;
}

.primary-btn:hover { box-shadow: 0 12px 32px rgba(242, 193, 58, .32); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn[disabled] { opacity: .4; cursor: default; box-shadow: none; }

.roster-actions { display: flex; align-items: center; gap: 14px; }
.roster-actions .tip { font-size: 12.5px; color: var(--muted); }

/* ---------------- 汇总页 ---------------- */

.summary {
  width: min(1080px, 92vw);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  padding: 26px 28px 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 42, 37, .8), rgba(9, 19, 16, .92));
  box-shadow: 0 26px 70px rgba(0, 0, 0, .45);
}

.summary-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.summary-head h2 { margin: 0; font-size: 20px; letter-spacing: .03em; }
.summary-head .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.summary-head .spacer { flex: 1; }

.summary-scroll { overflow: auto; border-radius: 12px; border: 1px solid var(--line); }

table.result {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

table.result th {
  position: sticky;
  top: 0;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 11px 16px;
  background: #10221e;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.result td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  white-space: nowrap;
}

table.result tr:last-child td { border-bottom: 0; }
table.result tr.done td:first-child { color: #b6f2ce; }
table.result .muted { color: var(--muted); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.badge.ok { color: #a6f0c4; border-color: rgba(110, 225, 160, .35); background: rgba(110, 225, 160, .09); }
.badge.no { color: #ffb3a3; border-color: rgba(255, 140, 120, .3); background: rgba(255, 120, 100, .07); }

.summary-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.summary-actions .spacer { flex: 1; }

.danger-btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13px;
  color: #ffb4a6;
  border: 1px solid rgba(255, 140, 120, .35);
  background: rgba(255, 120, 100, .07);
  transition: background .16s, border-color .16s;
}

.danger-btn:hover { background: rgba(255, 120, 100, .14); border-color: rgba(255, 140, 120, .55); }

/* ---------------- 翻页器 ---------------- */

.pager {
  position: fixed;
  right: 26px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 40;
}

.pager .dots { display: flex; gap: 6px; }

.pager .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  transition: background .2s, transform .2s;
}

.pager .dot.on { background: var(--gold); transform: scale(1.25); box-shadow: 0 0 10px var(--gold-soft); }

.nav-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 19px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(10, 20, 17, .72);
  backdrop-filter: blur(8px);
  transition: background .16s, border-color .16s, opacity .2s, transform .12s;
}

.nav-btn:hover:not([disabled]) { border-color: rgba(255, 212, 84, .5); background: rgba(30, 48, 43, .9); }
.nav-btn:active:not([disabled]) { transform: scale(.94); }
.nav-btn[disabled] { opacity: .22; cursor: default; }

/* ---------------- 弹窗 ---------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(2, 7, 6, .62);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 440px;
  padding: 26px 26px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(180deg, #1a332c, #0d1d19);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: rise .24s cubic-bezier(.2, .8, .2, 1);
}

.modal h3 { margin: 0 0 10px; font-size: 16.5px; }
.modal p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.modal ul { margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; max-height: 220px; overflow: auto; }
.modal li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; padding: 9px 12px; border-radius: 9px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
}
.modal li .prog { margin-left: auto; color: var(--gold); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------- 烟花 ---------------- */

#fireworks {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  display: none;
}

#fireworks.on { display: block; }

.success-banner {
  position: fixed;
  left: 50%;
  top: 9%;
  transform: translateX(-50%);
  z-index: 320;
  text-align: center;
  pointer-events: none;
  animation: popIn .5s cubic-bezier(.2, 1.4, .4, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: translateX(-50%) scale(.8); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.success-banner .big {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff6d6;
  text-shadow: 0 0 26px rgba(255, 212, 84, .8), 0 0 70px rgba(255, 180, 60, .5);
}

.success-banner .small {
  margin-top: 8px;
  font-size: 14px;
  color: rgba(232, 239, 236, .7);
  letter-spacing: .12em;
}

.success-actions {
  position: fixed;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  z-index: 320;
  display: flex;
  gap: 10px;
}

/* ---------------- 结束卡 ---------------- */

.ended-card {
  width: 420px;
  padding: 40px 36px;
  border-radius: 22px;
  text-align: center;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 48, 42, .88), rgba(10, 21, 18, .94));
}

.ended-card h2 { margin: 0 0 10px; font-size: 20px; }
.ended-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.9; }

.empty-hint { color: rgba(255, 255, 255, .28); font-size: 13.5px; letter-spacing: .08em; }

/* ---------------- 小工具 ---------------- */

.hidden { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1280px) {
  .board { transform: scale(.92); transform-origin: top center; }
}
