:root {
  color-scheme: light;
  --ink: #153d32;
  --soft-ink: #416255;
  --page: #f7f5eb;
  --paper: #fffcf0;
  --lime: #d9ee88;
  --line: #c6d0bf;
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
  color: var(--ink);
  background: var(--page);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.print-notice { display: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #b35419; outline-offset: 3px; }
.skip { position: absolute; z-index: 4; inset: 10px auto auto 14px; padding: 10px 14px; color: var(--ink); background: var(--lime); transform: translateY(-180%); }
.skip:focus { transform: none; }
.masthead { border-bottom: 1px solid #385447; color: #fbf8e9; background: var(--ink); }
.mast-inner { max-width: 1120px; margin: auto; min-height: 66px; padding: 8px 28px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: .12em; }
.brand img { margin-inline-start: -5px; }
.format { font: 700 12px/1.4 Consolas, 'Microsoft YaHei', monospace; letter-spacing: .09em; color: #e1ecc6; }
.format span { padding: 0 5px; color: #b8d26d; }
main { max-width: 1120px; margin: 0 auto; padding: 34px 28px 42px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.intro h1 { margin: 0; font: 900 clamp(30px,4.3vw,60px)/1.06 'Songti SC', SimSun, serif; letter-spacing: -.05em; }
.intro h1 span { color: #547832; }
.intro p { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--soft-ink); }
.sample { flex: none; border: 1px solid var(--ink); min-height: 44px; border-radius: 24px; color: var(--ink); background: transparent; padding: 5px 15px; font-size: 13px; font-weight: 700; }
.sample span { margin-inline-start: 3px; }
.sample:hover { background: var(--lime); }
.workspace { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); grid-template-areas: 'editor preview' 'delivery preview'; gap: 16px; align-items: start; }
.editor, .delivery, .preview { border: 1px solid var(--line); border-radius: 12px; }
.editor { grid-area: editor; padding: 17px 20px 16px; background: #fdfaf0; }
.editor-head { margin: 0 0 11px; }
.editor h2, .preview h2, .delivery h2 { margin: 0; font-size: 17px; letter-spacing: .06em; }
.field { margin-top: 10px; }
.field label, legend { display: block; font-size: 13px; line-height: 1.4; font-weight: 750; padding: 0; }
.field input, .field textarea { display: block; width: 100%; padding: 7px 10px; margin-top: 4px; min-height: 42px; border: 1px solid #91a499; border-radius: 5px; background: #fffdf7; color: #193b31; font-size: 15px; line-height: 1.42; }
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: #9c2e20; }
.error { color: #8e2517; font-size: 12px; line-height: 1.48; margin: 5px 0 0; }
.separator { border-top: 1px dashed #8eaa96; padding-top: 11px; margin: 14px 0 0; font-size: 13px; }
fieldset { border: 0; margin: 9px 0 0; padding: 0; min-inline-size: 0; }
.choices { margin-top: 4px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.choices label { position: relative; cursor: pointer; }
.choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choices span { display: grid; place-items: center; min-height: 44px; border: 1px solid #92a597; border-radius: 5px; font-size: 14px; }
.choices input:checked + span { color: var(--ink); background: var(--lime); border: 2px solid var(--ink); font-weight: 800; }
.choices input:focus-visible + span { outline: 3px solid #b35419; outline-offset: 2px; }
#code { font-family: Consolas, monospace; letter-spacing: .07em; }
.hint, .fit { margin: 5px 0 0; font-size: 12px; line-height: 1.35; color: var(--soft-ink); }
.fit { font-weight: 700; }
.preview { grid-area: preview; --preview-line: #a8bfad; background: #dce9db; overflow: hidden; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 15px 19px; border-bottom: 1px solid var(--preview-line); }
.preview-head span { font: 700 12px/1.4 Consolas, monospace; }
.paper-stage { position: relative; display: grid; place-items: start center; padding: 24px 18px 21px; background: radial-gradient(#8caf9d 1px, transparent 1px) 0 0/16px 16px, #d9e9da; }
.paper-ruler { position: absolute; inset: 0 18px auto; height: 8px; background: repeating-linear-gradient(90deg, #557d69 0 1px, transparent 1px 16px); opacity: .6; pointer-events: none; }
.preview .notice-sheet, .paper-empty { width: min(100%, 397px); background: var(--paper); border: 1px solid #a2ad98; padding: 18px; box-shadow: 5px 7px 0 #28573b30; }
.preview .notice-sheet { box-sizing: content-box; width: min(calc(100% - 38px), 359px); }
.preview .sheet-kicker { background: var(--lime); }
.paper-empty { aspect-ratio: 210 / 297; display: grid; align-content: center; justify-items: center; text-align: center; }
.paper-empty p { margin: 0 0 10px; font-weight: 800; }
.paper-empty span { color: var(--soft-ink); font-size: 13px; }
.preview-note { display: flex; align-items: baseline; gap: 7px; padding: 11px 18px; border-top: 1px solid var(--preview-line); margin: 0; color: #244938; font-size: 12px; line-height: 1.55; }
.preview-note span { flex: 0 0 16px; border-top: 2px dashed; }
.delivery { grid-area: delivery; padding: 14px 18px; color: #fcf9e9; background: var(--ink); }
.offer { display: flex; align-items: center; gap: 10px; }
.offer-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; color: var(--ink); background: var(--lime); border-radius: 6px; }
.offer p { margin: 4px 0 0; font-size: 12px; line-height: 1.34; color: #e0e9d4; }
.offer .price { margin: 0 0 0 auto; font: 700 25px/1 Consolas, monospace; color: var(--lime); white-space: nowrap; }
.actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.actions button { min-height: 44px; padding: 6px 8px; border: 1px solid #e0efa2; border-radius: 6px; background: var(--lime); color: var(--ink); font-weight: 800; font-size: 13px; }
.actions button:not(:disabled):hover { background: #eeffa9; }
.actions button:disabled { color: #d7e6d6; background: #305344; border-color: #749083; }
.delivery :focus-visible { outline-color: #ffbb6c; }
.delivery-hint, .message { margin: 6px 0 0; font-size: 12px; color: #e0e9d4; line-height: 1.5; }
.message:empty { margin: 0; }
@media (max-width: 780px) {
  .workspace { grid-template-columns: 1fr; grid-template-areas: 'editor' 'preview' 'delivery'; }
  main { padding: 26px 18px 28px; }
  .mast-inner { padding-inline: 18px; }
  .intro { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 380px) {
  main { padding-inline: 12px; }
  .mast-inner { padding-inline: 12px; }
  .editor, .delivery { padding-inline: 12px; }
  .paper-stage { padding-inline: 12px; }
  .offer .price { font-size: 21px; }
  .offer-icon { display: none; }
}
@media print {
  .masthead, main, .skip { display: none; }
  .print-notice { display: block; }
}
