:root {
  color-scheme: light;
  --paper: #f4f0e7;
  --panel: #fffaf0;
  --ink: #173649;
  --mid: #365567;
  --muted: #5b5a51;
  --line: #d7c9b0;
  --gold: #dfba70;
  --ochre: #b68643;
  --red: #853b2d;
  --serif: Georgia, "Noto Serif TC", "PMingLiU", serif;
  --sans: "Segoe UI", "Microsoft JhengHei", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.55 var(--sans); }
a { color: inherit; text-underline-offset: .22em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.shell { max-width: 1240px; width: calc(100% - 88px); margin: 0 auto; }
.top { background: var(--ink); color: #f8f2e6; }
.masthead { display: flex; height: 62px; justify-content: space-between; align-items: center; }
.brand { font: bold 30px/1 var(--serif); text-decoration: none; }
.brand span { color: var(--gold); }
nav { display: flex; align-items: center; gap: 25px; font-size: 13px; }
.intro { min-height: 213px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 22px 0 27px; }
.safety { font-size: 12px; color: var(--mid); margin: 0 0 12px; }
.safety a { margin-left: .45em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; }
h1 { font-size: clamp(56px, 7vw, 94px); line-height: 1.04; letter-spacing: -.055em; }
html[lang="zh-TW"] h1 { letter-spacing: -.03em; }
.lead { margin: 12px 0 0; font-size: 16px; color: var(--mid); }
.clock { border-left: 1px solid var(--ochre); padding: 3px 0 3px 23px; min-width: 176px; display: grid; align-content: center; }
.clock time, .clock span { font-size: 12px; color: var(--muted); }
.clock strong { color: var(--red); font: 44px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.panel { border: 1px solid var(--line); background: var(--panel); }
.weave, .preview, .archive { padding: 22px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-head h2 { font-size: 31px; line-height: 1.12; }
.section-head span { color: var(--muted); font-size: 12px; text-align: right; }
.allowance { margin: 9px 0 15px; color: var(--mid); min-height: 23px; }
.boards { display: grid; gap: 10px; }
.board { border: 1px solid var(--line); display: grid; grid-template-columns: minmax(105px, 1.22fr) repeat(3, minmax(0, 1fr)); align-items: stretch; min-height: 86px; }
.board-title { display: grid; align-content: center; padding: 9px 11px; background: #eee6d7; border-right: 1px solid var(--line); }
.board-title h3 { font-size: 21px; line-height: 1.16; }
.board-title small { color: var(--muted); font-size: 11px; }
.sign { border: 0; border-right: 1px solid var(--line); background: transparent; min-width: 0; padding: 7px 3px; display: grid; justify-items: center; align-content: center; gap: 1px; }
.sign:last-child { border-right: 0; }
.sign:hover:enabled { background: #efe1bc; }
.sign svg { width: 30px; height: 30px; }
.sign strong { font-size: 12px; line-height: 1.18; font-weight: 600; text-align: center; }
.sign span { font-size: 11px; color: var(--mid); font-variant-numeric: tabular-nums; }
.action { min-height: 39px; padding: 7px 13px; border: 1px solid currentColor; border-radius: 3px; font-size: 13px; font-weight: 600; line-height: 1.2; }
.action.dark { background: var(--ink); color: #fffaf0; border-color: var(--ink); }
.action.dark:hover:enabled { background: var(--mid); }
.action.outline { background: transparent; }
.action.outline:hover:enabled { background: #eee6d7; }
.action.gold { background: var(--gold); color: #382619; border-color: var(--ochre); }
.action.gold:hover:enabled { background: #eacb8f; }
.action:disabled { opacity: .53; }
.controls { display: flex; align-items: center; gap: 11px; margin: 13px 0 17px; }
#status { font-size: 12px; color: var(--red); overflow-wrap: anywhere; }
.purchase { background: #f3ead9; border-top: 2px solid var(--ochre); padding: 14px; }
.purchase h3, .settle h3 { font-size: 22px; line-height: 1.15; }
.purchase p, .settle p { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.buy-fields { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; align-items: end; gap: 8px; margin-top: 11px; }
.buy-fields label { display: grid; gap: 4px; color: var(--mid); font-size: 11px; }
.buy-fields select, .buy-fields input { height: 39px; width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); font-size: 13px; }
.paid-quote { min-height: 19px; }
.preview { background: var(--ink); color: #faf2e1; border-color: var(--ink); }
.preview .section-head span { color: #e5d4b7; }
.preview img { display: block; width: min(100%, 280px); height: auto; aspect-ratio: 2 / 3; object-fit: contain; margin: 18px auto; border: 1px solid #b98547; }
.settle { border-top: 1px solid #b98547; display: flex; align-items: center; gap: 10px; justify-content: space-between; padding-top: 12px; }
.settle p { color: #e5d4b7; }
.settle .action:hover:enabled { color: var(--ink); }
.archive { margin: 18px 0 0; }
.history { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.history .action { padding-inline: 3px; }
.history .action[aria-current="true"] { border: 2px solid var(--red); }
.foot { display: flex; flex-wrap: wrap; gap: 8px 17px; align-items: baseline; margin-top: 17px; padding-bottom: 21px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .shell { width: calc(100% - 46px); }
  .history { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .weave, .preview, .archive { padding: 16px; }
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 32px); }
  .workbench { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .masthead { height: 53px; }
  nav { gap: 13px; }
  .intro { gap: 9px; min-height: 0; padding: 16px 0; flex-wrap: wrap; }
  .safety { margin-bottom: 8px; }
  h1 { font-size: 55px; }
  .lead { font-size: 14px; margin-top: 6px; }
  .clock { border-left: 0; border-top: 1px solid var(--line); padding: 5px 0 0; width: 100%; align-items: center; grid-template-columns: 1fr auto; gap: 0 10px; }
  .clock strong { grid-row: span 2; font-size: 30px; }
  .section-head h2 { font-size: 25px; }
  .history { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .weave, .preview, .archive { padding: 12px; }
  .board { grid-template-columns: minmax(77px, 1fr) repeat(3, minmax(0, 1fr)); min-height: 76px; }
  .board-title { padding: 5px; }
  .board-title h3 { font-size: 17px; }
  html[lang="zh-TW"] .board-title h3 { font-size: clamp(12px, 3.5vw, 14px); white-space: nowrap; }
  .board-title small, .sign strong { font-size: 11px; }
  .buy-fields { grid-template-columns: minmax(0, 1fr) 58px; }
  .buy-fields .action { grid-column: span 2; }
}
