/* ==========================================================================
   卡牌库存 · iOS（Cupertino）外观层
   只做「设计/外观」，不改任何功能。加载顺序：在 app.css 之后引入即可。
   作用域：① 顶部导航 .navbar.app-nav（全站）② 首页仪表台 .ios-dash（仅首页）
   其余页面仍由 app.css 控制，互不影响。
   ========================================================================== */

/* ---------- 字体：Inter 自托管（替代 SF，授权友好）。
   下载 Inter 可变字体 woff2 放到 /static/vendor/fonts/Inter.var.woff2 即可；
   没放也能用——会自动回退到系统 SF / Segoe UI / 苹方 / 雅黑。 ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/vendor/fonts/Inter.var.woff2') format('woff2');
}

:root {
  --ios-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
              'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', sans-serif;

  /* 背景与文字（systemGroupedBackground 体系） */
  --ios-bg:      #f2f2f7;
  --ios-card:    #ffffff;
  --ios-ink:     #1c1c1e;
  --ios-ink2:    #6a6e76;   /* 次要文字：白底 ≥4.5:1，可承载正文阅读 */
  --ios-ink3:    #9ea0a6;   /* 仅装饰（chevron / 占位图标），不承载需阅读的文字 */
  --ios-sep:     rgba(60, 60, 67, .14);

  /* 配色（靛紫 · 薄荷青 · 珊瑚 · 蜜金 + 辅助） */
  --ios-indigo:  #0a84ff;
  --ios-indigo2: #0070e0;
  --ios-violet:  #0a84ff;
  --ios-teal:    #0fb6a8;
  --ios-coral:   #fb7a6b;
  --ios-amber:   #f0a93b;
  --ios-red:     #f43f5e;
  --ios-sky:     #38bdf8;
  --ios-rose:    #f43f6b;

  /* 渐变：蓝→青（非紫，呼应薄荷青）；金色用于榜首 */
  --ios-grad:       linear-gradient(135deg, #0a84ff 0%, #19c2d6 100%);
  --ios-grad-amber: linear-gradient(135deg, #fbcf6b 0%, #f0a93b 100%);

  /* 圆角分级：卡片 12 / 控件 10 / 胶囊仅限分段器、徽章、chip */
  --ios-r:    12px;
  --ios-r-lg: 14px;
  --ios-r-ctl: 10px;
  --ios-r-pill: 999px;
  --ios-sh:   0 1px 3px rgba(20, 20, 40, .05);
  --ios-sh-hi: 0 8px 20px -6px rgba(20, 20, 40, .18);
  /* 分段器：灰轨道 + 白色选中滑块（正宗 iOS segmented） */
  --ios-track: rgba(120, 120, 128, .17);
  --ios-thumb-sh: 0 1px 4px rgba(20, 20, 40, .14);
}

/* ==========================================================================
   1. 顶部导航 → iOS 半透明命令条（全站）
   ========================================================================== */
body { background: var(--ios-bg); font-family: var(--ios-font); }

.navbar.app-nav {
  height: 68px;
  min-height: 68px;
  flex: 0 0 68px;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: .5px solid var(--ios-sep);
  box-shadow: 0 1px 14px rgba(20, 20, 40, .05);
  font-family: var(--ios-font);
  padding: 0 20px;
}
.navbar.app-nav .container-fluid { gap: 14px; }
/* 卡盒模式菜单较多：中间菜单允许收缩/横向容纳，不能把右侧账号区挤出视口。 */
.navbar.app-nav .navbar-collapse { min-width: 0; }
.navbar.app-nav .navbar-nav {
  min-width: 0; max-width: 100%; flex: 0 1 auto; flex-wrap: nowrap;
}
.navbar.app-nav .navbar-collapse > .dropdown.ms-auto { flex: 0 0 auto; }

/* 品牌：靛紫渐变圆角芯片（加大、加深投影） */
.navbar.app-nav .navbar-brand {
  font-family: var(--ios-font); font-weight: 700; color: var(--ios-ink);
  font-size: 16px; letter-spacing: -.01em; white-space: nowrap; gap: 9px;
}
.navbar.app-nav .navbar-brand i {
  background: var(--ios-grad);
  color: #fff; width: 31px; height: 31px; border-radius: 9px; font-size: 15px;
  box-shadow: 0 2px 6px rgba(20, 20, 40, .12);
}
.navbar.app-nav .navbar-brand:hover i { filter: brightness(1.05); }
.navbar.app-nav .navbar-brand.dropdown-toggle::after { margin-left: 2px; opacity: .5; }
.navbar.app-nav .nav-divider { background: var(--ios-sep); height: 26px; margin: 0 6px 0 10px; }

/* 菜单做成「分段轨」容器：灰轨道 + 白色选中滑块（正宗 iOS segmented，不再满屏蓝） */
.navbar.app-nav .navbar-nav {
  gap: 2px;
  background: var(--ios-track);
  border: .5px solid rgba(60, 60, 67, .06);
  border-radius: var(--ios-r-pill);
  padding: 4px;
}
.navbar.app-nav .nav-link {
  color: #51525c;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--ios-r-pill);
  padding: 6px 14px;
  min-height: 32px;
}
.navbar.app-nav .nav-link i { opacity: .8; margin-right: 5px; }
.navbar.app-nav .nav-link:hover {
  color: var(--ios-ink);
  background: rgba(255, 255, 255, .65);
}
.navbar.app-nav .nav-link:hover i { opacity: 1; }
.navbar.app-nav .nav-link.active,
.navbar.app-nav .nav-link.active:hover {
  background: #fff;
  color: var(--ios-ink);
  font-weight: 600;
  box-shadow: var(--ios-thumb-sh);
}
.navbar.app-nav .nav-link.active i { opacity: 1; color: var(--ios-indigo); }

/* 卡盒导航分区：业务操作与通用工具之间留出明确的视觉断点。 */
.navbar.app-nav .nav-section-divider {
  align-self: stretch;
  flex: 0 0 1px;
  width: 1px;
  margin: 4px 7px;
  background: var(--ios-sep);
  list-style: none;
}

/* 992–1450px 仍使用桌面导航，但压紧菜单，保证报表/财务和账号入口都完整可见。 */
@media (min-width: 993px) and (max-width: 1450px) {
  .navbar.app-nav { padding-inline: 14px; }
  .navbar.app-nav .container-fluid { gap: 8px; }
  .navbar.app-nav .nav-divider { margin-inline: 4px; }
  .navbar.app-nav .nav-link { padding-inline: 10px; }
  .navbar.app-nav .nav-link i { margin-right: 3px; }
  .navbar.app-nav .btn-ghost.dropdown-toggle { padding-inline: 9px; }
}

@media (min-width: 993px) and (max-width: 1220px) {
  .navbar.app-nav .nav-link i { display: none; }
  .navbar.app-nav .nav-link { padding-inline: 9px; }
}

/* 下拉、用户菜单等沿用 iOS 圆角 */
.navbar.app-nav .dropdown-menu { border-radius: 12px; border: .5px solid var(--ios-sep); box-shadow: 0 12px 32px -8px rgba(20, 20, 40, .22); padding: 5px; margin-top: 8px; }
.navbar.app-nav .dropdown-item { border-radius: 9px; padding: 8px 12px; }
.navbar.app-nav .dropdown-item:hover,
.navbar.app-nav .dropdown-item:focus { background: rgba(10, 132, 255, .1); color: var(--ios-indigo); }

/* 库存来源颜色图例（仅卡盒模式）：静态提示胶囊，说明表格里在库/均价的
   蓝=本地、橙=赵总；非交互。颜色复用「供货来源着色」令牌（--c-accent / --c-warning），不写 hex。 */
.navbar.app-nav .nav-source-key {
  align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--ios-r-pill);
  background: rgba(120, 120, 128, .1);
  font-size: 12px; white-space: nowrap; color: var(--ios-ink2);
  box-sizing: border-box;
  flex: 0 0 auto;
  width: auto;
  height: 36px;
  justify-content: center;
}
.navbar.app-nav .nav-user-group {
  margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
}
.navbar.app-nav .nav-source-key .nsk-cap { color: var(--ios-ink2); }
.navbar.app-nav .nav-source-key .nsk-local { color: var(--c-accent); font-weight: 600; }
.navbar.app-nav .nav-source-key .nsk-zhao { color: var(--c-warning); font-weight: 600; }
.navbar.app-nav .nav-source-key .nsk-sep { color: var(--ios-ink2); opacity: .55; }

/* 右侧用户：胶囊 + 高亮头像图标 */
.navbar.app-nav .btn-ghost.dropdown-toggle {
  color: var(--ios-ink); font-weight: 500;
  border-radius: var(--ios-r-pill);
  background: rgba(120, 120, 128, .1);
  padding: 5px 12px;
}
.navbar.app-nav .btn-ghost.dropdown-toggle:hover { background: rgba(10, 132, 255, .12); color: var(--ios-indigo); }
.navbar.app-nav .btn-ghost.dropdown-toggle .bi-person-circle { color: var(--ios-indigo); font-size: 16px; }
.navbar.app-nav .badge.bg-secondary { background: rgba(10, 132, 255, .14) !important; color: var(--ios-indigo); font-weight: 600; }
.navbar.app-nav .navbar-toggler { border-color: var(--ios-sep); }
.navbar.app-nav .navbar-toggler:focus { outline: 2px solid var(--ios-indigo); box-shadow: none; }

/* 移动端折叠：去掉分段轨，回到竖直列表 */
@media (max-width: 992px) {
  .navbar.app-nav { height: auto; min-height: 0; flex: 0 0 auto; padding: 8px 14px; }
  .navbar.app-nav .navbar-nav { background: transparent; border: 0; padding: 0; border-radius: 0; }
  .navbar.app-nav .nav-divider { display: none; }
  .navbar.app-nav .nav-section-divider {
    flex-basis: auto;
    width: auto;
    height: 1px;
    margin: 7px 4px;
  }
}

/* ==========================================================================
   2. 首页仪表台 .ios-dash（仅首页 main 上加这个类）
   ========================================================================== */
main.ios-dash {
  max-width: min(calc(100vw - 48px), 1920px);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-6) var(--sp-8);
  font-family: var(--ios-font);
  color: var(--ios-ink);
}
.ios-dash *,
.ios-dash *::before,
.ios-dash *::after { box-sizing: border-box; }

