:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #eef2f6;
  --border: #d7dee7;
  --text: #17202b;
  --muted: #5c6a7b;
  --accent: #2f6fdb;
  --accent-text: #ffffff;
  --felt-1: #2f8462;
  --felt-2: #1d5c43;
  --rail: #3a2b1f;
  --seat-bg: rgba(255, 255, 255, 0.94);
  --seat-text: #17202b;
  --cell-bg: #e7ecf1;
  --cell-text: #2b3746;

  --c-raise: #e0524a;
  --c-call: #36a874;
  --c-fold: #b9c4d0;
  --c-tie: #e2ad35;
  --c-win: #36a874;

  --g-best: #22a882;
  --g-good: #7cb342;
  --g-inacc: #d9a821;
  --g-mistake: #ef7d32;
  --g-blunder: #e0524a;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 25, 40, 0.06), 0 4px 16px rgba(15, 25, 40, 0.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e1319;
    --panel: #151c25;
    --panel-2: #1b2430;
    --border: #283444;
    --text: #e4eaf1;
    --muted: #8a97a8;
    --accent: #4d94ff;
    --felt-1: #23694e;
    --felt-2: #123a2b;
    --rail: #2a1f17;
    --seat-bg: rgba(21, 28, 37, 0.95);
    --seat-text: #e4eaf1;
    --cell-bg: #1f2a37;
    --cell-text: #c9d3de;
    --c-fold: #3a4757;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0e1319;
  --panel: #151c25;
  --panel-2: #1b2430;
  --border: #283444;
  --text: #e4eaf1;
  --muted: #8a97a8;
  --accent: #4d94ff;
  --felt-1: #23694e;
  --felt-2: #123a2b;
  --rail: #2a1f17;
  --seat-bg: rgba(21, 28, 37, 0.95);
  --seat-text: #e4eaf1;
  --cell-bg: #1f2a37;
  --cell-text: #c9d3de;
  --c-fold: #3a4757;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Segoe UI', sans-serif;
}

button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}

.boot,
.loading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--felt-1);
  color: #fff;
}
.spacer {
  flex: 1;
}
.session {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.btn,
.chip-btn,
.icon-btn,
.game-select {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}
.btn:hover,
.chip-btn:hover,
.icon-btn:hover {
  border-color: var(--accent);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.btn-danger {
  color: var(--g-blunder);
}
.icon-btn {
  padding: 6px 10px;
  line-height: 1;
}
.focus-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip-btn {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 999px;
}
.chip-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* ---------- 布局 ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 1fr);
  gap: 16px;
  padding: 16px;
  max-width: 1560px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 1240px) {
  .session {
    display: none;
  }
}
@media (max-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }
}

.left,
.right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.left {
  position: relative;
}
.left.is-loading > *:not(.loading-overlay) {
  opacity: 0.45;
}
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 600;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.error {
  grid-column: 1 / -1;
  background: var(--panel);
  border: 1px solid var(--g-blunder);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  white-space: pre-wrap;
}

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

