:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --bg: #f5f7f4;
  --surface: #fff;
  --green: #185a45;
  --deep: #123b31;
  --green-soft: #eaf4ee;
  --text: #192b25;
  --muted: #596e63;
  --line: #dbe5de;
  --error: #9d3829;
  --radius: 17px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
a { color: var(--green); }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #268263; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: wait; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 2.65rem); letter-spacing: -.045em; line-height: 1.13; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.04rem; }
.muted, small { color: var(--muted); }
.small { font-size: .875rem; }
.notice { border: 1px solid #bfd9c9; background: var(--green-soft); padding: 13px 16px; border-radius: 10px; margin: 12px 0; overflow-wrap: anywhere; }
.error { color: var(--error); background: #fff1eb; border-color: #efc5b6; }
.topbar { min-height: 72px; padding: 10px max(24px, calc((100vw - 1170px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--deep); text-decoration: none; font-size: 1.3rem; font-weight: 800; white-space: nowrap; }
.brand small { display: block; font-size: .75rem; font-weight: 600; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--green); color: #fff; font-size: 1.25rem; }
.top-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.shell { max-width: 1218px; padding: 35px 24px 54px; margin: auto; }
.workspace-title { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.section-label { color: var(--green); font-size: .875rem; font-weight: 750; letter-spacing: .08em; margin-bottom: 7px; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; padding: 8px 14px; font-weight: 670; font-size: .91rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.primary { background: var(--green); color: #fff; }
.primary:hover { background: #114c39; }
.secondary { background: #fff; color: var(--green); border-color: #c9dbcf; }
.secondary:hover, .plain:hover { background: var(--green-soft); }
.plain { background: transparent; color: var(--green); }
.danger { background: #fff4ef; color: var(--error); border-color: #f1cbbf; }
.light { background: #e7f4e9; color: var(--deep); }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; color: #42554b; background: #edf1ed; font-weight: 650; font-size: .875rem; white-space: nowrap; }
.state-open, .state-picked { background: #daf1e4; color: #17563b; }
.state-packed { background: #e4efff; color: #265178; }
.state-pending { background: #fff0c7; color: #755000; }
.state-cancelled { background: #f4e8e4; color: #783e35; }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.group-bar { background: var(--deep); color: #fff; border-radius: var(--radius); padding: 22px; }
.group-bar .muted, .shop-hero .muted { color: #cee2d6; }
.group-bar p, .shop-hero p { margin-top: 8px; }
.group-bar select { max-width: 290px; min-width: 170px; border-color: #8ba99b; }
.group-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.group-heading h2 { font-size: 1.45rem; }
.columns, .split { display: grid; gap: 16px; }
.columns { grid-template-columns: 1.5fr 1fr; }
.split { grid-template-columns: 1fr 1fr; }
.row-space { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 13px; }
.tabs { display: flex; gap: 10px; margin: 19px 0 18px; border-bottom: 1px solid var(--line); }
.tabs button { margin-bottom: -1px; padding: 10px 15px 13px; border: none; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-weight: 650; cursor: pointer; }
.tabs button[aria-current] { border-color: var(--green); color: var(--green); }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.metric { display: flex; flex-direction: column; gap: 6px; }
.metric span { color: var(--muted); font-size: .9rem; }
.metric strong { font-size: clamp(1.5rem, 4vw, 2.05rem); font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.panel-title { margin-bottom: 13px; }
.panel-title .muted { margin-top: 5px; line-height: 1.5; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .91rem; }
td, th { padding: 11px 9px; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { background: #f1f6f2; font-size: .875rem; color: #496253; white-space: nowrap; }
td:first-child, th:first-child { padding-left: 10px; }
tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td small { display: block; margin-top: 4px; }
.empty { color: var(--muted); background: #f5f8f5; border: 1px dashed #cddbcf; border-radius: 10px; padding: 20px 15px; line-height: 1.55; }
.group-bar .empty { background: transparent; color: #e8f3eb; }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.form-grid + .form-grid, .editor-section, .form-actions { margin-top: 18px; }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: .9rem; font-weight: 650; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #bfcfc3; border-radius: 8px; background: white; color: var(--text); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
select { appearance: none; padding-right: 27px; background: linear-gradient(45deg,transparent 50%,#4c6555 50%) calc(100% - 16px) 50%/5px 5px no-repeat, linear-gradient(135deg,#4c6555 50%,transparent 50%) calc(100% - 11px) 50%/5px 5px no-repeat, white; }
textarea { min-height: 70px; resize: vertical; }
.auth { max-width: 480px; margin: 60px auto; }
.stack { display: grid; gap: 14px; }
.filters { display: grid; grid-template-columns: minmax(170px, 2fr) minmax(125px, 1fr) auto; align-items: end; gap: 10px; margin: 14px 0; }
.order-table { min-width: 700px; }
.link-button { border: 0; background: transparent; padding: 0; color: var(--green); font: inherit; text-decoration: underline; cursor: pointer; }
.order-code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: .06em; }
.paper-list { margin: 0; padding: 0; list-style: none; }
.paper-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.paper-list strong { white-space: nowrap; }
.editor-items { display: grid; gap: 9px; margin-top: 10px; }
.editor-item { border: 1px solid var(--line); border-radius: 11px; padding: 13px; background: #f8faf7; }
.flavor-fields { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) auto; align-items: end; margin-top: 0; }
dialog { max-width: min(640px, calc(100vw - 24px)); width: 100%; max-height: calc(100vh - 24px); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; color: var(--text); }
dialog::backdrop { background: #142a2390; }
.dialog-content { padding: 22px; }
.shop-shell { max-width: 1000px; }
.shop-hero { padding: clamp(22px, 5vw, 38px); border-radius: 23px; background: radial-gradient(circle at 94% 22%, #2e785f, transparent 55%), var(--deep); color: white; margin-bottom: 18px; }
.shop-hero .section-label { color: #c4edce; }
.shop-hero h1 { margin: 9px 0; }
.shop-details { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 12px; }
.shop-details div { padding: 10px 0; }
.shop-details span { display: block; margin-bottom: 4px; font-size: .875rem; color: #cce5d8; }
.shop-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.shop-list { display: grid; gap: 11px; }
.product-help { margin-top: 6px; }
.product-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.product-row:last-child { border-bottom: 0; }
.product-row h3 { overflow-wrap: anywhere; }
.product-row p { margin-top: 5px; line-height: 1.45; }
.price { color: var(--green); font-weight: 750; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; gap: 4px; align-items: center; }
.stepper .button { width: 36px; padding: 0; min-height: 36px; }
.stepper input { padding: 5px; width: 45px; text-align: center; min-height: 36px; }
.cart { position: sticky; top: 10px; }
.cart .button { width: 100%; }
.receipt { max-width: 650px; margin: auto; }
.receipt-code { background: var(--green-soft); border: 1px solid #c7ddcf; border-radius: 14px; text-align: center; padding: 18px 10px; }
.receipt-code strong { display: block; color: var(--deep); font-size: clamp(1.9rem,7.7vw,3.25rem); }
.receipt-details { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; }
.receipt-details dt { font-weight: 700; }
.receipt-details dd { margin: 0; overflow-wrap: anywhere; }
.cart-shortcut { display: none; }
.shop-card { display: block; color: var(--text); text-decoration: none; }
.shop-card:hover { border-color: var(--green); }
.shop-card p { margin-top: 7px; }
.link-share { margin: 10px 0 0; }
#print-output { display: none; }
@media (max-width: 850px) {
  .columns, .shop-grid { grid-template-columns: 1fr; }
  .cart { position: static; }
  .cart-shortcut { display: flex; position: fixed; right: 15px; bottom: 12px; z-index: 2; box-shadow: 0 5px 16px #153c3260; }
  .shop-shell:has(.cart-shortcut:not([hidden])) { padding-bottom: 78px; }
  .cart { scroll-margin-top: 10px; }
}
@media (max-width: 580px) {
  .topbar { padding: 8px 14px; }
  .shell { padding: 22px 13px 35px; }
  .panel, .group-bar { padding: 15px; }
  .metrics, .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .flavor-fields { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) auto; }
  .split { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
  .tabs { gap: 4px; }
  .tabs button { padding-inline: 9px; font-size: .875rem; }
  .top-actions { justify-content: end; }
  .brand { font-size: 1.12rem; }
}
@media print {
  @page { margin: 10mm; }
  :root, body { background: white; color: #000; }
  body > :not(#print-output) { display: none !important; }
  #print-output { display: block; }
  .print-label { padding: 5mm; border: 1px solid #333; break-inside: avoid; margin-bottom: 5mm; max-width: 135mm; }
  .print-label .order-code { font-size: 24pt; }
  .print-label p, .print-label h3 { margin-top: 2mm; }
  .print-label .paper-list li { border-color: #aaa; }
}
