[hidden] { display: none !important; }
:root {
  color-scheme: dark;
  --night: #0a1521;
  --slate: #10232b;
  --surface: #162c34;
  --ink: #f7eedc;
  --muted: #afc0bd;
  --gold: #f2cd8b;
  --line: #385054;
  --serif: Georgia, 'Noto Serif TC', PMingLiU, serif;
  --sans: 'Segoe UI', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --mono: Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: linear-gradient(153deg,#0a1526 12%,#0b1f23 66%,#0d2224); font-family: var(--sans); }
a { color: var(--gold); text-underline-offset: .22em; }
a:hover { color: var(--ink); }
button, select { min-height: 44px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font: inherit; padding: 8px 12px; }
button:not(:disabled) { cursor: pointer; }
button:disabled, select:disabled { color: var(--muted); }
button:hover:not(:disabled) { border-color: var(--gold); }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.primary { color: #142127; background: var(--gold); border-color: var(--gold); font-weight: 700; white-space: nowrap; }
.primary:disabled { color: #d2d8d3; background: var(--surface); border-color: var(--line); }
main, .top { width: min(1200px, calc(100% - 72px)); margin-inline: auto; }
.top { min-height: 69px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.top nav { display: flex; flex-wrap: wrap; gap: 18px; }
.brand { font-family: var(--serif); font-size: 1.65rem; text-decoration: none; letter-spacing: .06em; }
.proof { margin: 17px 0 0; font-size: .88rem; color: var(--muted); }
.mast { display: flex; justify-content: space-between; align-items: end; gap: 22px; padding: 43px 0 31px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(2.75rem,6.6vw,5.6rem); line-height: 1.04; letter-spacing: -.036em; color: var(--gold); }
.intro p { margin-top: 12px; font-size: clamp(1rem,1.5vw,1.19rem); }
.clock { text-align: right; min-width: 146px; }
.clock small, .clock span { display: block; color: var(--muted); }
.clock time { font: 2.15rem var(--mono); color: var(--gold); }
.clock span { font: .88rem var(--mono); }
.workroom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 32%); gap: 16px; align-items: stretch; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--slate); }
.play { padding: 20px; }
.panelhead { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.panelhead h2, figcaption h2 { font-size: 1.5rem; }
.panelhead p { color: var(--muted); margin-top: 3px; font-size: .92rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.modes { display: flex; gap: 5px; }
.modes button { font-size: .9rem; }
.modes button[aria-pressed=true] { color: var(--gold); border-color: var(--gold); background: #252e2c; }
#quantity-wrap { color: var(--muted); font-size: .9rem; }
#allowances { color: var(--gold); font-size: .87rem; min-height: 1.5em; margin: 7px 0; }
#boards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.board { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #101e27; min-width: 0; }
.board-title { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; min-height: 39px; }
.board-title h3 { color: var(--gold); font-size: 1.28rem; }
.board-title .realm { color: var(--muted); }
.board-title small { margin-left: auto; font-size: .75rem; color: var(--muted); }
.sign { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px; text-align: left; width: 100%; padding-inline: 7px; }
.sign svg { width: 20px; height: 32px; grid-row: 1 / 3; fill: none; stroke: var(--gold); stroke-width: 2; }
.sign strong { font: .98rem var(--serif); }
.sign small { grid-column: 2; font-size: .76rem; color: var(--muted); }
.tally { grid-row: 1 / 3; grid-column: 3; font: .84rem var(--mono); }
.actions { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#collect-info, #notice { font-size: .88rem; color: var(--muted); }
#notice { min-height: 1.4em; margin-top: 10px; }
.specimen { padding: 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; background: linear-gradient(#102129,#192d2c); }
.specimen figcaption { text-align: center; }
.specimen time { color: var(--muted); font: .8rem var(--mono); }
.specimen img { width: min(100%, 300px); height: auto; display: block; align-self: center; }
.archive { margin-top: 16px; padding: 16px; }
.archive time { font: .86rem var(--mono); color: var(--muted); }
#history { display: grid; grid-template-columns: repeat(24,minmax(36px,1fr)); gap: 5px; margin-top: 12px; overflow-x: auto; padding: 4px; }
.history-hour { padding: 4px; min-width: 36px; }
.history-hour[aria-pressed=true] { border-color: var(--gold); }
.line { display: flex; justify-content: center; gap: 2px; margin: 3px 0; }
.line i { width: 4px; height: 3px; background: var(--line); }
.line .lit { background: var(--gold); }
#history-detail { padding-top: 8px; min-height: 2em; font-size: .9rem; }
footer { display: flex; gap: 19px; padding: 26px 0 32px; font-size: .92rem; }
@media (max-width: 950px) {
  #boards { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .board-title { grid-column: 1/-1; min-height: auto; }
  .sign { column-gap: 4px; }
  .workroom { grid-template-columns: minmax(0,1fr) minmax(230px,32%); }
}
@media (max-width: 680px) {
  main, .top { width: calc(100% - 30px); }
  .top { min-height: 55px; }
  .top nav { gap: 12px; font-size: .88rem; }
  .mast { padding: 24px 0 19px; align-items: start; gap: 12px; }
  .clock { min-width: 100px; }
  .clock time { font-size: 1.65rem; }
  .clock small, .clock span { font-size: .75rem; }
  .workroom { grid-template-columns: 1fr; }
  .play { padding: 12px; }
  .panelhead { align-items: start; }
  .panelhead p { font-size: .87rem; }
  .board { gap: 5px; padding: 7px; }
  .sign { grid-template-columns: 16px minmax(0,1fr) auto; padding-inline: 4px; }
  .sign svg { width: 13px; }
  .sign strong { font-size: .83rem; }
  .sign small { font-size: .73rem; }
  .specimen img { width: min(70%,270px); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
