:root {
  color-scheme: light;
  --paper: #f2eee3;
  --card: #fcfaf4;
  --ink: #19374d;
  --muted: #496173;
  --line: #c7d0cf;
  --blue: #245d80;
  --orange: #913f21;
  --orange-bg: #faecde;
  font-family: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
a { color: inherit; text-underline-offset: 4px; }
.skip { position: fixed; z-index: 5; inset: 8px auto auto 8px; transform: translateY(-140%); color: white; background: var(--ink); padding: 9px 14px; }
.skip:focus { transform: none; }
:focus-visible { outline: 3px solid #aa4c24; outline-offset: 3px; }
.top { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #b8c4c5; }
.brand { display: inline-flex; gap: 10px; align-items: center; font-size: 17px; font-weight: 750; text-decoration: none; }
.top nav a { color: var(--blue); font-size: 13px; display: inline-block; padding-block: 12px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 22px; padding: 34px 0 27px; }
.eyebrow { color: var(--blue); font: 700 12px/1.5 ui-monospace, 'Microsoft YaHei', monospace; letter-spacing: .1em; margin: 0 0 6px; }
h1, h2, p { margin: 0; }
h1 { font-family: 'Songti SC', SimSun, serif; font-size: clamp(2rem, 4.2vw, 3.55rem); line-height: 1.17; letter-spacing: -.045em; }
h2 { font-size: 1.33rem; line-height: 1.3; }
.hero div:first-child > p:last-child { margin-top: 12px; color: var(--muted); max-width: 42em; }
.hero-note { border-left: 2px solid #c98b64; padding-left: 14px; white-space: nowrap; display: grid; color: var(--muted); font-size: 12px; }
.hero-note strong { color: var(--ink); font: 700 26px/1.2 ui-monospace, monospace; margin-block: 2px; }
.workbench { display: grid; grid-template-columns: minmax(310px, .9fr) minmax(0, 1.7fr); gap: 18px; align-items: stretch; }
.card { border: 1px solid #bdc9ca; background: var(--card); border-radius: 13px; padding: 22px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.muted { color: var(--muted); }
.form-note { font-size: 13px; margin: 9px 0 15px; }
button, input { font: inherit; color: inherit; }
button { min-height: 42px; padding: 8px 13px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; }
button:disabled { color: #526774; background: #e8eae5; border-color: #cdd3ce; cursor: default; }
button.text-button { background: transparent; color: var(--blue); padding-inline: 4px; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; flex: none; }
button.primary:not(:disabled) { background: var(--ink); color: #fffdf6; }
button.primary:not(:disabled):hover { background: #295d7e; }
button.secondary:not(:disabled) { background: #eef3f3; border-color: #a4bbbf; color: var(--ink); }
button.secondary:not(:disabled):hover { background: #ddebed; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.input-unit { position: relative; }
.input-unit span { position: absolute; right: 10px; top: 10px; color: var(--muted); pointer-events: none; font: 13px/23px ui-monospace, monospace; }
input { width: 100%; min-width: 0; height: 43px; border-radius: 5px; border: 1px solid #9eb1b7; background: #fffefb; font-family: ui-monospace, monospace; padding: 6px 32px 6px 9px; appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { appearance: none; margin: 0; }
input[aria-invalid='true'] { border-color: var(--orange); background: #fff6ed; }
.field small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.field .field-error { color: var(--orange); font-weight: 700; }
.preview-button { margin-top: 15px; width: 100%; display: flex; justify-content: space-between; align-items: center; }
.chip { font-size: 11px; color: var(--blue); background: #e8f0f0; padding: 4px 8px; border-radius: 4px; white-space: nowrap; }
.chip.stale { background: var(--orange-bg); color: var(--orange); }
.sizes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 12px; }
.sizes div { border-top: 1px solid var(--line); padding-top: 6px; }
.sizes span { display: block; color: var(--muted); font-size: 12px; }
.sizes strong { display: block; font: 750 clamp(14px, 2.1vw, 21px)/1.3 ui-monospace, monospace; overflow-wrap: anywhere; }
.drawing { display: grid; place-items: center; padding: 19px 14px; min-height: 182px; border: 1px solid #b8c8cd; background-color: #f1f4ef; background-image: linear-gradient(#dce5e3 1px, transparent 1px),linear-gradient(90deg, #dce5e3 1px, transparent 1px); background-size: 15px 15px; border-radius: 5px; color: var(--muted); }
.drawing .schematic { display: block; width: 100%; height: clamp(130px, 22vw, 248px); }
.legend, .panels { list-style: none; padding: 0; margin: 10px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 12px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 18px; border-top: 2px solid var(--ink); }
.legend i.fold { border-top: 2px dashed var(--blue); }
.legend i.bleed { border-top: 2px dashed var(--orange); }
.panels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.panels li { padding: 5px 3px; background: #e8eff0; text-align: center; color: var(--ink); font-size: 11px; border-top: 1px solid #abc2cb; }
.panels li:nth-child(3) { background: #d1e2eb; }
.panels strong { display: block; font: 700 12px/1.4 ui-monospace, monospace; overflow-wrap: anywhere; }
.delivery { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.delivery h2 + p { margin-top: 6px; }
.print-note { margin-top: 8px; color: var(--orange); font-size: 13px; }
.delivery-controls { padding-left: 18px; border-left: 1px solid var(--line); font-size: 13px; }
.snapshot { margin: 4px 0 8px; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.status { color: var(--blue); font-size: 12px; }
.status:not(:empty) { margin-top: 6px; }
.status.error { color: var(--orange); font-weight: 700; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 18px; padding-block: 16px 23px; font-size: 12px; color: var(--muted); }
@media (max-width: 850px) {
  .wrap { width: min(100% - 36px, 1200px); }
  .workbench { grid-template-columns: minmax(255px, 1fr) minmax(0, 1.35fr); gap: 12px; }
  .card { padding: 16px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .top { min-height: 60px; }
  .hero { padding: 24px 0 17px; }
  .hero div:first-child > p:last-child { font-size: 14px; }
  .hero-note { display: none; }
  .workbench, .delivery { grid-template-columns: minmax(0, 1fr); }
  .delivery-controls { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .delivery { gap: 12px; margin-top: 12px; }
}
@media (max-width: 350px) {
  .wrap { width: calc(100% - 20px); }
  .card { padding: 12px; }
  .panels strong { font-size: 10px; }
}
