:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e8eaf0;
  --text: #222733;
  --muted: #6b7280;
  --green: #47c894;
  --red: #f0352f;
  --gold: #fff0bd;
  --blue: #2d8cf0;
  --shadow: 0 8px 24px rgba(24, 39, 75, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
.site-shell { min-height: 100vh; padding-bottom: 72px; }
.topbar { height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 22px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0; }
.brand-mark { width: 52px; height: 28px; display: inline-grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4ba3ff, #1653b8); border-radius: 3px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.brand-text { font-size: 18px; }
.topnav { display: flex; align-items: center; gap: 34px; font-size: 14px; color: #3f4652; white-space: nowrap; }
.topnav a:hover { color: var(--blue); }
.notice-row { height: 58px; display: flex; align-items: center; gap: 10px; background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 16px; overflow: hidden; }
.notice-badge { flex: 0 0 auto; font-weight: 800; color: #111827; padding-left: 3px; border-left: 4px solid #111827; }
.notice-text { white-space: nowrap; color: #5b6472; font-size: 14px; animation: marquee 28s linear infinite; }
@keyframes marquee { from { transform: translateX(18%); } to { transform: translateX(-100%); } }
.category-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 98px; gap: 12px; overflow-x: auto; background: var(--panel); padding: 22px 28px 18px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.category-item { display: grid; justify-items: center; gap: 9px; min-width: 88px; cursor: pointer; color: #1f2937; font-weight: 700; font-size: 13px; border: 0; background: transparent; font-family: inherit; padding: 0; }
.category-icon { width: 74px; height: 74px; border-radius: 17px; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 900; box-shadow: 0 10px 18px rgba(20, 35, 60, .13); border: 1px solid rgba(255,255,255,.7); }
.category-item.active .category-icon { outline: 3px solid rgba(45,140,240,.18); transform: translateY(-1px); }
.category-name { max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.products-section { padding: 18px 18px 28px; }
.section-title { display: flex; align-items: center; gap: 8px; height: 42px; }
.title-icon { color: #4b5563; font-size: 18px; }
h1 { margin: 0; font-size: 18px; line-height: 1; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 34px; }
.product-card { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); min-height: 96px; background: var(--panel); border: 1px solid #edf0f5; box-shadow: 0 2px 8px rgba(17, 24, 39, .04); overflow: hidden; }
.cover { display: grid; place-items: center; padding: 8px; }
.cover-inner { width: 78px; height: 78px; border-radius: 8px; color: #fff; display: grid; align-content: center; justify-items: center; gap: 3px; font-weight: 900; text-align: center; box-shadow: inset 0 -16px 0 rgba(0,0,0,.12); }
.cover-inner.image-cover { overflow: hidden; background: #fff; box-shadow: 0 8px 18px rgba(20, 35, 60, .14); }
.cover-inner.image-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-main { font-size: 19px; }
.cover-sub { font-size: 11px; opacity: .95; }
.product-main { min-width: 0; padding: 10px 110px 38px 0; }
.product-title { margin: 0 0 7px; font-size: 15px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { height: 22px; line-height: 20px; padding: 0 8px; border-radius: 3px; border: 1px solid currentColor; font-size: 12px; background: #fff; }
.tag.green { color: #3bb981; }
.tag.red { color: #d94b42; }
.tag.gold { color: #c19b35; }
.price-bar { position: absolute; left: 96px; right: 0; bottom: 0; height: 34px; display: flex; align-items: center; background: var(--gold); padding-left: 12px; color: #7d4a10; font-weight: 800; }
.price { font-size: 17px; color: #8b4a0f; }
.price small { font-size: 12px; margin-left: 1px; color: #8b4a0f; }
.hot-corner { position: absolute; right: 0; bottom: 0; width: 78px; height: 42px; padding-top: 8px; text-align: center; color: #fff; font-size: 12px; line-height: 1.2; background: var(--red); clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%); }
.float-service { position: fixed; right: 8%; bottom: 96px; z-index: 30; height: 70px; min-width: 118px; border-radius: 22px; background: #2f8bed; color: #fff; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 800; box-shadow: 0 12px 28px rgba(45,140,240,.36); }
.float-service .bubble { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.2); }
.bottom-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; height: 62px; background: rgba(255,255,255,.98); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); box-shadow: 0 -8px 22px rgba(17,24,39,.06); }
.bottom-tabs a { display: grid; place-items: center; align-content: center; gap: 3px; color: #6b7280; font-size: 12px; font-style: normal; }
.bottom-tabs span { font-size: 22px; line-height: 1; }
.bottom-tabs em { font-style: normal; }
.bottom-tabs a.active { color: #111827; }
.empty-state { margin: 20px auto 0; max-width: 420px; min-height: 140px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); background: var(--panel); border: 1px dashed #cfd6e2; }
.empty-state[hidden] { display: none !important; }
.products-section.detail-mode { padding: 18px 18px 96px; }
.detail-page { max-width: 1080px; margin: 0 auto; }
.detail-back { display: inline-flex; align-items: center; height: 34px; margin-bottom: 12px; color: #4b5563; font-size: 14px; font-weight: 700; }
.detail-back:hover { color: var(--blue); }
.detail-hero { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; background: var(--panel); border: 1px solid #edf0f5; padding: 22px; box-shadow: 0 2px 8px rgba(17, 24, 39, .04); }
.detail-cover { width: 100%; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; background: #f8fafc; border: 1px solid var(--line); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-size: 54px; font-weight: 900; }
.detail-summary { min-width: 0; display: grid; align-content: start; gap: 14px; }
.detail-summary h1 { font-size: 22px; line-height: 1.35; margin: 0; }
.detail-desc { margin: 0; color: var(--muted); line-height: 1.7; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-price { display: flex; align-items: baseline; gap: 3px; color: #8b4a0f; font-size: 30px; font-weight: 900; background: var(--gold); padding: 12px 14px; width: fit-content; min-width: 180px; }
.detail-price small { font-size: 14px; font-weight: 800; }
.detail-skus { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-sku { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid #d7dce6; background: #fff; color: #374151; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.detail-sku.selected { color: #e5322d; border-color: #e5322d; box-shadow: inset 0 0 0 1px #e5322d; }
.detail-sku.sold-out { color: #9ca3af; background: #f3f4f6; text-decoration: line-through; cursor: not-allowed; }
.detail-buy { width: 180px; height: 42px; border: 0; background: var(--red); color: #fff; font-family: inherit; font-size: 16px; font-weight: 900; cursor: pointer; }
.detail-buy:disabled { background: #aeb7c5; cursor: not-allowed; }
.detail-content { margin-top: 18px; background: var(--panel); border: 1px solid #edf0f5; padding: 22px; box-shadow: 0 2px 8px rgba(17, 24, 39, .04); }
.detail-content h2 { margin: 0 0 14px; font-size: 18px; }
.detail-rich { color: #343b48; line-height: 1.85; font-size: 15px; overflow-wrap: anywhere; }
.detail-rich p { margin: 0 0 12px; }
.detail-rich img, .detail-rich-image { max-width: 100%; height: auto; display: block; margin: 12px 0; border-radius: 6px; }
.detail-rich a { color: var(--blue); text-decoration: underline; }
.detail-empty { display: grid; }
body.modal-open { overflow: hidden; }
.checkout-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.checkout-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .52); }
.checkout-panel { position: relative; width: min(100%, 480px); max-height: calc(100vh - 36px); overflow-y: auto; background: #fff; padding: 24px; box-shadow: 0 22px 60px rgba(17, 24, 39, .28); }
.checkout-panel h2 { margin: 0 36px 4px 0; font-size: 21px; }
.checkout-close { position: absolute; top: 13px; right: 13px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: #f1f3f6; color: #4b5563; font-size: 25px; line-height: 1; cursor: pointer; }
.checkout-product-name { margin: 0 0 18px; color: #5b6472; font-size: 14px; line-height: 1.55; }
.checkout-field { display: grid; gap: 8px; margin-bottom: 15px; }
.checkout-label, .checkout-channels legend { color: #303744; font-size: 13px; font-weight: 800; }
.checkout-input { width: 100%; height: 42px; border: 1px solid #d7dce6; padding: 0 12px; color: var(--text); background: #fff; font: inherit; font-size: 14px; outline: none; }
.checkout-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45, 140, 240, .12); }
.checkout-sku-list { display: flex; flex-wrap: wrap; gap: 8px; }
.checkout-sku { min-height: 36px; border: 1px solid #d7dce6; background: #fff; padding: 0 10px; color: #374151; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.checkout-sku.selected { color: #e5322d; border-color: #e5322d; box-shadow: inset 0 0 0 1px #e5322d; }
.quantity-stepper { display: grid; grid-template-columns: 40px 64px 40px; width: fit-content; height: 38px; border: 1px solid #d7dce6; }
.quantity-stepper button { border: 0; background: #f6f7f9; color: #374151; font-size: 18px; cursor: pointer; }
.quantity-stepper input { min-width: 0; border: 0; border-left: 1px solid #d7dce6; border-right: 1px solid #d7dce6; text-align: center; font: inherit; font-weight: 800; outline: none; appearance: textfield; }
.quantity-stepper input::-webkit-inner-spin-button { appearance: none; }
.checkout-channels { display: grid; gap: 8px; margin: 0 0 15px; padding: 0; border: 0; }
.checkout-channels legend { margin-bottom: 8px; }
.checkout-channels label { min-height: 42px; display: flex; align-items: center; gap: 9px; border: 1px solid #d7dce6; padding: 0 12px; cursor: pointer; }
.checkout-channels img { width: 24px; height: 24px; object-fit: contain; }
.checkout-no-payment { margin: 2px 0 15px; padding: 11px 12px; border-left: 3px solid #d5a528; background: #fff8df; color: #795b0b; font-size: 13px; line-height: 1.6; }
.checkout-total { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; padding-top: 13px; border-top: 1px solid var(--line); color: #4b5563; }
.checkout-total strong { color: #d52f29; font-size: 21px; }
.checkout-error { margin: 0 0 12px; padding: 9px 10px; background: #fff0ef; color: #c52c27; font-size: 13px; }
.checkout-submit { width: 100%; height: 46px; border: 0; background: var(--red); color: #fff; font: inherit; font-size: 16px; font-weight: 900; cursor: pointer; }
.checkout-submit:disabled { background: #aeb7c5; cursor: wait; }
.checkout-tip { margin: 10px 0 0; text-align: center; color: #7b8492; font-size: 12px; }
.order-result { max-width: 680px; margin: 30px auto; background: #fff; border: 1px solid #edf0f5; padding: 30px; text-align: center; box-shadow: var(--shadow); }
.order-result-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: #3fbd83; color: #fff; font-size: 30px; font-weight: 900; }
.order-result h1 { font-size: 23px; }
.order-result-status { display: inline-block; margin: 12px 0 18px; padding: 5px 12px; background: #fff4ce; color: #8a5a00; font-weight: 800; }
.order-payment-note { margin: 0 0 18px; padding: 12px; background: #fff8df; color: #795b0b; line-height: 1.65; text-align: left; }
.order-result dl { margin: 0; border-top: 1px solid var(--line); text-align: left; }
.order-result dl div { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.order-result dt { color: #727b89; }
.order-result dd { margin: 0; overflow-wrap: anywhere; color: #252b35; font-weight: 800; }
.order-result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.order-result-actions a, .order-result-actions button { min-width: 120px; height: 40px; display: inline-grid; place-items: center; border: 1px solid #d7dce6; background: #fff; color: #374151; font: inherit; font-weight: 800; cursor: pointer; }
.order-result-actions a { background: var(--blue); border-color: var(--blue); color: #fff; }
.payment-qr { display: grid; justify-items: center; gap: 8px; margin: 18px 0 0; }
.payment-qr img { width: 210px; height: 210px; object-fit: contain; }
.fulfillment-box { margin-top: 18px; padding: 15px; background: #f8fafc; text-align: left; }
.fulfillment-box h2 { margin: 0 0 10px; font-size: 16px; }
.fulfillment-box pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; }
.orders-page { max-width: 900px; margin: 12px auto 40px; }
.orders-title { margin-bottom: 16px; }
.orders-title h1 { font-size: 24px; line-height: 1.3; }
.orders-title p { margin: 7px 0 0; color: var(--muted); }
.order-search-form { display: grid; grid-template-columns: minmax(0, 1fr) 100px; margin-bottom: 15px; background: #fff; border: 1px solid #dde2ea; }
.order-search-form input { min-width: 0; height: 46px; border: 0; padding: 0 14px; font: inherit; outline: none; }
.order-search-form button { border: 0; background: var(--blue); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.order-search-error { margin: -5px 0 14px; color: #d52f29; }
.saved-orders-list { display: grid; gap: 14px; }
.saved-order-card { background: #fff; border: 1px solid #e5e8ee; box-shadow: 0 3px 12px rgba(17, 24, 39, .05); }
.saved-order-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.saved-order-head div { min-width: 0; display: grid; gap: 3px; }
.saved-order-head span { color: #7a8390; font-size: 12px; }
.saved-order-head strong { overflow-wrap: anywhere; font-size: 14px; }
.order-status { flex: 0 0 auto; padding: 5px 9px; background: #fff3ca; color: #855800; font-size: 13px; }
.order-status.status-delivered, .order-status.status-completed { background: #e3f7ed; color: #16724c; }
.order-status.status-canceled, .order-status.status-expired { background: #f0f1f3; color: #707885; }
.saved-order-product { display: grid; grid-template-columns: minmax(0, 1fr) 60px 120px; gap: 12px; align-items: center; padding: 16px; }
.saved-order-product h2 { margin: 0; font-size: 15px; line-height: 1.5; }
.saved-order-product span { color: var(--muted); text-align: center; }
.saved-order-product strong { color: #d52f29; text-align: right; }
.saved-order-tip { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff9e8; color: #7b6017; font-size: 13px; }
.saved-fulfillment { margin: 0 16px 16px; padding: 14px; border: 1px solid #bfe5d2; background: #f1fbf6; text-align: left; }
.saved-fulfillment h3 { margin: 0 0 9px; color: #16724c; font-size: 14px; }
.saved-fulfillment pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #24362d; font: 14px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.orders-empty, .orders-loading { padding: 34px 18px; background: #fff; border: 1px dashed #cfd6e2; color: var(--muted); text-align: center; }
@media (max-width: 760px) {
  .topbar { height: 52px; padding: 0 12px; }
  .brand-text { display: none; }
  .topnav { gap: 18px; font-size: 13px; }
  .notice-row { height: 44px; padding: 0 10px; }
  .category-strip { grid-auto-columns: 76px; gap: 8px; padding: 16px 12px 14px; }
  .category-icon { width: 58px; height: 58px; border-radius: 14px; font-size: 18px; }
  .category-name { max-width: 74px; font-size: 12px; }
  .products-section { padding: 14px 8px 24px; }
  .product-grid { grid-template-columns: 1fr; gap: 10px; }
  .product-card { grid-template-columns: 86px minmax(0, 1fr); min-height: 92px; }
  .cover-inner { width: 70px; height: 70px; }
  .product-main { padding-right: 82px; }
  .price-bar { left: 86px; }
  .hot-corner { width: 72px; }
  .float-service { right: 18px; bottom: 80px; height: 56px; min-width: 96px; border-radius: 18px; font-size: 17px; }
  .products-section.detail-mode { padding: 12px 10px 82px; }
  .detail-hero { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .detail-summary { gap: 9px; }
  .detail-summary h1 { font-size: 16px; }
  .detail-desc { font-size: 13px; }
  .detail-price { min-width: 132px; padding: 8px 10px; font-size: 22px; }
  .detail-buy { width: 132px; height: 38px; font-size: 14px; }
  .detail-sku { font-size: 12px; }
  .detail-content { padding: 14px 12px; }
  .detail-rich { font-size: 14px; line-height: 1.75; }
  .checkout-modal { align-items: end; padding: 0; }
  .checkout-panel { width: 100%; max-height: 88vh; padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); }
  .order-result { margin: 10px auto; padding: 22px 15px; }
  .order-result dl div { grid-template-columns: 72px minmax(0, 1fr); }
  .orders-title h1 { font-size: 20px; }
  .order-search-form { grid-template-columns: minmax(0, 1fr) 76px; }
  .saved-order-head { align-items: flex-start; }
  .saved-order-product { grid-template-columns: minmax(0, 1fr) 45px; }
  .saved-order-product strong { grid-column: 1 / -1; text-align: left; }
}
.category-icon.image-icon {
  background: #fff;
  overflow: hidden;
  padding: 0;
}
.category-icon.image-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.category-strip[hidden] { display: none !important; }
