
/* 版面：單欄文件式，條件分區由細金線分隔；編輯時同一位置換成表單 */
:root {
  --bg: #f6f5f0; --surface: #ffffff; --ink: #223b36; --muted: #6f7c76; --line: #e3e7e0;
  --accent: #265d4c; --accent-ink: #ffffff; --gold: #b9833e; --warn: #9a5b1f; --bad: #a13c30; --soft: #edf2eb;
  --display: "Noto Serif TC", "Songti TC", serif; --body: "Noto Sans TC", -apple-system, "Microsoft JhengHei", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121815; --surface: #1a221e; --ink: #e3ebe6; --muted: #98a59e; --line: #2c3632;
  --accent: #7fbfa6; --accent-ink: #0f1613; --gold: #d0a35e; --warn: #e0a96a; --bad: #ef8a7c; --soft: #22302a; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #121815; --surface: #1a221e; --ink: #e3ebe6; --muted: #98a59e; --line: #2c3632;
  --accent: #7fbfa6; --accent-ink: #0f1613; --gold: #d0a35e; --warn: #e0a96a; --bad: #ef8a7c; --soft: #22302a; color-scheme: dark }
* { box-sizing: border-box }
html { background: var(--bg) }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.7 var(--body); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
main { max-width: 860px; margin: 0 auto; padding-block: 32px 64px; display: grid; gap: 24px }
h1 { font: 600 28px/1.3 var(--display); margin: 0; text-wrap: balance; letter-spacing: .02em }
h2 { font: 600 18px/1.4 var(--display); margin: 0 0 12px; letter-spacing: .02em }
.head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--gold); padding-bottom: 16px }
.meta { color: var(--muted); font-size: 13px }
.actions { display: flex; flex-wrap: wrap; gap: 8px }
button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 7px 14px; cursor: pointer }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500 }
button:disabled { opacity: .45; cursor: not-allowed }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px }
section.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px }
table { width: 100%; border-collapse: collapse }
th, td { text-align: left; vertical-align: top; padding: 9px 8px; border-bottom: 1px solid var(--line) }
th { width: 34%; font-weight: 500; color: var(--muted); font-size: 14px }
tr:last-child th, tr:last-child td { border-bottom: 0 }
.tbl { overflow-x: auto }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { background: var(--soft); border-radius: 4px; padding: 1px 8px; font-size: 13px }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0 }
.empty { text-align: center; padding: 40px 16px; color: var(--muted) }
.status { font-size: 14px; padding: 10px 14px; border-radius: 6px; background: var(--soft) }
.status.warn { color: var(--warn) } .status.bad { color: var(--bad) }
input[type=text], input[type=password], input[type=number], select, textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; max-width: 420px }
textarea { min-height: 64px; resize: vertical; max-width: 100% }
.store { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line) }
.store:last-of-type { border-bottom: 0 }
.store .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.store .row input { max-width: 200px }
.store .addr { color: var(--muted); font-size: 13px }
.hist li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline }
.hist { list-style: none; margin: 0; padding: 0 }
.hist .v { font-variant-numeric: tabular-nums; font-weight: 500 }
.confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border: 1px solid var(--gold); border-radius: 6px }
.bm { display: inline-block; padding: 10px 22px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; text-decoration: none; font-weight: 500; cursor: grab }
.steps { margin: 12px 0; padding-left: 20px; display: grid; gap: 4px }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; background: var(--soft); padding: 8px; border-radius: 6px; max-height: 120px; overflow: auto }
@media (max-width: 560px) { th { width: auto; display: block; border-bottom: 0; padding-bottom: 0 } td { display: block } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

.bm { display: inline-block; padding: 10px 22px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; text-decoration: none; font-weight: 500; cursor: grab }
.steps { margin: 12px 0; padding-left: 20px; display: grid; gap: 4px }
.toplink { color: var(--accent) }
label { cursor: pointer }
.note.first { margin-top: 0 }
input.age { width: 90px }
