:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --primary: #e8532b;
  --primary-dark: #d4451f;
  --primary-soft: #fef0eb;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.grow { flex: 1; }

/* ---------- boot ---------- */
.boot-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; background: var(--bg); z-index: 999;
  color: var(--text-2);
}
.boot-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 14px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; padding: 10px; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger { background: var(--surface); color: #dc2626; border-color: #fca5a5; }
.btn-danger:hover:not(:disabled) { background: #fef2f2; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field-label .req { color: var(--primary); font-style: normal; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="url"], select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  outline: none; transition: .15s;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input::placeholder { color: var(--text-3); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { accent-color: var(--primary); width: 15px; height: 15px; }

textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px; line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none; transition: .15s;
  resize: vertical;
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea::placeholder { color: var(--text-3); }

/* ---------- auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #fff7f3 0%, var(--bg) 55%);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 30px 28px;
}
.auth-brand { text-align: center; margin-bottom: 22px; }
/* ⚠️ 这两条目前都没有 HTML 使用者，别当成"漏改"：
   .app-logo = 红色 AMZ 方块，已按用户要求从顶栏移除（2026-09-30）；
   .auth-logo / .auth-brand = 已废弃的登录页遗留。规则留作备用。 */
.auth-logo, .app-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--primary); color: #fff;
  font-weight: 800; font-size: 14px; letter-spacing: .5px;
}
.auth-brand h1 { font-size: 19px; margin: 12px 0 4px; }
.auth-brand p { color: var(--text-2); font-size: 13px; margin: 0; }

