:root {
  --ink: #282837;
  --muted: #57586c;
  --accent: #a52b46;
  --sheet: #fff;
  --surface: #f4f2f5;
  --edge: #ded9e3;
  --selected: #faedf2;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 1rem; line-height: 1.55; }
button, input, textarea { font: inherit; }
h1, h2, p { margin: 0; }
a { color: var(--accent); text-underline-offset: .22em; }
.container, .top-inner { width: min(70rem, calc(100% - 3rem)); margin-inline: auto; }
.top { background: var(--sheet); border-bottom: 1px solid var(--edge); }
.top-inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.wordmark { color: var(--accent); font: 800 1.65rem/1.05 Arial, sans-serif; letter-spacing: -.065em; }
.intro { padding: 3.1rem 0 1.85rem; }
h1 { font-family: "Noto Serif SC", SimSun, "Songti SC", serif; font-size: clamp(2.15rem, 4.3vw, 3.45rem); letter-spacing: -.04em; line-height: 1.16; }
.intro p { color: var(--muted); margin-top: .85rem; max-width: 40rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.panel { min-width: 0; background: var(--sheet); border: 1px solid var(--edge); border-radius: .8rem; padding: clamp(1rem, 3vw, 1.7rem); }
.intake { border-top: 4px solid var(--accent); }
.lookup { border-top: 4px solid #6f5b78; }
h2 { font-size: 1.35rem; letter-spacing: -.025em; font-weight: 760; }
form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.services { padding: 0; border: 0; margin: 0; min-width: 0; }
.services legend, .field > span { font-size: .9rem; font-weight: 700; }
.service-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-top: .55rem; }
.service { position: relative; cursor: pointer; min-width: 0; display: grid; gap: .32rem; padding: .7rem .65rem; border: 1px solid var(--edge); border-radius: .55rem; }
.service:has(input:checked) { border-color: var(--accent); background: var(--selected); color: #821d37; }
.service:focus-within { outline: 3px solid #6155bc; outline-offset: 2px; }
.service input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.service strong { font-size: .94rem; overflow-wrap: anywhere; }
.service span { color: var(--muted); font-size: .77rem; overflow-wrap: anywhere; }
.field { display: grid; gap: .37rem; min-width: 0; }
.field small, .footnote, .support { font-size: .83rem; color: var(--muted); font-weight: 400; }
.field input:not([type="checkbox"]), .field textarea { border: 1px solid var(--edge); border-radius: .45rem; padding: .66rem .7rem; width: 100%; min-width: 0; background: var(--sheet); color: var(--ink); }
.field textarea { resize: vertical; }
.field .file { font-size: .86rem; }
.file::file-selector-button { cursor: pointer; background: var(--selected); border: 0; border-radius: .3rem; padding: .27rem .55rem; margin-right: .65rem; color: var(--accent); font: inherit; font-weight: 700; }
.button { min-height: 2.6rem; border: 1px solid transparent; border-radius: .44rem; padding: .55rem .9rem; font-weight: 700; cursor: pointer; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.primary { background: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: #87233a; }
.outline { border-color: var(--edge); color: var(--ink); background: var(--sheet); }
.outline:hover:not(:disabled) { border-color: var(--accent); }
:focus-visible { outline: 3px solid #6155bc; outline-offset: 2px; }
.order-input, .receipt-number { font-variant-numeric: tabular-nums; }
.empty, .receipt { border: 1px dashed var(--edge); padding: 1rem; margin-top: 1rem; border-radius: .5rem; color: var(--muted); overflow-wrap: anywhere; }
.receipt { border-style: solid; display: grid; gap: .5rem; }
.receipt > div { display: flex; justify-content: space-between; gap: .5rem; }
.receipt-number { color: var(--ink); overflow-wrap: anywhere; }
.receipt-name { color: var(--ink); font-weight: 700; }
.status { align-self: flex-start; padding: .12rem .45rem; border-radius: .25rem; color: #634719; background: #f8edce; font-size: .8rem; flex-shrink: 0; }
.status[data-state="ready"] { color: #22654d; background: #e1f1e9; }
.support { border-top: 1px solid var(--edge); margin-top: 1.5rem; padding-top: .8rem; }
.message { padding: .67rem .8rem; border-radius: .4rem; background: #f3ecf7; color: #50365e; font-size: .9rem; overflow-wrap: anywhere; }
.message.error { background: #faeaed; color: #92213b; }
#local-preview { margin-top: 1.15rem; }
.footer { display: flex; gap: 1.2rem; flex-wrap: wrap; padding: 1.6rem 0; font-size: .83rem; color: var(--muted); }
dialog { width: min(30rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 1.35rem; border: 1px solid var(--edge); border-radius: .7rem; color: var(--ink); }
dialog::backdrop { background: #27203681; }
.dialog-title, .code-row { display: flex; justify-content: space-between; gap: .6rem; align-items: end; }
.code-row .field { flex: 1; }
.consent { display: flex; align-items: flex-start; gap: .42rem; font-size: .85rem; }
.consent input { margin-top: .23rem; }
@media (max-width: 760px) {
  .container, .top-inner { width: calc(100% - 1.6rem); }
  .top-inner { min-height: 3.7rem; }
  .workspace { grid-template-columns: 1fr; gap: 1rem; }
  .intro { padding: 1.65rem 0 1.3rem; }
}
