/* ==========================================================================
   组件：按钮、输入、席位、阶段条、骰子、卡牌、计分带、日志、弹窗
   ========================================================================== */

/* 按钮 -------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(17, 30, 58, 0.7);
  color: var(--cream-dim);
  font-size: 13px;
  letter-spacing: 0.06em;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:hover {
  border-color: var(--gold);
  color: var(--cream);
  background: rgba(24, 40, 74, 0.9);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  min-height: 46px;
  padding: 10px 30px;
  border-color: transparent;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1b1505;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  box-shadow: 0 10px 24px rgba(201, 162, 74, 0.22);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #f0d795, #d4ad55);
  color: #14100a;
  box-shadow: 0 14px 30px rgba(201, 162, 74, 0.3);
}

.btn--ghost {
  min-height: 32px;
  padding: 5px 14px;
  font-size: 12px;
  background: transparent;
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

/* 选项片 / 声明按钮 -------------------------------------------------------- */

.seg,
.chip-btn {
  min-height: 34px;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 20, 40, 0.6);
  color: var(--muted);
  font-size: 13px;
  transition: all 0.2s var(--ease);
}

.seg:hover,
.chip-btn:hover {
  border-color: var(--gold-dim);
  color: var(--cream-dim);
}

.seg.is-active,
.chip-btn.is-active {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.14);
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.22);
}

.segmented {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 输入框 ------------------------------------------------------------------ */

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.field__row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.field__row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: rgba(5, 10, 21, 0.7);
  color: var(--cream);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.input::placeholder {
  color: var(--muted-2);
}

.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.14);
}

.input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.input.is-ai {
  border-color: var(--gold-line);
  background: rgba(201, 162, 74, 0.06);
  color: var(--gold-bright);
}

.ai-toggle {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: rgba(11, 20, 40, 0.6);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.ai-toggle:hover {
  border-color: var(--gold-dim);
  color: var(--cream-dim);
}

.ai-toggle.is-active {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.16);
  color: var(--gold-bright);
}

/* 顶部信息片 -------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 24, 48, 0.6);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.chip--strong {
  border-color: var(--gold-line);
  color: var(--gold-bright);
}

.chip--strong b {
  color: var(--gold-bright);
}

.chip--dim {
  color: var(--muted-2);
}

/* 玩家席位 ---------------------------------------------------------------- */

.seat {
  position: relative;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--seat-accent, var(--line-strong));
  border-radius: var(--radius-m);
  background: linear-gradient(180deg, rgba(16, 29, 55, 0.72), rgba(9, 16, 32, 0.82));
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.seat.is-active {
  border-color: var(--gold-line);
  border-left-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(201, 162, 74, 0.22), 0 10px 26px rgba(0, 0, 0, 0.35);
  transform: translateX(2px);
}

.seat__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seat__avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--seat-accent, var(--gold)) 55%, transparent);
  background: color-mix(in srgb, var(--seat-accent, var(--gold)) 18%, transparent);
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 13px;
  flex-shrink: 0;
}

.seat__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--cream);
}

