:root {
  color-scheme: dark;
  --ink: #f1eee5;
  --muted: #aaa494;
  --green: #f4ce72;
  --soft: #262218;
  --line: #3b3528;
  --panel: #1b1914;
  --control-border: #514735;
  --amber: #d8b56e;
  --gold: #292216;
  --axis: 124px;
  --serif: "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; background: var(--gold-bg, #14130f); }
body { margin: 0; color: var(--ink); background: var(--gold-bg, #14130f); font: 14px/1.75 var(--serif); -webkit-font-smoothing: antialiased; }
::selection { color: #15130c; background: #e8c46b; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { min-height: 40px; border: 1px solid var(--control-border); background: transparent; border-radius: 3px; padding: 8px 16px; font-size: 13px; font-weight: 500; line-height: 1.4; transition: background .15s, border-color .15s; }
button:hover { background: #29251b; border-color: #827153; }
button:disabled { opacity: .45; cursor: default; }
a { color: var(--ink); text-underline-offset: 4px; }
input, select, textarea { min-width: 0; max-width: 100%; border: 1px solid var(--control-border); background: #17150f; border-radius: 3px; padding: 8px 12px; }
input:not([type="checkbox"]):not([type="range"]), select { min-height: 42px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"] { width: 19px; height: 19px; flex-shrink: 0; margin: 3px 0; padding: 0; accent-color: var(--green); cursor: pointer; }
textarea { resize: vertical; width: 100%; min-height: 70px; }
input:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.page { position: relative; z-index: 1; width: calc(100% - var(--gold-gutter, clamp(24px, 3.3vw, 52px)) * 2); margin: auto; }
.gold-intro { padding: 40px 0 32px; font-family: var(--serif); }
.gold-intro h1 { margin: 0; font-family: var(--serif); font-size: clamp(32px, 3.2vw, 46px); font-weight: 500; line-height: 1.3; letter-spacing: -.045em; }
.gold-intro p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.vaccine-scope { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; letter-spacing: .02em; }
.profile { display: grid; grid-template-columns: minmax(135px,.9fr) minmax(150px,.9fr) minmax(130px,.9fr) minmax(180px,1.2fr) auto; align-items: center; gap: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.profile label { display: grid; gap: 8px; font-size: 13px; }
.profile input { width: 100%; font-size: 14px; }
.progress-wrap { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding-left: 24px; border-left: 1px solid var(--line); min-width: 0; }
.progress-label { grid-column: 1; grid-row: 1; font-size: 12px; color: var(--muted); }
.progress-count { grid-column: 2; grid-row: 1; white-space: nowrap; font-size: 14px; color: var(--green); font-variant-numeric: tabular-nums; }
.progress-wrap progress { grid-column: 1/-1; grid-row: 2; width: 100%; height: 6px; border: 0; border-radius: 6px; background: #45433b; appearance: none; }
progress::-webkit-progress-bar { background: #45433b; border-radius: 6px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 6px; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions button { padding: 8px 12px; white-space: nowrap; min-height: 40px; }
#image-import { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; gap: 8px; background: var(--green); color: #211b0e; border-color: var(--green); font-weight: 500; }
#image-import:hover { background: #ffdc8e; border-color: #ffdc8e; }
#image-import svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; padding: 16px 24px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.mode-wrap { display: flex; align-items: center; gap: 24px; font-size: 13px; }
.segments { display: flex; gap: 8px; }
.segments button { min-width: 64px; min-height: 36px; padding: 8px 16px; border-color: transparent; border-radius: 3px; font-size: 13px; }
.segments button[aria-pressed="true"] { color: var(--ink); background: #302b20; border-color: #6b5a36; font-weight: 500; }
.storage { display: flex; flex-direction: column; text-align: right; gap: 4px; color: var(--muted); font-size: 12px; }
#storage-status:not(:empty) { font-size: 12px; color: var(--muted); }
.settings { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.settings > summary { width: fit-content; padding: 8px 0; color: var(--ink); font-size: 13px; }
.settings-inner { margin-top: 8px; padding: 24px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.setting-fields { display: flex; flex-wrap: wrap; gap: 16px 32px; }
.setting-fields label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.settings p { max-width: 1100px; margin: 16px 0 0; line-height: 1.8; }
.heads, .timeline-row { display: grid; grid-template-columns: minmax(0,1fr) var(--axis) minmax(0,1fr); }
.heads { padding-top: 32px; align-items: start; }
.heads h2 { margin: 0 0 8px; font-size: 24px; font-weight: 500; line-height: 1.5; letter-spacing: -.025em; }
.heads p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.heads .right-head { grid-column: 3; padding-left: 16px; }
.filter-status { min-height: 24px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.timeline { margin-top: 24px; }
.timeline-row { position: relative; }
.lane { min-width: 0; padding: 24px 16px 32px 0; border-top: 1px solid var(--line); }
.lane.optional { padding: 24px 0 32px 16px; }
.age { position: relative; text-align: center; isolation: isolate; }
.age::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - .5px); width: 1px; background: #766039; z-index: -1; }
.age-label { display: inline-block; margin-top: -16px; padding: 6px 16px; border: 1px solid #766039; border-radius: 3px; background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.7; white-space: nowrap; }
.age::after { content: ""; display: block; width: 6px; height: 6px; margin: 16px auto 0; border-radius: 50%; background: #a88b52; }
.age-date { display: block; position: relative; margin-top: 8px; padding: 4px 0; background: var(--gold-bg, #14130f); color: var(--muted); font-size: 12px; line-height: 1.5; }
.timeline-row:last-child .age::before { bottom: 24px; }
.vaccine { padding: 16px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.vaccine.done { background: #222015; border-color: #4a422a; }
.item-line { display: flex; align-items: flex-start; gap: 12px; }
.item-label { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.item-title { font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.dose { padding-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.item-note { margin: 8px 0 0 31px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.record-details { margin: 8px 0 0 31px; font-size: 13px; }
.record-details summary { width: fit-content; padding-block: 4px; color: var(--muted); font-size: 12px; }
.record-form { display: grid; gap: 16px; padding-top: 16px; }
.record-form label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.record-form input, .record-form textarea { width: 100%; font-size: 14px; }
.done-status { margin: 8px 0 0 31px; color: var(--green); font-size: 12px; }
.vaccine.compact { padding: 8px 16px; }
.compact .item-title { font-size: 14px; }
.compact .item-note, .compact .record-details, .compact .done-status { display: none; }
.empty { display: grid; place-items: center; min-height: 74px; padding: 16px; border: 1px solid var(--line); border-radius: 4px; background: #17150f; color: var(--muted); font-size: 13px; }
.series { margin: 0 0 24px; padding: 0 0 16px; border-bottom: 1px dashed var(--line); }
.series:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.series-heading { margin: 8px; font-size: 16px; font-weight: 500; line-height: 1.75; }
.series-hint { margin: 8px 8px 16px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.series select { max-width: calc(100% - 16px); margin: 0 8px 16px; padding: 8px 12px; font-size: 14px; }
.optional .vaccine.done { background: #251f15; }
.optional .done-status { color: var(--green); }
.optional .item-title { font-size: 14px; }
.small-button { min-height: 36px; margin: 8px; padding: 8px 12px; font-size: 13px; }
.due-summary { margin: 24px 0 8px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.due-summary-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.due-summary strong { font-size: 14px; font-weight: 500; }
.due-counts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-size: 12px; }
.due-counts span { display: inline-flex; align-items: center; gap: 7px; }
.due-counts i { width: 7px; height: 7px; border-radius: 50%; background: #d6af5d; }
.due-counts .past-dot { background: #d78a7c; }
.due-counts .review-dot { background: #83a9bd; }
.due-caption { margin: 8px 0 0; max-width: 1100px; color: var(--muted); font-size: 12px; }
.due-jump { min-height: 36px; padding: 8px 12px; font-size: 13px; }
.vaccine.due-now { background: #292316; box-shadow: inset 3px 0 #c9a254; }
.vaccine.due-past { background: #2b1e19; box-shadow: inset 3px 0 #bb786b; }
.vaccine.due-review, .series.due-review { background: #1c262b; box-shadow: inset 3px 0 #7a9eaf; }
.series.due-review { padding: 16px; border-radius: 4px; }
.due-label { display: block; margin: 8px 0 8px 31px; color: #e4c27a; font-size: 12px; font-weight: 500; line-height: 1.75; }
.due-past > .due-label { color: #e0a194; }
.due-review > .due-label { color: #a7cadb; }
.due-wait > .due-label { color: var(--muted); font-weight: 400; }
.due-label small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.series > .due-label { margin: 8px 8px 16px; }
.row-current .age-label { background: var(--green); color: #211b0e; border-color: var(--green); }
.row-current .age::after { background: #f4d68d; box-shadow: 0 0 0 4px #e4bd6118; }
.tool-intro, .instructions { border-top: 1px solid var(--line); padding: 32px 0; }
.tool-intro { margin: 16px 0 0; }
.tool-intro h2, .instructions h2 { margin: 0 0 16px; font-size: 22px; font-weight: 500; line-height: 1.5; }
.tool-intro p, .instructions p { max-width: 1100px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.tool-intro strong { color: var(--ink); font-weight: 500; }
.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; padding: 0; list-style: none; }
.sources li { font-size: 12px; line-height: 1.8; }
.sources a { color: var(--muted); }
.page > footer { display: flex; justify-content: space-between; gap: 24px; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translateX(-50%); max-width: 90vw; display: none; padding: 16px 24px; border: 1px solid #9e8145; border-radius: 4px; background: #272216; color: #efe3c1; box-shadow: 0 6px 30px #0006; font-size: 12px; }
.toast.show { display: block; }
.error-banner { margin: 16px 0; padding: 16px; background: #34241a; color: #edc18f; border: 1px solid #6e4f30; border-radius: 4px; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
[hidden] { display: none !important; }
@media (max-width: 1280px) {
  .profile { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
  .progress-wrap { grid-column: 1; padding-left: 0; border-left: 0; }
  .actions { grid-column: 2/-1; justify-content: flex-end; }
  :root { --axis: 104px; }
}
@media (max-width: 760px) {
  .page { width: calc(100% - var(--gold-gutter, 20px) * 2); }
  .gold-intro { padding: 28px 0 24px; }
  .gold-intro p { font-size: 13px; }
  .profile { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding: 20px; }
  .profile input, .record-form input, .record-form textarea, .setting-fields select, .series select { font-size: 16px; }
  .profile input { padding-inline: 8px; }
  .progress-wrap { grid-column: 2; padding: 0; gap: 8px; }
  .progress-count { font-size: 13px; }
  .actions { grid-column: 1/-1; justify-content: stretch; gap: 8px; }
  .actions button { flex: 1; padding-inline: 8px; }
  #image-import { flex: 1.5; gap: 8px; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px; }
  .mode-wrap { justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
  .segments button { min-width: 52px; padding-inline: 12px; }
  .storage { text-align: left; padding-top: 16px; border-top: 1px solid var(--line); }
  .settings { font-size: 13px; }
  .settings-inner { padding: 20px; }
  .setting-fields { gap: 16px; }
  .setting-fields label { flex-wrap: wrap; }
  .due-summary { padding: 24px 0; }
  .due-counts { gap: 8px 16px; }
  .heads { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); padding: 0; }
  .filter-status { margin: 16px 0 24px; }
  .timeline { margin-top: 0; }
  .timeline-row { display: grid; grid-template-columns: minmax(0,1fr); padding: 0 0 32px 24px; border-left: 1px solid #766039; margin-left: 8px; }
  .timeline-row:last-child { border-left-color: transparent; }
  .age { grid-row: 1; text-align: left; margin-left: -33px; padding: 0 0 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
  .age::before, .age::after { display: none; }
  .age-label { margin-top: 0; padding: 6px 16px; }
  .age-date { margin: 0; padding: 4px 0; }
  .lane, .lane.optional { border-top: 0; padding: 0; }
  .lane.national { grid-row: 2; }
  .lane.optional { grid-row: 3; margin-top: 16px; }
  .lane::before { display: block; margin: 8px 0 16px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .025em; }
  .lane.national::before { content: "免疫规划疫苗 · 通常免费"; }
  .lane.optional::before { content: "非免疫规划疫苗 · 通常自费"; }
  .lane:has(> .empty:only-child) { display: none; }
  .item-label { gap: 8px; }
  .item-line { gap: 8px; }
  .item-note, .record-details, .done-status, .due-label { margin-left: 27px; }
  .series-heading { font-size: 16px; }
  .series.due-review { padding: 16px; }
  .series > .due-label { margin-left: 8px; }
  .tool-intro, .instructions { padding: 24px 0; }
  .tool-intro h2, .instructions h2 { font-size: 20px; }
  .tool-intro p, .instructions p { font-size: 13px; }
  .sources { grid-template-columns: 1fr; gap: 8px; }
  .page > footer { flex-direction: column; gap: 8px; }
}
@media (max-width: 360px) {
  .profile { grid-template-columns: minmax(0,1fr); }
  .progress-wrap { grid-column: 1; }
  .actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  #image-import { grid-column: 1/-1; }
  .segments { width: 100%; }
  .segments button { flex: 1; }
  .item-line { flex-wrap: wrap; }
  .item-label { flex-basis: 100%; }
  .dose { margin-left: 27px; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button { transition: none; }
}
@media print {
  :root { color-scheme: light; --ink:#152019; --muted:#596158; --line:#ccd1ca; --soft:#eef1eb; }
  html, body { background: #fff !important; color: #152019; }
  .page { width: 100%; }
  .goldbar, .actions, .toolbar, .settings, .record-details, .series select, .small-button, .toast, .due-jump { display: none !important; }
  .gold-intro { padding: 14px 0; }
  .gold-intro h1 { font-size: 30px; }
  .gold-intro p { font-size: 16px; }
  .profile { background: #fff; border: 1px solid #bbb; }
  input { background: #fff; color: #152019; border-color: #bbc0b5; }
  .heads, .timeline-row { display: grid; grid-template-columns: minmax(0,1fr) 75px minmax(0,1fr); }
  .heads { position: static; width: auto; height: auto; overflow: visible; clip: auto; padding-top: 18px; }
  .timeline-row { margin: 0; padding: 0; border: 0; break-inside: avoid; }
  .lane.national { grid-column: 1; grid-row: 1; }
  .age { grid-column: 2; grid-row: 1; display: block; margin: 0; text-align: center; }
  .lane.optional { grid-column: 3; grid-row: 1; margin: 0; }
  .lane::before { display: none; }
  .age-label, .age-date { background: #fff; color: #604c1c; }
  .vaccine, .vaccine.done, .empty { background: #fff; border-color: #d4d4cd; }
  .item-title, .optional .item-title { font-size: 12px; }
  .item-note, .series-hint, .instructions p, .tool-intro p { color: #596158; }
}
