:root {
  --blue: #007aff;
  --blue-2: #0a84ff;
  --green: #34c759;
  --green-2: #30d158;
  --red: #ff3b30;
  --orange: #ff9500;
  --purple: #af52de;
  --gray: #8e8e93;
  --bg: #f4f4f9;
  --text: #1c1c1e;
  --text-2: #6a6a70;
  --text-3: #9a9aa1;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-weak: rgba(255, 255, 255, 0.4);
  --border: rgba(255, 255, 255, 0.6);
  --sep: rgba(60, 60, 67, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.06), 0 22px 55px rgba(0, 0, 0, 0.1);
  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 11px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Microsoft YaHei", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --bg2: #ececf2;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before, body::after {
  content: ""; position: fixed; z-index: -1;
  width: 50vw; height: 50vw; border-radius: 50%;
  filter: blur(110px); opacity: 0.62; pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { display: none; }
}
body::before { background: radial-gradient(circle, #cfe2ff, transparent 70%); top: -16vw; left: -10vw; }
body::after { background: radial-gradient(circle, #ffdcc0, transparent 70%); bottom: -18vw; right: -10vw; }
a { color: var(--blue); text-decoration: none; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 22px 18px 96px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  background: rgba(244, 244, 249, 0.66);
  border-bottom: 1px solid var(--sep);
}
.topbar-inner {
  max-width: 1000px; margin: 0 auto; padding: 11px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: 0.2px; }
.brand svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0, 122, 255, 0.25)); }
.brand .dot {
  width: 30px; height: 30px; border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--blue-2), var(--blue));
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}
.brand .dot svg { width: 19px; height: 19px; filter: none; }

/* ---------- 卡片（毛玻璃 + 顶部高光） ---------- */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  padding: 18px;
  position: relative;
}
.card + .card { margin-top: 14px; }
/* 网格内的相邻卡片不加纵向间距（否则会错位） */
.shop-grid .shop-card + .shop-card,
.grid .card + .card { margin-top: 0; }

/* ---------- 标题 ---------- */
.section-title { font-size: 23px; font-weight: 800; margin: 2px 2px 14px; letter-spacing: -0.3px; }
.page-head { margin: 2px 2px 16px; }
.page-head .eyebrow { font-size: 12.5px; font-weight: 700; color: var(--blue); letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 4px; }
.page-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.5px; }
.page-head p { color: var(--text-2); font-size: 14.5px; margin-top: 5px; }
.panel-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 17px; font-weight: 700; margin-bottom: 12px;
}
.panel-title svg { width: 20px; height: 20px; color: var(--blue); }

