:root {
  color-scheme: light;
  --paper: #f7f7f1;
  --white: #fff;
  --ink: #172620;
  --muted: #516258;
  --green: #175841;
  --dark: #0d392a;
  --line: #dce4db;
  --tint: #e8f2e9;
  --warm: #f6f0e0;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; gap: .35rem; min-height: 44px;
  padding: .55rem .92rem; border: 1px solid var(--line); border-radius: 9px;
  background: var(--white); color: var(--ink); font-weight: 650; line-height: 1.25;
  text-align: center; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { border-color: #a6beb0; }
button:disabled, .button:disabled { opacity: .52; cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid #367e58; outline-offset: 3px;
}
.primary { background: var(--green); border-color: var(--green); color: #fff; }
.primary:hover { background: var(--dark); border-color: var(--dark); }
.wide { width: 100%; }
.link, .icon { background: transparent; border: 0; }
.icon { font-size: 1.4rem; min-width: 44px; padding: .25rem; }
h1, h2, h3, p { margin: 0 0 .65rem; }
h1, h2, h3 { line-height: 1.25; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.65rem,4vw,2.35rem); letter-spacing: -.04em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.025rem; }
p:last-child { margin-bottom: 0; }
small, .muted { color: var(--muted); font-size: .875rem; }
.lede { color: var(--muted); }
.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.narrow { max-width: 690px; }
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.top-inner { min-height: 68px; display: flex; justify-content: space-between; gap: .6rem; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.025rem; font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.brandmark { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 35px; border-radius: 9px; background: var(--dark); color: #fff; font-family: "Songti SC", SimSun, serif; }
.top nav { display: flex; gap: clamp(.65rem, 3vw, 2rem); }
.top nav a { padding: .4rem 0; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.top nav a:hover, .footer a:hover, .row-name a:hover { color: var(--green); text-decoration: underline; }
.testbar { text-align: center; background: var(--warm); color: #614612; padding: .4rem .75rem; font-size: .875rem; }
.home { padding: 1.45rem 0 2.75rem; }
.hero {
  isolation: isolate; position: relative; overflow: hidden; display: flex; align-items: center; min-height: 320px;
  border-radius: 18px; color: #fffdf1; background: #071a12;
}
.hero img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero::after { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(90deg,#071a12 0%,#071a126e 50%,transparent 81%); }
.hero-copy { width: min(100%, 670px); padding: 2.25rem clamp(1.2rem,6vw,4.6rem); }
.hero-copy h1 { font-size: clamp(2.15rem,5.3vw,4.05rem); letter-spacing: -.06em; margin: .75rem 0 .85rem; }
.hero-copy p { max-width: 32rem; color: #e1e9db; }
.hero-copy .hero-name { color: #bfdec8; font-size: .9rem; letter-spacing: .13em; }
.hero-button { margin-top: .85rem; color: #123629; background: #f1f3e7; border-color: #f1f3e7; padding-inline: 1.1rem; }
.quick { display: grid; grid-template-columns: repeat(3,1fr); gap: .8rem; margin: .9rem 0; }
.quick > * {
  display: flex; justify-content: flex-start; align-items: center; gap: .7rem; text-align: left; min-width: 0;
  background: var(--white); color: var(--ink); text-decoration: none; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 11px;
}
.quick small { display: block; margin-top: .12rem; font-weight: 400; }
.quick-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: 0 0 2.25rem; border-radius: 8px; color: var(--green); background: var(--tint); font-size: 1.3rem; }
.notice { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; padding: .15rem .65rem .15rem 1rem; border-radius: 9px; background: var(--tint); overflow-wrap: anywhere; white-space: pre-wrap; }
.notice strong { margin-right: .45rem; }
.guide-fold { border: 1px solid var(--line); border-radius: 10px; background: var(--white); margin-bottom: 1.25rem; }
.guide-fold summary { padding: .7rem 1rem; cursor: pointer; font-weight: 650; }
.guide-fold .guide-grid { padding: 0 .75rem .75rem; }
.guide-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .7rem; }
.guide-item { background: var(--white); border: 1px solid var(--line); padding: .8rem 1rem; border-radius: 9px; white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-item p { color: var(--muted); }
.guide-entry { display: flex; width: 100%; justify-content: space-between; margin-bottom: 1.25rem; padding-inline: 1rem; }
.guide-entry span { font-size: 1.2rem; line-height: 1; }
.home-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; gap: .55rem; margin-bottom: 1rem; }
.home-tools .guide-entry { margin: 0; }
@media (max-width: 420px) {
  .home-tools { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-tools .install-entry { grid-column: 1 / -1; }
}
.install-entry { white-space: nowrap; color: var(--dark); border-color: var(--green); }
.app-installed .install-entry { display: none; }
@media (display-mode: standalone) { .install-entry { display: none; } }
#order-guide .guide-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
#order-guide .guide-item { background: var(--paper); }
.guide-actions { justify-content: space-between; margin-top: .85rem; }
.guide-actions .link { color: var(--green); text-decoration: underline; }
@media (max-width: 560px) { #order-guide .guide-grid { grid-template-columns: 1fr; } }
.catalog { display: grid; grid-template-columns: 195px minmax(0,1fr); gap: 1.15rem; align-items: start; scroll-margin-top: 1rem; }
.side { border: 1px solid var(--line); border-radius: 12px; background: var(--white); padding: 1rem .65rem .6rem; }
.side h2 { padding-inline: .4rem; }
.side button { width: 100%; justify-content: flex-start; border-color: transparent; margin-bottom: .2rem; overflow-wrap: anywhere; text-align: left; }
.side-children { padding-left: .8rem; }
button[aria-pressed="true"] { background: var(--tint); color: var(--dark); border-color: #c4dbc9; }
.listing-head { display: flex; justify-content: space-between; gap: .6rem; align-items: center; margin-bottom: .7rem; }
.listing-head h2 { font-size: 1.48rem; margin-bottom: .1rem; }
.listing-head p { color: var(--muted); font-size: .875rem; }
.listing-head .search { width: min(100%,300px); display: flex; align-items: center; position: relative; gap: 0; }
.search > span { position: absolute; left: .7rem; font-size: 1.3rem; color: var(--green); }
.search input[type=search] { padding-left: 2rem; }
.mobile-cats { display: none; }
#products, .admin-list { display: grid; gap: .65rem; }
.product-row { display: grid; grid-template-columns: 70px minmax(135px,1fr) minmax(120px,.62fr) auto; align-items: center; gap: .85rem; padding: .86rem; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.product-art { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: radial-gradient(ellipse at 75% 15%,#438368,#124834 62%,#0c3829); color: #e8f3e3; text-decoration: none; }
.product-art span { display: grid; place-items: center; width: 58%; aspect-ratio: 1; border: 1px solid #a9cfaf82; border-radius: 50%; font-family: "Songti SC", SimSun, serif; font-size: 1.25em; }
.product-art img { width: 100%; height: 100%; object-fit: cover; }
.row-name a { text-decoration: none; }
.row-name h3 { margin: 0 0 .2rem; }
.row-name p { color: var(--muted); font-size: .875rem; margin-bottom: .35rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.row-name select { width: auto; max-width: 100%; min-height: 36px; padding-block: .25rem; font-size: .875rem; }
.price { color: var(--green); font-size: 1.55rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badges, .price-line, .selector, .stack-actions, .order-actions { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; }
.price-line { gap: .65rem; margin: .65rem 0; }
.chip { display: inline-flex; padding: .2rem .45rem; border-radius: 5px; font-size: .875rem; font-weight: 650; background: var(--tint); color: var(--dark); white-space: nowrap; }
.chip.manual { background: var(--warm); color: #634b22; }
.stock { font-size: .875rem; color: var(--muted); }
.empty-stock { color: #8d432b; }
.footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; border-top: 1px solid var(--line); color: var(--muted); padding: 1rem 0 5rem; font-size: .875rem; }
.footer > div { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.footer .link { padding-inline: 0; font-size: inherit; color: inherit; }
.help { position: fixed; bottom: max(env(safe-area-inset-bottom), .85rem); right: max(env(safe-area-inset-right), .85rem); z-index: 3; box-shadow: 0 5px 20px #0d392a23; background: var(--dark); color: #fff; border-color: var(--dark); border-radius: 40px; }
.page { padding-block: 1.55rem 3rem; }
.page-block { margin-top: 1rem; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 13px; padding: clamp(.86rem,3vw,1.5rem); min-width: 0; }
.empty { text-align: center; color: var(--muted); padding-block: 2rem; }
.back { display: inline-block; margin-bottom: .75rem; color: var(--green); }
.detail-grid { display: grid; grid-template-columns: minmax(0,.7fr) minmax(0,1fr); gap: 1rem; align-items: start; }
.detail-art { max-height: 520px; font-size: 3.6rem; }
.detail-art img { object-fit: contain; }
.product-description { margin-block: .9rem; }
.product-description h2 { font-size: 1rem; }
.tutorials .guide-fold + .guide-fold { margin-top: .6rem; }
.eyebrow { display: block; color: var(--green); font-size: .9rem; font-weight: 700; margin-bottom: .4rem; }
.pairs { display: grid; margin: .7rem 0 1rem; }
.pairs > div { display: grid; grid-template-columns: minmax(110px,.36fr) minmax(0,1fr); gap: .65rem; padding: .46rem 0; border-bottom: 1px solid var(--line); }
.pairs dt { color: var(--muted); font-size: .9rem; }
.pairs dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
form { margin: 0; }
form > label, .field-grid > label, .filter-grid > label, .file-field label { margin-bottom: .75rem; }
label { display: grid; gap: .28rem; font-size: .9rem; font-weight: 650; min-width: 0; }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 44px; min-width: 0; padding: .52rem .7rem; border: 1px solid #c8d5cc; border-radius: 8px; background: #fff; color: var(--ink); font-size: 1rem; font-weight: 400; }
select { appearance: none; padding-right: 1.85rem; background-image: linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position: right 12px center,right 7px center; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { min-height: 86px; resize: vertical; }
.check { display: flex; align-items: center; gap: .55rem; min-height: 44px; }
input[type=checkbox] { width: 19px; height: 19px; flex: 0 0 19px; accent-color: var(--green); }
.split, .confirm-line { display: flex; justify-content: space-between; align-items: center; gap: .65rem; }
.confirm-line { margin-block: .75rem; }
.split > *, .owner-head > * { min-width: 0; }
.order-id, .delivery { display: flex; align-items: center; gap: .5rem; justify-content: space-between; padding: .5rem; border-radius: 8px; background: var(--paper); margin-block: .65rem; }
code, pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.order-id button, .delivery button { flex-shrink: 0; }
.order-actions { margin: .65rem 0; }
#pay { margin-bottom: .65rem; }
.inline-error { color: #843219; background: #faeee5; padding: .55rem .65rem; border-radius: 7px; }
dialog { width: min(100% - 24px, 660px); max-height: min(90dvh, 850px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 15px; padding: clamp(.85rem, 3vw, 1.5rem); color: var(--ink); background: var(--white); }
dialog::backdrop { background: #06181192; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.dialog-head h2 { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
#toast { position: fixed; bottom: max(4.3rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 20; max-width: 90%; width: max-content; border-radius: 9px; padding: .65rem .9rem; background: #142c22; color: white; overflow-wrap: anywhere; }
body:has(dialog[open]) #toast { display: none; }
.dialog-toast { padding: .45rem .6rem; margin-top: .5rem; border-radius: 7px; background: var(--tint); color: var(--dark); }
.clipboard { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
.owner { max-width: 1020px; }
.owner-head { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.admin-tabs { display: flex; overflow-x: auto; gap: .55rem; padding: .1rem .12rem .45rem; margin-bottom: .85rem; }
.admin-tabs button { flex: 0 0 auto; }
.page-title { margin-block: .6rem 1rem; }
.page-title h1, .split p { margin-bottom: .18rem; }
.page-title > button, .admin-list .split > button { flex-shrink: 0; }
.admin-product > .split { align-items: flex-start; margin-bottom: .6rem; }
.admin-product-summary { display: flex; gap: .65rem; align-items: center; overflow-wrap: anywhere; }
.admin-cover { width: 50px; flex: 0 0 50px; }
.owner-tasks { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .55rem; margin: .65rem 0 1rem; }
.support-messages { list-style: none; margin: .65rem 0; padding: 0; display: grid; gap: .45rem; }
.support-message { background: var(--paper); border-radius: 9px; padding: .55rem .7rem; }
.support-message.owner { background: var(--tint); }
.support-byline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .7rem; margin-bottom: .22rem; font-size: .85rem; }
.support-byline time { color: var(--muted); }
@media (max-width: 520px) { .owner-tasks { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.owner-tasks button { justify-content: space-between; padding-inline: .7rem; border-radius: 10px; font-size: .9rem; }
.owner-tasks button strong { min-width: 1.55rem; padding: .13rem .26rem; border-radius: 999px; background: var(--paper); text-align: center; font-variant-numeric: tabular-nums; }
.owner-tasks button.has-tasks { color: var(--dark); border-color: var(--green); background: var(--tint); }
.owner-tasks button.has-tasks strong { color: #fff; background: var(--green); }
.product-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: .6rem .8rem; }
#product-count { margin: .6rem 0; scroll-margin: 1rem; }
.product-pages { justify-content: center; }
.manual-inventory[hidden] { display: none; }
.stock-label { display: inline-block; width: fit-content; padding: .12rem .54rem; border-radius: 99px; font-size: .82rem; font-weight: 650; }
.stock-label.in-stock { background: var(--tint); color: var(--dark); }
.stock-label.out-of-stock { background: var(--paper); color: var(--muted); }
.bulk-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .45rem .65rem; margin-block: .65rem; }
.bulk-toolbar[hidden] { display: none; }
.bulk-toolbar > span { font-weight: 650; }
.bulk-toolbar button { padding-inline: .62rem; }
.bulk-result { margin-bottom: .65rem; }
.bulk-result ul, .bulk-confirm-list { padding-inline-start: 1.25rem; overflow-wrap: anywhere; }
.product-select { margin: 0 -.25rem 0 0; min-width: 40px; min-height: 44px; place-items: center; cursor: pointer; }
.draft-issues { padding: .42rem .6rem; margin: 0 0 .4rem; border-radius: 7px; background: var(--warm); color: #624b22; font-size: .875rem; }
.draft-issues strong { margin-right: .35rem; }
button[aria-busy="true"]::before { content: ''; width: .85rem; height: .85rem; margin-right: .25rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spinner .8s linear infinite; }
@keyframes button-spinner { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button[aria-busy="true"]::before { animation: none; } }
@media (max-width: 650px) { .product-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } .product-filters > :first-child { grid-column: 1 / -1; } }
@media (max-width: 360px) { .owner-tasks button { flex-wrap: wrap; justify-content: center; gap: .2rem; } }
.price-form { border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) minmax(90px,155px) auto; align-items: end; gap: .6rem; padding: .52rem 0; }
.owner-price label { margin: 0; }
.owner-price .supplier-price { display: block; margin-top: .22rem; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.price-form small { display: block; }
.stock-control { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .25rem; }
.stock-control button { font-size: .82rem; padding-inline: .5rem; }
.variant-editor { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; min-width: 0; margin: .65rem 0; }
.variant-editor legend { font-weight: 700; color: var(--green); }
.recovery-panel { padding: 0 .85rem .85rem; }
.payment-qr { display: block; width: min(100%, 260px); height: auto; margin: 1rem auto; }
.reference-results { grid-column: 1 / -1; }
.field-grid, .filter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .1rem .65rem; }
.filter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; margin-bottom: .7rem; }
.filter-grid label { margin-bottom: .35rem; }
.filter-grid button { margin-bottom: .35rem; }
.file-field { margin-bottom: .75rem; }
.file-field img { display: block; max-width: 100%; max-height: 110px; border-radius: 8px; margin-bottom: .35rem; }
.preview-art { width: 95px; margin-bottom: .65rem; }
.login { max-width: 420px; margin-inline: auto; }

@media (max-width: 720px) {
  .wrap { width: calc(100% - 26px); }
  .top-inner { min-height: 57px; }
  .top nav { gap: .65rem; }
  .top nav a:first-child { display: none; }
  .brandmark { width: 30px; height: 30px; flex-basis: 30px; }
  .brand { gap: .45rem; font-size: .96rem; }
  .home { padding-top: .75rem; }
  .hero { min-height: 225px; border-radius: 13px; }
  .hero img { object-position: 65% center; }
  .hero::after { background: linear-gradient(90deg,#071a12 0%,#071a12b5 52%,#071a1210); }
  .hero-copy { padding: 1rem 1.05rem; }
  .hero-copy h1 { margin: .45rem 0; max-width: 100%; }
  .hero-copy p:not(.hero-name) { max-width: min(100%, 18rem); }
  .hero-button { margin-top: .35rem; }
  .quick { gap: .42rem; margin-block: .55rem; }
  .quick > * { padding: .5rem .25rem; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .25rem; font-size: .875rem; }
  .quick small { display: none; }
  .quick-icon { width: 1.8rem; height: 1.8rem; flex-basis: 1.8rem; font-size: 1rem; }
  .guide-fold { margin-bottom: .85rem; }
  .guide-entry { margin-bottom: .85rem; }
  .guide-grid { grid-template-columns: 1fr; }
  .catalog { display: block; }
  .side { display: none; }
  .listing { display: flex; flex-direction: column; }
  .listing-head { display: contents; }
  .listing-head > div { order: 0; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
  .listing-head .search { order: 2; width: 100%; margin: .42rem 0 .55rem; }
  .mobile-cats { display: block; order: 1; min-width: 0; }
  .scroll-cats { display: flex; overflow-x: auto; gap: .35rem; padding: .1rem .12rem .2rem; }
  .scroll-cats button { flex: 0 0 auto; font-size: .9rem; padding-inline: .68rem; }
  .sub-cats button { background: transparent; }
  .sub-cats button[aria-pressed="true"] { background: var(--tint); }
  #products { order: 3; }
  .product-row { grid-template-columns: 46px minmax(0,1fr) 106px; grid-template-areas: "art name name" ". meta cta"; gap: .38rem .55rem; padding: .62rem .55rem; }
  .product-row > .product-art { grid-area: art; align-self: start; }
  .row-name { grid-area: name; }
  .row-meta { grid-area: meta; }
  .row-cta { grid-area: cta; align-self: center; justify-self: start; padding-inline: .52rem; }
  .help { width: 44px; padding: 0; font-size: .82rem; }
  .help span { display: none; }
  .price { font-size: 1.42rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-art { aspect-ratio: 2.6; font-size: 1.7rem; }
  .detail-art span { width: min(23%,100px); }
  .pairs > div { grid-template-columns: minmax(80px,.39fr) minmax(0,1fr); gap: .4rem; }
  .admin-product > .split { flex-wrap: wrap; }
  .price-form { gap: .3rem; grid-template-columns: minmax(0,1fr) minmax(64px,.8fr) auto; }
  .price-form button { padding-inline: .42rem; }
  .price-form input { padding-inline: .42rem; }
  .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-tabs { gap: .32rem; }
  .admin-tabs button { padding-inline: .57rem; font-size: .9rem; }
}
@media (max-width: 365px) {
  .top nav a:not(:first-child) { display: inline-flex; min-height: 44px; align-items: center; }
  .field-grid { grid-template-columns: 1fr; }
  .confirm-line { flex-wrap: wrap; }
  .admin-tabs { display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr 1.3fr; gap: .26rem; }
  .admin-tabs button { min-width: 0; padding-inline: .18rem; font-size: .82rem; white-space: nowrap; }
}
