:root {
  color-scheme: dark;
  --bg: #131813;
  --panel: #1b231c;
  --surface: #242e25;
  --line: #374437;
  --muted: #a5b3a3;
  --text: #f2f5ed;
  --accent: #d1f68a;
  --accent-strong: #b9ed62;
  --red: #ed8d88;
  --radius: 18px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.08rem; font-weight: 740; }
h3 { font-size: .94rem; }
small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.shell { width: min(1180px, calc(100% - 56px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid #2a352b; }
.masthead { height: 67px; display: flex; align-items: center; gap: 38px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; letter-spacing: .12em; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 35px; border-radius: 9px; background: var(--accent); color: #223013; font-size: 24px; line-height: 1; letter-spacing: 0; transform: rotate(-7deg); }
.masthead nav { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: .9rem; }
.masthead a:hover, .nav-primary { color: var(--text); }
.connection { margin-left: auto; color: var(--muted); white-space: nowrap; font-size: .82rem; display: flex; align-items: center; gap: 7px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-strong); }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 38px 0 24px; }
.intro h1 { font-weight: 810; font-size: clamp(1.85rem, 4.1vw, 3rem); letter-spacing: -.055em; line-height: 1.15; }
.intro h1 span { color: var(--accent); }
.intro p { color: var(--muted); margin-top: 10px; font-size: .97rem; }
.quiet, .accent { border: 1px solid var(--line); border-radius: 8px; padding: 7px 13px; min-height: 38px; white-space: nowrap; background: var(--surface); font-size: .875rem; }
.quiet:hover, .text-button:hover:not(:disabled) { background: #303d30; }
.accent { background: var(--accent); color: #1e2913; border-color: var(--accent); font-weight: 750; }
.accent:hover { background: var(--accent-strong); }
.workspace { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 0; overflow: clip; }
.panel-head { display: flex; height: 61px; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 0 19px; }
.actions { display: flex; gap: 4px; }
.text-button { border: 0; background: transparent; color: var(--muted); min-height: 38px; border-radius: 7px; padding: 4px 9px; white-space: nowrap; font-size: .875rem; }
.text-button:disabled { opacity: .38; }
.entry-body, .results-body, .detail-body { padding: 16px 19px 18px; }
.slots-group + .slots-group { margin-top: 13px; }
.group-label, .picker-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.group-label strong { font-size: .9rem; }
.group-label span, .help { color: var(--muted); font-size: .82rem; }
.slots { display: flex; gap: 7px; }
.slot { height: 58px; width: 47px; background: #222b23; border: 1px dashed #566653; border-radius: 9px; display: grid; color: #94a692; place-items: center; position: relative; padding: 0; }
.slot.active { border: 1px solid var(--accent); box-shadow: 0 0 0 2px #c7ee7d25; }
.slot:disabled { opacity: .45; }
.slot:hover:not(:disabled):not(.filled) { background: #344331; }
.slot .slot-label { font-size: .74rem; white-space: nowrap; }
.slot .slot-rank { position: absolute; left: 6px; top: 3px; font-size: 1.02rem; font-weight: 800; line-height: 1; }
.slot .slot-suit { font-size: 1.55rem; margin-top: 6px; line-height: 1; }
.slot.filled { border: 1px solid #e6eadc; background: #f1f2e4; color: #232a22; }
.slot.red.filled { color: #a92e2c; }
.picker { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.picker-title { min-height: 24px; }
.picker-title .text-button { min-height: 25px; padding-block: 0; }
.suits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 7px; }
.suit { background: #202920; border: 1px solid var(--line); border-radius: 8px; min-height: 42px; color: var(--text); font-size: 1.3rem; line-height: 1; }
.suit[aria-pressed="true"] { border-color: var(--accent); background: #36472c; }
.suit.red, .rank-card.red { color: var(--red); }
.deck { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.rank-card { display: grid; place-items: center; min-height: 42px; min-width: 0; padding: 0; position: relative; background: #263327; border: 1px solid #405240; border-radius: 8px; font-size: 1rem; font-weight: 780; }
.rank-card:hover:not(:disabled) { border-color: var(--accent); background: #3a4d32; }
.rank-card:disabled { opacity: .3; }
.opponents { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 13px; }
.opponents summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 670; font-size: .9rem; }
.opponents summary span:last-child { color: var(--muted); font-size: .79rem; font-weight: 400; }
.opponents summary::before { content: '+'; order: 2; font-size: 1.05rem; color: var(--accent); }
.opponents summary span:first-child { flex: 1; }
.opponents[open] summary::before { content: '−'; }
.opponent-controls { margin-top: 12px; font-size: .85rem; }
.opponent-controls p { color: var(--muted); margin-block: 7px 12px; }
select, input { border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #151c15; padding: 8px 9px; }
.opponent-controls select { margin-left: 9px; }
.opponent-seat { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 9px; }
.opponent-seat .slot { width: 37px; height: 45px; }
.opponent-seat .slot-rank { font-size: .81rem; }
.opponent-seat .slot-suit { font-size: 1.1rem; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metrics > div { border: 1px solid var(--line); border-radius: 12px; background: #202b21; padding: 10px 12px; min-width: 0; }
.metrics span { display: block; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.metrics strong { display: block; font-size: clamp(1.26rem, 3.7vw, 2rem); white-space: nowrap; line-height: 1.35; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.metrics .metric-equity { border-color: #536641; background: #2d3c23; }
.metric-equity strong { color: var(--accent); }
.result-caption { min-height: 32px; margin: 12px 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .84rem; }
.result-caption span { color: var(--muted); text-align: right; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { font-weight: 610; }
#comparison { font-size: .9rem; }
#comparison thead th { font-size: .81rem; color: var(--muted); border-bottom: 1px solid var(--line); padding: 4px 8px 6px; white-space: nowrap; }
#comparison th, #comparison td { text-align: right; padding: 2px 8px; white-space: nowrap; }
#comparison th:first-child, #comparison td:nth-child(2), #comparison thead th:nth-child(2) { text-align: left; }
#comparison td:nth-child(2) { width: 39%; }
#comparison tbody tr { height: 34px; border-bottom: 1px solid #304031; }
#comparison tbody tr.selected { background: #2a3a24; }
#comparison tbody tr.selected td:last-child { color: var(--accent); }
#comparison tbody td:last-child { font-weight: 770; }
.person { min-height: 31px; background: transparent; border: 0; padding: 1px 7px 1px 0; white-space: nowrap; font-weight: 630; }
.person:hover { color: var(--accent); }
.bar { height: 6px; border-radius: 8px; width: 100%; background: #374637; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; width: var(--pct, 0%); background: #93b96c; transition: width 150ms ease-out; }
.selected .bar i { background: var(--accent); }
.results-help { margin-top: 9px; }
.matchup { margin-top: 11px; border-top: 1px solid var(--line); padding-top: 12px; }
.matchup h3 { font-size: 1rem; }
.matchup p { margin-top: 4px; font-size: .85rem; }
#matchup-values { color: var(--accent); font-weight: 700; }
.detail-grid, .reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.pot-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: .9rem; }
.pot-inputs input { width: 100%; display: block; margin-top: 5px; min-height: 43px; }
.pot-inputs small { white-space: nowrap; }
.pot-result { border-left: 2px solid var(--accent); background: #283824; padding: 8px 11px; margin: 12px 0; font-size: .9rem; }
.pot-result p + p, .detail-body .help + .help { margin-top: 5px; }
.pot-result strong, .draw-metrics strong { color: var(--accent); }
.draw-metrics { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; margin-block: 6px 9px; }
.draw-outs, .threats { margin-top: 9px; font-size: .86rem; }
.draw-outs summary, .threats summary { padding-block: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-block: 6px; }
.card-chip { display: inline-flex; gap: 3px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; min-width: 29px; justify-content: center; }
.card-chip.red { color: var(--red); }
.card-chip.clean { border-color: #82ae56; }
.reference { margin-top: 38px; }
.reference-heading h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
.reference-heading p { color: var(--muted); margin-top: 5px; font-size: .9rem; }
.reference-table { font-size: .88rem; }
.reference-table th, .reference-table td { padding: 11px 8px; text-align: center; }
.reference-table th:first-child { padding-left: 15px; text-align: left; }
.reference-table thead { background: var(--surface); color: var(--muted); }
.reference-table tbody tr + tr { border-top: 1px solid var(--line); }
.glossary details { padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.glossary details:first-child { padding-top: 2px; }
.glossary p { color: var(--muted); margin-top: 6px; }
footer { color: var(--muted); font-size: .82rem; margin-top: 36px; padding: 14px 0 26px; border-top: 1px solid var(--line); }
dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; color: var(--text); width: min(480px, calc(100% - 36px)); padding: 17px; }
dialog::backdrop { background: #070d08b8; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
dialog p { margin: 8px 0; color: var(--muted); font-size: .9rem; }
dialog input { width: 100%; margin: 6px 0 11px; }
.toast { position: fixed; z-index: 2; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #232d17; background: var(--accent); border-radius: 9px; padding: 8px 12px; font-size: .86rem; text-align: center; max-width: 95%; box-shadow: 0 5px 30px #0009; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); }
  .masthead { height: 54px; gap: 16px; }
  .masthead nav { gap: 11px; font-size: .83rem; }
  .brand { gap: 7px; font-size: 1rem; }
  .brand-mark { width: 27px; height: 29px; font-size: 19px; }
  .connection { font-size: .72rem; }
  .intro { padding: 19px 0 13px; gap: 5px; }
  .intro h1 { font-size: clamp(1.3rem, 6.4vw, 2rem); }
  .intro p { font-size: .8rem; margin-top: 5px; }
  .intro .quiet { padding-inline: 7px; font-size: .75rem; min-height: 36px; }
  .workspace, .detail-grid, .reference-grid { grid-template-columns: 1fr; gap: 10px; }
  .panel { border-radius: 13px; }
  .panel-head { height: 46px; padding-inline: 12px; }
  .panel-head h2 { font-size: 1rem; }
  .panel-head .quiet { min-height: 33px; padding-inline: 8px; }
  .entry-body, .results-body, .detail-body { padding: 9px 12px 11px; }
  .entry-body { display: grid; grid-template-columns: 90px minmax(0, 1fr); column-gap: 11px; }
  .entry-body > .picker, .entry-body > .opponents { grid-column: 1 / -1; }
  .slots-group + .slots-group { margin-top: 0; }
  .board-slots { gap: 5px; }
  .board-slots .slot { flex: 1; width: auto; min-width: 0; max-width: 44px; }
  .group-label { margin-bottom: 3px; }
  .group-label strong { font-size: .83rem; }
  .slot { width: 42px; height: 44px; border-radius: 7px; }
  .slot .slot-rank { font-size: .86rem; }
  .slot .slot-suit { font-size: 1.24rem; }
  .picker { margin-top: 8px; padding-top: 7px; }
  .picker.mobile-collapsed { display: none; }
  .picker-title { margin-bottom: 4px; }
  .deck, .suits { gap: 4px; }
  .rank-card, .suit { min-height: 44px; }
  .opponents { margin-top: 8px; padding-top: 7px; }
  .opponents summary { min-height: 30px; }
  .metrics { gap: 5px; }
  .metrics > div { padding: 6px 7px; }
  .metrics span { font-size: .77rem; }
  .metrics small { display: none; }
  .result-caption { margin-top: 6px; min-height: 23px; font-size: .78rem; }
  #comparison { font-size: .82rem; }
  #comparison th, #comparison td, #comparison thead th { padding-inline: 4px; }
  #comparison thead th { font-size: .75rem; }
  #comparison tbody tr { height: 29px; }
  .person { min-height: 27px; }
  #comparison td:nth-child(2) { width: 23%; }
  .results-help { margin-top: 6px; }
  .detail-grid, .reference-grid { margin-top: 10px; }
}
@media (max-width: 340px) {
  .shell { width: calc(100% - 18px); }
  .masthead { gap: 12px; }
  .intro p { font-size: .77rem; }
  #comparison td:nth-child(2) { width: 17%; }
  .reference-table { font-size: .79rem; }
}
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }
