:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --card: #fff;
  --ink: #172e28;
  --muted: #4c675e;
  --line: #dce5e0;
  --brand: #20594c;
  --brand-dark: #153f35;
  --mint: #e4f1eb;
  --radius: 18px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, a { font: inherit; }
button, .secondary, .primary { cursor: pointer; }
button:disabled { cursor: default; opacity: .51; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #267160; outline-offset: 3px; }
button, input { min-height: 44px; }
input { width: 100%; padding: 10px 12px; color: var(--ink); background: #fcfdfc; border: 1px solid #bacdc3; border-radius: 9px; }
input::placeholder { color: #5c7268; opacity: 1; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 3.3vw, 2.8rem); letter-spacing: -.055em; line-height: 1.16; }
h2 { font-size: 1.13rem; letter-spacing: -.02em; }
p { line-height: 1.55; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 66px; max-width: 1560px; padding: 8px 32px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand, .account { display: flex; align-items: center; gap: 11px; }
.brand { font-size: 1.05rem; font-weight: 800; letter-spacing: .06em; white-space: nowrap; }
.mark { width: 36px; height: 36px; color: #fff; background: var(--brand); border-radius: 9px; font-weight: 600; display: grid; place-items: center; font-size: 1.18rem; }
.account { font-size: .88rem; color: var(--muted); min-width: 0; }
#account { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.workspace { max-width: 1560px; margin: auto; padding: 28px 32px 42px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.intro p { color: var(--muted); margin-top: 8px; }
.sku-search { display: flex; gap: 8px; width: min(100%, 360px); }
.sku-search input { min-width: 0; flex: 1 1 0; }
.sku-search button { flex-shrink: 0; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.facets section { padding: 13px 14px 13px; }
.facets section + section { border-top: 1px solid var(--line); }
.facet-head, .basket-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.facet-head { margin-bottom: 4px; padding-left: 4px; }
.quiet { color: var(--brand); padding: 5px 9px; background: transparent; border: 0; border-radius: 9px; font-weight: 700; font-size: .88rem; }
.quiet:hover:not(:disabled) { background: var(--mint); }
.choices { display: flex; flex-direction: column; gap: 5px; overflow: auto; max-height: 248px; scrollbar-color: #adc2b8 transparent; scrollbar-width: thin; }
.choice { display: flex; justify-content: space-between; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 8px 10px; color: var(--ink); background: #f5f7f6; text-align: left; font-size: .9rem; font-weight: 600; }
.choice-meta { font-size: .82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.choice[aria-pressed="true"] { background: var(--brand); color: white; }
.choice[aria-pressed="true"] .choice-meta { color: #deeee4; }
.choice:hover:not([aria-pressed="true"]) { border-color: #82a597; }
.product-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 70px; margin-bottom: 5px; padding: 2px 0 10px; }
.product-head h2 { font-size: 1.3rem; }
.product-head p, .basket-head p { color: var(--muted); font-size: .89rem; margin-top: 4px; }
.product-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product { position: relative; width: 100%; min-height: 145px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); padding: 13px; }
.product:hover { border-color: #87a99b; }
.product[aria-pressed="true"] { background: #f0f8f3; border-color: #5e9481; box-shadow: inset 0 0 0 1px #5e9481; }
.photo { width: 78px; height: 96px; border-radius: 8px; background: #eef2f0; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; color: var(--muted); font-size: .82rem; }
.photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-right: 7px; }
.sku { font-size: .88rem; font-weight: 800; color: var(--brand); overflow-wrap: anywhere; }
.product-name { font-weight: 750; line-height: 1.35; }
.product-meta { font-size: .82rem; line-height: 1.42; color: var(--muted); overflow-wrap: anywhere; }
.price { font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
.missing { font-size: .81rem; font-weight: 650; color: #76552d; }
.toggle { align-self: start; margin-left: auto; border-radius: 50%; width: 28px; height: 28px; border: 1px solid #a9c5b9; flex: 0 0 28px; display: grid; place-items: center; color: var(--brand); font-size: 1.18rem; background: #f8fbf8; }
.product[aria-pressed="true"] .toggle { color: white; background: var(--brand); border-color: var(--brand); }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--brand); border-radius: 10px; padding: 8px 14px; text-align: center; text-decoration: none; font-size: .9rem; font-weight: 750; }
.primary { color: #fff; background: var(--brand); }
.primary:hover:not(:disabled) { background: var(--brand-dark); }
.secondary { background: #fff; color: var(--brand); border-color: #a6c4b6; }
.secondary:hover:not(:disabled) { background: var(--mint); }
.pager { display: flex; align-items: center; justify-content: center; color: var(--muted); gap: 14px; margin-top: 18px; }
.message { padding: 16px; border: 1px dashed #a6c4b6; border-radius: 12px; color: var(--muted); background: #fff; }
.basket-dock { position: sticky; top: 15px; min-width: 0; }
.basket { padding: 16px; }
.basket-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.basket-rows { max-height: 42vh; overflow: auto; scrollbar-color: #adc2b8 transparent; scrollbar-width: thin; }
.basket-empty { display: grid; min-height: 125px; place-items: center; text-align: center; color: var(--muted); font-size: .9rem; padding: 14px; }
.basket-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.basket-item p { overflow-wrap: anywhere; font-size: .86rem; }
.basket-item .quiet { min-height: 37px; padding: 6px 7px; flex-shrink: 0; }
.basket-item .product-meta { font-size: .8rem; }
.export-form { margin-top: 16px; display: grid; gap: 8px; }
.export-form label, .login-card label { font-size: .9rem; font-weight: 700; }
.export-form .primary { margin-top: 4px; }
.export-status { margin-top: 9px; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.downloads { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 11px; }
.mobile-bar { display: none; }
dialog { border: 1px solid var(--line); color: var(--ink); border-radius: 17px; background: #fff; width: min(90vw, 500px); padding: 15px; }
dialog::backdrop { background: #10261e88; }
.dialog-head, .dialog-top { margin-bottom: 8px; }
.dialog-top { display: flex; justify-content: end; }
.choice-list { display: grid; gap: 6px; max-height: 51vh; overflow: auto; margin-top: 10px; }
.drawer .basket { border: 0; padding: 0; }
.login-card { max-width: 450px; margin: 48px auto; padding: 24px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); display: grid; gap: 10px; }
.login-card h1 { font-size: 1.75rem; margin-bottom: 12px; }
.login-card .primary { margin-top: 10px; }
.login-card p { font-size: .9rem; color: var(--muted); }
.login-view { padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (min-width: 1051px) and (max-width: 1220px) {
  .layout { grid-template-columns: 188px minmax(0, 1fr) 262px; }
  .photo { width: 60px; }
  .product { padding: 9px; gap: 8px; }
}
@media (max-width: 1050px) {
  .layout { grid-template-columns: 205px minmax(0, 1fr); }
  .basket-dock { display: none; }
  .workspace { padding-bottom: 95px; }
  .mobile-bar { display: flex; position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 9px 32px calc(9px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-between; gap: 10px; font-weight: 750; }
  .drawer { margin: auto auto 0; border-radius: 19px 19px 0 0; width: min(100%, 560px); max-width: 100%; padding: 9px 18px calc(14px + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px) {
  .topbar-inner { min-height: 57px; padding: 5px 15px; }
  .mark { width: 32px; height: 32px; }
  .workspace { padding: 19px 13px 95px; }
  .intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
  .intro p { margin-top: 5px; font-size: .91rem; }
  .sku-search { width: 100%; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .facets section { padding: 4px 8px 8px; }
  .facet-head { margin: 0 0 2px; }
  .facet-head h2 { font-size: 1rem; }
  .choices { flex-direction: row; gap: 6px; overscroll-behavior-inline: contain; padding-bottom: 2px; }
  .choice { flex-shrink: 0; white-space: nowrap; padding: 8px 10px; }
  .choice-list .choice { width: 100%; }
  .product-head { min-height: 63px; margin-bottom: 0; }
  .product-head h2 { font-size: 1.16rem; }
  .product-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .product { min-height: 108px; padding: 9px 12px; }
  .photo { width: 69px; height: 84px; }
  .product-copy { gap: 3px; }
  .mobile-bar { padding-left: 14px; padding-right: 14px; }
  .mobile-bar button { min-width: 134px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .12s, border-color .12s; }
}
