:root { color-scheme: light; --ink:#262822; --muted:#62695d; --green:#253e35; --paper:#f8f5ee; --line:#e5e4da; --accent:#bd402b; --action:#e64b35; --tab-height:64px; font-family:"PingFang SC","Microsoft YaHei",sans-serif; }
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; background:var(--paper); color:var(--ink); line-height:1.55; }
button,input,textarea { font:inherit; }
button { cursor:pointer; min-height:42px; color:var(--green); background:white; border:1px solid var(--line); border-radius:9px; padding:8px 14px; }
button:disabled { cursor:default; opacity:.55; }
button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible { outline:2px solid var(--green); outline-offset:3px; }
.primary { background:var(--action); color:white; border-color:var(--action); font-weight:650; }
.top { background:var(--paper); border-bottom:1px solid var(--line); }
.top-inner { max-width:1040px; margin:auto; padding:13px 24px; min-height:62px; display:flex; gap:12px; align-items:center; justify-content:space-between; }
.brand { color:var(--ink); text-decoration:none; font-size:21px; font-weight:650; white-space:nowrap; }
#account { display:flex; align-items:center; gap:9px; font-size:13px; }
#account button { min-height:34px; padding:5px 8px; }
main { max-width:1040px; margin:auto; padding:16px 24px 40px; min-height:70vh; }
footer { padding:18px 24px 28px; text-align:center; color:var(--muted); font-size:13px; }
h1,h2,h3,p { margin:0; }
h1 { font-size:29px; letter-spacing:-.04em; }
h2 { font-size:22px; }
h3 { font-size:17px; }
.gate { max-width:430px; margin:42px auto 0; padding:27px; border:1px solid var(--line); background:#fff; border-radius:17px; }
.gate>p { margin-top:7px; }
.gate form { margin:22px 0 12px; }
.gate form button { width:100%; }
.gate-actions,.actions,.inline { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }
.gate-actions { margin-top:15px; }
.id-button { font-size:23px; margin-top:14px; letter-spacing:.07em; font-variant-numeric:tabular-nums; }
label { display:grid; gap:5px; font-size:14px; font-weight:600; }
input,textarea { background:#f6f6f1; width:100%; min-height:44px; padding:8px 11px; border:1px solid #d7dacf; border-radius:8px; color:var(--ink); }
textarea { min-height:78px; resize:vertical; }
form { display:grid; gap:13px; }
.quiet { color:var(--muted); font-size:13px; }
.notice { border-radius:10px; padding:10px 14px; margin-bottom:13px; background:#edf0e8; color:var(--green); overflow-wrap:anywhere; }
.notice.error { color:#982e1c; background:#ffebe4; }
#workspace { padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom)); }
#tabs {
  position:fixed; z-index:10; inset:auto 0 0;
  padding-bottom:env(safe-area-inset-bottom); background:#fff; border-top:1px solid var(--line);
}
.tab-inner { display:flex; max-width:1040px; height:var(--tab-height); margin:auto; }
.tab-inner button { display:grid; flex:1; place-content:center; justify-items:center; gap:4px; padding:4px; color:#656b5f; background:none; border:0; border-radius:0; font-size:12px; white-space:nowrap; }
.tab-inner button[aria-current="page"] { color:var(--accent); font-weight:650; }
.tab-icon { position:relative; width:22px; height:22px; background-size:contain; background-repeat:no-repeat; }
.icon-store { background-image:url('./assets/store.svg'); }
.icon-bag { background-image:url('./assets/bag.svg'); }
.icon-receipt { background-image:url('./assets/receipt.svg'); }
.icon-user { background-image:url('./assets/user.svg'); }
[aria-current="page"] .icon-store { background-image:url('./assets/store-active.svg'); }
[aria-current="page"] .icon-bag { background-image:url('./assets/bag-active.svg'); }
[aria-current="page"] .icon-receipt { background-image:url('./assets/receipt-active.svg'); }
[aria-current="page"] .icon-user { background-image:url('./assets/user-active.svg'); }
.tab-badge,.bag-quantity { background:var(--accent); color:#fff; border-radius:20px; font-size:12px; padding:1px 6px; }
.tab-badge { position:absolute; top:-4px; left:14px; line-height:17px; }
.floating-bag {
  position:fixed; z-index:9; bottom:calc(var(--tab-height) + 10px + env(safe-area-inset-bottom));
  left:50%; transform:translateX(-50%); width:min(992px,calc(100% - 30px));
  background:var(--green); color:white; border:0; border-radius:12px; padding:12px 16px;
  box-shadow:0 5px 16px #253e3529;
}
.bag-quantity { margin-left:5px; }
#content.with-bag { padding-bottom:65px; }
.page-head { display:flex; flex-wrap:wrap; gap:11px; align-items:center; justify-content:space-between; margin-bottom:14px; }
.search { display:flex; align-items:center; gap:10px; padding:0 13px; background:#fff; border:1px solid var(--line); border-radius:9px; margin-bottom:14px; }
.search img { width:19px; height:19px; }
.search input { border:0; background:none; flex:1; min-width:0; padding:8px 0; }
.search input:focus-visible { outline-offset:0; }
.search-count { font-size:12px; color:var(--accent); white-space:nowrap; }
.menu-heading { margin-bottom:10px; }
.menu-heading h1 { font-size:21px; }
.catalog { display:grid; grid-template-columns:85px minmax(0,1fr); gap:16px; align-items:start; }
.menu-categories { display:grid; gap:5px; position:sticky; top:10px; max-height:calc(100dvh - var(--tab-height) - env(safe-area-inset-bottom) - 20px); overflow-y:auto; }
#content.with-bag .menu-categories { max-height:calc(100dvh - var(--tab-height) - env(safe-area-inset-bottom) - 80px); }
.menu-category { min-width:0; padding:8px 4px; line-height:1.4; font-size:14px; border:0; background:none; color:var(--muted); overflow-wrap:anywhere; }
.menu-category[aria-pressed="true"] { color:var(--accent); background:#fbe6de; font-weight:650; }
.grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.grid>.empty { grid-column:1/-1; }
.card { border-radius:13px; background:white; min-width:0; overflow:hidden; }
.product-cover { display:block; width:100%; position:relative; min-height:0; padding:0; border:0; border-radius:0; }
.product-cover img { width:100%; aspect-ratio:2.05; object-fit:cover; display:block; background:#eeeee5; }
.image-tag { position:absolute; left:10px; top:10px; color:white; background:#262822b8; border-radius:5px; padding:3px 7px; font-size:11px; }
.sold-out { position:absolute; inset:0; display:grid; place-items:center; color:white; background:#26282266; font-weight:650; }
.card-body { padding:12px; overflow-wrap:anywhere; }
.product-name { display:block; min-height:0; text-align:left; padding:0; border:0; border-radius:0; background:none; font-size:17px; color:var(--ink); font-weight:650; }
.product-shop { color:#586c51; font-size:13px; margin-top:2px; }
.product-description { margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.product-deadline { color:#586c51; margin-top:4px; }
.product-bottom { margin-top:6px; }
.product-price { white-space:nowrap; }
.product-add { flex:0 0 42px; width:42px; min-height:42px; padding:0; border:0; border-radius:50%; background:var(--action); color:#fff; font-size:23px; line-height:1; }
.row { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.price { color:var(--accent); font-family:"DIN Alternate","PingFang SC","Microsoft YaHei",sans-serif; font-size:20px; font-variant-numeric:tabular-nums; font-weight:700; white-space:nowrap; }
.product-detail-photo { width:100%; max-height:260px; object-fit:cover; border-radius:9px; }
.product-dialog #dialog-body { display:grid; gap:9px; }
.product-detail-description { overflow-wrap:anywhere; white-space:pre-wrap; }
.list { display:grid; gap:11px; }
.panel { background:white; padding:14px 16px; border-radius:12px; overflow-wrap:anywhere; }
.panel>p,.panel>.row,.panel>.actions { margin-top:7px; }
.empty { padding:34px 15px; text-align:center; color:var(--muted); border:1px dashed var(--line); border-radius:12px; }
.tag { background:#edf0e8; color:var(--green); padding:3px 8px; font-size:12px; border-radius:6px; white-space:nowrap; }
.subnav { display:flex; gap:5px; padding:4px; margin-bottom:10px; background:#eaece2; border-radius:9px; }
.subnav button { flex:1; min-height:36px; padding:5px 8px; background:none; border:0; }
.subnav [aria-pressed="true"] { background:white; color:var(--green); font-weight:650; }
.order-filters { display:flex; gap:8px; margin-bottom:12px; }
.order-filters button { min-height:36px; padding:5px 12px; border:0; border-radius:24px; background:#eeeee6; color:var(--muted); }
.order-filters [aria-pressed="true"] { background:var(--green); color:#fff; }
.order-card { padding:10px 13px; }
.order-card h3 { min-width:0; }
.order-card .price { font-size:17px; }
.order-card .row { margin-top:4px; }
.order-card .row:first-child { margin-top:0; }
.order-card .actions button { min-height:35px; padding:4px 10px; font-size:13px; }
.order-card .status-pending { background:#fbe9e3; color:#983927; }
.order-card .status-completed,.order-card .status-cancelled { background:#f1f1e9; color:var(--muted); }
.order-card .tag { flex-shrink:0; }
.order-card .note { color:#80513b; font-size:13px; margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.order-details summary { cursor:pointer; color:#345d47; min-height:36px; display:list-item; padding:6px 0; font-size:13px; }
.order-details p { margin-bottom:4px; }
.cart-item { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid #eeeee6; }
.thumb { width:64px; height:64px; object-fit:cover; border-radius:8px; flex-shrink:0; }
.cart-info { flex:1; min-width:0; }
.cart-info .row { flex-wrap:wrap; }
.cart-info .price { font-size:17px; }
.stepper { display:flex; flex-shrink:0; align-items:center; gap:8px; }
.stepper button { width:38px; min-height:38px; padding:0; border-radius:50%; font-size:18px; }
.stepper span { min-width:16px; text-align:center; }
.cart-shop .cart-total { padding-top:8px; }
.seller-banner { background:var(--green); color:#fff; border-radius:12px; padding:14px 16px; margin-bottom:16px; }
.seller-banner p { color:#e6ebdf; }
.seller-banner button { color:#fff; border-color:#ffffff50; background:transparent; }
.shop-product { display:flex; align-items:center; gap:12px; }
.shop-product-info { flex:1; min-width:0; }
.shop-product-info .row { margin-bottom:4px; }
dialog { width:min(92vw,505px); max-height:85vh; color:var(--ink); padding:20px; border:1px solid var(--line); border-radius:13px; }
dialog::backdrop { background:rgba(25,35,29,.5); }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:13px; }
.columns { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media(max-width:900px) { .grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:650px) {
  main { padding:12px 14px 24px; }
  .top-inner { padding:10px 14px; min-height:54px; }
  .catalog { grid-template-columns:60px minmax(0,1fr); gap:10px; }
  .menu-category { font-size:13px; }
  .grid { grid-template-columns:minmax(0,1fr); gap:11px; }
  .card-body { padding:10px 11px; }
  .gate { margin-top:24px; }
  .checkout-sheet { position:fixed; inset:auto 0 0; width:100%; max-width:none; max-height:88dvh; margin:0; border-radius:17px 17px 0 0; padding-bottom:calc(18px + env(safe-area-inset-bottom)); }
}
@media(max-width:370px) { .cart-item .thumb { width:50px; height:50px; } .stepper { gap:5px; } }
.merge-choices { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.merge-choices legend { padding: 0 5px; color: var(--muted); font-size: 14px; }
.merge-choice { display: flex; align-items: center; gap: 10px; padding: 7px 4px; cursor: pointer; }
.merge-choice input { width: 19px; min-height: 19px; accent-color: var(--green); }