.table-wrap {
  padding: 10px 8px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stage {
  position: relative;
  aspect-ratio: 16 / 9.4;
}
.felt {
  position: absolute;
  inset: 11% 9% 13%;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, var(--felt-1) 0%, var(--felt-2) 78%);
  border: 10px solid var(--rail);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35);
}
.felt-center {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
}
.pot {
  font-weight: 700;
  font-size: 15px;
  background: rgba(0, 0, 0, 0.28);
  padding: 2px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pot-units {
  font-weight: 400;
  opacity: 0.8;
}
.board {
  display: flex;
  gap: 4px;
}
.board-empty {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  letter-spacing: 2px;
}
.texture {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(62px, 14.5%, 112px);
  background: var(--seat-bg);
  color: var(--seat-text);
  border: 1px solid var(--border);
  border-top: 3px solid var(--pc);
  border-radius: 8px;
  padding: 2px 6px 3px;
  text-align: center;
  font-size: 11px;
  line-height: 1.35;
  box-shadow: var(--shadow);
  z-index: 1;
}
.seat-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
}
.seat-pos {
  font-weight: 700;
  font-size: 12px;
}
.seat-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.seat-stack {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.seat-act {
  font-weight: 600;
  color: var(--accent);
}
.seat-folded {
  opacity: 0.42;
}
.seat-hero {
  border: 2px solid var(--accent);
  border-top: 3px solid var(--accent);
  width: clamp(84px, 17%, 130px);
  z-index: 2;
}
.seat-hero .seat-name {
  color: var(--accent);
  font-weight: 700;
}
.hero-cards {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: -40px;
  margin-bottom: 3px;
}
.chip {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #f6d36b;
  color: #3b2a00;
  border: 2px dashed #b8901c;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

/* 实战模拟 */
.seat-active {
  box-shadow: 0 0 0 3px var(--accent), var(--shadow);
}
.seat-won {
  border-color: var(--g-best);
  box-shadow: 0 0 0 2px var(--g-best), var(--shadow);
}
.bot-cards {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: -22px;
  margin-bottom: 2px;
}
.card.card-back {
  background: repeating-linear-gradient(45deg, #2f5fb3 0 4px, #24498c 4px 8px);
  border-color: #1b3566;
}
.dealer-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  color: #222;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  z-index: 1;
}
.play-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.play-result.win {
  --gc: var(--g-best);
}
.play-result.lose {
  --gc: var(--g-blunder);
}
.play-result {
  --gc: var(--muted);
}
.action-bar .options {
  margin-top: 8px;
}
.custom-raise {
  margin: 8px 0 0;
}
.raise-input {
  width: 110px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 7px;
  padding: 5px 8px;
}
.play-prefs {
  margin: 0;
}
.mode-seg .chip-btn {
  font-weight: 600;
}
.hh-row {
  width: 100%;
  display: grid;
  grid-template-columns: 52px 1fr auto 64px;
  gap: 8px;
  align-items: center;
  text-align: left;
  border: none;
  background: none;
  padding: 5px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
}
.hh-row:hover {
  background: var(--panel-2);
}
.hh-no,
.hh-cards {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hh-net {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hh-row.win .hh-net {
  color: var(--g-best);
}
.hh-row.lose .hh-net {
  color: var(--g-blunder);
}

/* 账号 */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  font-size: 18px;
  margin: 14px 0 12px;
}
.auth-card .btn-primary {
  padding: 8px 12px;
}
.auth-card a {
  color: var(--accent);
  margin-left: 4px;
}
.auth-error {
  color: var(--g-blunder);
  font-size: 13px;
}
.account {
  position: relative;
}
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--g-best);
}
.sync-pending,
.sync-syncing {
  background: var(--g-inacc);
}
.sync-error {
  background: var(--g-blunder);
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 170px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 10;
}
.menu-head {
  padding: 6px 8px 8px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.menu-item:hover {
  background: var(--panel-2);
}
.btn-sm {
  padding: 3px 8px;
  font-size: 12px;
}
.table-scroll {
  overflow-x: auto;
}
.admin-users td,
.admin-users th {
  white-space: nowrap;
}
.clickable {
  cursor: pointer;
}
.clickable:hover {
  background: var(--panel-2);
}
.row-disabled {
  opacity: 0.55;
}
.detail-row td {
  background: var(--panel-2);
}
.user-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 2px;
}
.user-detail .grid-table {
  margin: 0;
  max-width: 520px;
}
.pos {
  color: var(--g-best);
}
.neg {
  color: var(--g-blunder);
}
.codes {
  background: var(--panel-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0 0 8px;
}
.invite-result {
  margin: 10px 0;
}

/* 牌谱记录（手机优先，单手点按） */
.layout-single {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}
.recorder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.rec-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.rec-top .tabs {
  margin: 0;
}
.rec-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rec-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rec-no {
  font-weight: 700;
}
.rec-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.rec-stage {
  aspect-ratio: 16 / 8.5;
}
.rec-seat .seat-act {
  color: var(--text);
}
.rec-pad {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rec-prompt {
  font-size: 15px;
}
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.rec-opt {
  min-height: 54px;
}
.rec-fold .opt-label {
  color: var(--muted);
}
.rec-allin .opt-label {
  color: var(--g-blunder);
}
.rec-sizes .rec-opt {
  min-height: 48px;
}
.rec-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 8px;
}
.rec-actions .btn {
  min-height: 44px;
}
.rec-lines {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.card-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cp-selected {
  display: flex;
  gap: 4px;
  min-height: 34px;
  align-items: center;
}
.cp-ranks {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cp-suits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.cp-btn {
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.cp-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.cp-btn:disabled {
  opacity: 0.3;
}
.cp-suit {
  font-size: 22px;
  background: #fdfdfd;
}
.rec-seats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rec-seat-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 0.8fr) auto auto;
  gap: 6px;
  align-items: center;
}
.rec-seat-row input,
.rec-seat-row select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 7px;
  padding: 6px 6px;
  min-width: 0;
}
.rec-seat-row .check {
  padding: 0;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .rec-seat-row {
    grid-template-columns: 36px 1fr 1fr;
  }
  .rec-seat-row input[type='number'] {
    grid-column: 2;
  }
}
.sd-block {
  margin: 2px 0 12px;
}

/* 整手评分 */
.hand-score {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--gc);
  font-weight: 700;
  font-size: 12px;
}
.hand-score b {
  font-variant-numeric: tabular-nums;
}
.hand-score-big b {
  font-size: 20px;
}
.hand-score-big {
  font-size: 14px;
}
.verdict-score {
  margin-left: 10px;
  font-weight: 600;
  font-size: 13px;
}
.rv-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 4px;
}

