:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --line: #e7e9ee;
  --text: #1d2129;
  --text-2: #5c6370;
  --text-3: #959aa5;
  --accent: #ff5a36;
  --accent-2: #ff8a3d;
  --accent-soft: #fff1ec;
  --accent-ink: #ffffff;
  --ok: #18a058;
  --warn: #e6a23c;
  --danger: #e5484d;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 6px 24px rgba(16, 24, 40, .08);
  --shadow-lg: 0 18px 60px rgba(16, 24, 40, .22);
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --topbar-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317;
    --surface: #1a1d23;
    --surface-2: #22262d;
    --line: #2c3038;
    --text: #e8eaed;
    --text-2: #aab0bb;
    --text-3: #7a808c;
    --accent-soft: #3a2119;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 18px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111317; --surface: #1a1d23; --surface-2: #22262d; --line: #2c3038;
  --text: #e8eaed; --text-2: #aab0bb; --text-3: #7a808c; --accent-soft: #3a2119;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner, .toolbar-inner, .page { max-width: 1280px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.topbar-inner { height: var(--topbar-h); display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; }
.brand-text small { color: var(--text-3); font-size: 11px; }

.search {
  flex: 1; max-width: 520px; margin: 0 auto; position: relative; display: flex; align-items: center;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; height: 38px; padding: 0 12px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { color: var(--text-3); width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 0 8px; height: 100%; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--text-2); line-height: 1; font-size: 16px; }

.batch-select, .sort-select {
  height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 0 12px; outline: none;
}
.cart-btn {
  position: relative; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--text); color: var(--surface); font-weight: 600; transition: transform .15s var(--ease);
}
.cart-btn:active { transform: scale(.95); }
.cart-btn.bump { animation: bump .45s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.15); } 60% { transform: scale(.95); } 100% { transform: scale(1); } }
.badge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 11px; line-height: 20px; text-align: center; font-weight: 700;
  border: 2px solid var(--surface);
}

.toolbar { border-top: 1px solid var(--line); }
.toolbar-inner { display: flex; align-items: center; gap: 12px; height: 48px; }
.tabs { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 32px; padding: 0 14px; border-radius: 999px; color: var(--text-2); white-space: nowrap;
  transition: background .2s, color .2s;
}
.tab:hover { background: var(--surface-2); }
.tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tab small { color: var(--text-3); margin-left: 3px; font-size: 11px; }
.tab.active small { color: inherit; opacity: .7; }
.toolbar-actions { display: flex; gap: 8px; flex: none; }
.filter-btn {
  display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface);
}
.filter-btn svg { width: 16px; height: 16px; }
.filter-count { background: var(--accent); color: #fff; border-radius: 9px; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; }

/* ---------- 列表 ---------- */
.page { padding-top: 16px; padding-bottom: 80px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip-x {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 12px;
}
.chip-x b { font-weight: 400; color: var(--text-3); font-size: 14px; }
.chip-x.clear { border-color: transparent; background: none; color: var(--accent); }
.result-meta { color: var(--text-3); font-size: 12px; margin-bottom: 10px; min-height: 18px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  cursor: pointer; position: relative; display: flex; flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  animation: rise .35s var(--ease) both;
  content-visibility: auto; contain-intrinsic-size: 210px 340px;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); } }