.seg {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 3px; padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 18px;
}
.seg-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 7px 4px; border-radius: 7px;
  font-size: 13px; font-family: inherit; color: var(--text-2);
  transition: .15s;
}
.seg-btn.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field-row { display: flex; gap: 8px; align-items: flex-end; }
.field-row .field { flex: 1; }
.field-row .btn { margin-bottom: 1px; }
.auth-msg { font-size: 13px; min-height: 18px; color: #dc2626; }
.auth-msg.ok { color: var(--green); }
.auth-hint { font-size: 12.5px; color: var(--text-3); text-align: center; margin: 2px 0 0; }

/* ---------- app shell ---------- */
/* 头部整条（顶栏 + tab 条）的共同吸顶容器。
   2026-09-30 用户要求「下滑自动隐藏」→ 下滑给 <body> 加 .nav-hidden，整条一起上移收起。
   ⚠️ 必须是**一个** sticky 容器包住两截，别再让 .topbar / .tabs 各自 sticky：
   两个独立 sticky 要用 `top: 64px` / `top: 60px` 手动对齐，收起来时中间必然留缝、
   且顶栏高度一变就要同步改两处（历史上为了 `top` 与高度差 1px 出双线纠结过很久）。
   现在两截都是普通 block，高度怎么变都不用再管 `top`。 */
.head-wrap {
  position: sticky; top: 0; z-index: 30;
  transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
body.nav-hidden .head-wrap { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { .head-wrap { transition: none; } }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px;
  padding: 12px 22px;
}
/* 品牌块固定在中间列 → 真正居中；左右两列等宽，右侧按钮不会把中轴挤偏 */
/* ⚠️ min-height 40px：红色 logo 移除后（2026-09-30 用户要求）顶栏会矮 1px。
   吸顶已合并到 .head-wrap，不再需要靠这个 height 对齐 `top`，但保留它让顶栏高度稳定
   （收起/展开的位移由 translateY(-100%) 按实际高度算，高度抖动会造成动画末帧台阶）。 */
.topbar-left { grid-column: 1; justify-self: start; display: flex; align-items: center; gap: 11px; }
.topbar-center { grid-column: 2; display: flex; align-items: center; justify-content: center; min-height: 40px; }
/* 站点名加大加粗（置中后它是视觉主角）；行高收紧到 1.2，
   让「标题 + 副标题」总高 ≤ logo 的 40px，topbar 高度不变（否则 tab 条吸顶位要重算） */
/* ⚠️ align-items/text-align 必须 center：副标题比主标题窄，左对齐会让整个品牌块看着偏左 23px */
.app-title { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.2; }
.app-title strong {
  font-size: 20px; font-weight: 800;
  letter-spacing: .3px; color: var(--text);
}
.app-title span { font-size: 12.5px; color: var(--text-3); }
.topbar-right { grid-column: 3; display: flex; align-items: center; gap: 10px; justify-self: end; }
.user-chip {
  display: inline-flex; align-items: center;
  font-size: 12.5px; color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
  max-width: 220px; overflow: hidden; white-space: nowrap;
}
/* 左侧环境标识前加一个小绿点：顶栏左半边原本全空，加个点后左右视觉重量才接近 */
.user-chip::before {
  content: ""; flex: 0 0 auto;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  margin-right: 7px;
}

.tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tabs-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0 22px;
  display: flex; gap: 4px; justify-content: center;
}
.tab {
  border: none; background: transparent; cursor: pointer;
  padding: 11px 14px; font-size: 14px; font-family: inherit;
  color: var(--text-2); font-weight: 500;
  border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
  transition: .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.badge {
  background: var(--primary); color: #fff;
  font-size: 11px; font-style: normal; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}

.main { padding: 20px 22px 60px; max-width: 1400px; margin: 0 auto; }
.view { display: flex; flex-direction: column; gap: 16px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow);
}
.stat-num { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.stat-label { font-size: 12.5px; color: var(--text-3); }

/* ---------- panel ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.panel-title { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.panel-desc { font-size: 12.5px; color: var(--text-2); margin: 0 0 16px; max-width: 760px; }
.tip {
  font-size: 12.5px; color: var(--text-2);
  background: var(--blue-soft);
  border: 1px solid #dbeafe;
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-bottom: 16px;
  line-height: 1.7;
}
.tip code {
  background: rgba(37, 99, 235, .1);
  color: var(--blue);
  padding: 1px 5px; border-radius: 4px;
  font-size: 12px;
}
.count {
  font-style: normal; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); border-radius: 999px; padding: 1px 8px;
}

/* ---------- filters ---------- */
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.range-row { display: flex; align-items: center; gap: 6px; }
.range-dash { color: var(--text-3); }
/* 爆款选品的口径说明条 */
.pick-note {
  font-size: 12.5px; line-height: 1.65; color: var(--text-2);
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 8px; padding: 8px 11px; margin-bottom: 14px;
}
.pick-note b { color: var(--primary-dark); }
/* 说明条里的「抓取口径 vs 面板默认」补充行，压一档字重和颜色，不抢主口径的注意力 */
.pick-note-sub { color: var(--text-3); font-size: 12px; }

.filters-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--border);
}
/* ---------- 类目筛选 ---------- */
.cat-filter {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.cat-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--border);
}
.cat-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cat-head .check-all { margin-left: auto; }
.cat-list {
  max-height: 236px; overflow-y: auto; overflow-x: hidden;
  padding: 8px 4px 8px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 1px 16px;
}
.cat-item {
  min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text-2);
  user-select: none;
  transition: background .12s;
}
.cat-item:hover { background: var(--surface-2); }
.cat-item input { flex: 0 0 auto; margin: 0; accent-color: var(--primary); cursor: pointer; }
.cat-label {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-item.on .cat-label { color: var(--primary); font-weight: 600; }
.cat-foot {
  display: flex; align-items: center; gap: 14px;
  margin-top: 9px; padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.cat-hint { color: var(--text-3); }
.cat-foot .link-mini { font-size: 12px; }

.list-head { display: flex; align-items: center; font-size: 13px; color: var(--text-2); padding: 0 2px; }

/* ---------- listing cards ---------- */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow);
  transition: .15s;
  position: relative;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card.is-new { border-left: 3px solid var(--primary); }

/* 图片区：整卡宽度 + 正方形，hover 轻微放大 */
.card-media {
  display: block; position: relative; overflow: hidden;
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.card-media .card-img { transition: transform .25s ease; }
.card:hover .card-media .card-img { transform: scale(1.04); }

.card-img {
  display: block; width: 100%; height: 100%;
  object-fit: contain; padding: 10px;
  background: #fff;
}
.card-img.img-fail {
  visibility: hidden;
}
/* 图片抓取失败时，露出占位底色和一角商品图标 */
.card-media:has(.img-fail)::after {
  content: "🖼";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; opacity: .28;
}

.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.card-title {
  font-size: 14.5px; font-weight: 600; color: var(--text);
  text-decoration: none; line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.76em;
}
.card-title:hover { color: var(--primary); }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-3); }
.card-price { font-size: 17px; font-weight: 700; color: var(--primary); }
.card-price.na { color: var(--text-3); font-weight: 500; font-size: 13px; }
.card-foot {
  display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap;
  margin-top: auto; padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-3);
}
.card-foot-right {
  display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap;
  margin-left: auto; justify-content: flex-end;
}
.foot-asin {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px; letter-spacing: .2px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 0 5px;
}

.pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid transparent;
}
.pill-seller { background: var(--blue-soft); color: var(--blue); }
.pill-new { background: var(--primary-soft); color: var(--primary-dark); }
.pill-cat { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.pill-ok { background: var(--green-soft); color: var(--green); }
.pill-warn { background: var(--amber-soft); color: var(--amber); }
.pill-badge { background: #fff1f2; color: #be123c; }
/* 爆款选品专用标签 */
.pill-fbm { background: var(--green-soft); color: var(--green); font-weight: 600; }
.pill-profit { background: var(--amber-soft); color: var(--amber); }

.card-actions { display: flex; gap: 6px; margin-left: auto; }
.link-mini {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 11.5px; color: var(--text-3); font-family: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}
.link-mini:hover { color: var(--primary); }

/* ---------- sellers ---------- */
.seller-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.form-msg { font-size: 13px; color: var(--green); }
.form-msg.err { color: #dc2626; }

.seller-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.seller-tools {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;                    /* 窄屏放「显示系统导入的店铺」开关时会挤，允许换行 */
  margin-bottom: 12px;
}
.seller-tools input { max-width: 320px; }
.seller-hint { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* 「系统导入」来源标签：只在管理员展开全部店铺时出现，用来区分 star-95 批量导入的那批 */
.src-tag {
  display: inline-block; margin-right: 6px; padding: 0 5px;
  font-size: 10.5px; line-height: 17px; border-radius: 4px;
  color: var(--text-3); background: var(--surface-2);
  border: 1px solid var(--border);
  vertical-align: 1px;
}
.more-btn { margin-top: 4px; }

/* ---- 翻页条（新品雷达 / 爆款选品）----
   2026-09-30 用户要求：把原来的「显示更多」堆叠式加载改成真分页，每页 100 / 200 / 500 可选。
   两个 tab 共用同一套结构，只有 id 后缀不同（Listings / Picks）。
   ⚠️ 视觉演进（三轮）：
       v1 全宽 flex 行 —— 左一坨控件、右孤零零一个「跳至」，中间大片空洞 → 重心失衡（用户「有些丑」）；
       v2 居中两行 —— 上行数字页码、下行元信息，左右对称（用户又要求「做成一排 不用两排」）；
       v3 **居中单排**（当前）：`‹ 1 2 › │ 共 606 款 │ 每页 200 条 │ 跳至 _ 页`。
          组间靠 .pager-meta::before 画一根竖分隔线；宽度 fit-content 居中，不撑满整行。 */
.pager {
  display: flex; flex-direction: row; align-items: center; gap: 13px;
  /* 桌面单排；窄屏放不下时整组换行（优雅降级，不横向溢出） */
  flex-wrap: wrap; justify-content: center;
  /* 宽度贴合内容并居中（不是撑满整行）—— 撑满时卡片里 90% 是空白，看着很空 */
  width: fit-content; max-width: 100%; margin: 18px auto 4px; padding: 13px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-md);
  font-size: 13px; color: var(--text-2);
}

/* 单排左侧：‹ 1 … 4 5 [6] 7 8 … 47 ›  —— 页码不折行，避免又变回两行 */
.pager-pages { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.pager-nums { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }

.pg-btn {
  min-width: 32px; height: 32px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.pg-btn:hover:not(:disabled):not(.is-active) {
  color: var(--primary); border-color: var(--primary); background: var(--primary-soft);
}
.pg-btn.is-active {
  color: #fff; background: var(--primary); border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(232, 83, 43, .28);
}
.pg-btn:disabled { opacity: .34; cursor: not-allowed; }
/* 上一页 / 下一页：只用 SVG 箭头（`‹`/`›` 字形太细太弱，实测观感很差） */
.pg-nav { padding: 0; color: var(--text); }
.pg-nav .pg-ic { display: block; }
.pg-gap {
  min-width: 20px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); letter-spacing: 1px; user-select: none;
}

/* 单排右侧：共 N 条 │ 每页 200 条 │ 跳至 __ 页 */
.pager-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 页码组与元信息组之间的竖分隔线（组内分隔线由下面那条兄弟规则画） */
.pager-meta::before {
  content: ''; width: 1px; height: 18px; margin-right: 2px;
  background: var(--border-strong); opacity: .55;
}
.pager-meta > * { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
/* 竖分隔线用 ::before 画，这样「跳至」在页数少时被隐藏，分隔线也会跟着消失 */
.pager-meta > * + *::before {
  content: ''; width: 1px; height: 12px; margin-right: 10px;
  background: var(--border-strong); opacity: .55;
}
.pager-info { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.pager-size select, .pager-jump input {
  height: 28px; padding: 0 6px; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.pager-size select { padding-right: 4px; }
.pager-jump input { width: 56px; text-align: center; }
.pager-size select:focus, .pager-jump input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
@media (max-width: 720px) {
  /* 手机上单排塞不下 → 允许页码组内部换行 + 隐藏组间分隔线，退回「导航 / 元信息」两段 */
  .pager { gap: 10px; padding: 12px 12px; }
  .pager-pages, .pager-nums { flex-wrap: wrap; justify-content: center; }
  .pager-meta { justify-content: center; }
  .pager-meta::before { display: none; }
  .pg-btn { min-width: 30px; height: 30px; padding: 0 7px; }
}
.seller-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  display: flex; flex-direction: column; gap: 9px;
  background: var(--surface-2);
}
.seller-card.off { opacity: .62; }
.seller-top { display: flex; align-items: flex-start; gap: 9px; }
.seller-name { font-weight: 600; font-size: 14px; word-break: break-word; }
.seller-sub { font-size: 12px; color: var(--text-3); }
.seller-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.seller-stats b { color: var(--text); font-size: 13.5px; }
.seller-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* toggle */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 38px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-strong); border-radius: 999px; transition: .18s;
}
.slider:before {
  content: ""; position: absolute;
  width: 15px; height: 15px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .18s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider:before { transform: translateX(17px); }

/* ---------- runs ---------- */
.runs-list { display: flex; flex-direction: column; gap: 9px; }
.run-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  background: var(--surface-2);
  font-size: 13px;
}
.run-time { font-weight: 600; min-width: 150px; }
.run-meta { color: var(--text-2); font-size: 12.5px; }
.run-msg { color: #dc2626; font-size: 12px; flex-basis: 100%; }

/* ---------- empty / toast ---------- */
.empty {
  text-align: center; padding: 46px 20px;
  color: var(--text-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty-icon { font-size: 30px; margin-bottom: 8px; }
.empty p { margin: 0 0 4px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.empty span { font-size: 12.5px; }
/* 空态副文案（如「系统导入的店铺仍在监控，可点开关查看」）—— 比主文案小一号、更淡 */
.empty-sub {
  max-width: 440px; margin: 8px auto 0 !important;
  font-size: 12.5px !important; line-height: 1.7;
  color: var(--text-3) !important; font-weight: 400 !important;
}

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 999;
  box-shadow: var(--shadow-md);
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- 批量导入弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
}
.modal-mask { position: absolute; inset: 0; background: rgba(17, 24, 39, .45); }
.modal-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 760px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: modalIn .16s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15.5px; flex: 1; }
.modal-x {
  border: none; background: transparent; cursor: pointer;
  font-size: 15px; color: var(--text-3);
  padding: 3px 7px; border-radius: 6px; line-height: 1;
}
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.modal-body {
  padding: 16px 18px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-body .tip { margin-bottom: 0; }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.bulk-top { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bulk-line {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-2);
}
.bulk-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 230px; overflow-y: auto;
  background: var(--surface-2);
}
.bulk-row {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 11px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.bulk-row:last-child { border-bottom: none; }
.bulk-row .bname {
  flex: 1 1 46%; min-width: 0;
  font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bulk-row .bmeta { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.bulk-row .bnote {
  flex: 0 1 auto; min-width: 0;
  color: var(--text-3); font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bulk-row.bad { background: #fff7ed; }
.bulk-row.skip { opacity: .62; }
.bulk-empty { padding: 14px 12px; font-size: 12.5px; color: var(--text-3); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar-inner { padding: 10px 14px; display: flex; justify-content: space-between; }
  /* 窄屏退回「左品牌 / 右按钮」两端对齐：左列整体隐藏，
     否则它作为 0 宽 flex 项参与 space-between，会把品牌块顶成居中 */
  .topbar-left { display: none; }
  .topbar-center, .topbar-right { grid-column: auto; justify-self: auto; }
  .app-title strong { font-size: 17px; }
  /* ⚠️ 这里原来有 `.tabs { top: 60px }` —— 吸顶已合并进 .head-wrap，`top` 不再需要，
     窄屏下顶栏高度变化也不会再让两截错位。别把它加回来。 */
  .tabs-inner { padding: 0 14px; }
  .main { padding: 14px 14px 50px; }
  .user-chip { display: none; }
  .listing-grid, .seller-list { grid-template-columns: 1fr; }
  .seg { grid-template-columns: repeat(2, 1fr); }
  .bulk-top { grid-template-columns: 1fr; }
  .modal { padding: 10px; }
  .modal-panel { max-height: 94vh; }
}

/* =========================================================
   登录门禁（2026-09-30 商用化：会员制，首页即登录）
   ---------------------------------------------------------
   未登录时 <body> 带 .gated：
     · 主应用整块 display:none —— 不是盖一层遮罩，那样数据照样会被拉下来
     · 登录层铺满视口，z-index 高于头部(30)与弹窗(200)
   ⚠️ 别再做成「遮罩盖住主站」：门禁的意义是「没登录就拿不到数据」，
      遮罩只是看起来锁了，接口照样能读。
   ========================================================= */
body.gated .app { display: none; }

.login-gate {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
  background:
    radial-gradient(1100px 520px at 50% -12%, #fdece5 0%, rgba(253, 236, 229, 0) 62%),
    var(--bg);
}

.login-card {
  width: 100%; max-width: 392px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 44px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .04);
  padding: 32px 30px 20px;
}

.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  width: 46px; height: 46px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  border-radius: 13px; font-weight: 800; font-size: 15px; letter-spacing: .6px;
  box-shadow: 0 5px 14px rgba(232, 83, 43, .30);
}
.login-brand h1 { margin: 0 0 6px; font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.login-brand p { margin: 0; font-size: 12.5px; color: var(--text-3); }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.login-field input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface); transition: .15s;
}
.login-field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 83, 43, .12);
}
.login-field input::placeholder { color: var(--text-3); }

/* 提示区固定高度，避免出错时卡片跳动 */
.login-msg {
  min-height: 18px; font-size: 12.5px; line-height: 1.5;
  color: #b91c1c; text-align: center;
}
.login-msg.ok { color: var(--green); }

.login-submit {
  width: 100%; padding: 11px; margin-top: 2px;
  font-size: 15px; font-weight: 600; letter-spacing: 1px;
}

.login-foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 12px; color: var(--text-3);
}

@media (max-width: 420px) {
  .login-card { padding: 26px 20px 16px; border-radius: 14px; }
  .login-brand h1 { font-size: 17px; }
}

@media (max-width: 860px) {
  /* 窄屏也要留退出入口：左列不再整块隐藏，只收起用户名 chip。
     ⚠️ 上面原有的 `.topbar-left { display: none }` 会让手机端完全没有退出按钮，
        会员在手机上就没法换账号 —— 所以这里必须覆盖掉。 */
  .topbar-left { display: flex; gap: 8px; }
  .topbar-left .user-chip { display: none; }
}

/* =========================================================
   后台同步进度条（#syncBar，由 app.js 动态创建）
   ---------------------------------------------------------
   2026-09-30 加：跨洋链路下拉全量数据要十几秒，原来这段时间是
   全屏「正在加载…」把人挡在外面。现在改成
   「本地缓存先出内容 + 顶部一条细进度条表示还在同步」。
   ⚠️ z-index 要高于 .head-wrap(30)，低于弹窗；用 fixed 而非 sticky，
      避免参与布局把内容顶下去。
   ========================================================= */
#syncBar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 45%, var(--primary) 55%, transparent 100%);
  background-size: 35% 100%;
  background-repeat: no-repeat;
  animation: syncSlide 1.15s linear infinite;
}
#syncBar.on { opacity: 1; }

@keyframes syncSlide {
  0%   { background-position: -45% 0; }
  100% { background-position: 145% 0; }
}

/* 用户开了「减少动态效果」就别让它一直动 */
@media (prefers-reduced-motion: reduce) {
  #syncBar { animation: none; background: var(--primary); background-size: 100% 100%; }
}