.seat__dealer {
  flex-shrink: 0;
  padding: 1px 6px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  color: var(--gold-bright);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.seat__scoreline {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.seat__scoreline b {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1;
  color: var(--cream);
}

.seat__rounds {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.seat__round {
  display: grid;
  place-items: center;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(5, 10, 21, 0.5);
  color: var(--muted-2);
  font-size: 10px;
  font-family: var(--font-mono);
}

.seat__round.has-value {
  color: var(--gold-bright);
  border-color: var(--gold-dim);
}

.seat__meta {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.pill {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.pill--ai {
  border-color: rgba(127, 167, 201, 0.55);
  background: rgba(127, 167, 201, 0.12);
  color: #a8c8e4;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.pill--shield {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-color: rgba(212, 86, 79, 0.6);
  background: rgba(212, 86, 79, 0.14);
  color: #e46a63;
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 0 6px rgba(212, 86, 79, 0.45);
}

.pill--limit {
  border-color: rgba(224, 90, 79, 0.55);
  background: rgba(224, 90, 79, 0.1);
  color: #f0b0a8;
}

.panel-label .pill {
  margin-left: 6px;
  vertical-align: middle;
}

.mark-group {
  margin-left: auto;
  display: inline-flex;
  gap: 3px;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  color: var(--muted-2);
  font-family: var(--font-mono);
}

.mark.is-used {
  border-color: var(--gold-dim);
  background: rgba(201, 162, 74, 0.12);
  color: var(--gold);
  text-decoration: line-through;
}

/* 阶段条 ------------------------------------------------------------------ */

.steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.step {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: rgba(9, 16, 32, 0.55);
  min-width: 0;
  transition: all 0.25s var(--ease);
}

.step__num {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.step__body {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.step__body b {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step__body small {
  font-size: 10px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step.is-done {
  border-color: rgba(78, 159, 122, 0.4);
}

.step.is-done .step__num {
  color: #7fc9a6;
  border-color: rgba(78, 159, 122, 0.5);
}

.step.is-current {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.1);
  box-shadow: 0 0 18px rgba(201, 162, 74, 0.14);
}

.step.is-current .step__num {
  color: #1b1505;
  border-color: transparent;
  background: var(--gold);
}

.step.is-current .step__body b {
  color: var(--gold-bright);
}

.step.is-current .step__body small {
  color: var(--cream-dim);
}

/* 牌桌中央 ---------------------------------------------------------------- */

.table-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 12px;
  flex: 1 1 320px;
  max-height: 380px;
  min-height: 240px;
}

.dice-panel,
.played-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background:
    radial-gradient(220px 140px at 30% 10%, rgba(201, 162, 74, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(15, 27, 51, 0.7), rgba(7, 13, 27, 0.85));
  overflow: hidden;
}

.panel-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted-2);
}

.dice-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex: 1;
}

.dice-cell {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.dice-cell figcaption {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
}

.die {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  width: 82px;
  height: 82px;
  padding: 12px;
  border: 1px solid rgba(201, 162, 74, 0.5);
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(160deg, #1a2b4e, #0c1730);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 18px rgba(0, 0, 0, 0.4);
}

.die__pip {
  visibility: hidden;
  align-self: center;
  justify-self: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9b8, var(--gold));
  box-shadow: 0 0 6px rgba(228, 200, 124, 0.45);
}

.die__pip.is-on {
  visibility: visible;
}

.die.is-empty {
  border-style: dashed;
  opacity: 0.5;
}

.die.is-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.18) 0 2px, transparent 3px);
}

.played-panel {
  align-items: flex-start;
}

.played-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.slot {
  display: grid;
  place-items: center;
  width: 150px;
  height: 210px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s);
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
  padding: 8px;
}

.decl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: rgba(201, 162, 74, 0.1);
  color: var(--gold-bright);
  font-size: 11px;
  white-space: nowrap;
}

/* 卡牌 -------------------------------------------------------------------- */

.card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: var(--card-w);
  height: calc(var(--card-w) * 1.4);
  padding: 8px;
  border: 1px solid rgba(201, 162, 74, 0.65);
  border-radius: 9px;
  background: linear-gradient(160deg, #f8f1e0 0%, #e9dcc0 100%);
  color: #1b2333;
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
    border-color 0.22s var(--ease);
}

.card--red {
  color: #a8342c;
}

.card--lg {
  --card-w: 150px;
}

.card.is-interactive:hover:not([disabled]) {
  transform: translateY(-8px);
  border-color: var(--gold);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(228, 200, 124, 0.4);
}

.card.is-selected {
  transform: translateY(-10px);
  border-color: var(--gold);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(228, 200, 124, 0.55);
}