/* 大标题栏 */
.ios-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ios-eyebrow { font-size: 12px; color: var(--ios-ink2); margin-bottom: 2px; }
.ios-title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .01em; color: var(--ios-ink); }
.ios-actions { display: flex; gap: 10px; }
.ios-btn {
  font-family: var(--ios-font); font-size: 14px; font-weight: 600;
  border: none; padding: 9px 18px; border-radius: var(--ios-r-ctl);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; transition: filter .15s ease, background .15s ease;
}
.ios-btn--primary { color: #fff; background: var(--ios-grad); box-shadow: 0 2px 6px rgba(20, 20, 40, .16); }
.ios-btn--primary:hover { filter: brightness(1.05); color: #fff; }
.ios-btn--plain { color: var(--ios-indigo); background: var(--ios-card); font-weight: 500; box-shadow: var(--ios-sh); }
.ios-btn--plain:hover { background: #f7f7fb; color: var(--ios-indigo); }
/* 灰胶囊按钮：与统一灰工具条同色（摄像头等次要动作） */
.ios-btn--soft { color: var(--ios-ink); background: #eef0f4; font-weight: 500; }
.ios-btn--soft:hover { background: #e4e7ee; color: var(--ios-ink); }

/* ── 表格内联输入框（数量/单价/单元格编辑）：始终显框，交互再强化 ── */
.catalog-table .form-control,
.catalog-table .form-select,
.recycle-table .form-control,
.recycle-table .form-select,
.stock-out-table .form-control,
.stock-out-table .form-select {
  background: var(--c-surface-1);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  box-shadow: none;
  transition: background .12s ease, border-color .12s ease;
}
.catalog-table .form-control:hover,
.catalog-table .form-select:hover,
.recycle-table .form-control:hover,
.recycle-table .form-select:hover,
.stock-out-table .form-control:hover,
.stock-out-table .form-select:hover {
  background: var(--c-surface-2);
  border-color: color-mix(in srgb, var(--c-accent) 35%, var(--c-border));
}
.catalog-table .form-control:focus,
.catalog-table .form-select:focus,
.recycle-table .form-control:focus,
.recycle-table .form-select:focus,
.stock-out-table .form-control:focus,
.stock-out-table .form-select:focus {
  background: var(--c-surface-1);
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 16%, transparent);
}

/* KPI 小组件网格（形态各异） */
.ios-kpis { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.ios-widget {
  background: var(--ios-card); border-radius: var(--ios-r-lg);
  padding: 16px 18px; box-shadow: var(--ios-sh);
  color: inherit; text-decoration: none; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ios-widget:hover { transform: translateY(-2px); }
.ios-w-label { font-size: 13px; color: var(--ios-ink2); }
.ios-w-figure { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--ios-ink); }
.ios-w-sub { font-size: 12px; color: var(--ios-ink2); }
.ios-w-ic { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: 0 0 auto; }

/* 销售英雄卡：整块靛紫渐变 */
.ios-widget--sales {
  grid-row: span 1;
  background: var(--ios-grad);
  color: #fff; box-shadow: var(--ios-sh-hi); justify-content: space-between; gap: 10px;
}
.ios-widget--sales:hover { transform: translateY(-2px); filter: brightness(1.02); }
.ios-sales-top { display: flex; align-items: center; justify-content: space-between; }
.ios-sales-top .ios-w-label { color: rgba(255, 255, 255, .85); }
.ios-chip-up { font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .22); padding: 2px 9px; border-radius: var(--ios-r-pill); }
.ios-sales-fig { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ios-sales-sub { font-size: 12px; color: rgba(255, 255, 255, .88); }

/* 圆环 / 甜甜圈卡：图 + 文 横排 */
.ios-widget--ring,
.ios-widget--donut { flex-direction: row; align-items: center; gap: 14px; }
.ios-ring-text { min-width: 0; }
.ios-legend { display: flex; gap: 10px; margin-top: 5px; font-size: 12px; color: var(--ios-ink2); }
.ios-legend span { display: inline-flex; align-items: center; gap: 4px; }
.ios-dot { width: 7px; height: 7px; border-radius: 2px; }

/* 入库卡：珊瑚色块 */
.ios-widget--in .ios-w-figure { color: var(--ios-coral); }
.ios-widget--in .ios-w-ic { background: #ffe9e4; color: var(--ios-coral); }

/* 两列工作区 */
.ios-cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.ios-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ios-section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 8px; }
.ios-section-head .ios-h { font-size: 13px; font-weight: 600; color: var(--ios-ink2); }
.ios-section-head a { font-size: 13px; color: var(--ios-indigo); text-decoration: none; }

/* 分组卡片（设置 App 风列表） */
.ios-list { background: var(--ios-card); border-radius: var(--ios-r); overflow: hidden; box-shadow: var(--ios-sh); }
.ios-row { display: grid; align-items: center; gap: 13px; padding: 11px 16px; color: inherit; text-decoration: none; }
.ios-row:hover { background: #fafafe; }
.ios-row + .ios-row { border-top: .5px solid var(--ios-sep); }
.ios-ic { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; flex: 0 0 auto; }
.ios-ic--sm { width: 28px; height: 28px; border-radius: 7px; }
.ios-ic--in { background: var(--ios-teal); }
.ios-ic--out { background: var(--ios-indigo); }

/* 流水行 */
.ios-row--txn { grid-template-columns: 30px 1fr auto; }
.ios-row-main { min-width: 0; }
.ios-row-title { font-size: 14px; color: var(--ios-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-row-sub { font-size: 12px; color: var(--ios-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-amt { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ios-ink); white-space: nowrap; }

/* 待处理行 */
.ios-row--task { grid-template-columns: 28px 1fr auto auto; }
.ios-task-label { font-size: 14px; color: var(--ios-ink); }
.ios-task-count { font-size: 14px; color: var(--ios-ink2); font-variant-numeric: tabular-nums; }
.ios-task-count.is-alert { color: var(--ios-red); font-weight: 600; }
.ios-chevron { color: var(--ios-ink3); font-size: 13px; }

/* 畅销榜行 */
.ios-row--rank { grid-template-columns: 24px 1fr auto; }
.ios-rank-no { width: 24px; height: 24px; border-radius: 7px; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ios-rank-no.r1 { background: var(--ios-grad-amber); }
.ios-rank-no.r2 { background: var(--ios-sky); }
.ios-rank-no.r3 { background: var(--ios-rose); }
.ios-rank-no.rn { background: #c7c7cc; }
.ios-rank-name { font-size: 14px; color: var(--ios-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-profit-pos { font-size: 13px; font-weight: 600; color: var(--ios-teal); font-variant-numeric: tabular-nums; }
.ios-profit-neg { font-size: 13px; font-weight: 600; color: var(--ios-red); font-variant-numeric: tabular-nums; }

.ios-empty { padding: 22px 16px; text-align: center; color: var(--ios-ink2); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .ios-kpis { grid-template-columns: 1fr 1fr; }
  .ios-widget--sales { grid-column: span 2; }
}
@media (max-width: 992px) {
  .ios-cols { grid-template-columns: 1fr; }
  .navbar.app-nav { height: auto; }
}
@media (max-width: 768px) {
  main.ios-dash { padding: 18px 14px 48px; }
  .ios-kpis { grid-template-columns: 1fr; }
  .ios-widget--sales { grid-column: span 1; }
  .ios-title { font-size: 24px; }
}

/* ==========================================================================
   3. 全局组件统一（覆盖 app.css 令牌）→ 所有页面自动变 iOS 风
   原理：app.css 全程走语义令牌 var(--c-*) / 结构令牌 --r-* / --sh-*。
   这里在其后重定义这些令牌为 iOS 取值，于是表格 / 卡片 / 按钮 / 筛选 /
   徽章 / 分页 / 表单 / 报表 KPI 等所有共用组件一次性换肤，模板与功能不动。
   换肤系统已下线，此 :root 覆盖层无条件生效，是唯一的 iOS 蓝青主题。
   ========================================================================== */
:root {
  /* —— 颜色（语义令牌） —— */
  --c-text: #1c1c1e;  --c-text-muted: #5f6470;  --c-text-faint: #9499a3;
  --c-surface: #f2f2f7;  --c-surface-1: #ffffff;  --c-surface-2: #e3e6ec;
  --c-surface-3: #d5d9e1;  --c-border: #e5e5ea;
  --c-accent: #0a84ff;  --c-accent-hover: #0070e0;
  --c-success: #0fb6a8;  --c-warning: #f0a93b;  --c-danger: #f43f5e;

  /* —— 字体：标题/数字改 Inter（去掉 Space Grotesk 的个性，统一 iOS） —— */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                  'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', sans-serif;

  /* —— 结构：圆角分级（卡片 12 / 控件 10）+ 柔和中性阴影 —— */
  --r-sm: 10px;  --r-md: 12px;  --r-lg: 14px;
  --sh-1: 0 1px 3px rgba(20, 20, 40, .05);
  --sh-2: 0 6px 16px -6px rgba(20, 20, 40, .12);
  --sh-3: 0 16px 40px -10px rgba(20, 20, 40, .20);

  /* —— Bootstrap 镜像令牌（弹窗 / 表单控件 / 下拉等跟上） —— */
  --bs-body-bg: #f2f2f7;  --bs-body-color: #1c1c1e;  --bs-emphasis-color: #1c1c1e;
  --bs-primary-rgb: 10, 132, 255;
  --bs-secondary-color: #5f6470;  --bs-tertiary-color: #9499a3;
  --bs-tertiary-bg: #eef0f4;  --bs-secondary-bg: #e4e7ee;  --bs-border-color: #e5e5ea;
  --bs-border-radius: 10px;  --bs-border-radius-sm: 8px;  --bs-border-radius-lg: 14px;
}

/* 主按钮：用蓝青渐变（与首页一致），非纯色 */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus {
  background: var(--ios-grad);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.04); }
.btn-outline-primary:hover { background: var(--ios-grad); border-color: transparent; }

/* 卡片 / 容器：与首页一致——去边框 + 12px 圆角 + 柔和投影（grouped-card 风） */
.card,
.table-wrap,
.filter-bar,
.form-section,
.summary-tile,
.kpi-tile,
.summary-collapse {
  border: 0;
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.ios-toolbar { border-radius: var(--r-md); }
/* 报表 KPI 卡：去左侧色条（side-stripe），与首页/分析页白卡统一 */
.kpi-tile { border-left: 0 !important; }
.card:hover,
.summary-tile:hover { box-shadow: var(--sh-2); }

/* 表头：白底 + 深色加粗字 + 灰细线（全站统一）。白底而非透明，滚动容器里吸顶时行不透出；
   字色用本文色 --c-text（而非 muted 灰），和下方数据行拉开对比。 */
.table-wrap .table thead th { background: var(--c-surface-1); color: var(--c-text); font-weight: 600; letter-spacing: 0; border-bottom: 1px solid var(--c-border); }
/* 灰底徽章（系列/稀有度）：提高对比度，别发灰看不清 */
.badge.text-bg-secondary,
.badge.text-bg-light {
  background: rgba(99, 102, 241, .1) !important;
  color: #3a4458 !important;
}
/* 空徽章（JS 填充但值为空时）不占位、不露出小色块 */
.badge:empty { display: none; }
/* 卡盒系列徽章：系列是卡盒关键信息，做大做醒目——加大字号 + 加粗 + iOS 蓝，
   比通用灰底小徽章更抢眼；全站卡盒页系列列统一用它 */
.series-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .1px;
  background: rgba(10, 132, 255, .13);
  color: var(--ios-indigo);
  white-space: nowrap;
}
.series-badge:empty { display: none; }
/* 可点击行 hover */
tr.row-link:hover > td { background: var(--c-surface-2); }

/* 表格行：贴近首页分组列表的清爽手感——加大行高 + 整行 hover + 清晰分隔 */
.table-wrap .table thead th { padding-top: 11px; padding-bottom: 11px; }
.table-wrap .table tbody td { padding-top: 13px; padding-bottom: 13px; }
.table-wrap .table tbody tr { transition: background .12s ease; }
.table-wrap .table tbody tr:hover > td { background: color-mix(in srgb, var(--c-accent) 5%, transparent); }

/* 录入型密集表（出库购物车 / 入库登记）：行显式纯白 + 灰细线，符合规范第 4 节，
   避免行背景透明而透出画布灰（隔行发灰错觉）。density 保持不变。 */
.table-wrap .table tbody td { background: #fff; border-top: 1px solid var(--c-border); }
.table-wrap .table tbody tr:first-child td { border-top: 0; }
.table-wrap .table tbody tr:hover > td { background: color-mix(in srgb, var(--c-accent) 5%, #fff); }

/* ── 卡片行（图一首页风）：一张白圆角卡，行间用一条灰细线分隔 ── */
.table-wrap.ios-cardrows { background: #fff; box-shadow: var(--sh-1); border-radius: var(--r-md); overflow: hidden; padding: 0; }
.ios-cardrows .table { border-collapse: collapse; }
.ios-cardrows .table thead th { background: var(--c-surface-1); border: 0; border-bottom: 1px solid var(--c-border); color: var(--c-text); font-size: 12px; font-weight: 600; padding: 13px 16px; }
.ios-cardrows .table tbody td { background: transparent; border: 0; border-top: 1px solid var(--c-border); padding: 15px 16px; vertical-align: middle; }
.ios-cardrows .table tbody tr:first-child td { border-top: 0; }
.ios-cardrows .table tbody tr { transition: background .12s ease; }
.ios-cardrows .table tbody tr:hover > td { background: color-mix(in srgb, var(--c-accent) 4%, transparent); }

/* 表单聚焦：iOS 蓝光环 */
.form-control:focus,
.form-select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 18%, transparent);
}

/* 分段控件 active：灰轨道 + 白色选中滑块（正宗 iOS segmented，全站统一） */
.segmented { background: var(--ios-track); }
.segmented a.active { background: #fff; box-shadow: var(--ios-thumb-sh); color: var(--ios-ink); font-weight: 600; }
.segmented a.active:hover { color: var(--ios-ink); }

/* 分页 active 用纯蓝（渐变只留给主按钮/品牌/英雄卡） */
.pagination .page-item.active .page-link { background: var(--ios-indigo); border-color: transparent; color: #fff; }

/* ==========================================================================
   4. 列表页外壳（iOS 重设计）—— 所有列表/管理页复用
   大标题头 + 带计数的分段视图 + 搜索胶囊 + 筛选下拉 + 溢出菜单。
   只换页面外壳与控件外观，数据表沿用 .table-wrap（已 iOS 化），功能不动。
   ========================================================================== */
.ios-listhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ios-listhead .lh-l { min-width: 0; }
.ios-listhead .lh-title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .01em; color: var(--ios-ink); }
.ios-listhead .lh-sub { font-size: 13px; color: var(--ios-ink2); margin-top: 3px; }
.ios-listhead .lh-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* 全站：左上角大标题（lh-title）+ 副标题（lh-sub）不再视觉展示，让出更多阅读空间与视野。
   仍留在 DOM（.visually-hidden 技法），满足规范红线7「每页保留唯一语义 H1」。
   覆盖 .ios-listhead 与 .page-header 两种头部（含详情页）。 */
.ios-listhead .lh-title, .ios-listhead .lh-sub,
.page-header .lh-title, .page-header .lh-sub {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* 标题收起后：没有右侧操作按钮的 listhead 整条收起，不留空白带 */
.ios-listhead:not(:has(.lh-actions)) { margin-bottom: 0; gap: 0; }
/* 详情页顶部：「返回」与随后的 .page-header 操作行并成一行——标题视觉隐藏后
   头部左侧本就空着，返回浮动过去，flex 头部自建 BFC 避让、天然同排；
   min-height 兜底保证头部不矮于返回钮，后续内容不绕排 */
main > .page-back:has(+ .page-header) { float: left; }
main > .page-back:has(+ .page-header) + .page-header { min-height: 40px; }

/* 圆形图标按钮（溢出菜单 / 次要动作） */
.ios-iconbtn { width: 38px; height: 38px; border-radius: 999px; background: rgba(120,120,128,.1); color: var(--ios-ink); display: inline-flex; align-items: center; justify-content: center; border: none; font-size: 16px; cursor: pointer; }
.ios-iconbtn:hover { background: rgba(10,132,255,.12); color: var(--ios-indigo); }

/* 分段视图（灰轨道 + 白色选中滑块，正宗 iOS segmented） */
.ios-seg { display: inline-flex; gap: 2px; background: var(--ios-track); border: .5px solid rgba(60,60,67,.06); border-radius: 999px; padding: 4px; margin-bottom: 16px; max-width: 100%; overflow-x: auto; }
.ios-seg a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: #51525c; text-decoration: none; white-space: nowrap; }
.ios-seg a:hover { color: var(--ios-ink); }
.ios-seg a .c { font-variant-numeric: tabular-nums; color: var(--ios-ink2); font-size: 12px; }
.ios-seg a.active { background: #fff; color: var(--ios-ink); font-weight: 600; box-shadow: var(--ios-thumb-sh); }
.ios-seg a.active:hover { color: var(--ios-ink); }
.ios-seg a.active .c { color: var(--ios-indigo); }
/* ios-seg 支持 <button>（导航栏 裸卡/PSA10 全局切换走 POST 表单） */
.ios-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: #51525c; white-space: nowrap; border: none; background: transparent; cursor: pointer; font-family: inherit; }
.ios-seg button:hover { color: var(--ios-ink); }
.ios-seg button.active { background: #fff; color: var(--ios-ink); font-weight: 600; box-shadow: var(--ios-thumb-sh); }
.ios-seg button.active:hover { color: var(--ios-ink); }
/* 导航栏内的 裸卡/PSA10 段：清掉默认下边距、纵向居中，与顶栏其它控件对齐 */
.nav-trackseg { align-items: center; }
.nav-trackseg .ios-seg { margin-bottom: 0; }

/* 工具条：搜索胶囊 + 筛选下拉（白卡容器） */
.ios-toolbar { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; background: var(--ios-card); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--ios-sh); margin-bottom: 18px; }
.ios-search { flex: 1 1 280px; min-width: 200px; display: flex; align-items: center; gap: 8px; background: #eef0f4; border-radius: var(--ios-r-ctl); padding: 9px 16px; }
.ios-search i { color: var(--ios-ink2); font-size: 15px; }
.ios-search input { border: none; background: transparent; outline: none; width: 100%; font-size: 14px; color: var(--ios-ink); font-family: inherit; }
.ios-toolbar .ios-fsel { border: none; border-radius: var(--ios-r-ctl); background: #eef0f4; font-size: 13px; padding: 9px 30px 9px 15px; width: auto; min-width: 92px; color: var(--ios-ink); box-shadow: none; }
.ios-toolbar .ios-fsel:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 18%, transparent); }
.ios-toolbar .tb-actions { display: flex; gap: 8px; margin-left: auto; }

@media (max-width: 768px) {
  .ios-listhead .lh-title { font-size: 24px; }
  .ios-search { flex-basis: 100%; }
}

/* 通用下拉菜单 iOS 化（全站，含溢出菜单 / 筛选下拉 / 用户菜单） */
.dropdown-menu {
  border-radius: 12px; border: .5px solid var(--ios-sep);
  box-shadow: 0 12px 32px -8px rgba(20, 20, 40, .22);
  padding: 6px; margin-top: 6px; min-width: 132px;
  /* 选项过多时菜单内部滚动，避免滚动带着整页跑（全站生效） */
  max-height: min(70vh, 460px); overflow-y: auto; overscroll-behavior: contain;
}
.dropdown-item { border-radius: 8px; padding: 8px 12px; font-size: 13px; display: flex; align-items: center; gap: 9px; }
.dropdown-item:hover, .dropdown-item:focus { background: rgba(10, 132, 255, .1); color: var(--ios-indigo); }
.dropdown-item.active, .dropdown-item:active { background: var(--ios-indigo); color: #fff; }
.dropdown-item .mk { margin-left: auto; color: var(--ios-indigo); font-size: 13px; }
.dropdown-item.active .mk { color: #fff; }
.dropdown-divider { margin: 5px 6px; border-color: var(--ios-sep); }

/* 筛选下拉按钮：胶囊 + 右侧 chevron 留足间距（替代原生 select 的贴边箭头） */
/* 筛选字段：上=字段名小标题（浅），下=下拉胶囊控件（深） */
.ios-ffield { display: inline-flex; flex-direction: column; align-items: stretch; gap: 4px; }
.ios-ffield .ios-fcap { font-size: 12px; font-weight: 500; color: var(--ios-ink2); padding-left: 4px; }
.ios-ffield > .dropdown, .ios-ffield > .ios-casc { display: block; }
/* 搜索占位字段：跟着一起撑开；内部控件填满宽度 */
.ios-ffield--grow { flex: 1 1 280px; min-width: 0; }
/* 内层搜索控件填满宽度，但不要在纵向（列方向）被拉伸成巨型胶囊 */
.ios-ffield--grow > .ios-search, .ios-ffield--grow > .ig-search { width: 100%; flex: 0 0 auto; }
/* 按钮上方的占位小标题：只占高度、不显示文字，用于让按钮与带标题的字段底部对齐 */
.ios-ffield .ios-fcap.is-spacer { visibility: hidden; }
/* 扫码标题充当搜索框的小标题：单行、含就绪圆点+状态，与其它字段小标题同一行对齐 */
.ios-ffield .ios-fcap--scan { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin: 0; }

.ios-fdrop {
  display: inline-flex; align-items: center; gap: 8px;
  background: #eef0f4; border: none; border-radius: var(--ios-r-ctl);
  padding: 9px 16px; font-size: 14px; color: var(--ios-ink);
  cursor: pointer; white-space: nowrap;
  min-width: 116px; justify-content: space-between;
}
.ios-fdrop:hover { background: #e4e7ee; color: var(--ios-ink); }
.ios-fdrop .v {
  font-weight: 500; flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.ios-fdrop .bi-chevron-down { font-size: 10px; color: var(--ios-ink2); flex: none; }
.ios-fdrop.dropdown-toggle::after { display: none; }
.ios-fdrop[aria-expanded="true"] { background: #dfe3ea; color: var(--ios-ink); }

/* 原生 select.ios-fsel 回退：箭头间距修宽，不贴边 */
.ios-toolbar .ios-fsel { padding-right: 34px; background-position: right 13px center; }

/* ==========================================================================
   5. 淘宝分析/管理页外壳对齐（作用域 .ana-page）——与报表页同一水准
   只覆盖外观：KPI 去左条去边框、面板无边框大圆角、筛选改灰胶囊、日期段渐变。
   不动 HTML 结构与图表 JS。
   ========================================================================== */
/* 大标题 */
.ana-page > .page-title { font-family: var(--ios-font); font-weight: 700; letter-spacing: .01em; color: var(--ios-ink); }

/* 筛选条：白卡容器无边框大圆角 */
.ana-page .ana-filters { border: 0 !important; border-radius: var(--r-md) !important; box-shadow: var(--sh-1); padding: 16px 18px; }
.ana-page .ana-filters .f label { font-size: 12px; color: var(--c-text-muted); }
/* 筛选输入 / 级联触发器 → 灰胶囊 */
.ana-page .ana-filters .form-control,
.ana-page .ana-filters .form-select,
.ana-page .ana-filters .casc-trigger,
.ana-page .ana-filters input[type="date"] {
  border: 1px solid transparent !important;
  background: #eef0f4 !important;
  border-radius: var(--ios-r-ctl) !important;
  box-shadow: none !important;
  height: 36px;
  padding-left: 15px; padding-right: 14px;
}
.ana-page .ana-filters .casc-trigger { display: flex; align-items: center; }
.ana-page .ana-filters .form-control:focus,
.ana-page .ana-filters .form-select:focus {
  background: #fff !important;
  border-color: var(--c-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 16%, transparent) !important;
}

/* 日期段：灰轨道 + 白色选中滑块（与 ios-seg 一致） */
.ana-page .date-presets { border: 0; background: var(--ios-track); padding: 4px; }
.ana-page .date-presets button.active { background: #fff; color: var(--ios-ink); font-weight: 600; box-shadow: var(--ios-thumb-sh); }

/* KPI 卡：去左侧蓝条、去边框、12px 圆角（首页/报表同款白卡） */
.ana-page .kpi-card { border: 0 !important; border-radius: var(--r-md) !important; box-shadow: var(--sh-1); }
.ana-page .kpi-card::before { display: none !important; }
.ana-page .kpi-card:hover { box-shadow: var(--sh-2); }
/* 数字字重调细，别太粗 */
.ana-page .kpi-card .value { font-weight: 600 !important; }
.ana-page .kpi-card .label { font-weight: 500; display: flex; align-items: center; gap: 7px; }
/* 每卡一个彩色圆点做区分（循环 iOS 色板） */
.ana-page .kpi-card .label::before { content: ""; width: 8px; height: 8px; border-radius: 3px; flex: none; background: var(--kpi-dot, #0a84ff); }
.ana-page .ana-kpis .kpi-card:nth-child(1) { --kpi-dot: #0a84ff; }
.ana-page .ana-kpis .kpi-card:nth-child(2) { --kpi-dot: #0fb6a8; }
.ana-page .ana-kpis .kpi-card:nth-child(3) { --kpi-dot: #19c2d6; }
.ana-page .ana-kpis .kpi-card:nth-child(4) { --kpi-dot: #f0a93b; }
.ana-page .ana-kpis .kpi-card:nth-child(5) { --kpi-dot: #fb7a6b; }
.ana-page .ana-kpis .kpi-card:nth-child(6) { --kpi-dot: #f43f5e; }
.ana-page .ana-kpis .kpi-card:nth-child(7) { --kpi-dot: #5e9cff; }
.ana-page .ana-kpis .kpi-card:nth-child(8) { --kpi-dot: #9b7cd6; }

/* 图表/榜单面板：无边框 18px 圆角，标题分隔线更淡 */
.ana-page .panel { border: 0 !important; border-radius: var(--r-md) !important; box-shadow: var(--sh-1); overflow: hidden; }
.ana-page .panel .ph { border-bottom: 1px solid var(--c-border); font-weight: 600; }

/* ── 通用 .filter-bar 输入 → 灰胶囊（统一流水/在库等未手工改造的筛选栏） ── */
.filter-bar .form-control,
.filter-bar .form-select,
.filter-bar input[type="date"] {
  border: 1px solid transparent !important;
  background: #eef0f4 !important;
  border-radius: var(--ios-r-ctl) !important;
  box-shadow: none !important;
}
.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  background: #fff !important;
  border-color: var(--c-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 16%, transparent) !important;
}
/* select 自适应内容宽度，不再撑满 */
.filter-bar select.form-select { width: auto !important; min-width: 88px; }
/* 筛选栏里的级联选择器触发钮：压到与 form-select-sm 同高（21px 行高 + 上下 5px = 31px），
   避免「系列」胶囊比旁边小号下拉大一圈。line-height 必须显式给：button 默认 normal（≈1.2），
   不给就比同排 select 矮一截 */
.filter-bar .ios-fdrop { padding: 5px 12px; font-size: .875rem; line-height: 1.5; min-width: 96px; }

/* ── 举一反三：让筛选字段的外层格子按内容自适应，消除死宽留下的空距 ──
   （app.css 把每个 > div 写死成 flex:0 0 150px；这里改为按控件宽收缩） */
.filter-bar.txn-filter .txn-filter-grid > div,
.filter-bar.inv-filter .inv-filter-grid > div {
  flex: 0 1 auto !important;
}
/* 文本输入给合理宽度，日期/下拉按自身内容 */
.filter-bar.txn-filter .txn-filter-grid > div .form-control,
.filter-bar.inv-filter .inv-filter-grid > div .form-control { width: 150px; }
.filter-bar.txn-filter .txn-filter-grid > div.filter-keyword,
.filter-bar.inv-filter .inv-filter-grid > div.filter-keyword { flex: 0 1 300px !important; }
.filter-bar.txn-filter .txn-filter-grid > div.filter-keyword .form-control,
.filter-bar.inv-filter .inv-filter-grid > div.filter-keyword .form-control { width: 300px; max-width: 100%; }
.filter-bar input[type="date"].form-control { width: auto !important; }

/* 榜单/明细内的搜索框 → 灰底圆角矩形 */
.ana-page .rank-tools .form-control,
.ana-page .rank-toggle { border-radius: var(--ios-r-ctl); }
.ana-page .rank-tools .form-control { background: #eef0f4; border: 1px solid transparent; }

/* ── 流水顶部紧凑：裸卡/PSA10 紧贴标题下方，收紧整体间距 ── */
.ios-listhead:has(~ .page-header > #txn-segmented) { margin-bottom: 8px; }
.page-header:has(> #txn-segmented) {
  margin-top: 0;
  margin-bottom: 14px;
  padding-top: 0;
  padding-bottom: 0;
}

/* ── 流水·订单视图修复：去掉订单号 code 的长灰条 + 选中态改柔和淡蓝（不再灰圈） ── */.txn-order-table .oh-code,
.txn-order-table code {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  color: var(--c-text) !important;
}
.txn-order-table .order-head .oh-bar:hover {
  background: color-mix(in srgb, var(--c-accent) 5%, transparent) !important;
}
.txn-order-table .order-head.expanded .oh-bar {
  background: color-mix(in srgb, var(--c-accent) 8%, transparent) !important;
}
/* 订单视图行自带 oh-bar 高亮，取消全局行 hover 叠加，避免双层灰 */
.txn-order-table tbody tr:hover > td { background: transparent !important; }

/* 目录表/清单表里的商品码等 code：去灰底胶囊，静默等宽文本（与流水订单视图同一处理） */
.catalog-table code,
.recycle-table code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* 订单明细表 & 榜单：白底吸顶表头 + 细线 + 字重收敛（与全站表格一致） */
.ana-page .detail-panel thead th {
  background: var(--c-surface-1) !important;
  color: var(--c-text-muted) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  border-bottom: 1px solid var(--c-border) !important;
}
.ana-page .detail-panel tbody td { border-color: var(--c-border); }
.ana-page .rank-compare .rank-box { border: 0 !important; border-radius: 0 !important; }
.ana-page .rank-compare .rank-box + .rank-box { border-left: 1px solid var(--c-border) !important; }
.ana-page .rank-subhead { background: transparent !important; font-weight: 600 !important; }
.ana-page .rank-subhead span:last-child { font-weight: 500 !important; }

/* ==========================================================================
   6. 系列分类级联选择器（.ios-casc，全站可复用）
   两栏浮层：左=分类、右=系列；选叶子系列写回隐藏字段并提交所在表单。
   与淘宝分析页内联的 .casc-* 不同名，互不影响。
   ========================================================================== */
.ios-casc { position: relative; display: inline-block; }
.ios-casc-trigger.dropdown-toggle::after { display: none; }
/* 嵌在 input-group 里（如出库渠道）：拉伸填满剩余宽度，外观对齐旁边的 form-control
   （白底 + 细描边 + 同内边距），不再用工具栏的灰胶囊底 */
.input-group .ios-casc { flex: 1 1 auto; display: flex; min-width: 0; }
.input-group .ios-casc .ios-casc-trigger {
  width: 100%;
  background: var(--c-surface-1);
  border: 1px solid var(--c-border);
  border-radius: 0 var(--bs-border-radius, .375rem) var(--bs-border-radius, .375rem) 0;
  padding: .375rem .75rem;
}
.input-group .ios-casc .ios-casc-trigger:hover { background: var(--c-surface-1); }
.input-group .ios-casc .ios-casc-trigger[aria-expanded="true"] {
  background: var(--c-surface-1);
  border-color: var(--c-accent);
}
/* 嵌在筛选栏字段格里（如流水页渠道）：默认 inline-block 会和小标题挤在同一行，
   改成 flex —— 小标题在上、控件在下，跟同排的「类型」下拉一致。
   用 flex 而不是 block：触发钮是 inline-flex，行内盒下方会留一截字体降部空白，
   使这一格比旁边的 select 高出几像素、底部对不齐（筛选栏 align-items:end）。
   外观（灰胶囊 + 同高）沿用上面的 .filter-bar .ios-fdrop，不另起一套。 */
.filter-grid .ios-casc { display: flex; }
/* 外观对齐全站筛选下拉（.dropdown-menu / .dropdown-item）：同圆角/阴影、渐变选中态 */
.ios-casc-pop {
  position: absolute; z-index: 1080; top: 100%; left: 0; margin-top: 6px;
  /* 底色与全站 .dropdown-menu 一致（bootstrap 取 --bs-body-bg = 画布灰） */
  display: flex; background: var(--ios-bg); border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(20, 20, 40, .22); overflow: hidden;
  border: .5px solid var(--ios-sep);
}
.ios-casc-pop[hidden] { display: none; }
/* 列宽随内容自适应：短列表（如出库渠道）收紧不留白，长列表仍封顶 184px（＝旧固定宽），
   超出由 .nm 的省略号兜底，故长系列名表现与改动前一致 */
.ios-casc-col {
  width: max-content; min-width: 120px; max-width: 184px;
  max-height: min(70vh, 460px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border-right: .5px solid var(--ios-sep);
}
.ios-casc-col:last-child { border-right: 0; }
.ios-casc-item {
  display: flex; align-items: center; gap: 9px; justify-content: space-between;
  padding: 8px 12px; border-radius: 8px; font-size: 13px; color: var(--ios-ink);
  cursor: pointer; white-space: nowrap;
}
.ios-casc-item:hover { background: rgba(10, 132, 255, .1); color: var(--ios-indigo); }
.ios-casc-item.active { background: var(--ios-indigo); color: #fff; font-weight: 600; }
.ios-casc-item .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ios-casc-item .chev { font-size: 10px; color: var(--ios-ink2); }
.ios-casc-item:hover .chev { color: var(--ios-indigo); }
.ios-casc-item.active .chev { color: rgba(255, 255, 255, .8); }
.ios-casc-item .mk { color: var(--ios-indigo); font-size: 13px; margin-left: auto; }
.ios-casc-item.active .mk { color: #fff; }
.ios-casc-item .casc-cnt { color: var(--ios-ink2); font-size: 12px; font-variant-numeric: tabular-nums; margin-left: auto; }
.ios-casc-item:hover .casc-cnt { color: var(--ios-indigo); }
.ios-casc-item.active .casc-cnt { color: rgba(255, 255, 255, .85); }
.ios-casc-empty { padding: 14px 10px; color: var(--ios-ink2); font-size: 13px; }

/* ==========================================================================
   6b. 清单合计块（.cart-totals，全站唯一一套）
   由 _partials/cart_totals.html 渲染，紧贴提交按钮左侧：出/入库/回收清单弹窗底栏
   与卡牌入库页操作条共用。金额加粗等宽，净利润用强调色。
   ========================================================================== */
.cart-totals {
  display: flex; align-items: center; gap: var(--sp-3); margin-right: var(--sp-2);
  font-size: var(--fs-small); color: var(--c-text-muted); white-space: nowrap;
}
/* 各段之间用中点分隔（替代原标题里手写的「 · 」） */
.cart-totals > span + span::before { content: "·"; margin-right: var(--sp-3); color: var(--c-text-faint); }
.cart-totals b { color: var(--c-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-totals .ct-count b { margin-right: 2px; }
.cart-totals .ct-net b { color: var(--c-accent); }

/* 系列分类后台管理页 .series-admin：未分类池 + 分类卡片 + 可拖拽系列 chip */
.series-admin {
  display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; width: 100%;
}
.series-admin .ios-listhead { flex: 0 0 auto; }
.series-admin .sc-grid {
  display: grid; flex: 1 1 auto;
  grid-template-columns: 440px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 16px; row-gap: 16px;
  align-items: stretch; min-height: 0; overflow: hidden;
}
.series-admin > .series-head-back { margin-bottom: 8px; }
.series-admin .ios-listhead { align-items: center; }
.series-admin .sc-page-title {
  margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .01em; color: var(--ios-ink);
}
/* 工作台本身固定不滚；左侧保持原位，只有左右内容区在内容过多时各自内部滚动。 */
.series-admin .sc-sidebar {
  display: flex; grid-column: 1; grid-row: 2;
  flex-direction: column; min-width: 0; min-height: 0;
}
.series-admin .sc-sidebar-filters {
  display: flex; grid-column: 1 / -1; grid-row: 1;
  flex-wrap: wrap; align-items: stretch; gap: 8px; min-width: 0;
}
.series-admin .sc-sidebar-filters .ios-seg {
  align-items: stretch; min-height: 42px; margin-bottom: 0;
}
.series-admin .sc-sidebar-filters .ios-seg > a,
.series-admin .sc-sidebar-filters .ios-seg > .sc-empty {
  display: inline-flex; align-items: center;
  padding: 6px 12px; line-height: normal; white-space: nowrap;
}
.series-admin .sc-sidebar-filters #ip-seg { flex: 0 1 auto; min-width: 0; }
.series-admin .sc-sidebar-filters #domain-seg { flex: 0 0 auto; }
.series-admin .sc-sidebar-filters #edition-seg { flex: 0 1 auto; min-width: 0; }
.series-admin .sc-cats {
  grid-column: 2; grid-row: 2;
  padding: 0 4px 4px 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
.series-admin .sc-sidebar > .sc-panel {
  display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden;
}
.series-admin .sc-sidebar > .sc-panel .sc-drop[data-pool] {
  flex: 1 1 auto; min-height: 44px; max-height: none;
  align-content: flex-start; align-items: flex-start;
}
@media (max-width: 900px) {
  body.fixed-head.series-admin-page { height: auto; overflow: auto; display: block; }
  body.fixed-head.series-admin-page main.wide { overflow: visible; padding-bottom: var(--sp-7); }
  .series-admin { display: block; }
  .series-admin .sc-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .series-admin .sc-sidebar-filters,
  .series-admin .sc-sidebar,
  .series-admin .sc-cats { grid-column: 1; grid-row: auto; }
  .series-admin .sc-grid, .series-admin .sc-cats { overflow: visible; }
  .series-admin .sc-cats { padding: 0; }
  .series-admin .sc-sidebar > .sc-panel .sc-drop[data-pool] { max-height: 360px; }
}
@media (max-width: 480px) {
  .series-admin .sc-sidebar-filters .ios-seg > a,
  .series-admin .sc-sidebar-filters .ios-seg > .sc-empty {
    padding-inline: 10px;
  }
}
.series-admin .sc-panel {
  background: var(--ios-card); border-radius: var(--r-md); box-shadow: var(--sh-1);
  padding: 14px 16px;
}
.series-admin .sc-panel-head {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  margin-bottom: 10px;
}
.series-admin .sc-panel-title { font-weight: 600; color: var(--ios-ink); }
.series-admin .sc-count { color: var(--ios-ink2); font-size: 13px; font-weight: 400; }
.series-admin .sc-cats { display: flex; flex-direction: column; gap: 14px; }
.series-admin .sc-drop {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px;
  padding: 8px; border-radius: 12px; border: 1.5px dashed var(--ios-sep);
  background: var(--ios-bg);
  max-height: 360px; overflow-y: auto; overscroll-behavior: contain;
}
/* 右侧整列是唯一滚动容器：分类卡里的灰色标签区不再截获滚轮。 */
.series-admin .sc-cat .sc-drop {
  max-height: none; overflow: visible; overscroll-behavior: auto;
}
/* 未分类池通常很长：单独给更高的滚动窗口，避免撑高整页 */
.series-admin .sc-drop[data-pool] { max-height: calc(100vh - 250px); }
.series-admin .sc-search { flex: 0 0 auto; width: 200px; min-width: 0; padding: 6px 14px; }
.series-admin .sc-search input { font-size: 13px; }
.series-admin .sc-drop.drag-over { border-color: var(--c-accent); background: color-mix(in srgb, var(--c-accent) 8%, var(--ios-bg)); }
.series-admin .sc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; font-size: 13px;
  background: var(--ios-card); color: var(--ios-ink); cursor: grab; user-select: none;
  border: 1px solid rgba(60, 60, 67, .28);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}
.series-admin .sc-chip:hover { border-color: rgba(60, 60, 67, .42); background: #f7f8fa; }
.series-admin .sc-chip:active { cursor: grabbing; }
.series-admin .sc-chip.dragging { opacity: .45; }
.series-admin .sc-chip.selected {
  background: color-mix(in srgb, var(--c-accent) 18%, transparent);
  border-color: var(--c-accent); color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent) inset;
}
.series-admin .sc-empty { color: var(--ios-ink3); font-size: 13px; padding: 4px 6px; }
.series-admin .sc-orderbtns { display: inline-flex; gap: 2px; }
.series-admin .sc-head-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.series-admin .sc-cat-grip {
  display: inline-flex; align-items: center; color: var(--ios-ink3);
  cursor: grab; font-size: 16px; padding: 2px; border-radius: 6px; flex: none;
}

/* ========================================================================== 
   用户管理：账号概览 + 行内编辑 + 受保护的危险操作
   ========================================================================== */
.users-page { max-width: 1180px; }
.users-summary {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 14px; padding: 12px 16px;
  background: var(--c-surface-1); border-radius: var(--r-md); box-shadow: var(--sh-1);
}
.users-summary-item {
  display: flex; align-items: baseline; gap: 7px;
  padding-right: 20px; margin-right: 20px; border-right: 1px solid var(--c-border);
}
.users-summary-value { font-size: var(--fs-h3); font-weight: 700; font-variant-numeric: tabular-nums; }
.users-summary-value--active { color: var(--c-success); }
.users-summary-label, .users-summary-note { font-size: var(--fs-small); color: var(--c-text-muted); }
.users-summary-note { margin-left: auto; }
.users-summary-note i { color: var(--c-success); margin-right: 4px; }

.users-table { min-width: 1040px; }
.users-table th:nth-child(1) { width: 19%; }
.users-table th:nth-child(2) { width: 18%; }
.users-table th:nth-child(3) { width: 18%; }
.users-table th:nth-child(4) { width: 9%; }
.users-table th:nth-child(5) { width: 14%; }
.users-table th:nth-child(6) { width: 22%; }
.users-row--inactive > td { background: var(--c-surface-2); }
.users-account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.users-avatar {
  display: inline-grid; place-items: center; flex: 0 0 34px; height: 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c-accent) 10%, var(--c-surface-1));
  color: var(--c-accent); font-weight: 700;
}
.users-account-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.users-username { font-family: var(--font-mono); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.users-meta { min-height: 16px; font-size: var(--fs-small); color: var(--c-text-muted); white-space: nowrap; }
.users-me {
  display: inline-block; margin-right: 5px; padding: 1px 6px; border-radius: 999px;
  background: var(--c-surface-2); color: var(--c-text); font-size: var(--fs-small);
}
.users-inline-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.users-inline-form .form-control, .users-inline-form .form-select { min-width: 0; }
.users-text-btn, .users-action-btn {
  border: 1px solid var(--c-border); border-radius: var(--ios-r-ctl);
  background: transparent; color: var(--c-accent); font-size: var(--fs-small);
  line-height: 1.25; padding: 7px 9px; transition: var(--motion);
}
.users-text-btn:hover, .users-action-btn:hover:not(:disabled) {
  border-color: var(--c-accent);
  background: color-mix(in srgb, var(--c-accent) 7%, transparent);
}
.users-text-btn:focus-visible, .users-action-btn:focus-visible {
  outline: 2px solid var(--c-accent); outline-offset: 2px;
}
.users-action-btn:disabled { color: var(--c-text-muted); opacity: .5; cursor: not-allowed; }
.users-action-btn--danger { color: var(--c-danger); }
.users-action-btn--danger:hover:not(:disabled) {
  border-color: var(--c-danger); background: color-mix(in srgb, var(--c-danger) 8%, transparent);
}
.users-actions { display: flex; align-items: center; gap: 6px; }
.users-actions form { margin: 0; }
.users-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px;
  border-radius: 999px; font-size: var(--fs-small); font-weight: 600;
}
.users-status--active {
  background: color-mix(in srgb, var(--c-success) 11%, var(--c-surface-1));
  color: var(--c-success);
}
.users-status--inactive { background: var(--c-surface-2); color: var(--c-text-muted); }
.users-status-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.users-last-login { color: var(--c-text-muted); font-size: var(--fs-small); white-space: nowrap; font-variant-numeric: tabular-nums; }
.users-footnote { margin: 10px 4px 0; color: var(--c-text-muted); font-size: var(--fs-small); }
.users-footnote i { margin-right: 4px; }

@media (max-width: 767.98px) {
  .users-summary { flex-wrap: wrap; row-gap: 10px; }
  .users-summary-item { flex: 1 1 auto; padding-right: 12px; margin-right: 12px; }
  .users-summary-note { width: 100%; margin-left: 0; }
  .users-table-wrap, .users-table-wrap .table-responsive { overflow: visible; }
  .users-table { display: block; min-width: 0; }
  .users-table thead { display: none; }
  .users-table tbody { display: grid; gap: 10px; }
  .users-table tbody tr {
    display: grid; grid-template-columns: 92px minmax(0, 1fr);
    padding: 6px 14px; background: var(--c-surface-1); border: 0; border-radius: var(--r-md);
  }
  .users-table tbody tr.users-row--inactive { background: var(--c-surface-2); }
  .users-table tbody td {
    display: grid; grid-template-columns: subgrid; grid-column: 1 / -1;
    align-items: center; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--c-border);
    background: transparent;
  }
  .users-table tbody td::before {
    content: attr(data-label); color: var(--c-text-muted); font-size: var(--fs-small); font-weight: 600;
  }
  .users-table tbody td:first-child { padding-top: 12px; }
  .users-table tbody td:last-child { padding-bottom: 12px; border-bottom: 0; }
  .users-actions { flex-wrap: wrap; }
}
.series-admin .sc-cat-grip:hover { color: var(--ios-ink2); background: #eef0f4; }
.series-admin .sc-cat-grip:active { cursor: grabbing; }
.series-admin .sc-cat.cat-dragging { opacity: .5; }
.series-admin .sc-cat.cat-dragging .sc-drop { border-style: solid; }

/* ── 商品/个体详情：图片 + 信息并排 ─────────────────────────────── */
.detail-hero { display: flex; gap: var(--sp-5); align-items: flex-start; }
.detail-hero .meta-grid { flex: 1 1 auto; min-width: 0; }
.detail-media {
  flex: 0 0 auto; width: 176px; display: block; align-self: flex-start;
  border-radius: var(--r-md); overflow: hidden;
  /* 有图白底（同 .prod-thumb）；空占位在 --empty 回退灰底 */
  background: var(--c-surface-1); border: 1px solid var(--c-border);
  box-shadow: var(--sh-1);
  transition: box-shadow .16s ease, transform .16s ease;
}
.detail-media:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.detail-media:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.detail-media img { display: block; width: 100%; height: auto; object-fit: contain; }
.detail-media--empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 243px; /* 176px × 63:88 卡面比例，占位与有图时体量一致 */
  color: var(--ios-ink3); font-size: 34px; background: var(--c-surface-2);
  box-shadow: none; cursor: default;
}
.detail-media--empty:hover { box-shadow: none; transform: none; }
.detail-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.detail-name { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 650; letter-spacing: -.01em; }
.detail-name-sub { color: var(--c-text-muted); font-size: var(--fs-small); margin-top: 2px; }
.detail-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-2) var(--sp-5); }
.detail-meta .dm-row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-body); }
.detail-meta .dm-label { flex: none; min-width: 4.5em; color: var(--c-text-muted); font-size: var(--fs-small); }
.detail-stats {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6);
  padding-top: var(--sp-4); border-top: 1px solid var(--c-border); margin-top: auto;
}
.detail-stats .ds-item { display: flex; flex-direction: column; gap: 1px; }
.detail-stats .ds-num {
  font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 650;
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.detail-stats .ds-label { color: var(--c-text-muted); font-size: var(--fs-small); }
.detail-stats .ds-num--profit { color: var(--c-success); }
.detail-stats .ds-num--loss { color: var(--c-danger); }
@media (max-width: 640px) {
  .detail-hero { flex-direction: column; }
  .detail-media { width: 148px; }
  .detail-media--empty { min-height: 205px; }
}

/* ── 导出图预览弹窗（批发价目表 / 报价单共用；原 box_prices 页内样式上移） ── */
.price-image-dialog { width: min(94vw, 1660px); height: 90vh; max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 20px; overflow: hidden; background: #eef1f6;
  box-shadow: 0 24px 70px rgba(20, 31, 48, .25); }
.price-image-dialog::backdrop { background: rgba(20, 29, 43, .48); backdrop-filter: blur(3px); }
.price-image-dialog-head { height: 72px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 22px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid #dfe5ed; }
.price-image-dialog-body { height: calc(90vh - 72px); padding: 18px; overflow: auto; }
.price-image-dialog-body img { display: block; width: 100%; height: auto; border-radius: 12px; }
.price-image-loading { display: grid; place-items: center; min-height: 240px; color: var(--c-text-muted); }

/* ── 商品详情 hero：图片 / 基础信息 / 指标 三分区（item_detail 沿用上面的 flex 基线） ── */
.detail-hero-card { margin-bottom: var(--sp-6); }
.detail-hero.detail-hero--product {
  display: grid;
  grid-template-columns: 176px minmax(240px, 1fr) minmax(520px, 1.9fr);
  grid-template-areas: "media ident stats";
  gap: var(--sp-5) var(--sp-6);
  align-items: start;
}
.detail-hero--product > .detail-media { grid-area: media; }
.detail-hero--product .detail-ident {
  grid-area: ident; min-width: 0;
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.detail-hero--product .detail-stats { grid-area: stats; }
.detail-media--empty { flex-direction: column; gap: var(--sp-2); }
.detail-media--empty .dm-empty-text { font-size: var(--fs-small); color: var(--c-text-muted); }
/* 键值单列排布：标签定宽，值左对齐 */
.detail-meta--stack { grid-template-columns: 1fr; gap: var(--sp-2); }
.detail-meta--stack .dm-label { min-width: 76px; }
/* 指标网格：固定 4 列 ×2 行，白底小卡 + 彩点标签（观感向首页/分析页 KPI 卡看齐） */
.detail-stats.detail-stats--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
  border-top: 0; padding-top: 0; margin-top: 0;
}
.detail-stats--grid .ds-item {
  background: var(--c-surface-1);
  border: 1px solid var(--c-border);
  border-radius: var(--ios-r);
  box-shadow: var(--sh-1);
  padding: var(--sp-4);
  min-height: 92px;
  min-width: 0;
  justify-content: center;
  gap: 4px;
}
.detail-stats--grid .ds-num {
  font-size: clamp(17px, 1.3vw, 22px); font-weight: 700; letter-spacing: -.01em;
  white-space: nowrap;
}
.detail-stats--grid .ds-label {
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 7px;
}
.detail-stats--grid .ds-label::before {
  content: ""; width: 8px; height: 8px; border-radius: 3px; flex: none;
  background: var(--ds-dot, #0a84ff);
}
/* 彩点按位循环（同分析页 KPI 调色，不用紫） */
.detail-stats--grid .ds-item:nth-child(8n+1) { --ds-dot: #0a84ff; }
.detail-stats--grid .ds-item:nth-child(8n+2) { --ds-dot: #0fb6a8; }
.detail-stats--grid .ds-item:nth-child(8n+3) { --ds-dot: #19c2d6; }
.detail-stats--grid .ds-item:nth-child(8n+4) { --ds-dot: #f0a93b; }
.detail-stats--grid .ds-item:nth-child(8n+5) { --ds-dot: #fb7a6b; }
.detail-stats--grid .ds-item:nth-child(8n+6) { --ds-dot: #5e9cff; }
.detail-stats--grid .ds-item:nth-child(8n+7) { --ds-dot: #f43f5e; }
.detail-stats--grid .ds-item:nth-child(8n+8) { --ds-dot: #6a6e76; }
.detail-stats .ds-num--zero { color: var(--ios-coral); }
@media (max-width: 1199px) {
  .detail-hero.detail-hero--product {
    grid-template-columns: 176px minmax(0, 1fr);
    grid-template-areas: "media ident" "stats stats";
  }
}
@media (max-width: 640px) {
  .detail-hero.detail-hero--product {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "media" "ident" "stats";
  }
  .detail-stats.detail-stats--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
}

/* ── 商品列表：商品码前的缩略图列 ─────────────────────────────── */
.prod-thumb {
  width: 64px; height: 88px; border-radius: 10px; overflow: hidden;
  /* 有图时白底：商品图多为白底/透明底，灰底槽会透出一圈脏边；空占位在下方回退灰底 */
  background: var(--c-surface-1); border: 1px solid var(--c-border);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; transition: box-shadow .15s ease;
  perspective: 500px;  /* 给缩略图卡牌 3D 倾斜的景深 */
}
.prod-thumb:not(.prod-thumb--empty):hover { box-shadow: var(--sh-1); border-color: var(--c-accent); }
a.prod-thumb:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
/* contain：整张图完整显示、不裁切两边；宽图（卡盒）横向铺满、余量上下留白 */
.prod-thumb img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transition: transform .12s ease-out;  /* 跟随鼠标倾斜的平滑过渡 */
}
.prod-thumb:not(.prod-thumb--empty) { cursor: pointer; }
/* 尺寸变体：sm=流水等紧凑列，md=详情稍大 */
.prod-thumb--sm { width: 34px; height: 47px; border-radius: 6px; }
.prod-thumb--sm.prod-thumb--empty { font-size: 15px; }
.prod-thumb--md { width: 80px; height: 110px; border-radius: 12px; }
.prod-thumb--empty { color: var(--c-text-faint); font-size: 22px; background: var(--c-surface-2); }
/* 图片加载失败：退化成空占位框，不显示裂图 */
.prod-thumb--broken img { display: none; }
.prod-thumb--broken { background: var(--c-surface-2); }
/* 悬停大图预览（JS 挂到 body、fixed 定位）——外层只做定位与景深，内层卡片整张倾斜 */
.prod-preview {
  position: fixed; z-index: 3000; pointer-events: none;
  perspective: 900px;
  animation: prod-preview-in .16s ease-out;  /* 弹出淡入 + 轻微放大 */
}
.prod-preview-card {
  position: relative;
  background: var(--c-surface-1); border: 1px solid var(--c-border);
  border-radius: var(--r-md); box-shadow: var(--sh-3); padding: 6px;
  transform-style: preserve-3d; transform-origin: center;
  transition: transform .1s ease-out;  /* 跟随鼠标倾斜的平滑过渡 */
  will-change: transform;
}
.prod-preview-card img {
  display: block; width: auto; height: auto;
  max-width: 300px; max-height: 420px; border-radius: 10px;
}
/* 跟随真实鼠标坐标的小光点（挂在 body、fixed，位置由 JS 写 left/top） */
.prod-cursor-glow {
  position: fixed; z-index: 3001; pointer-events: none;
  width: 26px; height: 26px; margin: -13px 0 0 -13px;  /* 以光点中心对准鼠标 */
  border-radius: 50%;
  background: radial-gradient(circle,
              rgba(255, 255, 255, .95), rgba(120, 200, 255, .55) 45%, rgba(120, 200, 255, 0) 70%);
  mix-blend-mode: screen;
  animation: prod-glow-in .12s ease-out;
}
@keyframes prod-glow-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

/* 编辑弹窗里的图片预览框 */
.edit-img-box {
  flex: 0 0 auto; width: 96px; height: 132px; border-radius: var(--r-sm);
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 4px;
}
.edit-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
@keyframes prod-preview-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .prod-preview, .prod-cursor-glow { animation: none; }
  .prod-preview-card, .prod-thumb img { transition: none; }
}

/* —— 暂存出库单列表（草稿卡片）—— */
.draft-cards { display: flex; flex-direction: column; gap: 12px; }
.draft-card {
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: var(--c-surface-1); overflow: hidden;
}
.draft-card-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--c-border);
}
.draft-card-head .min-w-0 { flex: 1 1 auto; min-width: 0; }
.draft-card-title { font-weight: 600; color: var(--c-text); }
.draft-card-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.draft-card-lines { padding: 6px 14px 10px; }
.draft-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto 42px 76px 84px;
  align-items: center; gap: 8px;
  padding: 5px 0; border-top: 1px solid var(--c-border);
}
.draft-card-lines .draft-line:first-child { border-top: 0; }
.draft-line-thumb { display: inline-flex; }
.draft-line-thumb .prod-thumb { width: 30px; height: 42px; }
.draft-line-name { color: var(--c-text); }
.draft-line-type, .draft-line-stock { justify-self: start; }
.draft-line-qty, .draft-line-unit { text-align: right; font-variant-numeric: tabular-nums; }
.draft-line-amt {
  text-align: right; font-weight: 600; color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  .draft-card-head { flex-direction: column; }
  .draft-line { grid-template-columns: 30px minmax(0, 1fr) auto auto 60px; }
  .draft-line-qty, .draft-line-unit { display: none; }
}

/* 叠层弹窗（如暂存单列表上再弹确认框）：第二层及以后的遮罩透明，
   避免多层 .modal-backdrop 叠加把背景压得过暗。 */
.modal-backdrop.show ~ .modal-backdrop.show { opacity: 0; }

/* ==========================================================================
   提示浮层（#toast-region）
   落在右上、导航栏下方；右下角留给「出库清单 / 加入选中」浮动按钮。
   收窄 + 压扁：一次提示只是回执，不该盖住半屏内容。
   ========================================================================== */
#toast-region {
  top: 64px; right: 12px; bottom: auto; left: auto;
  max-width: min(340px, 46vw);
  z-index: 1080;   /* 高于弹窗，出库清单里提交的回执也看得见 */
}
#toast-region .toast {
  font-size: var(--fs-small);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
}
#toast-region .toast-body { padding: 8px 12px; }
#toast-region .btn-close { padding: .5rem; }

/* ==========================================================================
   供货来源着色（C 的库存 / 赵总库存）
   卡盒出库目录表的库存数字、清单弹窗与抖音弹窗的供货下拉共用一套色：
   自己的货=主蓝，赵总的货=警示橙。颜色只在这里定义，模板不写 hex。
   ========================================================================== */
.local-source-value,
.supply-own,
.form-select.supply-own { color: var(--c-accent); font-weight: 600; }
.zhao-source-value,
.supply-zhao,
.form-select.supply-zhao { color: var(--c-warning); font-weight: 600; }
.stock-source-picked { font-weight: 700; }

/* ==========================================================================
   抖音出库弹窗（卡盒出库页 #douyin-modal）
   两段视图共用 .recycle-table：批次列表 → 单主播明细。
   ========================================================================== */
/* 顶部工具条（沿用弹窗统一的 .recycle-meta）：主播下拉 / 日期 / 拉取按钮同高居中 */
#douyin-modal .modal-body {
  /* Pulled rows can exceed the fixed dialog height; keep the header/footer fixed
     and make the content area itself scrollable in both directions. */
  display: block;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#douyin-modal .recycle-meta { align-items: center; }
/* 主播下拉宽度写死：文案在「选择主播 / 已选 N 个主播」之间切换，宽度不固定的话
   一勾选按钮就变宽，把右边的日期/拉取整条推着走（版面跳动） */
#douyin-modal .recycle-meta .dropdown-toggle {
  width: 150px; text-align: left; position: relative; padding-right: 28px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#douyin-modal .recycle-meta .dropdown-toggle::after { position: absolute; right: 12px; top: 50%; margin-top: -2px; }
#douyin-modal .dy-tabs-menu { min-width: 200px; }
#douyin-modal .dy-date-group { max-width: 200px; }
/* 拉取进度文案长度会变（「拉取中 2/3：小游…」→「拉取完成…」）：占满剩余宽度，
   不让它换行把工具条撑高一行 */
#douyin-modal #dy-info { flex: 1 1 0; min-width: 0; }
#douyin-modal .dy-tab-item { cursor: pointer; border-radius: var(--r-sm); }

/* 抖音明细表：含库存参考成本与表内参考售价两列 */
.dy-detail-table { table-layout: fixed; min-width: 1192px; }

/* 行状态底色：走令牌，不用 bootstrap 的 .table-danger/.table-warning */
.dy-detail-table tbody tr.dy-row-bad > td { background: color-mix(in srgb, var(--c-danger) 8%, var(--c-surface-1)); }
.dy-detail-table tbody tr.dy-row-short > td { background: color-mix(in srgb, var(--c-warning) 10%, var(--c-surface-1)); }

/* 状态胶囊：.recycle-table 的 `td > span` 会把直接子 span 拉成 block 撑满整列，这里收回来 */
.recycle-table td > .status-pill { display: inline-block; width: auto; max-width: 100%; }

/* 商品单元格：系列徽标在上、名称在下（两列合一，省出一列宽度） */
.dy-prod { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: flex-start; }
.dy-prod .series-badge { max-width: 100%; }
.dy-prod .dy-prod-name {
  max-width: 100%;
  font-size: var(--fs-small); color: var(--c-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 表价列：主播表 GMV ÷ 数量，只读参考，排在总价右边 */
.dy-ref {
  font-size: var(--fs-small); color: var(--c-text-muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* 金额/数量输入：保持左对齐（填数顺手），只统一等宽数字 */
.dy-detail-table input[inputmode="decimal"],
.dy-detail-table input[type="number"],
.dy-num { font-variant-numeric: tabular-nums; }

/* 明细页汇总条：件数 / 成本 / 售价 / 毛利 / 表内 GMV */
.dy-summary {
  display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--c-surface-2); border-radius: var(--r-md);
}
.dy-summary .dy-sm-item { display: flex; align-items: baseline; gap: 6px; }
.dy-summary .dy-sm-k { font-size: var(--fs-small); color: var(--c-text-muted); }
.dy-summary .dy-sm-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.dy-summary .dy-sm-v.is-profit { color: var(--c-success); }
.dy-summary .dy-sm-v.is-loss { color: var(--c-danger); }

/* ========================================================================== 
   卡盒盘点表 /inventory/stocktake —— 屏幕上是普通 iOS 列表页，Ctrl+P 直接出表
   C / 赵总库存直接相加，按「系列 × 五种类型」压成一行；有库存的格子用浅色标记。
   ========================================================================== */
.table-wrap.ios-cardrows.st-paper {
  width: min(210mm, 100%); margin: 0 auto; padding: 8mm; box-sizing: border-box;
  background: var(--c-surface-1); border-radius: 2px; box-shadow: var(--sh-2);
  overflow: visible;
}
.stocktake-pages { display: flex; flex-direction: column; gap: 16px; }
.table-wrap .table.st-table { width: 100%; table-layout: fixed; }
.table-wrap .table.st-table th,
.table-wrap .table.st-table td { font-size: 12px; padding: 4px 6px; }
.table-wrap .table.st-table th,
.table-wrap .table.st-table .st-col-series,
.table-wrap .table.st-table .st-col-qty { white-space: nowrap; }
.table-wrap .table.st-table .st-col-series { width: 38mm; overflow: hidden; text-overflow: ellipsis; }
.table-wrap .table.st-table .st-col-qty {
  width: auto; font-variant-numeric: tabular-nums; text-align: center;
}
.table-wrap .table.st-table thead th { vertical-align: middle; }
.st-table .st-head-label,
.st-table .st-head-note { display: inline; line-height: 1.25; }
.st-table .st-head-note { margin-left: 3px; color: var(--c-text-muted); font-size: 12px; font-weight: 400; }
.ios-cardrows .st-table tbody th.st-col-series {
  background: var(--c-surface-1); border-top: 1px solid var(--c-border); font-weight: 600;
}
.ios-cardrows .st-table tbody td.st-col-qty {
  background: var(--c-surface-1);
  border-left: 1px solid var(--c-border);
}
.ios-cardrows .st-table tbody td.st-col-qty.is-stocked {
  background: color-mix(in srgb, var(--c-success) 10%, var(--c-surface-1));
  color: color-mix(in srgb, var(--c-success) 72%, var(--c-text));
  font-weight: 700;
}
.ios-cardrows .st-table tbody tr.st-grouprow td {
  background: var(--c-surface-2); font-weight: 600; color: var(--c-text);
  text-align: center; letter-spacing: .02em;
  padding-top: 5px; padding-bottom: 5px;
}
.st-printhead { margin-bottom: 10px; }
.st-printhead-title { font-size: 18px; font-weight: 700; color: var(--c-text); }
.st-printhead-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 12px; color: var(--c-text-muted); margin-top: 4px;
}

@media print {
  /* 打印只留表：导航 / 工具条 / 浮层一律不上纸 */
  .app-nav, #toast-region, .page-back, .modal, .d-print-none { display: none !important; }
  body, main { background: #fff; padding: 0; margin: 0; }
  .stocktake-pages { display: block; }
  /* 纸的白边交给 @page，屏幕上那张「纸」的宽度和内边距要撤掉，否则会叠一层 */
  .table-wrap.ios-cardrows.st-paper {
    width: auto; margin: 0; padding: 0;
    box-shadow: none; border: 0; border-radius: 0;
  }
  .st-table td, .st-table th { box-shadow: none; }
  /* 每个分页块就是一张纸；同一张纸内共用一套列和一个表头。 */
  .st-page { break-after: page; page-break-after: always; }
  .st-page:last-child { break-after: auto; page-break-after: auto; }
  .st-table thead { display: table-header-group; }
  .st-table tbody.st-group {
    break-inside: avoid; page-break-inside: avoid;
  }
  .st-table tr, .st-grouprow { break-inside: avoid; page-break-inside: avoid; }
  .st-table tbody.st-group > tr:not(.st-grouprow) > td,
  .st-table tbody.st-group > tr:not(.st-grouprow) > th { height: 8mm; }
  /* 纸上要能看清格子：屏幕那套浅灰细线（--c-border）打出来几乎看不见，
     这里一律换成黑色实线，全格描线；表头下方加粗一档。
     选择器带满 .table-wrap .table.st-table，才压得过通用表格 / ios-cardrows 的边框色。 */
  /* 特异度要压过通用表格的 first/last-child 去边框规则；分组拆成多个 tbody 后，
     否则每组首尾行会出现局部断线。 */
  .table-wrap.ios-cardrows .table.st-table thead th,
  .table-wrap.ios-cardrows .table.st-table tbody.st-group > tr > td,
  .table-wrap.ios-cardrows .table.st-table tbody.st-group > tr > th { border: 1px solid #000; }
  .table-wrap.ios-cardrows .table.st-table thead th {
    border-bottom: 2px solid #000; background: #fff;
  }
  /* 系列列打印成普通黑字，不打印蓝色标签底，减少彩色墨水消耗。 */
  .table-wrap.ios-cardrows .table.st-table tbody th.st-col-series .series-badge {
    background: transparent; color: #000;
  }
  .table-wrap .table.st-table tbody td.st-col-qty.is-stocked {
    background: color-mix(in srgb, var(--c-success) 10%, #fff);
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  @page { size: A4 portrait; margin: 8mm; }
}

/* 经营报表重设计：渠道总览 / 渠道分析 */
.reports-redesign { width:min(1180px,100%); margin:0 auto; padding:2px 0 40px; color:var(--c-text); font-variant-numeric:tabular-nums; }
.rr-page-head { margin-bottom:16px; }
.rr-page-head h1,.rr-detail-head h1 { margin:0; color:var(--c-text); font-size:26px; font-weight:700; letter-spacing:-.02em; }
.rr-page-head p,.rr-detail-head p { margin:3px 0 0; color:var(--c-text-muted); font-size:13px; }
.rr-filter-sticky { position:sticky; z-index:1020; top:68px; margin-bottom:4px; padding:8px 0 10px; background:var(--ios-bg); }
.rr-filter { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:0; padding:14px 18px; background:var(--c-surface-1); border-radius:var(--r-lg); box-shadow:var(--sh-2); }
.rr-filter .rr-presets { margin:0; }
.rr-filter-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.rr-filter-actions .ios-btn { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.rr-range { display:inline-flex; align-items:center; gap:6px; color:var(--c-text-muted); font-size:13px; white-space:nowrap; }
.rr-custom-dates { display:flex; align-items:center; gap:8px; }
.rr-custom-dates[hidden] { display:none; }
.rr-custom-dates input { min-height:36px; padding:7px 11px; border:0; border-radius:var(--ios-r-ctl); background:#eef0f4; color:var(--c-text); font:inherit; font-size:13px; }
/* 渠道卡：3 张（卡牌口径）或 4 张（卡盒多一张直播间零售）都要排得开，故用 auto-fit */
.rr-channel-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(272px,1fr)); gap:16px; }
.rr-channel-card { min-width:0; padding:22px; border-radius:16px; background:var(--c-surface-1); box-shadow:0 6px 22px rgba(16,24,40,.06); color:var(--c-text); text-decoration:none; transition:transform .14s ease,box-shadow .14s ease; }
.rr-channel-card:hover { color:var(--c-text); transform:translateY(-3px); box-shadow:0 14px 30px rgba(16,24,40,.12); }
.rr-channel-top { display:flex; align-items:center; gap:11px; margin-bottom:18px; }
.rr-channel-icon { width:44px; height:44px; flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; border-radius:12px; background:var(--ios-grad); color:#fff; font-size:19px; }
.rr-channel-icon--live { background:var(--ios-red); }
.rr-channel-icon--taobao { background:var(--ios-amber); }
.rr-channel-icon--live_retail { background:var(--ios-teal); }
.rr-channel-name { min-width:0; display:flex; flex-direction:column; }
.rr-channel-name strong { font-size:17px; line-height:1.3; }
.rr-channel-name span { color:var(--c-text-faint); font-size:12px; }
.rr-enter { margin-left:auto; color:var(--ios-indigo); font-size:12px; white-space:nowrap; }
.rr-label { display:block; color:var(--c-text-muted); font-size:12px; }
.rr-channel-revenue { display:block; margin-top:2px; font-size:29px; letter-spacing:-.02em; line-height:1.25; }
.rr-channel-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:17px 0 13px; }
.rr-channel-metrics div { min-width:0; }
.rr-channel-metrics dt { color:var(--c-text-faint); font-size:11px; font-weight:400; }
.rr-channel-metrics dd { margin:2px 0 0; font-size:16px; font-weight:600; white-space:nowrap; }
.rr-positive { color:var(--ios-teal)!important; }.rr-negative { color:var(--ios-coral)!important; }.rr-muted { color:var(--c-text-faint)!important; }
.rr-spark { height:39px; padding-top:6px; border-top:1px solid #f0f0f4; display:flex; align-items:flex-end; gap:4px; }
.rr-spark i { width:100%; height:var(--rr-bar-height,4%); border-radius:3px 3px 0 0; background:var(--ios-indigo); opacity:.3; }
.rr-channel-card--live .rr-spark i { background:var(--ios-red); }.rr-channel-card--taobao .rr-spark i { background:var(--ios-amber); }
.rr-channel-card--live_retail .rr-spark i { background:var(--ios-teal); }

/* ── 直播间零售分析页 /reports/live（表格与 KPI 复用 rr-* 与 ios-cardrows） ── */
.ls-headright { flex:0 0 auto; margin-left:auto; display:flex; align-items:center; gap:12px; }
.ls-synced { color:var(--c-text-faint); font-size:12px; white-space:nowrap; }
.ls-page .table-caption .ls-note { color:var(--c-text-muted); font-size:12px; font-weight:400; }
.ls-page .ls-sku { margin-left:6px; color:var(--c-text-faint); font-size:12px; }
.ls-page .ls-tablebox table { --bs-table-bg:var(--c-surface-1); }
.ls-page .ls-tablebox thead th { position:sticky; top:0; z-index:1; background:var(--c-surface-1); color:var(--c-text); font-weight:600; }
.ls-page .ls-tablebox td.num,.ls-page .ls-tablebox th.text-end { font-variant-numeric:tabular-nums; }
/* 表格宽度：app.css 全局给 .table-wrap .table 上了 table-layout:fixed，
   列宽必须显式给（写 width:1px 会被当真实宽度执行，把列压成一条缝还触发省略号裁切）。
   指标列定宽、文本列吃剩余宽度。 */
.ls-page .ls-tablebox th.ls-c-qty { width:88px; }
.ls-page .ls-tablebox th.ls-c-money { width:142px; }
.ls-page .ls-tablebox th.ls-c-pct { width:86px; }
/* 商品表：系列/类型定宽且类型右对齐 —— 类型就紧挨着右对齐的数量列，名称吃掉剩余宽度 */
/* 系列列留宽些：「高/2AR停」这种玩法码要放得下，且与名称列之间留出间距 */
.ls-fold--products .ls-tablebox th:nth-child(1) { width:136px; }
.ls-fold--products .ls-tablebox td:nth-child(1) { padding-right:var(--sp-5); }
.ls-fold--products .ls-tablebox th:nth-child(3) { width:74px; }
.ls-fold--products .ls-tablebox th:nth-child(3),.ls-fold--products .ls-tablebox td:nth-child(3) { text-align:right; padding-right:var(--sp-2); }
.ls-fold--products .ls-tablebox th:nth-child(4),.ls-fold--products .ls-tablebox td:nth-child(4) { padding-left:var(--sp-2); }
/* 明细表折叠块：默认收成一行方块，点开才展开表格（原生 details） */
.ls-folds { display:flex; flex-direction:column; gap:12px; }
.ls-fold { border-radius:var(--r-lg); background:var(--c-surface-1); box-shadow:var(--sh-1); overflow:hidden; }
.ls-fold>summary { display:flex; align-items:center; gap:12px; padding:16px 18px; cursor:pointer; list-style:none; }
.ls-fold>summary::-webkit-details-marker { display:none; }
.ls-fold>summary:hover { background:var(--c-surface-2); }
.ls-fold>summary:focus-visible { outline:2px solid var(--c-accent); outline-offset:-2px; }
.ls-fold-ic { width:38px; height:38px; flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; border-radius:11px; background:var(--ios-grad); color:#fff; font-size:16px; }
.ls-fold-t { min-width:0; display:flex; flex-direction:column; }
.ls-fold-t strong { font-size:15px; line-height:1.35; }
.ls-fold-t small { color:var(--c-text-faint); font-size:12px; }
.ls-fold-arrow { margin-left:auto; color:var(--c-text-faint); font-size:13px; transition:transform .15s ease; }
.ls-fold[open] .ls-fold-arrow { transform:rotate(180deg); }
.ls-fold[open]>summary { border-bottom:1px solid var(--c-border); }
.ls-fold .table-wrap { margin:0; border-radius:0; box-shadow:none; }
.ls-page .rr-kpi-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media (max-width:980px) { .ls-page .rr-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:680px) { .ls-page .rr-kpi-grid { grid-template-columns:1fr; } }
.rr-section { margin-top:26px; }.rr-section>h2 { margin:0 2px 12px; font-size:15px; font-weight:700; }.rr-section>h2 span { color:var(--c-text-muted); font-weight:500; }
.rr-kpi-grid,.rr-detail-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.rr-kpi { min-width:0; min-height:126px; padding:18px 20px; display:flex; flex-direction:column; justify-content:center; border-radius:var(--r-lg); background:var(--c-surface-1); box-shadow:var(--sh-1); }
.rr-kpi>span { color:var(--c-text-muted); font-size:12px; }.rr-kpi>strong { margin-top:4px; font-size:23px; letter-spacing:-.02em; }.rr-kpi>small { margin-top:7px; color:var(--c-text-faint); font-size:11px; }
.rr-kpi--hero { background:var(--ios-grad); color:#fff; box-shadow:var(--ios-sh-hi); }.rr-kpi--hero>span,.rr-kpi--hero>small { color:rgba(255,255,255,.82); }.rr-kpi--hero>strong { color:#fff; font-size:26px; }
.rr-overview-grid,.rr-capital-grid,.rr-chart-grid { display:grid; grid-template-columns:1.25fr 1fr; gap:16px; margin-top:14px; }
.rr-overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.rr-panel { min-width:0; padding:18px 20px; border-radius:var(--r-lg); background:var(--c-surface-1); box-shadow:var(--sh-1); }
.rr-panel-head { min-height:38px; display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.rr-panel-head h3 { margin:0; font-size:14px; font-weight:700; }.rr-panel-head p { margin:2px 0 0; color:var(--c-text-faint); font-size:11px; }.rr-panel-head>strong { color:var(--ios-teal); font-size:18px; }
.rr-overview-bars { position:relative; height:190px; display:flex; align-items:flex-end; gap:6px; padding:18px 4px 0; isolation:isolate; }
.rr-overview-bars::before { content:""; position:absolute; z-index:-1; inset:18px 4px 26px; background:repeating-linear-gradient(to top,transparent 0,transparent 36px,#f0f1f4 36px,#f0f1f4 37px); }
.rr-overview-bars>.rr-day-bar { min-width:0; height:100%; flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; }
.rr-overview-bars .rr-day-bar>span { max-width:100%; margin-bottom:7px; overflow:hidden; color:var(--c-text-muted); font-size:12px; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.rr-overview-bars .rr-day-bar>i { width:60%; height:var(--rr-bar-height,3%); min-height:4px; border-radius:6px 6px 0 0; background:var(--ios-grad); }.rr-overview-bars .rr-day-bar>small { margin-top:8px; color:var(--c-text-faint); font-size:11px; }
.rr-overview-bars--empty .rr-day-bar>span,.rr-overview-bars--empty .rr-day-bar>i { opacity:0; }
.rr-chart-empty { position:absolute; z-index:2; inset:26px 12px 30px; display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--c-text-faint); text-align:center; }.rr-chart-empty i { margin-bottom:9px; color:color-mix(in srgb,var(--ios-indigo) 46%,#fff); font-size:30px; }.rr-chart-empty strong { color:var(--c-text-muted); font-size:14px; font-weight:600; }.rr-chart-empty span { margin-top:4px; font-size:12px; }
.rr-overview-side { display:grid; grid-template-rows:auto auto; gap:18px; }
.rr-progress-list { display:grid; gap:12px; margin-top:8px; }.rr-progress-list>div { display:grid; grid-template-columns:48px minmax(0,1fr) minmax(78px,auto); align-items:center; gap:12px; font-size:13px; }.rr-progress-list progress { width:100%; height:12px; }.rr-progress-list strong { min-width:78px; font-size:13px; text-align:right; }
progress { overflow:hidden; border:0; border-radius:var(--ios-r-pill); background:#eef0f4; } progress::-webkit-progress-bar { background:#eef0f4; border-radius:var(--ios-r-pill); } progress::-webkit-progress-value { border-radius:var(--ios-r-pill); background:var(--ios-indigo); } progress::-moz-progress-bar { border-radius:var(--ios-r-pill); background:var(--ios-indigo); }
.rr-progress--live::-webkit-progress-value { background:var(--ios-red); }.rr-progress--live::-moz-progress-bar { background:var(--ios-red); }.rr-progress--taobao::-webkit-progress-value { background:var(--ios-amber); }.rr-progress--taobao::-moz-progress-bar { background:var(--ios-amber); }
.rr-source-block { padding-top:16px; border-top:1px solid #f0f0f4; }.rr-source-legend { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:9px 16px; margin-top:12px; }.rr-source-legend>span { display:inline-flex; align-items:center; gap:6px; color:var(--c-text-muted); font-size:13px; }.rr-source-legend b { color:var(--c-text); }
.rr-source-dot { width:11px; height:11px; flex:0 0 auto; display:inline-block; border-radius:4px; background:var(--ios-grad); }.rr-source-dot--own { background:var(--ios-indigo); }.rr-source-dot--zhao { background:var(--ios-amber); }.rr-source-dot--all { background:var(--ios-grad); }
.rr-split-bar,.rr-capital-split { width:100%; height:14px; display:flex; overflow:hidden; border-radius:var(--ios-r-pill); background:#eef0f4; }.rr-split-bar i:first-child { background:var(--ios-indigo); }.rr-split-bar i:last-child { background:var(--ios-amber); }
.rr-section-heading { display:flex; align-items:baseline; gap:10px; margin:0 2px 12px; }.rr-section-heading h2 { margin:0; font-size:15px; font-weight:700; }.rr-section-heading p { margin:0; color:var(--c-text-faint); font-size:12px; }
.rr-capital-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.rr-capital-grid { grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:0; }
.rr-capital-card { min-width:0; display:flex; flex-direction:column; padding:18px 20px; border-radius:var(--r-lg); background:var(--c-surface-1); box-shadow:var(--sh-1); }
.rr-capital-card span { display:flex; align-items:center; gap:7px; color:var(--c-text-muted); font-size:12px; }.rr-capital-card span i { color:var(--ios-indigo); font-size:15px; }.rr-capital-card:nth-child(2) span i { color:var(--ios-amber); }.rr-capital-card:nth-child(3) span i { color:var(--ios-teal); }.rr-capital-card:nth-child(4) span i { color:#5e9cff; }
.rr-capital-card strong { margin-top:4px; overflow:hidden; font-size:23px; letter-spacing:-.02em; text-overflow:ellipsis; white-space:nowrap; }.rr-capital-card small { margin-top:2px; color:var(--c-text-faint); font-size:11px; }
.rr-capital-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }.rr-capital-head h3 { margin:0; font-size:14px; font-weight:600; }.rr-capital-head span { color:var(--c-text-faint); font-size:12px; }
.rr-capital-split { height:16px; margin-bottom:14px; }.rr-capital-split i:first-child { background:var(--ios-teal); }.rr-capital-split i:last-child { background:#eef0f4; }
.rr-capital-legend { display:flex; flex-direction:column; gap:10px; color:var(--c-text-muted); font-size:13px; }.rr-capital-legend span { display:flex; align-items:center; gap:8px; }.rr-capital-legend span>i { width:10px; height:10px; flex:0 0 auto; border-radius:3px; background:var(--ios-teal); }.rr-capital-legend span:last-child>i { background:#c9ccd4; }.rr-capital-legend b { margin-left:auto; color:var(--c-text); }
.rr-cashflow { display:flex; flex-direction:column; justify-content:center; gap:16px; }.rr-cashflow h3 { margin:0; font-size:14px; font-weight:600; }.rr-cashflow-main { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }.rr-cashflow-main>div:first-child { min-width:130px; flex:1; display:flex; flex-direction:column; }.rr-cashflow span { color:var(--c-text-muted); font-size:12px; }.rr-cashflow strong { margin-top:4px; color:var(--ios-teal); font-size:28px; letter-spacing:-.02em; }.rr-cashflow-breakdown { flex:none; display:flex; flex-direction:column; gap:2px; line-height:1.6; }.rr-cashflow p { margin:0; padding-top:12px; border-top:1px solid #f0f0f4; color:var(--c-text-faint); font-size:12px; }.rr-cashflow--negative strong { color:var(--ios-coral); }
.rr-detail-head { display:flex; align-items:center; justify-content:flex-start; gap:16px; margin:2px 0 16px; }
.rr-detail-title-wrap { display:flex; align-items:center; gap:12px; }
.rr-back { width:38px; height:38px; flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; background:rgba(120,120,128,.12); color:var(--c-text); text-decoration:none; }.rr-back:hover { color:var(--ios-indigo); }
.rr-source-menu { position:relative; }.rr-source-menu summary { min-width:126px; min-height:36px; display:flex; align-items:center; gap:7px; padding:8px 10px; border:1px solid var(--c-border); border-radius:11px; background:var(--c-surface-1); color:var(--c-text); font-size:13px; cursor:pointer; list-style:none; }.rr-source-menu summary::-webkit-details-marker { display:none; }.rr-source-menu summary .bi-chevron-down { margin-left:auto; color:var(--c-text-faint); }.rr-source-menu[open] summary { border-color:var(--ios-indigo); }
.rr-source-options { position:absolute; z-index:12; top:calc(100% + 8px); right:0; min-width:154px; padding:6px; border-radius:13px; background:var(--c-surface-1); box-shadow:0 12px 34px rgba(16,24,40,.16); }.rr-source-options a,.rr-source-options button { width:100%; display:flex; align-items:center; gap:8px; padding:9px 10px; border:0; border-radius:9px; background:transparent; color:var(--c-text); font:inherit; font-size:13px; text-align:left; text-decoration:none; cursor:pointer; }.rr-source-options a:hover,.rr-source-options button:hover { background:var(--c-surface-2); }.rr-source-options a.active,.rr-source-options button.active { background:color-mix(in srgb,var(--ios-indigo) 10%,#fff); color:var(--ios-indigo); font-weight:600; }.rr-source-options a .bi-check-lg,.rr-source-options button .bi-check-lg { margin-left:auto; }
.rr-operator-menu summary { min-width:126px; max-width:160px; }.rr-operator-menu summary>.bi-person-check { color:var(--ios-indigo); }.rr-operator-menu summary span,.rr-operator-options button span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.rr-operator-options { left:0; right:auto; min-width:160px; max-width:190px; max-height:320px; overflow-y:auto; }.rr-operator-person { width:13px; flex:0 0 13px; color:var(--ios-indigo); text-align:center; }
.rr-detail-kpis { margin-bottom:14px; }
.rr-detail--live .rr-kpi--hero { background:linear-gradient(135deg,var(--ios-red),var(--ios-coral)); }
.rr-detail--taobao .rr-kpi--hero { background:var(--ios-grad-amber); }
.rr-margin-kpi { display:grid; grid-template-columns:1fr 72px; grid-template-rows:auto auto 1fr; column-gap:12px; }
.rr-margin-kpi>span { grid-column:1; }.rr-margin-kpi>small { grid-column:1; grid-row:3; }
.rr-margin-ring { grid-column:2; grid-row:1/4; align-self:center; width:62px; height:62px; padding:8px; border-radius:50%; background:conic-gradient(var(--rr-detail-accent,var(--ios-indigo)) var(--rr-margin-value,0%),#eef0f4 0); }
.rr-detail--live { --rr-detail-accent:var(--ios-red); }.rr-detail--taobao { --rr-detail-accent:var(--ios-amber); }
.rr-margin-ring i { width:100%; height:100%; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--c-surface-1); font-style:normal; }.rr-margin-ring strong { font-size:13px; }
.rr-detail-section-title { margin:0 2px 9px; font-size:13px; font-weight:600; color:var(--c-text-muted); }
.rr-source-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:14px; }.rr-source-card { padding:18px 20px; border-radius:var(--r-lg); background:var(--c-surface-1); box-shadow:var(--sh-1); }.rr-source-card>div { display:flex; align-items:center; gap:10px; }.rr-source-card .rr-channel-icon { width:40px; height:40px; background:color-mix(in srgb,var(--ios-indigo) 12%,#fff); color:var(--ios-indigo); }.rr-source-card--zhao .rr-channel-icon { background:color-mix(in srgb,var(--ios-amber) 16%,#fff); color:#c8801a; }.rr-source-card h3 { margin:0; font-size:15px; }.rr-source-card p { margin:2px 0 0; color:var(--c-text-faint); font-size:11px; }.rr-source-card dl { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:16px 0 0; }.rr-source-card dt { color:var(--c-text-faint); font-size:11px; font-weight:400; }.rr-source-card dd { margin:2px 0 0; font-size:15px; font-weight:600; }
.rr-chart-grid { grid-template-columns:repeat(2,minmax(0,1fr)); margin:0 0 14px; }.rr-panel-head--seg { align-items:center; }.rr-mini-seg { margin:0; }.rr-mini-seg a { padding:4px 11px; font-size:12px; }.rr-chart { width:100%; height:280px; }.rr-inline-legend { display:flex; gap:12px; color:var(--c-text-muted); font-size:11px; }.rr-inline-legend span { display:inline-flex; align-items:center; gap:5px; }.rr-inline-legend i { width:9px; height:9px; border-radius:3px; background:var(--ios-indigo); }.rr-inline-legend span:last-child i { background:var(--ios-teal); }
.rr-pie-layout { min-height:280px; display:flex; align-items:center; gap:22px; }.rr-pie-visual { width:210px; height:220px; flex:0 0 210px; }.rr-pie-legend { min-width:0; max-height:238px; flex:1; display:flex; flex-direction:column; gap:11px; overflow:auto; }.rr-pie-legend>div { display:grid; grid-template-columns:10px minmax(0,1fr) 34px minmax(78px,auto); align-items:start; gap:9px; font-size:13px; }.rr-pie-legend i { width:10px; height:10px; margin-top:3px; border-radius:3px; background:var(--ios-indigo); }.rr-pie-legend span { min-width:0; line-height:1.3; overflow-wrap:anywhere; }.rr-pie-legend small { color:var(--c-text-faint); font-size:12px; text-align:right; }.rr-pie-legend strong { font-size:13px; text-align:right; white-space:nowrap; }
.rr-chart-color-0 { background:#0a84ff!important; }.rr-chart-color-1 { background:#0fb6a8!important; }.rr-chart-color-2 { background:#f0a93b!important; }.rr-chart-color-3 { background:#fb7a6b!important; }.rr-chart-color-4 { background:#5e9cff!important; }.rr-chart-color-5 { background:#9b7cd6!important; }.rr-chart-color-6 { background:#19c2d6!important; }.rr-chart-color-7 { background:#f43f5e!important; }
.rr-daily-chart { height:300px; }.rr-inline-legend { gap:14px; font-size:12px; }.rr-inline-legend span { gap:6px; }.rr-inline-legend i { width:10px; height:10px; }
.rr-table-card { margin-bottom:14px; overflow:hidden; border-radius:var(--r-lg); background:var(--c-surface-1); box-shadow:var(--sh-1); }.rr-table-head { display:flex; align-items:center; justify-content:space-between; padding:17px 20px 11px; }.rr-table-head h2 { margin:0; font-size:15px; }.rr-table-head p { margin:2px 0 0; color:var(--c-text-faint); font-size:11px; }.rr-table-card table { width:100%; border-collapse:collapse; font-size:13px; }.rr-table-card th { padding:11px 16px; border-top:1px solid var(--c-border); border-bottom:1px solid var(--c-border); color:var(--c-text-muted); font-size:11px; font-weight:600; text-align:right; white-space:nowrap; }.rr-table-card th:first-child,.rr-table-card td:first-child { text-align:left; }.rr-table-card td { padding:13px 16px; border-bottom:1px solid var(--c-border); text-align:right; white-space:nowrap; }.rr-table-card tbody tr:last-child td { border-bottom:0; }.rr-table-card tbody tr:hover td { background:color-mix(in srgb,var(--ios-indigo) 4%,transparent); }.rr-table-card td:first-child progress { width:min(220px,100%); height:5px; display:block; margin-top:6px; }.rr-table-card td:nth-child(2) a { color:var(--c-text); text-decoration:none; }
.rr-product-summary th:nth-child(-n+3),.rr-product-summary td:nth-child(-n+3) { text-align:left; }.rr-product-summary td:nth-child(2) { min-width:260px; white-space:normal; }.rr-product-summary td:nth-child(n+4) { font-variant-numeric:tabular-nums; }
.rr-series-tag,.rr-source-tag { display:inline-flex; padding:3px 7px; border-radius:6px; background:color-mix(in srgb,var(--ios-indigo) 12%,#fff); color:var(--ios-indigo); font-size:11px; font-weight:600; }.rr-source-tag { margin-left:7px; }.rr-source-tag--zhao { background:color-mix(in srgb,var(--ios-amber) 16%,#fff); color:#c8801a; }.rr-source-tag--mixed { background:var(--c-surface-2); color:var(--c-text-muted); }.rr-empty { padding:28px 20px; color:var(--c-text-faint); font-size:13px; text-align:center; }
@media (max-width:980px) { .rr-channel-grid,.rr-kpi-grid,.rr-detail-kpis,.rr-capital-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }.rr-overview-grid,.rr-capital-grid,.rr-chart-grid { grid-template-columns:1fr; }.rr-filter-actions { width:100%; margin-left:0; }.rr-range { margin-right:auto; } }
@media (max-width:680px) { .reports-redesign { padding-bottom:24px; }.rr-page-head h1,.rr-detail-head h1 { font-size:22px; }.rr-filter { padding:12px; }.rr-presets { width:100%; }.rr-custom-dates { width:100%; flex-wrap:wrap; }.rr-custom-dates input { flex:1 1 130px; min-width:0; }.rr-filter-actions { align-items:stretch; flex-wrap:wrap; }.rr-filter-actions .ios-btn { flex:1; justify-content:center; }.rr-range { width:100%; }.rr-channel-grid,.rr-kpi-grid,.rr-detail-kpis,.rr-capital-kpis,.rr-source-cards { grid-template-columns:1fr; }.rr-channel-card { padding:18px; }.rr-capital-legend { flex-direction:column; }.rr-detail-head { align-items:flex-start; flex-direction:column; }.rr-source-menu { width:100%; }.rr-source-menu summary { width:100%; }.rr-source-options { left:0; right:auto; width:100%; }.rr-detail-title-wrap { align-items:flex-start; }.rr-detail-title-wrap>.rr-channel-icon { display:none; }.rr-source-card dl { grid-template-columns:repeat(2,1fr); }.rr-chart { height:250px; } }
@media (max-width:680px) { .rr-pie-layout { min-height:0; align-items:stretch; flex-direction:column; }.rr-pie-visual { width:100%; height:220px; flex-basis:220px; }.rr-pie-legend { width:100%; max-height:none; } }
@media (min-width:981px) {
  .reports-redesign { width:min(1420px,100%); }
  .rr-filter { padding:16px 20px; margin-bottom:0; }
  .rr-channel-grid { gap:18px; }
  .rr-channel-card { padding:24px; }
  .rr-channel-name strong { font-size:18px; }
  .rr-channel-revenue { font-size:32px; }
  .rr-channel-metrics dt { font-size:12px; }
  .rr-channel-metrics dd { font-size:17px; }
  .rr-section { margin-top:30px; }
  .rr-section>h2,.rr-section-heading h2 { font-size:17px; }
  .rr-kpi { min-height:138px; padding:21px 24px; }
  .rr-kpi>span { font-size:13px; }
  .rr-kpi>strong { font-size:26px; }
  .rr-kpi--hero>strong { font-size:30px; }
  .rr-panel { padding:21px 24px; }
  .rr-panel-head h3,.rr-capital-head h3,.rr-cashflow h3 { font-size:15px; }
  .rr-panel-head p { font-size:12px; }
  .rr-overview-bars { height:210px; }
  .rr-capital-card { padding:21px 24px; }
  .rr-capital-card strong { font-size:25px; }
  .rr-detail-head h1 { font-size:28px; }
  .rr-detail-section-title { font-size:14px; }
  .rr-source-card { padding:21px 24px; }
  .rr-source-card h3 { font-size:16px; }
  .rr-source-card dd { font-size:17px; }
  .rr-pie-layout { min-height:310px; }
  .rr-pie-visual { width:235px; height:245px; flex-basis:235px; }
  .rr-daily-chart { height:330px; }
  .rr-table-head { padding:20px 24px 13px; }
  .rr-table-head h2 { font-size:16px; }
  .rr-table-card table { font-size:14px; }
  .rr-table-card th { padding:13px 18px; font-size:12px; }
  .rr-table-card td { padding:15px 18px; }
}

/* 卡盒首页重设计：仅 index.html 的 box 模式使用 */
.box-home { --c-text:#1c1c1e; --c-text-muted:#6a6e76; --c-text-faint:#9499a3; --c-border:#e5e5ea; --c-surface-1:#fff; --c-surface-2:#f2f2f7; width:100%; max-width:1180px; margin:0 auto; color:#1c1c1e; font-variant-numeric:tabular-nums; }
.box-home a { color:inherit; text-decoration:none; }
.box-home-titlebar { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.box-home-heading { min-width:0; display:flex; align-items:flex-end; gap:20px; }
.box-home-date { color:var(--c-text-faint); font-size:13px; font-weight:500; }
.box-home-title { margin-top:2px; font-size:26px; font-weight:700; letter-spacing:.01em; }
.box-home-period { display:flex; align-items:center; gap:2px; padding:3px; border:1px solid #dcdde3; border-radius:11px; background:#e9eaee; }
.box-home-period a { min-width:54px; height:30px; display:flex; align-items:center; justify-content:center; padding:0 12px; border-radius:8px; color:var(--c-text-muted); font-size:13px; font-weight:500; white-space:nowrap; transition:background .14s ease,color .14s ease,box-shadow .14s ease; }
.box-home-period a:hover { color:var(--c-text); }
.box-home-period a.active { background:#fff; color:#0a84ff; font-weight:600; box-shadow:0 1px 4px rgba(16,24,40,.14); }
.box-home-actions { display:flex; gap:10px; }
.box-home-btn { min-height:38px; display:inline-flex; align-items:center; gap:7px; padding:8px 15px; border:1px solid var(--c-border); border-radius:11px; background:var(--c-surface-1); box-shadow:0 1px 2px rgba(20,20,40,.04); font-size:14px; font-weight:500; white-space:nowrap; transition:border-color .14s ease,transform .14s ease; }
.box-home-btn:hover { border-color:var(--ios-indigo); color:var(--c-text); transform:translateY(-1px); }
.box-home .box-home-btn--primary { border-color:transparent; background:linear-gradient(135deg,#0a84ff,#0070e0); color:#fff; font-weight:600; box-shadow:0 4px 12px -2px rgba(10,132,255,.5); }
.box-home .box-home-btn--primary:hover { color:#fff; }
.box-home-card,.box-home-mini,.box-home-panel,.box-home-channel,.box-home-quick>a { min-width:0; background:var(--c-surface-1); border-radius:16px; box-shadow:0 6px 22px rgba(16,24,40,.055); }
.box-home-kpis { display:grid; grid-template-columns:1.4fr repeat(3,1fr); gap:14px; margin-bottom:14px; }
.box-home-card { min-height:132px; padding:18px; transition:transform .14s ease,box-shadow .14s ease; }
.box-home-card:hover,.box-home-mini:hover,.box-home-channel:hover,.box-home-quick>a:hover { color:var(--c-text); transform:translateY(-2px); box-shadow:0 12px 28px rgba(16,24,40,.1); }
.box-home .box-home-sales { padding:20px 22px; display:flex; flex-direction:column; justify-content:space-between; gap:16px; background:linear-gradient(135deg,#0a84ff 0%,#19c2d6 100%); color:#fff; box-shadow:0 8px 22px -6px rgba(10,80,180,.4); }
.box-home .box-home-sales:hover { color:#fff; }
.box-home-sales-top { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:13px; }
.box-home-delta { padding:3px 10px; border-radius:var(--ios-r-pill); background:rgba(255,255,255,.22); font-size:12px; font-weight:600; white-space:nowrap; }
.box-home-delta.is-down { background:rgba(255,255,255,.17); }
.box-home-sales strong { display:block; font-size:30px; line-height:1; letter-spacing:-.02em; }
.box-home-sales small { display:block; margin-top:6px; color:rgba(255,255,255,.85); font-size:12px; }
.box-home-profit { display:flex; align-items:center; gap:14px; }
.box-home-ring { flex:0 0 auto; font-family:var(--ios-font); }
.box-home-profit>div { min-width:0; display:flex; flex-direction:column; }
.box-home-profit span,.box-home-stat-label { color:var(--c-text-muted); font-size:12px; }
.box-home-profit strong { margin-top:3px; color:var(--ios-teal); font-size:21px; letter-spacing:-.01em; white-space:nowrap; }
.box-home-profit strong.is-negative,.box-hot-row .is-negative { color:var(--ios-red); }
.box-home-profit small,.box-home-stat small { margin-top:2px; color:var(--c-text-faint); font-size:12px; }
.box-home-stat { display:flex; flex-direction:column; gap:6px; }
.box-home-stat-label { display:flex; align-items:center; gap:7px; }
.box-home-dot { width:8px; height:8px; border-radius:3px; background:var(--ios-indigo); }
.box-home-dot--cyan { background:#19c2d6; }.box-home-dot--coral { background:var(--ios-coral); }
.box-home-stat strong { font-size:23px; line-height:1.3; }
.box-home-stat strong em { color:var(--c-text-faint); font-size:14px; font-style:normal; font-weight:500; }
.box-home-stat small { margin-top:auto; }
.box-home-status { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:22px; }
.box-home-status--sources { grid-template-columns:repeat(4,minmax(0,1fr)); }
.box-home-mini { min-height:72px; padding:16px 18px; display:flex; align-items:center; gap:13px; transition:transform .14s ease,box-shadow .14s ease; }
.box-home-mini-icon { width:38px; height:38px; flex:0 0 auto; display:flex; align-items:center; justify-content:center; border-radius:11px; font-size:17px; }
.box-home-mini-icon--amber { background:color-mix(in srgb,var(--ios-amber) 16%,#fff); color:#c8801a; }
.box-home-mini-icon--blue { background:color-mix(in srgb,var(--ios-indigo) 12%,#fff); color:var(--ios-indigo); }
.box-home-mini-icon--red { background:color-mix(in srgb,var(--ios-red) 12%,#fff); color:var(--ios-red); }
.box-home-mini>div { min-width:0; display:flex; flex-direction:column; }
.box-home-mini>div span { color:var(--c-text-muted); font-size:12px; }
.box-home-mini>div strong { overflow:hidden; font-size:18px; text-overflow:ellipsis; white-space:nowrap; }
.box-home-mini>small { margin-left:auto; color:var(--c-text-faint); font-size:12px; text-align:right; white-space:nowrap; }
.box-home-mini>small.is-link { color:var(--ios-indigo); }.box-home-mini>small.is-danger { color:var(--ios-red); }
.box-home-workspace { display:grid; grid-template-columns:1.55fr 1fr; gap:16px; align-items:stretch; }
.box-home-panel { height:583px; overflow:hidden; }
.box-home-hot { position:relative; z-index:2; min-height:470px; display:flex; flex-direction:column; overflow:visible; }
.box-home-panel-head { min-height:70px; padding:16px 20px 14px; display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.box-home-panel-head h2,.box-home-section-head h2 { margin:0; font-size:15px; font-weight:700; }
.box-home-panel-head p { margin:2px 0 0; color:var(--c-text-faint); font-size:12px; }
.box-home-panel-head>a,.box-home-panel-tools>a,.box-home-section-head>a,.box-hot-expand { color:var(--ios-indigo); font-size:13px; white-space:nowrap; }
.box-home-panel-tools { display:flex; align-items:center; gap:10px; }
.box-hot-expand { padding:6px 0 6px 8px; border:0; background:transparent; cursor:pointer; }.box-hot-expand .bi { font-size:10px; }.box-hot-expand[aria-expanded="true"] .bi { transform:rotate(180deg); }
.box-hot-menu { position:relative; }
.box-hot-menu>summary { min-width:132px; min-height:36px; display:flex; align-items:center; gap:8px; padding:8px 11px; border:1px solid var(--c-border); border-radius:11px; background:#fff; font-size:13px; font-weight:500; cursor:pointer; list-style:none; }
.box-hot-menu summary::-webkit-details-marker { display:none; }.box-hot-menu>summary .bi-chevron-down { margin-left:auto; color:var(--c-text-faint); font-size:11px; }
.box-hot-menu[open]>summary { border-color:var(--ios-indigo); }
.box-hot-options { position:absolute; z-index:16; top:calc(100% + 8px); left:0; right:auto; min-width:210px; padding:6px; border:.5px solid rgba(60,60,67,.1); border-radius:13px; background:#fff; box-shadow:0 12px 34px rgba(16,24,40,.16); }
.box-hot-options button { width:100%; min-height:36px; display:flex; align-items:center; gap:9px; padding:8px 10px; border:0; border-radius:9px; background:transparent; color:var(--c-text); font:inherit; font-size:13px; text-align:left; cursor:pointer; white-space:nowrap; }
.box-hot-options button:hover { background:var(--c-surface-2); }.box-hot-options button.active { background:color-mix(in srgb,var(--ios-indigo) 10%,#fff); color:var(--ios-indigo); font-weight:600; }
.box-hot-options button .bi-check-lg { margin-left:auto; visibility:hidden; }.box-hot-options button.active .bi-check-lg { visibility:visible; }
.box-hot-dot { width:10px; height:10px; flex:0 0 auto; display:inline-block; border-radius:4px; background:var(--ios-indigo); }
.box-hot-dot--all { background:linear-gradient(135deg,var(--ios-indigo),var(--ios-amber)); }.box-hot-dot--wholesale { background:var(--ios-indigo); }.box-hot-dot--live { background:var(--ios-red); }.box-hot-dot--taobao { background:var(--ios-amber); }
.box-hot-cascade-group { position:relative; }
.box-hot-options .box-hot-cascade-parent small { margin-left:auto; color:var(--c-text-faint); font-size:11px; }
.box-hot-options .box-hot-cascade-parent .bi-chevron-right { color:var(--c-text-faint); font-size:10px; }
.box-hot-cascade-group.is-open>.box-hot-cascade-parent { background:var(--c-surface-2); color:var(--ios-indigo); font-weight:600; }
.box-hot-cascade-sub { position:absolute; top:-6px; left:calc(100% + 12px); min-width:178px; display:none; padding:6px; border:.5px solid rgba(60,60,67,.1); border-radius:13px; background:#fff; box-shadow:0 12px 34px rgba(16,24,40,.16); }
.box-hot-cascade-sub::before { content:""; position:absolute; top:0; right:100%; width:14px; height:100%; }
.box-hot-cascade-group.is-open>.box-hot-cascade-sub { display:block; }
.box-hot-columns,.box-hot-row { display:grid; grid-template-columns:34px minmax(0,2.2fr) minmax(62px,.65fr) minmax(46px,.5fr) minmax(82px,.9fr) minmax(82px,.9fr); align-items:center; gap:10px; }
.box-hot-columns { padding:8px 20px; border-top:1px solid #f0f0f4; border-bottom:1px solid #f0f0f4; background:#fafafc; color:var(--c-text-faint); font-size:12px; }
.box-hot-columns span:nth-child(n+4),.box-hot-row>span:nth-child(n+4) { text-align:right; }
.box-hot-row { min-height:49px; padding:10px 20px; border-top:1px solid #f0f0f4; }
.box-hot-list:not([hidden]) { min-height:0; flex:1; overflow:hidden; border-radius:0 0 16px 16px; }
.box-home-hot.is-expanded .box-hot-list:not([hidden]) { overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.box-home-hot.is-expanded .box-hot-list:not([hidden])::-webkit-scrollbar { width:7px; }.box-home-hot.is-expanded .box-hot-list:not([hidden])::-webkit-scrollbar-thumb { border-radius:7px; background:#cfd2d9; }
.box-home-hot:not(.is-expanded) .box-hot-extra { display:none; }
.box-hot-row:first-child { border-top:0; }.box-hot-row:hover { background:color-mix(in srgb,var(--ios-indigo) 3.5%,#fff); }
.box-hot-rank { width:24px; height:24px; display:flex; align-items:center; justify-content:center; border-radius:7px; background:#ececed; color:#8a8f99; font-size:12px; font-weight:700; }
.box-hot-rank.rank-1 { background:var(--ios-amber); color:#fff; }.box-hot-rank.rank-2 { background:#5e9cff; color:#fff; }.box-hot-rank.rank-3 { background:var(--ios-red); color:#fff; }
.box-hot-product { min-width:0; display:flex; align-items:center; gap:10px; }
.box-hot-product i { max-width:90px; overflow:hidden; padding:2px 8px; border-radius:7px; background:color-mix(in srgb,var(--ios-indigo) 12%,#fff); color:var(--ios-indigo); font-size:11px; font-style:normal; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.box-hot-product strong { min-width:0; overflow:hidden; font-size:14px; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.box-hot-type { max-width:100%; justify-self:start; overflow:hidden; text-align:center!important; text-overflow:ellipsis; white-space:nowrap; }
.box-hot-row>span:nth-child(n+4) { color:var(--c-text-muted); font-size:13px; }.box-hot-row>span:nth-child(n+5) { color:var(--c-text); font-weight:600; }.box-hot-row .is-positive { color:var(--ios-teal); }
.box-home-recent { min-height:470px; }
.box-recent-row { min-height:57px; display:flex; align-items:center; gap:11px; padding:10px 18px; border-top:1px solid #f0f0f4; }
.box-recent-row:hover { background:color-mix(in srgb,var(--ios-indigo) 3.5%,#fff); }
.box-recent-icon { width:30px; height:30px; flex:0 0 auto; display:flex; align-items:center; justify-content:center; border-radius:9px; background:color-mix(in srgb,var(--ios-indigo) 12%,#fff); color:var(--ios-indigo); font-size:13px; }
.box-recent-icon.is-in { background:color-mix(in srgb,var(--ios-coral) 16%,#fff); color:#e5533d; }
.box-recent-main { min-width:0; flex:1; display:flex; flex-direction:column; }
.box-recent-main strong { overflow:hidden; font-size:13px; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.box-recent-main small { overflow:hidden; color:var(--c-text-faint); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.box-recent-amount { flex:0 0 auto; font-size:13px; font-weight:600; white-space:nowrap; }.box-recent-amount.is-in { color:#e5533d; }
.box-home-empty { padding:60px 20px; color:var(--c-text-faint); font-size:13px; text-align:center; }
.box-home-section-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:24px 2px 12px; }
.box-home-channels { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:24px; }
.box-home-channel { padding:18px 20px; display:flex; flex-direction:column; gap:14px; transition:transform .14s ease,box-shadow .14s ease; }
.box-home-channel-head { display:flex; align-items:center; gap:11px; }
.box-home-channel-head>span { width:38px; height:38px; display:flex; align-items:center; justify-content:center; border-radius:11px; background:var(--ios-indigo); color:#fff; font-size:17px; }
.box-home-channel--live .box-home-channel-head>span { background:var(--ios-red); }.box-home-channel--taobao .box-home-channel-head>span { background:var(--ios-amber); }
.box-home-channel-head strong { font-size:15px; }.box-home-channel-head>i { margin-left:auto; color:var(--c-text-faint); font-size:12px; }
.box-home-channel-values { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.box-home-channel-values>div { display:flex; flex-direction:column; }.box-home-channel-values>div:last-child { text-align:right; }
.box-home-channel-values span { color:var(--c-text-muted); font-size:12px; }.box-home-channel-values strong { margin-top:2px; font-size:22px; letter-spacing:-.01em; }.box-home-channel-values>div:last-child strong { color:var(--ios-teal); font-size:15px; }
.box-home-channel progress { width:100%; height:5px; }.box-home-channel--live progress::-webkit-progress-value { background:var(--ios-red); }.box-home-channel--live progress::-moz-progress-bar { background:var(--ios-red); }.box-home-channel--taobao progress::-webkit-progress-value { background:var(--ios-amber); }.box-home-channel--taobao progress::-moz-progress-bar { background:var(--ios-amber); }
.box-home-section-head--actions { margin-top:0; }
.box-home-quick { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.box-home-quick>a { padding:18px 10px; display:flex; flex-direction:column; align-items:center; gap:9px; border-radius:14px; box-shadow:0 4px 16px rgba(16,24,40,.05); transition:transform .14s ease,box-shadow .14s ease; }
.box-home-quick>a strong { font-size:13px; font-weight:500; }
.box-home-quick-icon { width:44px; height:44px; display:flex; align-items:center; justify-content:center; border-radius:13px; font-size:20px; }
.box-home-quick-icon.is-blue { background:color-mix(in srgb,var(--ios-indigo) 12%,#fff); color:var(--ios-indigo); }.box-home-quick-icon.is-coral { background:color-mix(in srgb,var(--ios-coral) 16%,#fff); color:#e5533d; }.box-home-quick-icon.is-teal { background:color-mix(in srgb,var(--ios-teal) 14%,#fff); color:var(--ios-teal); }.box-home-quick-icon.is-sky { background:color-mix(in srgb,#5e9cff 16%,#fff); color:#3d7de0; }.box-home-quick-icon.is-amber { background:color-mix(in srgb,var(--ios-amber) 16%,#fff); color:#c8801a; }.box-home-quick-icon.is-violet { background:color-mix(in srgb,#9b7cd6 16%,#fff); color:#7b5ec6; }
.card-home-status { grid-template-columns:1.25fr repeat(3,minmax(0,1fr)); }
.card-hot-type { max-width:100%; justify-self:start; overflow:hidden; padding:3px 8px; border-radius:7px; background:color-mix(in srgb,var(--ios-indigo) 10%,#fff); color:var(--ios-indigo); font-size:11px; font-weight:600; text-align:center; text-overflow:ellipsis; white-space:nowrap; }
.card-home .box-home-section-head--actions { margin-top:24px; }
.card-home-quick { grid-template-columns:repeat(6,minmax(0,1fr)); }
@media (min-width:981px) { .box-home { max-width:1420px; } }
@media (max-width:1050px) { .box-home-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }.box-home-workspace { grid-template-columns:1fr; }.box-home-status,.box-home-channels,.card-home-status { grid-template-columns:repeat(2,minmax(0,1fr)); }.box-home-quick,.card-home-quick { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:680px) { .box-home-heading { width:100%; align-items:flex-start; flex-direction:column; gap:10px; }.box-home-period { width:100%; }.box-home-period a { flex:1; }.box-home-actions { width:100%; }.box-home-btn { flex:1; justify-content:center; }.box-home-kpis,.box-home-status,.box-home-channels,.card-home-status { grid-template-columns:1fr; }.box-home-panel-head { align-items:stretch; flex-direction:column; }.box-home-panel-tools { justify-content:space-between; }.box-hot-columns,.box-hot-row { grid-template-columns:28px minmax(0,1fr) 54px 38px 72px; }.box-hot-columns span:last-child,.box-hot-row>span:last-child { display:none; }.box-hot-product i { display:none; }.box-home-quick,.card-home-quick { grid-template-columns:repeat(2,minmax(0,1fr)); }.box-home-mini { padding:14px; } }
@media (prefers-reduced-motion:reduce) { .rr-channel-card { transition:none; } }

/* ── 卡盒出库：淘宝待出库直达弹窗 ───────────────────────────── */
.outbound-entry-badge {
  min-width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center;
  padding:0 5px; border-radius:999px; background:var(--c-accent); color:var(--c-surface-1);
  font-size:12px; font-weight:700; font-variant-numeric:tabular-nums;
}
.taobao-box-stockout-dialog { width:min(1480px,96vw); max-width:none; }
.taobao-box-stockout-dialog .modal-content { height:min(820px,88vh); background:var(--c-surface-1); }
.taobao-box-stockout-dialog .modal-body { min-height:0; display:flex; flex-direction:column; padding:0 16px; overflow:hidden; }
.taobao-box-stockout-tools { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:12px 0; }
.taobao-box-stockout-tools>div { margin-right:auto; }
.taobao-box-stockout-table-wrap { min-height:0; flex:1; overflow:auto; }
.taobao-box-stockout-table { min-width:1310px; table-layout:fixed; }
.taobao-box-stockout-table thead { position:sticky; z-index:2; top:0; }
.taobao-box-stockout-table thead th { background:var(--c-surface-1); color:var(--c-text); font-weight:600; }
.taobao-box-stockout-table tbody tr,.taobao-box-stockout-table tbody td { background:var(--c-surface-1); }
.taobao-box-stockout-table tbody tr:hover td { background:color-mix(in srgb,var(--c-accent) 4%,var(--c-surface-1)); }
.taobao-box-stockout-table tr.has-error td { background:color-mix(in srgb,var(--c-danger) 7%,var(--c-surface-1)); }
.taobao-box-stockout-table .col-check { width:42px; }.taobao-box-stockout-table .col-image { width:48px; }
.taobao-box-stockout-table .col-code { width:82px; }
.taobao-box-stockout-table .col-product { width:190px; }.taobao-box-stockout-table .col-state { width:76px; }
.taobao-box-stockout-table .col-source { width:112px; }.taobao-box-stockout-table .col-stock { width:86px; }
.taobao-box-stockout-table .col-qty { width:62px; }.taobao-box-stockout-table .col-money { width:90px; }
.taobao-box-stockout-table .col-cost { width:104px; }.taobao-box-stockout-table .col-result { width:170px; }
.taobao-box-product b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.taobao-box-source { min-width:104px; }.taobao-box-cost { width:96px; }
.taobao-box-thumb { width:38px; height:48px; object-fit:contain; border-radius:var(--r-sm); background:var(--c-surface-2); }
.taobao-box-thumb.is-empty { display:inline-flex; align-items:center; justify-content:center; color:var(--c-text-faint); }
.taobao-box-stock-count { font-variant-numeric:tabular-nums; }
.taobao-box-error { display:block; color:var(--c-danger); font-size:12px; font-weight:600; }
.taobao-box-result { color:var(--c-text-muted); font-size:12px; }
.taobao-box-stockout-empty { padding:52px 20px; color:var(--c-text-muted); text-align:center; }
.taobao-box-stockout-empty.is-error { color:var(--c-danger); }
@media (max-width:680px) {
  .taobao-box-stockout-dialog { width:100%; margin-right:0; margin-left:0; }
  .taobao-box-stockout-dialog .modal-content { height:94vh; }
  .taobao-box-stockout-tools { align-items:stretch; flex-wrap:wrap; }
  .taobao-box-stockout-tools>div { width:100%; }
}
