:root {
  --ink: #162c29;
  --muted: #536961;
  --green: #145941;
  --line: #d7e1da;
  --paper: #fff;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #f5f7f3;
  font-synthesis: none;
  line-height: 1.55;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--green); }
button, input, textarea, select { font: inherit; color: inherit; }
a, button, select, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #408ac0; outline-offset: 3px; }
.skip { position: absolute; z-index: 5; background: white; padding: .6rem; transform: translateY(-150%); }
.skip:focus { transform: translateY(0); }
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead-inner, main { max-width: 1184px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 52px); }
.masthead-inner { display: flex; align-items: center; min-height: 74px; gap: clamp(16px, 4vw, 56px); }
.brand { flex: none; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 780; letter-spacing: .03em; text-decoration: none; color: var(--ink); }
.mark { display: flex; align-items: end; gap: 3px; padding: 8px; width: 34px; height: 34px; background: #164f40; border-radius: 8px; }
.mark i { flex: 1; height: 40%; background: #beedba; border-radius: 1px; }
.mark i:nth-child(2) { height: 70%; }
.mark i:last-child { height: 100%; }
nav { display: flex; align-items: stretch; align-self: stretch; gap: clamp(14px, 3vw, 32px); }
nav a { align-content: center; padding-block: 10px; border-bottom: 3px solid transparent; margin-top: 3px; color: var(--muted); text-decoration: none; white-space: nowrap; font-weight: 600; font-size: .92rem; }
nav a[aria-current="page"] { color: var(--green); border-color: var(--green); }
#account { margin-left: auto; text-align: end; }
button, .button { display: inline-flex; justify-content: center; align-items: center; padding: 8px 15px; min-height: 42px; border: 1px solid #becdc3; border-radius: 7px; background: var(--paper); color: var(--green); cursor: pointer; font-weight: 650; font-size: .89rem; text-decoration: none; }
button:hover, .button:hover { background: #edf4ed; }
.primary { border-color: var(--green); background: var(--green); color: white; }
.primary:hover { background: #0e4633; }
button:disabled { color: #69766c; background: #edf1ec; border-color: #d6dfd6; cursor: default; }
main { padding-block: clamp(26px, 4vw, 48px) 64px; }
.page-head, .panel-head, .list-row, .actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.page-head { align-items: end; margin-bottom: 24px; }
h1 { font-size: clamp(2rem, 3.8vw, 2.8rem); line-height: 1.22; letter-spacing: -.045em; }
.page-head p { margin-top: 8px; color: var(--muted); }
h2 { font-size: 1.14rem; line-height: 1.42; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
label { display: grid; gap: 6px; font-weight: 650; font-size: .91rem; }
input, select, textarea { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #acbfb2; border-radius: 6px; background: white; font-weight: normal; }
select { padding-right: 24px; }
.season-picker { max-width: 100%; min-width: 160px; color: var(--muted); font-size: .78rem; }
.season-picker select { color: var(--ink); }
.overview, .workspace { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; margin-bottom: 22px; }
.panel, .season-card { min-width: 0; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.season-card { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: start; justify-content: space-between; gap: 12px; background: linear-gradient(115deg,#153f35,#205b47); color: #fff; border-color: #174b3d; padding: clamp(20px, 3vw, 32px); }
.season-card .kicker { color: #cce8ca; font-weight: 650; font-size: .83rem; }
.season-card h2 { font-size: clamp(1.55rem, 2.8vw, 2rem); overflow-wrap: anywhere; }
.season-facts { display: flex; flex-wrap: wrap; gap: 14px 36px; }
dt, .hint, .as-of, .list-row small { font-size: .83rem; color: var(--muted); }
.season-facts dt { color: #cae3d5; }
dd, table { font-variant-numeric: tabular-nums; }
.season-facts dd { font-weight: 650; }
.card-art { pointer-events: none; z-index: -1; position: absolute; right: -35px; top: -65px; width: 180px; height: 220px; transform: rotate(30deg); background: repeating-linear-gradient(90deg, transparent 0 11px, #ffffff12 11px 13px); }
.rules, .guide, .form-panel, .gate { padding: clamp(18px, 2.5vw, 28px); }
.rules ul { margin: 12px 0 0; padding-left: 1.14rem; color: var(--muted); font-size: .9rem; }
.rules li + li { margin-top: 6px; }
.rules li::marker { color: #56866a; }
.panel-head { padding: 18px 22px; flex-wrap: wrap; }
.as-of { display: inline-flex; align-items: center; gap: 7px; }
.as-of::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #668372; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; text-align: left; }
th, td { padding: 14px 18px; border-top: 1px solid #e0e7e1; }
th { background: #f0f4ee; color: var(--muted); font-size: .8rem; white-space: nowrap; font-weight: 650; }
td { overflow-wrap: anywhere; }
.number { text-align: right; white-space: nowrap; }
.gain { color: #ab382d; }
.loss { color: #167046; }
.rank { color: var(--green); font-weight: 750; }
.empty { color: var(--muted); padding: 20px 22px; }
.gate p, .guide p { margin: 9px 0 16px; color: var(--muted); }
.guide p:last-child { margin-bottom: 0; }
.guide-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
.stack, form { display: grid; gap: 16px; }
form { margin-top: 18px; }
form > button { justify-self: start; }
.actions { justify-content: start; flex-wrap: wrap; }
textarea, pre, code { font-family: "IBM Plex Mono", ui-monospace, monospace; }
textarea { resize: vertical; min-height: 140px; font-size: .9rem; }
pre { overflow: auto; background: #f0f5ef; padding: 14px; border-radius: 7px; font-size: .84rem; }
input[type="file"] { font-size: .85rem; }
.list-row { border-top: 1px solid var(--line); padding: 12px 22px; }
.list-row div { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.list-row button { flex: none; }
.day-form { display: flex; align-items: end; flex-wrap: wrap; }
.day-form label { min-width: min(220px, 100%); }
#day-result > *, #ledger > h3 { margin-top: 18px; }
#ledger h3, .balance { margin-inline: 22px; }
.balance { color: var(--green); font-weight: 680; }
#ledger h3 { margin-bottom: 8px; }
#notice, #error { padding: 12px 16px; border: 1px solid #c2d8c7; border-radius: 8px; background: #eaf5e9; margin-bottom: 16px; }
#error { background: #fff4ec; border-color: #e8c6ad; color: #743815; }
#error button { margin-left: 10px; }
@media (max-width: 720px) {
  .masthead-inner { flex-wrap: wrap; column-gap: 10px; row-gap: 0; padding-top: 10px; }
  nav { order: 3; width: 100%; justify-content: space-between; gap: 6px; }
  nav a { min-height: 44px; }
  .overview, .workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page-head { flex-wrap: wrap; align-items: start; gap: 12px; }
  #season-slot, .season-picker { min-width: 0; width: 100%; }
  .season-card { min-height: 174px; }
  .panel-head, .list-row { padding-inline: 16px; }
  th, td { padding: 10px 12px; }
  .board-table, .board-table tbody { display: block; }
  .board-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .board-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; padding: 12px 16px; gap: 5px 12px; border-top: 1px solid var(--line); }
  .board-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; border: 0; padding: 0; min-width: 0; text-align: left; }
  .board-table td:nth-child(2) { justify-content: end; font-weight: 700; }
  .board-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .75rem; font-weight: 400; }
}