.card.is-marked {
  transform: translateY(-8px);
  border-color: #d4564f;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(212, 86, 79, 0.5);
}

.card.is-marked::after {
  content: "弃";
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c6483f;
  color: #fff;
  font-size: 11px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.card[disabled] {
  cursor: default;
  opacity: 0.42;
  filter: grayscale(0.45);
  box-shadow: none;
}

.card__corner {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1;
}

.card__corner b {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.card__corner i {
  font-style: normal;
  font-size: 12px;
}

.card__center {
  display: grid;
  place-items: center;
  font-size: calc(var(--card-w) * 0.44);
  line-height: 1;
  opacity: 0.9;
}

.card__foot {
  display: flex;
  justify-content: center;
}

.card__label {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(27, 35, 51, 0.08);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(27, 35, 51, 0.72);
  white-space: nowrap;
}

/* 计分带 ------------------------------------------------------------------ */

.bands {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.band {
  position: relative;
  padding: 8px 10px 9px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--band-tone, var(--line-strong));
  border-radius: var(--radius-s);
  background: rgba(9, 16, 32, 0.55);
  transition: all 0.25s var(--ease);
}

.band--doom { --band-tone: var(--band-doom); }
.band--safe { --band-tone: var(--band-safe); }
.band--lucky { --band-tone: var(--band-lucky); }
.band--jackpot { --band-tone: var(--band-jackpot); }
.band--bust { --band-tone: #3b1d1d; }

.band__label {
  display: block;
  font-size: 11px;
  color: var(--cream-dim);
  letter-spacing: 0.06em;
}

.band__range {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
}

.band__score {
  position: absolute;
  right: 9px;
  top: 6px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--band-tone);
}

.band--safe .band__score,
.band--bust .band__score {
  color: var(--muted);
}

.band.is-current {
  border-color: var(--gold-line);
  background: rgba(201, 162, 74, 0.08);
}

/* 行动区 ------------------------------------------------------------------ */

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: linear-gradient(180deg, rgba(16, 29, 55, 0.6), rgba(7, 13, 27, 0.8));
  text-align: center;
}

.actions__hint {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 46em;
  line-height: 1.65;
}

.actions__primary {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* AI 行动期间，中央主操作区不接受鼠标交互，避免真人误触 */
.actions__primary.is-ai-turn {
  pointer-events: none;
}

.actions__primary.is-ai-turn .btn {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.actions__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.target-btn {
  min-width: 120px;
}

.notice--reveal {
  border: 1px solid rgba(127, 167, 201, 0.4);
  background: rgba(127, 167, 201, 0.07);
  color: var(--cream-dim);
  text-align: left;
}

.notice--reveal > b {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #a8c8e4;
}

.reveal-list {
  display: grid;
  gap: 3px;
}

.reveal-list li {
  font-size: 12px;
  color: var(--cream-dim);
}

.reveal-list b {
  color: var(--cream);
  font-weight: 600;
}

.notice {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  font-size: 12px;
  text-align: left;
  line-height: 1.6;
}

.notice--todo {
  border: 1px dashed rgba(201, 162, 74, 0.5);
  background: rgba(201, 162, 74, 0.07);
  color: var(--cream-dim);
}

.notice--todo b {
  color: var(--gold-bright);
  margin-right: 4px;
}

.notice--warn {
  border: 1px solid rgba(224, 90, 79, 0.45);
  background: rgba(224, 90, 79, 0.08);
  color: #ffc9c1;
}

.notice--score {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--gold-line);
  background: rgba(201, 162, 74, 0.1);
  color: var(--cream-dim);
  text-align: center;
}

.notice--score b {
  color: var(--gold-bright);
  font-size: 15px;
  font-weight: 700;
}

.notice--score.is-bust {
  border-color: rgba(224, 90, 79, 0.5);
  background: rgba(224, 90, 79, 0.08);
}

.notice--score.is-bust b {
  color: #ff9d92;
}

.notice__aside {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted-2);
}

/* 声明选择 ---------------------------------------------------------------- */

.decl {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s);
  background: rgba(13, 24, 48, 0.5);
}

.decl__label {
  font-size: 12px;
  color: var(--cream-dim);
  margin-right: 4px;
}

/* 日志 -------------------------------------------------------------------- */

.log {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: #aeb8cb;
  border-left: 2px solid transparent;
}

.log + .log {
  border-top: 1px solid rgba(36, 53, 86, 0.4);
}

.log__round {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold-dim);
  letter-spacing: 0.06em;
}

.log__text {
  min-width: 0;
  word-break: break-word;
}

.log--round {
  border-left-color: var(--gold-dim);
  color: var(--cream-dim);
}

.log--roll {
  border-left-color: #6b88b3;
  color: #b9c6da;
}

.log--play {
  border-left-color: #b08a54;
  color: #e3d3b4;
}

.log--warn {
  border-left-color: #a04b45;
  color: #e4a8a2;
}

.log--todo {
  border-left-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(201, 162, 74, 0.04);
}

.log--ability {
  border-left-color: #8bc9a5;
  color: #cfe8da;
  background: rgba(78, 159, 122, 0.05);
}

.log--empty {
  color: var(--muted-2);
  font-style: italic;
}

/* 结算排名 ---------------------------------------------------------------- */

.ranking {
  margin-top: 26px;
  display: grid;
  gap: 8px;
}

.rank {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: rgba(11, 20, 40, 0.6);
}

.rank.is-winner {
  border-color: var(--gold-line);
  background: linear-gradient(90deg, rgba(201, 162, 74, 0.14), rgba(11, 20, 40, 0.6));
}

.rank__pos {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--muted);
  text-align: center;
}

.rank.is-winner .rank__pos {
  color: var(--gold-bright);
}

.rank__name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  font-size: 15px;
  color: var(--cream);
}

.rank__label {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank__meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.rank__crown {
  padding: 1px 7px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-size: 10px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
}

.rank__score {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--cream);
}

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

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 12, 0.78);
  backdrop-filter: blur(4px);
  animation: fade 0.2s var(--ease) both;
}

.modal__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, #0f1c36, #070d1c);
  box-shadow: var(--shadow-panel);
  animation: rise 0.25s var(--ease) both;
  overflow: hidden;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal__head h2 {
  font-size: 17px;
  letter-spacing: 0.12em;
}

.modal__close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s var(--ease);
}

.modal__close:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.modal__body {
  padding: 18px 20px 22px;
  overflow: auto;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgba(5, 10, 21, 0.4);
}

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

/* 规则速查内容 ------------------------------------------------------------ */

.help-section + .help-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.help-section h3 {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-family: var(--font-sans);
  font-weight: 600;
  margin-bottom: 10px;
}

.help-section p {
  font-size: 13px;
  color: var(--cream-dim);
  line-height: 1.8;
}

.help-list {
  display: grid;
  gap: 7px;
}

.help-list li {
  font-size: 13px;
  color: var(--cream-dim);
  line-height: 1.7;
  padding-left: 14px;
  position: relative;
}

.help-list li::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: var(--gold);
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.help-table th,
.help-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.help-table th {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.help-table td {
  color: var(--cream-dim);
}

.help-table td b {
  color: var(--cream);
}

.help-callout {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--gold-line);
  border-radius: var(--radius-s);
  background: rgba(201, 162, 74, 0.06);
  font-size: 12px;
  color: var(--cream-dim);
  line-height: 1.7;
}

.help-callout b {
  color: var(--gold-bright);
}

/* 移动端：横向滚动，避免 6 个阶段 / 5 个区间被压扁 */
@media (max-width: 860px) {
  .steps,
  .bands {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .step {
    flex: 0 0 136px;
  }

  .band {
    flex: 0 0 100px;
  }

  .table-center {
    max-height: 300px;
  }
}