.card:active { transform: scale(.985); }
.thumb { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s, transform .5s var(--ease); }
.thumb img.loaded { opacity: 1; }
@media (hover: hover) { .card:hover .thumb img { transform: scale(1.04); } }
.thumb .tag {
  position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(4px);
}
.thumb .low { left: auto; right: 8px; background: var(--danger); }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-weight: 600; font-size: 15px; letter-spacing: .2px; display: flex; gap: 6px; align-items: baseline; }
.card-title span { font-weight: 400; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { color: var(--accent); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.price small { font-size: 12px; margin-right: 1px; }
.stock { color: var(--text-3); font-size: 11px; }
.quick-add {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform .15s var(--ease);
}
.quick-add:active { transform: scale(.88); }
.quick-add svg { width: 18px; height: 18px; }
.in-cart {
  position: absolute; right: 8px; bottom: 8px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px;
  padding: 1px 8px; font-weight: 600;
}

.skeleton .thumb, .skeleton .sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; }
.skeleton .sk { height: 12px; border-radius: 6px; margin: 4px 0; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.sentinel { height: 1px; }
.empty { text-align: center; color: var(--text-3); padding: 80px 16px; }
.empty .big { font-size: 44px; margin-bottom: 8px; }
.empty a, .empty button { color: var(--accent); text-decoration: none; }

.to-top {
  position: fixed; right: 18px; bottom: calc(24px + env(safe-area-inset-bottom)); width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; z-index: 20;
  opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; transition: all .25s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- 弹层 ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.overlay-bg { position: absolute; inset: 0; background: rgba(10, 12, 16, .45); opacity: 0; transition: opacity .28s; }
.overlay.open .overlay-bg { opacity: 1; }
.sheet {
  position: relative; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  width: min(880px, calc(100vw - 32px)); max-height: min(88vh, 760px); border-radius: 20px; overflow: hidden;
  opacity: 0; transform: translateY(24px) scale(.98); transition: transform .32s var(--ease), opacity .25s;
  will-change: transform;
}
.overlay.open .sheet { opacity: 1; transform: none; }
.sheet.dragging { transition: none; }
.sheet-handle { display: none; }
.sheet-close {
  position: absolute; right: 12px; top: 12px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 85%, transparent); font-size: 22px; line-height: 1; color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.sheet-close.static { position: static; box-shadow: none; background: var(--surface-2); flex: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 17px; flex: 1; }
.sheet-head small { font-weight: 400; color: var(--text-3); font-size: 13px; }
.sheet-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.link-btn { color: var(--text-3); font-size: 13px; }
.link-btn:hover { color: var(--danger); }

.btn {
  height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 15px; flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .15s var(--ease), opacity .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.dark { background: var(--text); color: var(--surface); }
.btn.small { height: 34px; font-size: 13px; padding: 0 14px; flex: none; }

/* 详情 */
.detail-body { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; min-height: 0; flex: 1; }
.gallery { background: var(--surface-2); display: flex; flex-direction: column; min-height: 0; }
.gallery-main { flex: none; position: relative; aspect-ratio: 1; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.gallery-main img.loaded { opacity: 1; }
.gallery-thumbs { flex: none; display: flex; gap: 8px; padding: 10px; overflow-x: auto; scrollbar-width: none; }
.gallery-thumbs button { flex: none; width: 54px; height: 54px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--surface); transition: border-color .2s; }
.gallery-thumbs button.active { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info { padding: 24px 24px 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.info-price { color: var(--accent); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.info-price small { font-size: 16px; }
.info h1 { font-size: 20px; margin: 4px 0 2px; }
.info .crumbs { color: var(--text-3); font-size: 12px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.pill { background: var(--surface-2); color: var(--text-2); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.opt-title { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 10px; font-weight: 600; }
.opt-title small { color: var(--text-3); font-weight: 400; font-size: 12px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  min-width: 56px; padding: 6px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, background .15s, color .15s, transform .12s var(--ease);
  position: relative;
}
.opt:active { transform: scale(.95); }
.opt img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.opt.disabled { color: var(--text-3); background: var(--surface-2); border-style: dashed; cursor: not-allowed; }
.size-opt { flex-direction: column; gap: 0; padding: 6px 10px; line-height: 1.25; min-width: 60px; }
.size-opt small { font-size: 10px; color: var(--text-3); font-weight: 400; }
.size-opt.active small { color: inherit; opacity: .8; }
.size-opt .dot { position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; font-size: 10px; border-radius: 8px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; text-align: center; font-weight: 700; }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 6px; }
.qty-row .opt-title { margin: 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.stepper button { width: 34px; height: 32px; font-size: 18px; color: var(--text-2); transition: background .15s; }
.stepper button:hover:not(:disabled) { background: var(--surface-2); }
.stepper button:disabled { color: var(--line); cursor: not-allowed; }
.stepper input { width: 42px; text-align: center; border: 0; outline: 0; background: none; height: 32px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.sm button { width: 28px; height: 28px; font-size: 16px; }
.stepper.sm input { width: 34px; height: 28px; font-size: 13px; }
.detail-actions {
  position: sticky; bottom: 0; margin: 16px -24px 0; padding: 12px 24px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--surface) 75%, transparent); display: flex; gap: 10px; align-items: center;
}
.detail-actions .hint { font-size: 12px; color: var(--text-3); flex: none; }

/* 筛选 */
.filter-sheet { width: min(560px, calc(100vw - 32px)); }
.fgroup { padding: 14px 20px 4px; }
.fgroup h3 { font-size: 14px; margin-bottom: 10px; display: flex; justify-content: space-between; }
.fgroup h3 small { color: var(--text-3); font-weight: 400; }
.fopts { display: flex; flex-wrap: wrap; gap: 8px; }
.fopt { height: 32px; padding: 0 12px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 13px; border: 1px solid transparent; transition: all .15s; }
.fopt.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.price-range { display: flex; align-items: center; gap: 8px; }
.price-range input { width: 100%; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 10px; outline: none; }
.price-range input:focus { border-color: var(--accent); }

/* 购物车抽屉 */
.drawer { justify-content: flex-end; align-items: stretch; }
.cart-sheet { width: min(460px, 100vw); max-height: none; height: 100%; border-radius: 20px 0 0 20px; transform: translateX(40px); }
.drawer.open .cart-sheet { transform: none; }
.cart-list { padding: 8px 16px; }
.cart-group { margin: 8px 0 4px; font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; }
.cart-item {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line);
  transition: opacity .25s, transform .25s var(--ease), max-height .3s var(--ease); max-height: 200px; overflow: hidden;
}
.cart-item.removing { opacity: 0; transform: translateX(40px); max-height: 0; padding: 0; }
.cart-item.invalid { opacity: .55; }
.cart-item .ci-img { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.cart-item .ci-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.cart-item .ci-img img.loaded { opacity: 1; }
.ci-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ci-top { display: flex; justify-content: space-between; gap: 8px; }
.ci-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-del { color: var(--text-3); width: 24px; height: 24px; border-radius: 50%; font-size: 18px; line-height: 1; flex: none; }
.ci-del:hover { background: var(--surface-2); color: var(--danger); }
.ci-spec { color: var(--text-2); font-size: 12px; background: var(--surface-2); align-self: flex-start; padding: 1px 8px; border-radius: 6px; }
.ci-warn { color: var(--danger); font-size: 12px; }
.ci-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.ci-bottom .price { font-size: 16px; }
.receiver { margin: 8px 16px 16px; background: var(--surface-2); border-radius: var(--radius-sm); }
.receiver summary { padding: 12px 14px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.receiver summary::-webkit-details-marker { display: none; }
.receiver summary::after { content: "›"; transform: rotate(90deg); transition: transform .2s; color: var(--text-3); }
.receiver[open] summary::after { transform: rotate(-90deg); }
.receiver summary span { flex: 1; text-align: right; color: var(--text-3); font-weight: 400; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receiver-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 14px; }
.receiver-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.receiver-form .full { grid-column: 1 / -1; }
.receiver-form input, .receiver-form textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); outline: none; resize: vertical; font-size: 14px; color: var(--text);
}
.receiver-form input:focus, .receiver-form textarea:focus { border-color: var(--accent); }
.receiver-form .err { border-color: var(--danger); }
.cart-foot { border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); }
.cart-sum { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 10px; }
.sum-lines { display: flex; flex-direction: column; font-size: 12px; color: var(--text-3); }
.sum-lines b { color: var(--text-2); font-weight: 500; }
.sum-total { font-size: 13px; }
.sum-total strong { color: var(--accent); font-size: 22px; font-variant-numeric: tabular-nums; }
.cart-actions { display: flex; gap: 10px; }
.cart-empty { text-align: center; padding: 60px 0 40px; color: var(--text-3); }
.cart-empty .big { font-size: 48px; }

/* 飞入购物车动画 */
.fly { position: fixed; z-index: 100; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; pointer-events: none; box-shadow: var(--shadow); }
.fly img { width: 100%; height: 100%; object-fit: cover; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(20, 22, 26, .92); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px;
  display: flex; align-items: center; gap: 12px; transition: all .28s var(--ease); max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.toast button { color: var(--accent-2); font-weight: 700; }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  :root { --topbar-h: 56px; }
  .brand-text, .cart-label { display: none; }
  .cart-btn { width: 40px; padding: 0; justify-content: center; }
  .batch-select { max-width: 96px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { border-radius: 12px; contain-intrinsic-size: 170px 290px; }
  .card-body { padding: 8px 10px 10px; }
  .card-title { font-size: 14px; }
  .price { font-size: 16px; }
  .sort-select { width: 92px; padding: 0 8px; font-size: 13px; }
  .filter-btn { padding: 0 10px; font-size: 13px; }

  .overlay:not(.drawer) { align-items: flex-end; }
  .sheet { width: 100vw; max-height: 92vh; border-radius: 20px 20px 0 0; transform: translateY(100%); opacity: 1; }
  .filter-sheet { width: 100vw; }
  .sheet-handle { display: block; position: absolute; top: 0; left: 0; right: 0; height: 22px; z-index: 4; touch-action: none; }
  .sheet-handle::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: color-mix(in srgb, var(--text-3) 60%, transparent); }
  .detail-body { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .gallery-main { aspect-ratio: 4 / 3.4; }
  .info { padding: 16px 16px 0; overflow: visible; }
  .detail-actions { margin: 14px -16px 0; padding-left: 16px; padding-right: 16px; }
  .drawer .cart-sheet { width: 100vw; border-radius: 0; transform: translateX(100%); }
  .drawer.open .cart-sheet { transform: none; }
  .receiver-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 后台 ---------- */
.admin { max-width: 1080px; margin: 0 auto; padding: 24px 16px 80px; }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.admin-head h1 { font-size: 20px; flex: 1; }
.admin-head a { color: var(--text-2); text-decoration: none; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.panel p.desc { color: var(--text-3); font-size: 13px; margin-bottom: 12px; }
.dropzone {
  display: block;
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px 16px; text-align: center; color: var(--text-2);
  cursor: pointer; transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .big { font-size: 40px; margin-bottom: 6px; }
.dropzone small { display: block; color: var(--text-3); margin-top: 4px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 14px; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.import-log { margin-top: 12px; font-size: 13px; }
.import-log .row { padding: 8px 12px; border-radius: 8px; background: var(--surface-2); margin-top: 6px; }
.import-log .row.ok { color: var(--ok); }
.import-log .row.err { color: var(--danger); }
.table-wrap { overflow-x: auto; }
table.batches { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
table.batches th, table.batches td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.batches th { color: var(--text-3); font-weight: 500; }
table.batches td.num { font-variant-numeric: tabular-nums; }
table.batches .ship { width: 70px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; background: var(--surface-2); }
.status-on { color: var(--ok); font-weight: 600; }
.row-actions { display: flex; gap: 6px; }
.row-actions button { height: 28px; padding: 0 10px; border-radius: 6px; background: var(--surface-2); font-size: 12px; }
.row-actions button.danger { color: var(--danger); }
.row-actions button:hover { background: var(--line); }
.login { max-width: 360px; margin: 12vh auto 0; }
.login input { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0 14px; margin: 8px 0 14px; background: var(--surface-2); outline: none; }
.login input:focus { border-color: var(--accent); }
.login .btn { width: 100%; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.preview-grid figure { background: var(--surface-2); border-radius: 10px; overflow: hidden; font-size: 11px; }
.preview-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; opacity: 0; transition: opacity .3s; }
.preview-grid img.loaded { opacity: 1; }
.preview-grid figcaption { padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