/* ---------- Hero（买家首页） ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  padding: 30px 26px 26px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.92), rgba(10, 132, 255, 0.82) 55%, rgba(52, 199, 89, 0.8));
  box-shadow: 0 10px 34px rgba(0, 122, 255, 0.28);
  color: #fff;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 70%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 30px;
  background: rgba(255, 255, 255, 0.22); backdrop-filter: blur(6px);
  margin-bottom: 12px;
}
.hero-title { font-size: 30px; font-weight: 800; letter-spacing: -0.6px; position: relative; }
.hero-sub { font-size: 14.5px; opacity: 0.92; margin-top: 7px; position: relative; }
.hero-search {
  position: relative; margin-top: 18px; display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.85); border-radius: 14px; padding: 11px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
.hero-search svg { width: 19px; height: 19px; color: var(--text-3); flex-shrink: 0; }
.hero-search input { border: none; background: none; outline: none; font-size: 15px; font-family: inherit; color: var(--text); width: 100%; }
.hero-search input::placeholder { color: var(--text-3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: 14px; padding: 12px 18px;
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s ease, filter 0.2s;
  color: #fff; background: var(--blue);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn:active { transform: scale(0.97); filter: brightness(0.96); }
.btn svg { width: 18px; height: 18px; }
.btn.block { width: 100%; }
.btn.ghost { background: rgba(120, 120, 128, 0.12); color: var(--blue); box-shadow: none; }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.orange { background: var(--orange); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn.sm { padding: 8px 13px; font-size: 13.5px; border-radius: 11px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--blue);
  font-size: 15px; cursor: pointer; font-family: inherit; font-weight: 600; padding: 4px;
}
.link-btn svg { width: 17px; height: 17px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; padding-left: 2px; }
.input, .textarea, .select {
  width: 100%; border: 1px solid rgba(60, 60, 67, 0.16);
  background: rgba(255, 255, 255, 0.66); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 15px; font-family: inherit; color: var(--text);
  outline: none; transition: border 0.2s, box-shadow 0.2s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.16); }
.textarea { resize: vertical; min-height: 84px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.hint { font-size: 12.5px; color: var(--text-2); margin-top: 6px; padding-left: 2px; line-height: 1.45; }

/* ---------- 搜索条 ---------- */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(118, 118, 128, 0.12); border-radius: 12px;
  padding: 9px 13px;
}
.search-bar svg { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.search-bar input { border: none; background: none; outline: none; font-size: 15px; font-family: inherit; color: var(--text); width: 100%; }
.search-bar input::placeholder { color: var(--text-3); }

/* ---------- 分段控件 ---------- */
.segment { display: flex; gap: 8px; }
.segment .seg {
  flex: 1; border: 1px solid rgba(60, 60, 67, 0.16); background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm); padding: 12px; text-align: center; cursor: pointer;
  font-weight: 600; font-size: 14px; transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.segment .seg svg { width: 18px; height: 18px; }
.segment .seg.active { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 2px 8px rgba(0, 122, 255, 0.28); }

/* ---------- 商品网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.product {
  cursor: pointer; padding: 0; overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.22s ease;
}
.product:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.product:active { transform: scale(0.985); }
.product .cover {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block;
  background: linear-gradient(135deg, #e6effb, #faeede);
}
.product .body { padding: 14px 15px 15px; }
.product .meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.product .name { font-weight: 700; font-size: 15px; letter-spacing: -0.2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.product .desc {
  font-size: 13px; color: var(--text-2); display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; margin-top: 4px;
}
.product .price { color: var(--red); font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }
.product .price small { font-size: 13px; font-weight: 700; }
.price { color: var(--red); font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }
.price small { font-size: 12px; font-weight: 700; }
.price .origin { text-decoration: line-through; color: var(--text-3); font-size: 12px; font-weight: 400; margin-left: 4px; }
.stock-badge { font-size: 12px; color: var(--text-2); background: rgba(118, 118, 128, 0.14); padding: 4px 10px; border-radius: 20px; font-weight: 600; }
.stock-badge.zero { color: var(--red); background: rgba(255, 59, 48, 0.12); }
.buy-hint {
  display: flex; align-items: center; justify-content: flex-end; gap: 3px;
  margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--blue);
  opacity: 0; transform: translateX(-4px); transition: all 0.18s ease;
}
.product:hover .buy-hint { opacity: 1; transform: translateX(0); }

.detail-cover { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 16px; background: linear-gradient(135deg, #e6effb, #faeede); }
.row { display: flex; align-items: center; justify-content: space-between; padding: 11px 2px; border-bottom: 1px solid var(--sep); }
.row:last-child { border-bottom: none; }
.row .k { color: var(--text-2); font-size: 14px; }
.row .v { font-weight: 700; font-size: 15px; }
.back {
  display: inline-flex; align-items: center; gap: 5px; color: var(--blue);
  font-weight: 600; font-size: 15px; margin-bottom: 14px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.back svg { width: 18px; height: 18px; }

/* ---------- 收款码 ---------- */
.qr-box { text-align: center; padding: 8px 0 4px; }
.qr-box img { width: 220px; height: 220px; object-fit: contain; border-radius: 16px; background: #fff; padding: 12px; box-shadow: var(--shadow); }
.qr-placeholder {
  width: 220px; height: 220px; margin: 0 auto; border-radius: 16px;
  background: rgba(118, 118, 128, 0.1); display: flex; align-items: center;
  justify-content: center; color: var(--text-2); font-size: 13px; padding: 16px; text-align: center;
}

/* ---------- 商城目录（商户入驻平台风格） ---------- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 10px; align-items: stretch; justify-content: center; }
.shop-card {
  cursor: pointer; padding: 0; overflow: hidden; transition: transform 0.16s ease, box-shadow 0.22s ease;
  display: flex; flex-direction: column; height: 210px;
  width: 100%; max-width: 340px; margin: 0 auto;
}
.shop-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.shop-card .shop-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.shop-card .shop-head { display: flex; align-items: center; gap: 12px; }
.shop-card .shop-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-2), var(--blue)); color: #fff; font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shop-card .shop-htext { flex: 1; min-width: 0; }
.shop-card .shop-name { font-weight: 700; font-size: 16px; }
.shop-card .shop-desc-sm { font-size: 12.5px; color: var(--text-2); margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.shop-card .shop-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--sep); }
.shop-card .shop-stat { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.platform-cta {
  text-align: center; padding: 40px 20px; margin-top: 20px;
  background: linear-gradient(135deg, rgba(0,122,255,0.06), rgba(52,199,89,0.06));
  border-radius: var(--radius); border: 1px solid var(--border);
}
.platform-cta h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.platform-cta p { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.platform-footer {
  text-align: center; padding: 28px 18px 12px; color: var(--text-3); font-size: 12px;
  border-top: 1px solid var(--sep); margin-top: 30px;
}
.platform-features { margin: 30px 0 10px; }
.pf-title { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 18px; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.pf-card {
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 18px; box-shadow: var(--shadow);
}
.pf-ic { width: 38px; height: 38px; border-radius: 11px; background: rgba(0,122,255,.14); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.pf-ic svg { width: 20px; height: 20px; }
.pf-h { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.pf-d { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.tag.pending { color: var(--orange); background: rgba(255, 149, 0, 0.14); }
.tag.paid { color: var(--blue); background: rgba(0, 122, 255, 0.14); }
.tag.shipped { color: var(--green); background: rgba(52, 199, 89, 0.16); }
.tag.off { color: var(--gray); background: rgba(142, 142, 147, 0.16); }
.tag.auto { color: var(--green); background: rgba(52, 199, 89, 0.16); }
.tag.manual { color: var(--orange); background: rgba(255, 149, 0, 0.14); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(5px); display: flex; align-items: flex-end; justify-content: center;
  z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--glass-strong); border: 1px solid var(--border); border-radius: 22px 22px 0 0;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18); transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-mask.show .modal { transform: translateY(0); }
@media (min-width: 600px) {
  .modal-mask { align-items: center; }
  .modal { border-radius: 22px; transform: scale(0.96); }
  .modal-mask.show .modal { transform: scale(1); }
}
.modal h3 { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; margin-bottom: 16px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--text-2); font-weight: 600; font-size: 12.5px; padding: 9px 10px; border-bottom: 1px solid var(--sep); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--sep); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(118, 118, 128, 0.05); }
.thumbs { width: 44px; height: 44px; object-fit: cover; border-radius: 11px; background: rgba(118, 118, 128, 0.1); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- 后台标签页 ---------- */
.tabs { display: flex; gap: 4px; padding: 5px; background: rgba(118, 118, 128, 0.1); border-radius: 16px; margin-bottom: 18px; overflow-x: auto; }
.tabs .tab {
  flex: 1; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: 11px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer;
  border: none; background: none; font-family: inherit; transition: all 0.18s;
}
.tabs .tab svg { width: 17px; height: 17px; }
.tabs .tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1); }
.tabs .tab.active svg { color: var(--blue); }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--glass); border: 1px solid var(--border); border-radius: 16px; padding: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.stat-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.stat-ic svg { width: 19px; height: 19px; }
.stat .num { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.stat .lbl { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.stats.today { margin-top: 12px; }
.prod-stats { display: flex; flex-direction: column; gap: 10px; }
.prod-stat { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: rgba(118, 118, 128, 0.06); border-radius: 13px; }
.recent { margin-top: 14px; padding: 14px; background: rgba(0, 122, 255, 0.06); border-radius: 14px; }

/* ---------- 提示条 ---------- */
.todo, .warn {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  padding: 14px 16px; border-radius: 16px;
}
.todo { background: linear-gradient(120deg, rgba(255, 149, 0, 0.16), rgba(255, 149, 0, 0.05)); border: 1px solid rgba(255, 149, 0, 0.25); }
.warn { background: linear-gradient(120deg, rgba(255, 59, 48, 0.16), rgba(255, 59, 48, 0.05)); border: 1px solid rgba(255, 59, 48, 0.25); }
.todo .ic, .warn .ic {
  width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.todo .ic { background: var(--orange); }
.warn .ic { background: var(--red); }
.todo .ic svg, .warn .ic svg { width: 20px; height: 20px; color: #fff; }
.todo .tx, .warn .tx { flex: 1; }
.todo .tx b, .warn .tx b { font-size: 15px; }
.todo .tx div, .warn .tx div { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.contact-item { display: flex; align-items: center; gap: 12px; }
.contact-item + .contact-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.contact-ic { width: 38px; height: 38px; border-radius: 11px; background: rgba(0, 122, 255, 0.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-ic svg { width: 20px; height: 20px; color: var(--blue); }

/* ---------- 客户登录 / 个人中心 ---------- */
.icon-btn { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--border); background: var(--glass); color: #1c1c1e; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: all 0.16s; }
.icon-btn:hover { background: rgba(0, 122, 255, 0.10); color: var(--blue); }
.icon-btn svg { width: 18px; height: 18px; }
.user-bar { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: rgba(0, 122, 255, 0.07); }
.avatar { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--blue-2), var(--blue)); flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.avatar svg { width: 22px; height: 22px; }

/* ---------- 筛选 / 订单工具 ---------- */
.filter { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter .f {
  padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: rgba(118, 118, 128, 0.12); color: var(--text-2); border: none; font-family: inherit;
  transition: all 0.16s;
}
.filter .f.active { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25); }
.order-tools { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }
.order-tools .select { flex-shrink: 0; }
@media (max-width: 520px) { .order-tools { flex-wrap: wrap; } .order-tools .search-bar { width: 100%; } }

/* ---------- Toast / 空态 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
  background: rgba(28, 28, 30, 0.92); color: #fff; padding: 12px 20px; border-radius: 14px;
  font-size: 14px; font-weight: 600; z-index: 100; opacity: 0; pointer-events: none;
  transition: all 0.25s; max-width: 86vw; text-align: center; backdrop-filter: blur(8px);
}

/* ============ 通用 iOS 控件库 ============ */
/* 开关 Switch */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 14px; color: #1c1c1e; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 46px; height: 28px; border-radius: 999px; background: rgba(120,120,128,0.32); position: relative; transition: background .25s ease; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.2); transition: transform .25s cubic-bezier(.3,1.3,.6,1); }
.switch input:checked + .track { background: #34c759; }
.switch input:checked + .track::after { transform: translateX(18px); }

/* 密码显隐包裹 */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap .eye { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: #8e8e93; background: none; border: none; cursor: pointer; border-radius: 9px; }
.pw-wrap .eye:hover { background: rgba(120,120,128,0.14); }
.pw-wrap .eye svg { width: 19px; height: 19px; }

/* 表单错误提示 */
.form-err { color: #ff3b30; font-size: 13px; min-height: 0; margin: 4px 2px 2px; }

/* 工具栏（买家端筛选行） */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.toolbar .segment { flex-wrap: wrap; }
.toolbar .price-in { display: flex; align-items: center; gap: 6px; color: #8e8e93; font-size: 13px; }
.toolbar .price-in .input { width: 92px; padding: 9px 10px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 4px; flex-wrap: wrap; }
.pager button { min-width: 34px; padding: 7px 10px; border-radius: 10px; border: 1px solid rgba(120,120,128,0.3); background: rgba(255,255,255,0.6); color: #1c1c1e; cursor: pointer; font-size: 13px; }
.pager button.active { background: #007aff; color: #fff; border-color: #007aff; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .info { color: #8e8e93; font-size: 13px; margin: 0 6px; }

/* 可排序列头 */
.sort-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sort-th .arr { color: #007aff; font-size: 11px; margin-left: 3px; }

/* 买家端列表视图 */
.grid.list-view { grid-template-columns: 1fr; }
.grid.list-view .product { flex-direction: row; align-items: center; text-align: left; }
.grid.list-view .product .cover { width: 84px; height: 84px; flex-shrink: 0; }
.grid.list-view .product .buy-hint { display: none; }
.grid.list-view .product .body { flex: 1; }

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: rgba(255, 59, 48, 0.95); }

.empty { text-align: center; color: var(--text-2); padding: 52px 20px; font-size: 14px; }
.empty::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7l9-4 9 4-9 4z'/%3E%3Cpath d='M3 7v10l9 4 9-4V7'/%3E%3Cpath d='M12 11v10'/%3E%3C/svg%3E");
  display: block; width: 46px; height: 46px; margin: 0 auto 10px; opacity: .4;
}
.empty svg { width: 48px; height: 48px; opacity: 0.35; margin-bottom: 12px; color: var(--text-3); }
.spacer { height: 18px; }
.hidden { display: none !important; }

.cardcode-box { background: rgba(52, 199, 89, 0.12); border: 1px dashed var(--green); border-radius: 14px; padding: 18px; text-align: center; margin-top: 8px; }
.cardcode-box .code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 20px; font-weight: 700; color: #15803d; letter-spacing: 1px; word-break: break-all; }

.proof-img { max-width: 120px; max-height: 120px; border-radius: 10px; cursor: pointer; border: 1px solid var(--sep); }
.copy-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--blue); background: rgba(0, 122, 255, 0.1); border: none; border-radius: 8px; padding: 5px 9px; cursor: pointer; font-family: inherit; font-weight: 600; }
.copy-btn svg { width: 14px; height: 14px; }
.divider { height: 1px; background: var(--sep); margin: 16px 0; }
.my-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--sep); }
.my-item:last-child { border-bottom: none; }

/* ============ 移动端响应式适配 ============ */
@media (max-width: 640px) {
  .wrap { padding: 14px 12px 80px; }
  .hero { padding: 22px 18px 20px; }
  .hero-title { font-size: 24px; }
  .hero-sub { font-size: 13.5px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product .body { padding: 10px 12px 12px; }
  .product .name { font-size: 14px; }
  .product .desc { font-size: 12px; min-height: 32px; }
  .meta .price { font-size: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 12px; }
  .stat .num { font-size: 20px; }
  .stat-ic { width: 28px; height: 28px; margin-bottom: 6px; }
  .card { padding: 14px; border-radius: 18px; }
  .tabs { gap: 2px; padding: 4px; border-radius: 12px; }
  .tabs .tab { padding: 7px 8px; font-size: 12px; }
  .tabs .tab svg { width: 14px; height: 14px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 6px; }
  .btn { padding: 10px 14px; font-size: 14px; border-radius: 12px; }
  .btn.sm { padding: 6px 10px; font-size: 12px; }
  .input, .textarea { padding: 10px 12px; font-size: 16px; }
  .topbar-inner { padding: 8px 12px; }
  .brand svg { width: 22px; height: 22px; }
  .link-btn { font-size: 13px; }
  .detail-cover { border-radius: 16px; }
  .modal { padding: 18px 16px; }
  .order-tools { flex-wrap: wrap; }
  .order-tools .search-bar { width: 100%; }
  .qr-box img { width: 160px; height: 160px; }
  .filter .f { font-size: 12px; padding: 5px 10px; }
  .pager button { min-width: 28px; padding: 5px 7px; font-size: 12px; }
  .toolbar { gap: 6px; }
  .toolbar .price-in .input { width: 70px; }
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table thead, .table tbody, .table tr { display: table; width: 100%; }
}
@media (max-width: 400px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 20px; }
}

/* ============================================================
   UI 升级块（暗色主题 / 动效微交互 / 移动端底栏 / 骨架屏）
   仅增量追加，不改动上方既有规则
   ============================================================ */

/* ---------- 主题相关语义变量（明色为基准，暗色在下块覆盖） ---------- */
:root {
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --glass-hi: rgba(255, 255, 255, 0.45);
  --topbar-bg: rgba(244, 244, 249, 0.66);
  --field-bg: rgba(255, 255, 255, 0.58);
  --seg-bg: rgba(255, 255, 255, 0.46);
  --tab-active-bg: rgba(255, 255, 255, 0.95);
  --pager-bg: rgba(255, 255, 255, 0.5);
  --hero-search-bg: rgba(255, 255, 255, 0.85);
  --platform-bg: rgba(0, 122, 255, 0.06);
  --cover-grad: linear-gradient(135deg, #e6effb, #faeede);
  --skel-base: rgba(118, 118, 128, 0.14);
  --skel-hi: rgba(255, 255, 255, 0.5);
}

/* ---------- 暗色主题 ---------- */
[data-theme="dark"] {
  --blue: #0a84ff; --blue-2: #409cff;
  --green: #30d158; --green-2: #40e06a;
  --red: #ff453a; --orange: #ff9f0a; --purple: #bf5af2;
  --gray: #98989f;
  --bg: #0b0b0f; --bg2: #15151b;
  --text: #f2f2f7; --text-2: #aeaeb5; --text-3: #83838b;
  --glass: rgba(28, 28, 34, 0.5);
  --glass-strong: rgba(30, 30, 38, 0.8);
  --glass-weak: rgba(28, 28, 34, 0.32);
  --border: rgba(255, 255, 255, 0.16);
  --sep: rgba(255, 255, 255, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 4px 14px rgba(0, 0, 0, .35), 0 22px 55px rgba(0, 0, 0, .55);
  --glass-hi: rgba(255, 255, 255, 0.1);
  --topbar-bg: rgba(11, 11, 15, 0.62);
  --field-bg: rgba(255, 255, 255, 0.05);
  --seg-bg: rgba(255, 255, 255, 0.05);
  --tab-active-bg: rgba(255, 255, 255, 0.16);
  --pager-bg: rgba(255, 255, 255, 0.05);
  --hero-search-bg: rgba(255, 255, 255, 0.06);
  --platform-bg: rgba(0, 122, 255, 0.12);
  --cover-grad: linear-gradient(135deg, #23242e, #2a2026);
  --skel-base: rgba(255, 255, 255, 0.07);
  --skel-hi: rgba(255, 255, 255, 0.16);
}
[data-theme="dark"] body { color: var(--text); }
[data-theme="dark"] body::before, [data-theme="dark"] body::after { opacity: 0.5; }
[data-theme="dark"] body::before { background: radial-gradient(circle, #16335c, transparent 70%); }
[data-theme="dark"] body::after { background: radial-gradient(circle, #5a2f1a, transparent 70%); }
[data-theme="dark"] .topbar { background: var(--topbar-bg); }
[data-theme="dark"] .card { box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); }
[data-theme="dark"] .input, [data-theme="dark"] .textarea, [data-theme="dark"] .select { background: var(--field-bg); border-color: rgba(255, 255, 255, 0.14); }
[data-theme="dark"] .segment .seg { background: var(--seg-bg); border-color: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .tabs .tab.active { background: var(--tab-active-bg); }
[data-theme="dark"] .icon-btn { color: var(--text); }
[data-theme="dark"] .pager button { background: var(--pager-bg); border-color: rgba(255, 255, 255, 0.14); color: var(--text); }
[data-theme="dark"] .hero-search { background: var(--hero-search-bg); }
[data-theme="dark"] .platform-cta { background: var(--platform-bg); }
[data-theme="dark"] .product .cover, [data-theme="dark"] .detail-cover { background: var(--cover-grad); }
[data-theme="dark"] .stat { box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); }
[data-theme="dark"] .cardcode-box .code { color: #4ade80; }

/* ---------- 动效与微交互 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.product, .stat, .pf-card, .prod-stat, .my-item, .recent, .cardcode-box, .contact-item {
  animation: fadeUp .5s var(--ease) both;
}
.card:not(.product) { animation: fadeUp .5s var(--ease) both; }
.stat:nth-child(2) { animation-delay: .04s; }
.stat:nth-child(3) { animation-delay: .08s; }
.stat:nth-child(4) { animation-delay: .12s; }
.product:nth-child(2) { animation-delay: .03s; }
.product:nth-child(3) { animation-delay: .06s; }
.product:nth-child(4) { animation-delay: .09s; }
.product:nth-child(5) { animation-delay: .12s; }
.product:nth-child(6) { animation-delay: .15s; }

/* 触摸 / 点击回弹反馈 */
.card:not(.product):active { transform: scale(.99); }
.stat:active { transform: scale(.98); }
.icon-btn:active { transform: scale(.92); }
.filter .f:active, .pager button:active, .tabs .tab:active, .segment .seg:active { transform: scale(.96); }
.btn { transition: transform .14s var(--spring), opacity .2s, filter .2s; }
.btn:hover { filter: brightness(1.04); }
.row { transition: background .15s; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.hero-title { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

/* ---------- 移动端底部 Tab 栏 ---------- */
.bottom-nav { display: none; }
@media (max-width: 640px) {
  .wrap { padding-bottom: 96px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--topbar-bg); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-top: 1px solid var(--sep);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    justify-content: space-around; gap: 4px;
  }
  .bn-item {
    flex: 1; border: none; background: none; cursor: pointer; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--text-3); font-size: 10.5px; font-weight: 600; padding: 4px 0; border-radius: 12px;
    transition: transform .14s var(--spring), color .18s;
  }
  .bn-item svg { width: 23px; height: 23px; }
  .bn-item:active { transform: scale(.9); }
  .bn-item.active { color: var(--blue); }
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(100deg, var(--skel-base) 30%, var(--skel-hi) 50%, var(--skel-base) 70%);
  background-size: 200% 100%; animation: shimmer 1.25s linear infinite; border-radius: var(--radius-sm);
}
.sk-card { overflow: hidden; animation: none; }
.sk-card .sk-cover { width: 100%; aspect-ratio: 16 / 10; }
.sk-card .sk-line { height: 12px; margin: 10px 14px 0; }
.sk-card .sk-line.short { width: 52%; margin-bottom: 14px; }

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- 首页功能升级（动漫背景 + 公告条 + Banner + 热销/新品标签） ---------- */
.page-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: url('/assets/bg-anime.webp') center bottom / cover no-repeat;
  opacity: 0.14; transition: opacity .35s;
}
[data-theme="dark"] .page-bg { opacity: 0.05; }

/* 常驻公告条 */
.ann-bar {
  margin: 12px 16px 0; border-radius: 16px;
  background: var(--glass-strong); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border); padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 10px;
  color: var(--text); opacity: 0; transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s var(--spring);
}
.ann-bar.hidden { display: none; }
.ann-bar:not(.hidden) { opacity: 1; transform: none; }
.ann-icon { color: var(--orange); flex: 0 0 22px; margin-top: 1px; display: flex; }
.ann-body { flex: 1; min-width: 0; }
.ann-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.ann-text { font-size: 13px; color: var(--text-2); line-height: 1.45; word-break: break-word; }
.ann-close {
  flex: 0 0 28px; height: 28px; border-radius: 50%; border: none; background: transparent;
  color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s; padding: 0;
}
.ann-close:hover { background: var(--sep); color: var(--text); }

/* 热销 / 新品角标 */
.product .meta { flex-wrap: wrap; gap: 5px; }
.badge-hot, .badge-new {
  font-size: 10px; font-weight: 800; padding: 1.5px 7px; border-radius: 20px;
  line-height: 1.3; letter-spacing: .2px;
}
.badge-hot { background: rgba(255, 59, 48, .12); color: var(--red); }
.badge-new { background: rgba(0, 122, 255, .12); color: var(--blue); }

@media (max-width: 640px) {
  .ann-bar { margin: 10px 12px 0; border-radius: 14px; }
}

/* ============ 响应式适配：手机端 / 平板 ============ */
/* 平板竖屏（iPad 等 ~768–820px）：商品网格改 2 列更舒适 */
@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
/* 手机端（≤640px） */
@media (max-width: 640px) {
  .shop-grid { grid-template-columns: 1fr; }
  .shop-card { max-width: none; }
  #app { padding-bottom: 22px; }   /* 后台无底栏，去掉买家端预留的底部留白 */
}
/* 窄屏（手机 + 小平板）：后台管理界面防溢出 */
@media (max-width: 760px) {
  /* 表格横向滚动，避免撑破页面 */
  .table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 内联 flex 行自动换行，避免按钮/表单挤压溢出 */
  *[style*="display: flex"], *[style*="display:flex"] { flex-wrap: wrap !important; }
  /* 弹窗在手机上满宽、底部 sheet 弹出 */
  .modal { max-width: 100% !important; border-radius: 18px 18px 0 0; }
  /* 顶栏收窄，给品牌与操作按钮留空间 */
  .topbar-inner { padding: 9px 12px; gap: 8px; }
  .brand { font-size: 15px; }
  .brand svg { width: 22px; height: 22px; }
  .link-btn { font-size: 12.5px; }
}
/* 超小屏：统计卡单列 */
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
}

/* 详情页：信任感徽标 + 入场动效（复用 fadeUp，标准缓动非弹跳） */
.trust-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 2px; padding-top: 12px; border-top: 1px solid var(--sep); }
.trust { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.trust svg { width: 15px; height: 15px; color: var(--green); flex-shrink: 0; }
.detail-anim { animation: fadeUp .28s cubic-bezier(.4, 0, .2, 1); }

/* 商品收藏心形（localStorage，零后端） */
.card.product { position: relative; }
.fav-btn { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: none; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; color: var(--text-2); cursor: pointer; z-index: 2; transition: transform .15s ease, color .15s ease; }
.fav-btn:hover { transform: scale(1.08); }
.fav-btn svg { transition: fill .15s ease; }
.fav-btn.on { color: var(--red); }
.fav-btn.on svg { fill: var(--red); }
.btn.on-fav { color: var(--red); border-color: var(--red); }

/* 我的页订单项 */
.my-order { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(120, 120, 128, .06); cursor: pointer; transition: background .15s; }
.my-order:active { background: rgba(120, 120, 128, .12); }
.my-order-ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(0, 122, 255, .12); color: var(--blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.my-order-ic svg { width: 18px; height: 18px; }
.my-order-main { flex: 1; min-width: 0; }
.my-order-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-order-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