/* 实战复盘 */
.review {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rv {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.rv-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 13px;
}
.rv-grade {
  font-weight: 800;
  color: var(--gc);
}
.rv-title {
  font-weight: 600;
}
.rv-pick {
  color: var(--muted);
}
.rv-ctx {
  margin-bottom: 6px;
}
.rv-allin {
  font-size: 13px;
  background: var(--panel-2);
  border-radius: 8px;
  padding: 6px 10px;
}
.all-cards {
  margin-bottom: 10px;
}
.ac-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.ac {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.ac-pos {
  font-weight: 700;
  min-width: 46px;
}
.ac-cards {
  display: inline-flex;
  gap: 2px;
}
.ac-folded .ac-cards {
  opacity: 0.5;
}
.ac-hero .ac-pos {
  color: var(--accent);
}
.hh-detail {
  padding: 6px 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hh-grade {
  font-weight: 700;
  font-size: 12px;
}

/* 折线图 */
.lc-wrap {
  position: relative;
  margin-bottom: 12px;
}
.lc {
  width: 100%;
  height: auto;
  display: block;
}
.lc-grid {
  stroke: var(--border);
  stroke-width: 1;
}
.lc-zero {
  stroke: var(--muted);
  stroke-width: 1;
}
.lc-axis {
  fill: var(--muted);
  font-size: 11px;
}
.lc-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}
.lc-dot {
  fill: var(--accent);
  stroke: var(--panel);
  stroke-width: 2;
}
.lc-end {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.lc-cross {
  stroke: var(--muted);
  stroke-width: 1;
}
.lc-tip {
  position: absolute;
  top: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  box-shadow: var(--shadow);
  pointer-events: none;
  white-space: nowrap;
}

/* 扑克牌（四色） */
.card {
  background: #fdfdfd;
  border: 1px solid #c9ced6;
  border-radius: 5px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.card .suit {
  font-size: 0.85em;
}
.card-sm {
  width: 24px;
  height: 32px;
  font-size: 12px;
}
.card-md {
  width: 34px;
  height: 46px;
  font-size: 16px;
}
.card-lg {
  width: 38px;
  height: 52px;
  font-size: 18px;
}
.suit-0 {
  color: #1d232b;
}
.suit-1 {
  color: #d23636;
}
.suit-2 {
  color: #2366d1;
}
.suit-3 {
  color: #23914a;
}

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

.question,
.panel-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.q-head {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.badge {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
}
.badge-soft {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--pc);
}
.q-text {
  font-size: 15px;
  font-weight: 600;
}
.history {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 64px;
  padding: 10px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.opt:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.opt .kbd {
  position: absolute;
  top: 5px;
  left: 7px;
  font-size: 11px;
  color: var(--muted);
}
.opt-label {
  font-weight: 700;
  font-size: 15px;
}
.opt-detail {
  font-size: 12px;
  color: var(--muted);
}
.opt-done {
  cursor: default;
  border-color: var(--gc);
  border-width: 1px 1px 4px;
}
.opt-chosen {
  outline: 2px solid var(--gc);
  outline-offset: 1px;
}
.opt-best .opt-label::before {
  content: '★ ';
  color: var(--g-best);
}
.opt-ev {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

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

.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.verdict {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 6px solid var(--gc);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.verdict-grade {
  font-size: 22px;
  font-weight: 800;
  color: var(--gc);
  min-width: 70px;
}
.verdict-body {
  flex: 1;
  min-width: 200px;
}
.verdict-line {
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.score {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.verdict-sub {
  font-size: 13px;
  color: var(--muted);
}
.block-title {
  font-weight: 700;
  font-size: 13px;
  margin: 2px 0 8px;
}
.evchart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.evrow {
  display: grid;
  grid-template-columns: minmax(80px, 110px) minmax(60px, 1fr) minmax(86px, auto) 52px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 6px;
}
.evrow-chosen {
  background: var(--panel-2);
}
.ev-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-track {
  position: relative;
  height: 10px;
  background: var(--panel-2);
  border-radius: 999px;
}
.ev-zero {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: var(--muted);
}
.ev-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  min-width: 2px;
}
.ev-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.ev-units {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
.ev-grade {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
}
.details {
  display: grid;
  gap: 10px;
}
.detail-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-title b {
  color: var(--text);
}
table.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.kv th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  width: 108px;
  vertical-align: top;
  padding: 3px 8px 3px 0;
  white-space: nowrap;
}
.kv td {
  padding: 3px 0;
}
.reveal-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}
.notes summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.notes ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}
.hint p {
  margin: 0 0 10px;
}

.grade-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  margin-bottom: 8px;
}
.gl,
.lg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.gl i,
.lg i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* ---------- 范围网格 ---------- */

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tab {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.range-title {
  font-size: 13px;
  margin-bottom: 6px;
}
.rgrid {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.rc {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(7px, 0.75vw, 11px);
  font-weight: 600;
  background-color: var(--cell-bg);
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  white-space: nowrap;
}
.rc-empty {
  color: var(--cell-text);
  text-shadow: none;
  opacity: 0.55;
  font-weight: 400;
}
@media (max-width: 980px) {
  .rc {
    font-size: clamp(6px, 2.1vw, 11px);
  }
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  margin-top: 6px;
}
.lg-note {
  color: var(--muted);
}

/* ---------- 模态框与表单 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 12px;
  z-index: 20;
  overflow: auto;
}
.modal {
  width: 100%;
  max-width: 720px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.modal-wide {
  max-width: 1100px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0;
  font-size: 17px;
}
.modal-body {
  padding: 14px 16px 18px;
}
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
}
.field-help {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.field input[type='text'],
.field input[type='number'],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 7px;
  padding: 5px 8px;
}
.field input[type='color'] {
  width: 56px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: none;
  padding: 2px;
}
.num {
  display: flex;
  align-items: center;
  gap: 4px;
}
.num .unit {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
  margin: 0;
}
.group legend {
  font-weight: 700;
  font-size: 13px;
  padding: 0 6px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 4px 0;
}
.param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px 14px;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.profiles {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 760px) {
  .profiles {
    grid-template-columns: minmax(0, 1fr);
  }
}
.plist {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plist-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 0 8px;
}
.prow {
  display: grid;
  grid-template-columns: 12px 1fr 64px;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.prow:hover {
  background: var(--panel-2);
}
.prow.active {
  border-color: var(--accent);
  background: var(--panel-2);
}
.prow input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 6px;
  padding: 3px 6px;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.prow-name {
  font-size: 13px;
  font-weight: 600;
}
.plist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.peditor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prow-fields {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

/* ---------- 统计 ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.kpi {
  background: var(--panel-2);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.kpi-v {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.kpi-l {
  font-size: 12px;
  color: var(--muted);
}
.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}
.grid-table th,
.grid-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.grid-table th {
  color: var(--muted);
  font-weight: 600;
}
.stats {
  overflow-x: auto;
}
.seg {
  display: flex;
  gap: 4px;
}
.gdist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.gd-row {
  display: grid;
  grid-template-columns: 56px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.gd-track {
  height: 12px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}
.gd-bar {
  height: 100%;
  border-radius: 999px;
}
.gd-n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .stage {
    aspect-ratio: 4 / 3.3;
  }
  .seat {
    font-size: 10px;
    padding: 1px 3px 2px;
  }
  .seat-name {
    display: none;
  }
  .seat-hero .seat-name {
    display: block;
  }
  .card-lg {
    width: 30px;
    height: 42px;
    font-size: 15px;
  }
  .card-md {
    width: 26px;
    height: 36px;
    font-size: 13px;
  }
  .hero-cards {
    margin-top: -28px;
  }
  .evrow {
    grid-template-columns: minmax(64px, 90px) minmax(40px, 1fr) auto 46px;
    gap: 6px;
  }
}
