/* ============================================================
   拉环工作站 · Pull tab
   设计令牌：黑 / 橙 / 白；总部偏桌面、门店偏手机
   ============================================================ */
:root {
  /* 基础中性色（暖色调） */
  --bg: #f5f4f0;
  --bg-grad: linear-gradient(160deg, #f7f5ef 0%, #f4f1ea 60%, #efece4 100%);
  --panel: #ffffff;
  --line: #ecebe6;
  --line-2: #d9d6cc;
  --text: #181816;
  --text-2: #3d3d39;
  --muted: #7a7870;
  --muted-2: #9d9a90;

  /* 品牌色：拉环橙 */
  --primary: #ff5a1f;
  --primary-d: #e84a13;
  --primary-dd: #c13b08;
  --primary-soft: #fff0e8;
  --primary-tint: #fff7f2;
  --accent: #ff8a3d;
  --accent-soft: #ffe8d8;

  /* 顶栏深色 */
  --ink: #0c0c0d;
  --ink-2: #1a1a1c;
  --ink-3: #2a2a2d;
  --ink-line: rgba(255, 255, 255, 0.08);

  /* 状态色 */
  --green: #15a06b;
  --green-soft: #e8f7ee;
  --red: #e23d3d;
  --red-soft: #fdecea;
  --orange: #ff8a00;
  --orange-soft: #fff3df;

  /* 形状 / 阴影 */
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 6px 24px rgba(20, 18, 14, 0.07);
  --shadow-sm: 0 2px 10px rgba(20, 18, 14, 0.05);
  --shadow-lg: 0 22px 60px rgba(20, 18, 14, 0.14);
  --shadow-ink: 0 8px 24px rgba(0, 0, 0, 0.28);
  --ring: 0 0 0 3px rgba(255, 90, 31, 0.22);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html, body { height: 100%; overflow-x: hidden; }
/* 根元素与 body 直接等于真实可见高度，彻底消除 standalone 底部白边；
   同时在 html 铺一层相同的渐变作为兜底，避免 fixed 背景在 PWA 下漏出白底 */
html { height: var(--app-h, 100vh); background: var(--bg); background-image: var(--bg-grad); }
body { min-height: var(--app-h, 100vh); }
/* PWA（Safari「添加到主屏幕」standalone 模式）：用 dvh 让布局跟随真实可见高度，
   避免 100vh 把底部 home indicator 安全区也算入视口，导致页面整体上移、底部留白 */
/* PWA（Safari「添加到主屏幕」standalone 模式）真实视口高度：
   --app-h 由 common.js 用 visualViewport / innerHeight 写入「真正可见」高度（px），
   解决 100vh 把底部 home indicator 安全区也算入视口、导致页面整体上移/底部留白的问题；
   老版本 Safari 不支持 100dvh 时也能正确铺满。--nav-h 为底部导航真实高度（含安全区）。 */
:root { --vh-real: 100vh; --app-h: 100vh; --nav-h: 88px; }
@supports (height: 100dvh) { :root { --vh-real: 100dvh; } }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary-d); text-decoration: none; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: #d4d0c5; border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #b8b2a3; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   顶栏（深色玻璃质感）
   ============================================================ */
.topbar {
  /* 顶部安全区：避免 iOS 状态栏（时间/电量）遮挡顶栏按钮，内容整体下移到状态栏之下 */
  height: calc(60px + var(--safe-top));
  background: linear-gradient(180deg, #161618 0%, #0a0a0b 100%);
  border-bottom: 1px solid var(--ink-line);
  display: flex; align-items: center; padding: var(--safe-top) 18px 0;
  position: sticky; top: 0; z-index: 50;
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.topbar::after {
  /* 极细橙色高光 */
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  opacity: 0.5; pointer-events: none;
}
.topbar .logo {
  font-weight: 800; font-size: 15.5px;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: 0.4px; color: #fff;
}
.topbar .logo img {
  height: 36px; width: auto; display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  border-radius: 4px;
}
.topbar .logo .badge {
  font-size: 10.5px; font-weight: 600;
  background: var(--primary); color: #fff;
  padding: 2px 7px; border-radius: var(--radius-pill);
  letter-spacing: 0.4px; margin-left: 4px;
}
.topbar .spacer { flex: 1; }
.topbar .who { color: rgba(255, 255, 255, 0.78); margin-right: 12px; font-size: 13px; }
.topbar .who b { color: #fff; font-weight: 600; }
.topbar .btn.btn-sm {
  background: rgba(255, 255, 255, 0.08);
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}
.topbar .btn.btn-sm:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.2); }

/* ============================================================
   布局
   ============================================================ */
.layout { display: flex; min-height: calc(100vh - 60px); min-height: calc(var(--app-h, 100vh) - 60px - var(--safe-top)); }

/* ---- 侧边栏（总部 / 桌面） ---- */
.sidebar {
  width: 220px; background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  position: sticky; top: calc(60px + var(--safe-top)); align-self: flex-start;
  height: calc(100vh - 60px); height: calc(var(--app-h, 100vh) - 60px - var(--safe-top)); overflow: auto;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: 10px;
  color: var(--text); cursor: pointer; margin-bottom: 4px;
  font-size: 13.5px; font-weight: 500;
  position: relative; transition: background .15s, color .15s;
  user-select: none;
}
.sidebar .nav-item:hover { background: var(--primary-tint); color: var(--primary-dd); }
.sidebar .nav-item.active {
  background: var(--primary-soft); color: var(--primary-dd); font-weight: 700;
}
.sidebar .nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--primary);
  box-shadow: 0 0 8px rgba(255, 90, 31, 0.5);
}
/* 待处理调拨红色角标 */
.sidebar .nav-item[data-page="transfer"].has-pending::after,
.bottom-nav .bn-item[data-page="transfer"].has-pending::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px; background: #e2483d;
  border-radius: 50%; z-index: 2;
}
.sidebar .nav-item .ic {
  width: 20px; text-align: center; font-size: 14px; opacity: 0.75;
  filter: grayscale(0.2);
}
.sidebar .nav-item.active .ic { opacity: 1; filter: none; }

.main { flex: 1; padding: 24px 30px; overflow: auto; }
.page { display: none; animation: fadeUp .35s ease both; }
.page.active { display: block; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pulseOrange { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.4); } 50% { box-shadow: 0 0 0 12px rgba(255, 90, 31, 0); } }

/* ============================================================
   卡片 / 标题
   ============================================================ */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow); margin-bottom: 20px;
  animation: fadeUp .4s ease both;
  position: relative;
}
h2.page-title {
  margin: 0 0 4px; font-size: 21px; font-weight: 700;
  position: relative; padding-left: 14px; letter-spacing: 0.3px;
  color: var(--text);
}
h2.page-title::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 21px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dd));
  box-shadow: 0 0 8px rgba(255, 90, 31, 0.3);
}
.sub { color: var(--muted); margin: 0 0 18px; font-size: 13px; }

.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.2px; }

input, select, textarea {
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: #fff; color: var(--text); outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #b0aea5; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}
textarea { resize: vertical; min-height: 84px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237a7870' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
  border: 1px solid var(--line-2); background: #fff; color: var(--text);
  padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 600; transition: .15s; line-height: 1.2;
  display: inline-flex; align-items: center; gap: 5px; justify-content: center;
  font-family: inherit;
}
.btn:hover { border-color: #b8b2a3; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-d));
  border-color: var(--primary-d); color: #fff;
  box-shadow: 0 4px 14px rgba(255, 90, 31, 0.32);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #ff6c2e, var(--primary));
  box-shadow: 0 6px 18px rgba(255, 90, 31, 0.42); border-color: var(--primary-dd);
}
.btn-danger { background: #fff; border-color: #f3c9c5; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary-d); padding: 6px 10px; }
.btn-ghost:hover { background: var(--primary-tint); box-shadow: none; }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; border-color: #000; }

/* ============================================================
   表格
   ============================================================ */
.table-wrap, div[style*="overflow:auto"] { border-radius: 12px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th {
  color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.3px;
  background: var(--primary-tint); position: sticky; top: 0;
  border-bottom: 1px solid var(--line-2);
  text-transform: uppercase;
}
th:first-child { border-top-left-radius: 12px; }
th:last-child { border-top-right-radius: 12px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fbf9f5; }
tbody tr:last-child td { border-bottom: none; }

  /* 总部物料名称：过长时换行显示（不被移动端 .card table td 的 nowrap 压成单行溢出） */
  #matTable td.mat-name {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 200px;
  }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
  background: #efeee9; color: #4a4a44;
}
.tag.green { background: var(--green-soft); color: #0a6d3f; }
.tag.red { background: var(--red-soft); color: #b53025; }
.tag.gray { background: #efeee9; color: #6a6862; }
.tag.amber { background: var(--orange-soft); color: #b35e00; }
.mono { font-variant-numeric: tabular-nums; }

/* ============================================================
   统计大数字
   ============================================================ */
.stat-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 22px; min-width: 180px; flex: 1;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  animation: fadeUp .45s ease both;
}
.stat-box::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dd));
}
.stat-box .k { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; font-weight: 500; }
.stat-box .v { font-size: 27px; font-weight: 800; letter-spacing: 0.3px; }
.delta-up { color: #e5484d; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.delta-down { color: #2f9e5f; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
/* 环比涨跌三角（CSS 绘制，避免手机端 ▲▼ 乱码） */
.delta-arrow { display: inline-block; width: 0; height: 0; }
.delta-arrow.up { border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid #e5484d; }
.delta-arrow.down { border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid #2f9e5f; }

/* ===== 统计页智能分析卡 ===== */
.insight-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px; margin-bottom: 18px; box-shadow: var(--shadow);
  animation: fadeUp .45s ease both;
}
.insight-head {
  font-size: 15px; font-weight: 800; margin-bottom: 12px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.insight-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.insight-item {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.65; padding: 8px 12px; border-radius: 10px; margin-bottom: 6px;
}
.insight-item:last-child { margin-bottom: 0; }
/* 智能分析图标：CSS 圆点（warn 红 / good 绿 / info 灰），不用 emoji，避免手机端乱码 */
.insight-item .insight-ic { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: #788196; }
.insight-item.warn .insight-ic { background: #e5484d; }
.insight-item.good .insight-ic { background: #2f9e5f; }
.insight-item.info .insight-ic { background: #788196; }
.insight-item.warn { background: rgba(229, 72, 77, 0.07); border: 1px solid rgba(229, 72, 77, 0.18); }
.insight-item.good { background: rgba(47, 158, 95, 0.07); border: 1px solid rgba(47, 158, 95, 0.18); }
.insight-item.info { background: rgba(120, 130, 150, 0.07); border: 1px solid rgba(120, 130, 150, 0.16); }

/* ============================================================
   登录页（黑橙质感）
   ============================================================ */
.login-wrap {
  min-height: 100vh; min-height: var(--app-h, 100vh); display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(255, 138, 61, 0.18) 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 100%, rgba(255, 90, 31, 0.22) 0%, transparent 50%),
    linear-gradient(135deg, #161618 0%, #0a0a0b 100%);
  padding: 20px; position: relative; overflow: hidden;
}
.login-wrap::before {
  /* 极淡斜线纹路（高级感） */
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, transparent 0, transparent 60px, rgba(255, 255, 255, 0.012) 60px, rgba(255, 255, 255, 0.012) 61px);
  pointer-events: none;
}
.login-card {
  background: rgba(255, 255, 255, 0.97); width: 400px; max-width: 94vw;
  border-radius: 24px; padding: 36px 32px 30px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 90, 31, 0.1);
  text-align: center; animation: fadeUp .5s ease both;
  position: relative; z-index: 1;
}
.login-logo {
  width: 124px; height: 124px; margin: 0 auto 14px;
  display: block; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
  border-radius: 18px;
}
.login-card h1 {
  font-size: 24px; margin: 0 0 4px; font-weight: 800;
  letter-spacing: 1px; color: var(--text);
  background: linear-gradient(135deg, #0a0a0b 30%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-card .en-sub {
  color: var(--muted); margin: 0 0 18px; font-size: 12px;
  letter-spacing: 4px; font-weight: 600; text-transform: uppercase;
}
.login-card .desc { color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.login-card .field { text-align: left; }
.login-card .field label { padding-left: 2px; }
.login-card input {
  background: #f7f5ef; border-color: #e6e3d8; padding: 13px 14px; font-size: 15px;
}
.login-card input:focus { background: #fff; }
.captcha-row { display: flex; align-items: stretch; gap: 8px; }
.captcha-row input { flex: 1; }
.captcha-q {
  display: flex; align-items: center; justify-content: center;
  min-width: 120px; padding: 0 12px; border-radius: 10px;
  background: #1f1f24; color: #ffd76a; font-weight: 700; font-size: 15px;
  cursor: pointer; user-select: none; letter-spacing: 0.5px;
  border: 1px solid #35353d;
}
.captcha-q:hover { background: #2a2a31; }
.login-card .btn-primary {
  width: 100%; margin-top: 8px; padding: 14px; font-size: 15px;
  letter-spacing: 4px; font-weight: 700;
}
.login-foot {
  margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.7;
  border-top: 1px dashed var(--line); padding-top: 14px;
}
.brand-pick { display: flex; gap: 8px; }
.brand-pick .btn { flex: 1; }

/* ============================================================
   弹窗（确认 / 表单 / 错误）
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 8, 10, 0.55);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 2000;
  animation: fadeIn .2s ease both;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; width: 480px; max-width: 92vw; max-height: 90vh; overflow: auto;
  border-radius: var(--radius-lg); padding: 24px 26px;
  box-shadow: var(--shadow-lg);
  animation: pop .22s ease both;
  position: relative;
}
.modal h3 {
  margin: 0 0 18px; font-size: 17px; font-weight: 700;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); position: relative;
  color: var(--text);
}
.modal h3::after {
  content: ''; position: absolute; left: 0; bottom: -1px; width: 42px; height: 3px;
  border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--primary-d));
}
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
/* 通用 .actions（卡片里的按钮组）：默认按钮组右对齐 */
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.actions .btn { max-width: 100%; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.modal-head span { font-size: 17px; font-weight: 700; }
.modal-x {
  border: none; background: #f0eee8; color: #5a5852; width: 30px; height: 30px;
  border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; transition: .15s;
}
.modal-x:hover { background: #e3e0d6; color: #2f2d28; }
.modal-body { font-size: 14px; line-height: 1.7; color: var(--text); word-break: break-word; max-height: 64vh; overflow: auto; }
.modal-body img { max-width: 100%; border-radius: 8px; margin: 6px 0; display: block; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ============================================================
   错误弹窗（居中醒目 · 必须手动关）
   ============================================================ */
.err-modal {
  background: #fff; width: 460px; max-width: 92vw;
  border-radius: 22px; padding: 36px 30px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(255, 90, 31, 0.15);
  text-align: center; position: relative;
  animation: pop .28s cubic-bezier(.34, 1.56, .64, 1) both;
}
.err-modal::before {
  /* 顶部细橙线 */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  border-radius: 22px 22px 0 0;
}
.err-icon {
  width: 76px; height: 76px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff; font-size: 42px; font-weight: 800;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(255, 90, 31, 0.4);
  animation: pulseOrange 2s infinite;
}
.err-title {
  font-size: 20px; font-weight: 800; color: var(--text);
  margin: 0 0 10px; letter-spacing: 0.5px;
}
.err-msg {
  font-size: 14.5px; color: var(--text-2); line-height: 1.65;
  margin: 0 0 22px; word-break: break-word;
  background: #fff5ef; padding: 12px 14px; border-radius: 10px;
  border-left: 3px solid var(--primary);
  text-align: left; max-height: 220px; overflow: auto;
}
.err-actions { display: flex; justify-content: center; gap: 10px; }
.err-actions .btn-primary {
  min-width: 140px; padding: 12px 24px; font-size: 15px; font-weight: 700;
  letter-spacing: 2px;
}

/* ============================================================
   联想搜索 combobox
   ============================================================ */
.combo { position: relative; }
.combo-input { background: #f7f5ef; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff;
  border: 1px solid var(--line-2); border-radius: 12px;
  max-height: 240px; overflow: auto; z-index: 30;
  box-shadow: 0 14px 36px rgba(20, 18, 14, 0.16); display: none; padding: 6px;
  animation: pop .15s ease both;
}
.combo-list.show { display: block; }
.combo-item {
  padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px;
  border-radius: 8px; align-items: center;
}
.combo-item:hover, .combo-item.hl { background: var(--primary-tint); }
.combo-item .cat { color: var(--muted); font-size: 12px; }
.combo-item .pr { color: var(--primary-d); font-size: 12px; font-weight: 700; }

/* ============================================================
   报损清单行
   ============================================================ */
.loss-row {
  display: grid; grid-template-columns: 1fr auto 120px 40px; gap: 10px 12px;
  align-items: end; margin-bottom: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--primary-tint);
}
.loss-row .reason {
  grid-column: 1 / -1; height: 36px; padding: 0 10px; font-size: 12px; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%237a7870' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}
.loss-qty-unit {
  display: flex; gap: 0; align-items: center;
}
.loss-qty-unit .qty {
  width: 70px; border-radius: 10px 0 0 10px; border-right: none;
}
.loss-qty-unit .qty:focus { border-radius: 10px 0 0 10px; }
.qty-quick {
  display: flex; gap: 0;
}
.qty-quick .qb {
  width: 34px; height: 40px; padding: 0; border: 1px solid var(--line);
  border-right: none; background: #fff; color: var(--text-2);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: .1s;
}
.qty-quick .qb:first-child { border-left: none; }
.qty-quick .qb:last-child { border-radius: 0; border-right: 1px solid var(--line); }
.qty-quick .qb.qb-bs { font-size: 16px; color: var(--muted); font-weight: 400; }
.qty-quick .qb:active { background: var(--primary); color: #fff; }
.loss-qty-unit .unit {
  width: 56px; border-radius: 0 10px 10px 0; background: #f2efe8; text-align: center; color: var(--muted);
}
.loss-row .amt { font-weight: 800; color: var(--primary-d); align-self: center; font-size: 15px; }
.loss-row .rm {
  width: 40px; height: 40px; border-radius: 10px;
  background: #fff; color: var(--red); border: 1px solid #f3c9c5; cursor: pointer;
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: .15s;
}
.loss-row .rm:hover { background: var(--red-soft); }
.loss-total { text-align: right; font-size: 15px; padding: 14px 4px; color: var(--muted); }
.loss-total b { font-size: 24px; color: var(--red); margin-left: 6px; font-weight: 800; }

/* ============================================================
   快捷报损面板（常用物料芯片）
   ============================================================ */
.quick-loss {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--primary-tint);
  border: 1px solid var(--accent-soft);
  border-radius: 12px;
}
.quick-loss-title {
  font-size: 12px; font-weight: 700; color: var(--primary-d);
  margin-bottom: 8px;
}
.quick-loss-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.quick-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  transition: .15s;
  white-space: nowrap;
  user-select: none;
}
.quick-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(255,90,31,0.25);
}
.quick-chip .qc-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.quick-chip .qc-price { font-size: 11px; opacity: 0.7; }
.quick-chip.added {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--primary-d);
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

.kpi-row { display: flex; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.empty { color: var(--muted); text-align: center; padding: 36px 20px; font-size: 13.5px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col h3 { font-size: 15px; margin: 0 0 10px; font-weight: 700; }
.two-col .card { padding: 16px 18px; }

/* ============================================================
   Toast（保留轻量提示）
   ============================================================ */
#toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  z-index: 4000; padding: 11px 22px; border-radius: var(--radius-pill);
  color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-ink); pointer-events: none;
  animation: fadeUp .3s ease both;
  max-width: 90vw; text-align: center;
}
#toast.t-ok { background: var(--green); }
#toast.t-err { background: var(--red); }
#toast.t-info { background: var(--ink); }

/* ============================================================
   报表 / 调拨 / 业绩 / 公告
   ============================================================ */
.rep-sub { font-size: 15px; margin: 4px 0 12px; }
.rep-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.rep-store-card {
  flex: 1 1 160px; min-width: 150px; max-width: 220px;
  background: linear-gradient(135deg, var(--primary-tint), #ffffff);
  border: 1px solid var(--accent-soft); border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(255, 90, 31, 0.08);
}
.rep-store-head { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #2a2520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-store-amt { font-size: 22px; font-weight: 800; color: var(--primary-d); margin: 6px 0 2px; letter-spacing: 0.3px; }
.rep-store-sub { font-size: 12px; color: #8a8a82; }
.rep-grid-wrap { overflow: auto; max-height: 62vh; border-radius: 12px; border: 1px solid var(--line); }
.rep-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.rep-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.rep-grid th, .rep-grid td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: right; white-space: nowrap; }
.rep-grid thead th { position: sticky; top: 0; z-index: 3; background: var(--ink); color: #fff; font-weight: 600; }
.rep-grid tbody tr:hover td { background: var(--primary-tint); }
.rep-date, .rep-date-head {
  position: sticky; left: 0; z-index: 2; text-align: left !important;
  background: #fbfaf6; color: #2a2520; font-weight: 600; min-width: 86px;
}
.rep-date-head { z-index: 4; background: var(--ink); color: #fff; }
.rep-col-head { vertical-align: bottom; min-width: 104px; text-align: right; }
.rep-col-name { font-weight: 700; margin-top: 3px; color: #fff; white-space: nowrap; }
.rep-col-cnt { font-size: 11px; opacity: .85; font-weight: 400; }
.rep-cell { font-variant-numeric: tabular-nums; }
.rep-zero { color: #c8c5b8; }
.rep-daytotal { background: var(--primary-tint) !important; font-weight: 600; color: #2a2520; }
.rep-cell-total { font-weight: 700; color: var(--primary-d); background: var(--primary-tint); }
.rep-grand { font-weight: 700; color: var(--red); background: var(--primary-tint); }
.rep-foot td { border-top: 2px solid var(--accent-soft); background: var(--primary-tint) !important; }

/* ===== 门店切换器（自定义下拉，顶栏内） ===== */
.store-switcher { position: relative; margin-right: 10px; }
.ss-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(255, 90, 31, 0.18), rgba(255, 255, 255, 0.05));
  color: #fff; font: inherit; font-size: 13px;
  transition: border-color .18s, background .18s, box-shadow .18s;
  backdrop-filter: blur(6px); max-width: 230px;
}
.ss-btn:hover { border-color: rgba(255, 138, 76, 0.55); box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.14); }
.ss-btn.ss-single { cursor: default; }
.ss-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #35d07f; box-shadow: 0 0 0 3px rgba(53, 208, 127, 0.22);
  animation: ssPulse 2.2s infinite;
}
@keyframes ssPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(53, 208, 127, 0.22); }
  50% { box-shadow: 0 0 0 5px rgba(53, 208, 127, 0.08); }
}
.ss-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.ss-name { font-weight: 700; font-size: 13px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-brand { font-size: 10.5px; color: rgba(255, 255, 255, 0.6); letter-spacing: .3px; }
.ss-caret { font-size: 11px; color: rgba(255, 255, 255, 0.65); transition: transform .2s; margin-left: 2px; }
.store-switcher.open .ss-caret { transform: rotate(180deg); }
.ss-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 230px; z-index: 300;
  background: linear-gradient(180deg, #1c1c1f, #131315);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
  padding: 6px; opacity: 0; transform: translateY(-6px) scale(0.98);
  pointer-events: none; transition: opacity .18s, transform .18s;
}
.store-switcher.open .ss-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.ss-menu-title {
  font-size: 11px; color: rgba(255, 255, 255, 0.45); letter-spacing: .5px;
  padding: 8px 12px 6px;
}
.ss-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; color: #fff;
  transition: background .15s;
}
.ss-item:hover { background: rgba(255, 255, 255, 0.07); }
.ss-item.on { background: rgba(255, 90, 31, 0.16); }
.ss-item-ic { font-size: 16px; flex: none; }
.ss-item-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ss-item-txt b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-item-txt i { font-style: normal; font-size: 11px; color: rgba(255, 255, 255, 0.5); }
.ss-check { margin-left: auto; color: var(--primary); font-weight: 800; }

.store-pick {
  max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; background: #fbfaf6;
}
.store-check { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.store-check:hover { background: var(--primary-tint); }
.store-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.tag.sm { font-size: 11px; padding: 1px 7px; }

.import-result { margin: 6px 0 2px; }
.import-result .ok { color: #0a6d3f; font-weight: 600; font-size: 13px; }
.import-result .bad { color: var(--red); font-weight: 600; font-size: 13px; }
.import-result .err-title { color: #8a6d00; font-size: 12px; margin-top: 6px; }
.import-result .err-list { margin: 4px 0 0; padding-left: 18px; color: #9a7b00; font-size: 12px; max-height: 120px; overflow: auto; }
.import-result .err-list li { margin: 2px 0; }

/* 开发者模式 */
.dev-h3 { font-size: 15px; margin: 0 0 10px; color: var(--ink); }
.dev-summary { font-size: 13px; margin-bottom: 10px; color: var(--muted); }
.dev-summary b { color: var(--orange); }
.dev-table { font-size: 12.5px; }
.dev-table th, .dev-table td { padding: 6px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.dev-table th:first-child, .dev-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
.dev-table thead th { background: var(--ink); color: #fff; font-weight: 600; position: sticky; top: 0; }
.dev-foot td { background: #fff4ef; font-weight: 700; border-top: 2px solid var(--orange); }
.ok { color: #0a6d3f; font-weight: 600; font-size: 13px; }
.bad { color: var(--red); font-weight: 600; font-size: 13px; }

.rep-rank { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 4px 0 6px; }
.rep-rank-card {
  position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 12px;
  background: #fff; box-shadow: 0 2px 10px rgba(20, 18, 14, 0.05);
}
.rep-rank-card.top { background: linear-gradient(160deg, var(--primary-tint), #ffffff); border-color: var(--accent-soft); }
.rep-rank-no { position: absolute; top: 10px; right: 12px; font-size: 20px; }
.rep-rank-brand { margin-bottom: 4px; }
.rep-rank-name { font-size: 16px; font-weight: 700; color: #2a2520; margin-bottom: 2px; }
.rep-rank-amt { font-size: 24px; font-weight: 800; color: var(--primary-d); font-variant-numeric: tabular-nums; }
.rep-rank-sub { font-size: 12px; color: #8a8a82; margin-bottom: 8px; }
.rep-rank-deltas { font-size: 12px; color: #5a5852; line-height: 1.7; border-top: 1px dashed var(--line); padding-top: 7px; }
.rep-delta.up { color: var(--red); }
.rep-delta.down { color: var(--green); }
.rep-delta.flat { color: #8a8a82; }
.rep-ratio { color: #2a2520; font-size: 12px; }
.rep-ratio b { color: var(--primary-d); }

/* 报损页布局：左报损表单 + 右业绩速填卡 */
.report-layout { display: flex; gap: 16px; align-items: flex-start; }
.report-layout .report-main { flex: 1; min-width: 0; }
.perf-side { width: 260px; flex: 0 0 260px; position: sticky; top: 8px; }
.perf-side-title { margin: 0 0 4px; font-size: 15px; }
.perf-daily-tip { margin: 0 0 10px; font-size: 11px; color: #e5484d; font-weight: 600; }
.perf-side .field { margin-bottom: 10px; }
.perf-side-stats {
  margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.perf-side-stats .ps-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #6b6b63;
}
.perf-side-stats .ps-row b { font-variant-numeric: tabular-nums; color: #2a2520; }
.perf-side-stats .ps-row.ratio {
  background: var(--primary-soft); border: 1px solid var(--accent);
  border-radius: 9px; padding: 7px 10px; margin-top: 2px;
}
.perf-side-stats .ps-row.ratio b { color: var(--primary-d); font-size: 16px; }

.perf-today { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.perf-box { background: var(--primary-tint); border: 1px solid var(--accent-soft); border-radius: 12px; padding: 14px; text-align: center; }
.perf-box .k { font-size: 12px; color: #8a8a82; margin-bottom: 6px; }
.perf-box .v { font-size: 22px; font-weight: 800; color: #2a2520; font-variant-numeric: tabular-nums; }
.perf-box.ratio { background: var(--primary-soft); border-color: var(--accent); }
.perf-box.ratio .v { color: var(--primary-d); }

.btag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700;
  color: #fff; letter-spacing: 0.2px; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.tf-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
  animation: fadeUp .3s ease both;
}
.tf-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.tf-arrow { color: var(--primary); font-weight: 700; }
/* 调拨方向标签（替代 ← → 箭头，避免手机端乱码） */
.tf-dir { flex: none; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; line-height: 1.5; }
.tf-dir.out { color: #c2410c; background: rgba(255, 138, 61, 0.14); }
.tf-dir.in { color: #1d6fb8; background: rgba(58, 142, 222, 0.14); }
.tf-time { margin-left: auto; color: #9d9a90; font-size: 12px; white-space: nowrap; }
.tf-note { margin: 8px 0 4px; color: #5a5852; font-size: 13px; }
.tf-items { margin: 6px 0 0; padding-left: 18px; color: #2f2d28; font-size: 13px; }
.tf-items li { margin: 2px 0; }

.ann-toolbar {
  display: flex; gap: 6px; align-items: center; margin-bottom: 8px;
  padding: 8px; border: 1px solid var(--line-2); border-radius: 10px 10px 0 0;
  background: #fbfaf6; flex-wrap: wrap;
}
.ann-toolbar button, .ann-toolbar label {
  border: 1px solid var(--line-2); background: #fff; color: var(--text);
  padding: 5px 11px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600;
  line-height: 1.4; transition: .15s;
}
.ann-toolbar button:hover, .ann-toolbar label:hover { border-color: var(--primary); background: var(--primary-tint); }
.ann-editor {
  border: 1px solid var(--line-2); border-top: none; border-radius: 0 0 10px 10px;
  padding: 12px 14px; background: #fff; color: var(--text); outline: none;
  font-size: 14px; line-height: 1.7; min-height: 160px;
}
.ann-editor:focus { box-shadow: inset var(--ring); }
.ann-editor img { max-width: 100%; border-radius: 8px; margin: 6px 0; display: block; }
.ann-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  margin-bottom: 12px; background: #fff; box-shadow: var(--shadow-sm);
  animation: fadeUp .3s ease both;
}
.ann-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.ann-card-head b { font-size: 14.5px; color: #2a2520; }
.ann-content { font-size: 13.5px; color: #2f2d28; line-height: 1.7; word-break: break-word; }
.ann-content img { max-width: 100%; border-radius: 8px; margin: 6px 0; display: block; }

/* ===== 盘点：紧凑卡片（桌面/移动通用，只读项也用框呈现） ===== */
.stk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.stk-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stk-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.stk-card .nm { font-weight: 700; font-size: 15px; color: var(--text); line-height: 1.3; word-break: break-all; }
.stk-card .seq { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stk-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 5px 0 10px; font-size: 12px; color: var(--muted); }
.stk-meta .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #6b7280; }
.stk-boxes { display: flex; gap: 10px; }
.stk-box { flex: 1; min-width: 0; }
.stk-box .lbl { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stk-val {
  width: 100%; box-sizing: border-box; font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
  font-variant-numeric: tabular-nums; text-align: center;
}
.stk-val:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.stk-val.ro { background: #f1f3f5; color: #6b7280; cursor: not-allowed; }
.stk-count { color: var(--primary-d); font-weight: 700; }
.stk-count::placeholder { color: #b9c0c9; font-weight: 400; }
/* AI 分类板块 */
.stk-cats { display: flex; flex-direction: column; gap: 20px; }
.stk-cat-block { }
.stk-cat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: #f9fafb; border-radius: 12px;
  margin-bottom: 12px; font-weight: 700; font-size: 15px;
}
.stk-cat-emoji { font-size: 22px; }
.stk-cat-name { color: var(--text); }
.stk-cat-count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.stk-cat-block .stk-cards { margin-left: 0; }

/* ============================================================
   移动端（门店端为主，< 820px）
   ============================================================ */
@media (max-width: 820px) {
  /* 顶栏精简 */
  .topbar { height: 56px; padding: 0 12px; }
  .topbar .logo { font-size: 14px; }
  .topbar .logo img { height: 32px; }
  .topbar .logo .badge { display: none; }
  .topbar .who { display: none; }
  .store-switcher { margin-right: 6px; }
  .ss-btn { max-width: 165px; padding: 5px 10px 5px 9px; }
  .ss-name { max-width: 105px; font-size: 12.5px; }
  .ss-menu { right: -8px; min-width: 210px; }

  /* 总部端：无底部 tab bar，layout 改为垂直堆叠，侧边栏变横向滚动标签 */
  body:not(.has-bottom-nav) .layout { flex-direction: column; min-height: auto; }
  body:not(.has-bottom-nav) .sidebar {
    display: flex; flex-direction: row; overflow-x: auto;
    padding: 6px 10px; gap: 6px;
    width: 100%; min-width: 0; height: auto;
    background: #fff; border-right: 0; border-bottom: 1px solid var(--line);
    position: sticky; top: 56px; z-index: 50;
    white-space: nowrap; -webkit-overflow-scrolling: touch;
    align-self: stretch;
  }
  body:not(.has-bottom-nav) .sidebar .nav-item {
    flex: none; padding: 7px 13px; font-size: 12px;
    white-space: nowrap; margin-bottom: 0; border-radius: 8px;
    background: var(--bg);
  }
  body:not(.has-bottom-nav) .sidebar .nav-item .ic { font-size: 13px; width: auto; }
  body:not(.has-bottom-nav) .sidebar .nav-item.active { background: var(--primary-soft); }
  body:not(.has-bottom-nav) .sidebar .nav-item.active::before { display: none; }

  /* 主区域：底部留白统一交给有底部导航的页面接管（见下方 --nav-h） */
  .main { padding: 14px; }
  .page-title { font-size: 19px; }
  .card { padding: 16px 14px; border-radius: 14px; }
  .two-col { grid-template-columns: 1fr; }
  /* 统计卡：手机端两列网格，避免 5 个大卡横向挤压 / 文字溢出 */
  .stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-box { min-width: 0; padding: 14px 16px; }
  .stat-box .v { font-size: 22px; }
  /* 智能分析卡：手机端更紧凑 */
  .insight-card { padding: 14px 14px; margin-bottom: 14px; }
  .insight-item { padding: 7px 10px; }
  /* 调拨卡：手机端更紧凑，方向标签 + 时间正确换行 */
  .tf-card { padding: 12px 14px; }
  .tf-head { font-size: 13px; gap: 6px; }
  .tf-items { padding-left: 16px; }

  /* 报损行：手机版清爽布局 */
  .loss-row { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 12px 12px 12px 14px; position: relative; }
  .loss-row .combo { order: 1; flex: 1 1 100%; padding-right: 32px; box-sizing: border-box; }
  .loss-row .reason { order: 2; flex: 1 1 100%; }
  .loss-row .loss-qty-unit { order: 3; flex: 1 1 auto; }
  .loss-row .amt { order: 4; margin-left: auto; align-self: center; font-weight: 700; color: var(--primary-d); font-size: 16px; }
  .loss-row .rm { order: 5; position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; }
  .qty-quick .qb { height: 36px; width: 38px; font-size: 16px; }
  .loss-qty-unit .qty { width: 56px; }
  /* 手机顶部栏精简 */
  .topbar { padding: 0 10px; gap: 4px; height: 52px; }
  .topbar .logo img { height: 28px; }
  .topbar .logo span { display: none; }
  .topbar .who { display: none; }
  .topbar .store-switcher select { font-size: 12px; max-width: 100px; padding: 4px 20px 4px 6px; }
  .topbar .spacer { flex: 1; }
  .topbar .btn.btn-sm { height: 36px; min-width: 36px; padding: 0 10px; flex: none; }
  #refreshBtn { width: 36px; border-radius: 50%; padding: 0 !important; min-width: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08);
    color: transparent !important; font-size: 0; line-height: 0; }
  #refreshBtn::before { content: '🔄'; font-size: 17px; color: #fff; display: block; line-height: 1; }
  #logoutBtn { width: 36px; border-radius: 50%; padding: 0 !important; min-width: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08);
    color: transparent !important; font-size: 0; line-height: 0; }
  #logoutBtn::before { content: '⏻'; font-size: 16px; color: #fff; display: block; line-height: 1; }
  #notifyBtn { width: 36px; border-radius: 50%; padding: 0 !important; min-width: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08); font-size: 17px; line-height: 1; }

  /* 输入加大（避免 iOS 缩放） */
  input, select, textarea { font-size: 16px; padding: 11px 12px; }
  input, select, textarea, button, a, .btn { touch-action: manipulation; }
  .btn { padding: 12px 18px; font-size: 14px; }
  .btn-sm { padding: 7px 12px; font-size: 12.5px; }

  /* 表格在手机上横向滚动 */
  .table-wrap, table { font-size: 12.5px; }
  th, td { padding: 9px 10px; }
  /* HQ 表格：移动端保持横向滚动，禁止列被压缩导致门店名称等文字竖排堆叠 */
  body:not(.has-bottom-nav) .card table { width: auto; min-width: 100%; table-layout: auto; }
  body:not(.has-bottom-nav) .card table th,
  body:not(.has-bottom-nav) .card table td { white-space: nowrap; }
  body:not(.has-bottom-nav) .card table .sel-cell,
  body:not(.has-bottom-nav) .card table .acc-sel-cell { white-space: nowrap; width: 1%; }

  /* ===== 底部 tab bar（门店端专用，桌面隐藏） ===== */
  body.has-bottom-nav .layout { padding-bottom: 0; }
  body.has-bottom-nav .topbar { position: sticky; top: 0; }
  .bottom-nav {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0;   /* 永远钉在屏幕最下方，不随键盘移动 */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
    z-index: 60; flex-direction: column;
    padding-bottom: 0;
  }
  body.has-bottom-nav .bottom-nav { display: flex; }

  /* 子项行：当前分类下的具体页面（胶囊样式，可横向滑动） */
  .bottom-nav .bn-sub {
    display: flex; gap: 8px; align-items: center;
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    /* 默认收起：二级类目选择完毕后自动隐藏，不再常态显示 */
    padding: 0 10px; border-bottom: 1px solid transparent;
    max-height: 0; opacity: 0; overflow: hidden; pointer-events: none;
    transition: max-height .22s ease, padding .22s ease, opacity .18s ease, border-color .22s ease;
  }
  .bottom-nav .bn-sub.open {
    max-height: 60px; opacity: 1; pointer-events: auto;
    padding: 7px 10px; border-bottom-color: var(--line);
  }
  .bottom-nav .bn-sub .bn-item {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px; white-space: nowrap;
    background: var(--primary-tint); color: var(--primary-d);
    font-size: 13px; font-weight: 600; cursor: pointer; position: relative;
    transition: background .15s, color .15s;
  }
  .bottom-nav .bn-sub .bn-item .ic { font-size: 15px; line-height: 1; }
  .bottom-nav .bn-sub .bn-item.active { background: var(--primary); color: #fff; }
  .bottom-nav .bn-sub .bn-item:active { filter: brightness(.97); }

  /* 分类 tab 行：报损相关 / 日报 / 物料 / 团单 + 账号 */
  .bottom-nav .bn-cats { display: flex; width: 100%; }
  .bottom-nav .bn-cat,
  .bottom-nav .bn-cats .bn-item.account {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 5px 0 calc(5px + env(safe-area-inset-bottom, 0px)); cursor: pointer;
    color: var(--muted); font-size: 10px; font-weight: 600;
    transition: color .15s; user-select: none; position: relative;
  }
  .bottom-nav .bn-cats .bn-item.account { flex: 0 0 56px; }
  .bottom-nav .bn-cat .ic,
  .bottom-nav .bn-cats .bn-item.account .ic { font-size: 19px; line-height: 1; transition: transform .15s; }
  .bottom-nav .bn-cat span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bottom-nav .bn-cat.active,
  .bottom-nav .bn-cats .bn-item.account.active { color: var(--primary-d); }
  .bottom-nav .bn-cat.active .ic { transform: translateY(-1px); }
  .bottom-nav .bn-cat.active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 2px; border-radius: 0 0 2px 2px; background: var(--primary);
  }
  .bottom-nav .bn-cat:active,
  .bottom-nav .bn-cats .bn-item.account:active { background: var(--primary-tint); }

  /* 团单弹窗：手机端全屏覆盖，不溢出 */
  #goModal .modal.go-modal { max-width: 96vw; width: 96vw; padding: 0; border-radius: 14px; max-height: 96vh; display: flex; flex-direction: column; }
  #goModal .go-modal-body { overflow-y: auto; flex: 1; }
  #goModal .go-modal-body .row { flex-direction: row; gap: 8px; }

  /* 通用：手机端 .card 里跨多列的 .row 全部竖向堆叠，避免挤压溢出 */
  .card .row { flex-direction: column; gap: 8px; }
  .card .row > .field { width: 100%; min-width: 0; }
  .card .row > .btn, .card .row > .actions { width: auto; margin-top: 4px; }
  .card .row > .btn { padding: 11px 14px; }
  /* 调拨表单保持水平 */
  #tfFormCard .row { flex-direction: row; }

}

@media (max-width: 560px) {
  .perf-today { grid-template-columns: 1fr; }
  /* 报损页：手机端业绩卡收到表单下方 */
  .report-layout { flex-direction: column; }
  .perf-side { width: 100%; flex: none; position: static; }
  .rep-rank { grid-template-columns: 1fr; }
  .rep-grid-wrap { font-size: 11px; }
  .login-card { padding: 28px 22px 24px; }
  .login-logo { width: 100px; height: 100px; }
  .login-card h1 { font-size: 20px; }
  /* 快捷报损：手机端芯片更紧凑 */
  .quick-loss { padding: 8px 10px; }
  .quick-loss-grid { gap: 6px; }
  .quick-chip { padding: 5px 10px; font-size: 12px; }
  .quick-chip .qc-name { max-width: 80px; }
  .err-modal { padding: 28px 22px 24px; }
  .err-icon { width: 64px; height: 64px; font-size: 36px; }
  .err-title { font-size: 18px; }
  .err-actions .btn-primary { min-width: 120px; padding: 11px 20px; }
  /* 超窄屏：统计值再缩一点，确保两列不溢出 */
  .stat-box { padding: 11px 12px; }
  .stat-box .v { font-size: 19px; }
  .stat-box .k { font-size: 11.5px; margin-bottom: 6px; }
}

/* ===== 门店端：报损页“申请新增物料”细小按钮 ===== */
.matreq-link {
  align-self: center; margin-left: 4px; padding: 0; border: none; background: none;
  color: var(--muted); font-size: 11px; text-decoration: underline dotted; cursor: pointer;
  line-height: 1; white-space: nowrap;
}
.matreq-link:hover { color: var(--primary-d); }

/* ===== 总部侧栏：待审核数量徽标 ===== */
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
/* 注册审核卡片 */
.reg-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; background: #fff;
}
.reg-card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===== 小号静音文字（表格内补充信息） ===== */
.muted-sm { color: var(--muted); font-size: 11px; margin-left: 4px; }

/* ===== 物料审核弹窗：申请信息卡片 ===== */
.mrqv-meta {
  background: var(--primary-tint); border: 1px solid var(--accent-soft);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px;
}
.mrqv-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.mrqv-row span { color: var(--muted); flex: none; min-width: 56px; }
.mrqv-row b { color: var(--ink); font-weight: 600; word-break: break-all; }

/* ===== 团单记录：标签 / 卡片 / 汇总 ===== */
.tag-revisit { background: #e7f0ff; color: #2f6df6; }
.tag-company { background: #f0e9ff; color: #7b3fd6; }
.go-tel { color: var(--primary); font-weight: 600; text-decoration: none; }
.go-tel:hover { text-decoration: underline; }

.go-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  margin-bottom: 12px; background: #fff;
}
.go-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.go-date { font-weight: 700; font-size: 14px; }
.go-actions { margin-left: auto; display: flex; gap: 6px; }
.go-card-body { display: flex; flex-direction: column; gap: 2px; }
.go-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; border-bottom: 1px dashed rgba(140,150,160,.25); }
.go-row span { color: var(--muted); flex: none; }
.go-row b { text-align: right; word-break: break-all; font-weight: 600; }
@media (max-width: 600px) {
  .go-card-body { gap: 4px; }
  .go-row { flex-direction: column; gap: 1px; padding: 4px 0; }
  .go-row span { font-size: 11px; }
  .go-row b { text-align: left; font-size: 13px; }
}

.go-summary { display: flex; flex-wrap: wrap; gap: 10px; }
.go-kpi {
  background: var(--primary-tint); border: 1px solid var(--accent-soft);
  border-radius: 12px; padding: 8px 14px; min-width: 120px;
}
.go-kpi span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.go-kpi b { font-size: 16px; color: var(--ink); }

/* ===== 开发者模式：储存空间按月清除超链接 ===== */
.dev-clear {
  color: var(--primary); text-decoration: none; font-weight: 600;
  border-bottom: 1px dashed var(--primary); cursor: pointer;
}
.dev-clear:hover { color: var(--red); border-bottom-color: var(--red); }

/* ===== 门店管理：关联账号数超链接 / 美团序列号 ===== */
a.link {
  color: var(--primary); font-weight: 600; text-decoration: none;
  border-bottom: 1px dashed var(--primary); cursor: pointer;
}
a.link:hover { color: var(--red); border-bottom-color: var(--red); }
.sn, .ss-sn {
  font-size: 11px; color: var(--muted); font-weight: 500;
  background: rgba(120,130,150,.14); padding: 1px 6px; border-radius: 6px;
}
.ss-sn { display: block; font-style: normal; margin-top: 2px; }

/* ===== 账号批量权限 ===== */
.batch-bar {
  display: flex; align-items: center; gap: 12px;
  background: rgba(120,130,150,.12); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 10px; font-size: 13px;
}
.batch-bar b { color: var(--primary); }
.acc-sel-cell { width: 36px; text-align: center; }

/* ============================================================
   临期物料管理
   ============================================================ */
.ex-item { padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; border: 1px solid var(--line); background: #fff; }
.ex-item.ex-expired { border-left: 4px solid #e5484d; background: #fef2f2; }
.ex-item.ex-warn { border-left: 4px solid #ff8a00; }
.ex-item.ex-soon { border-left: 4px solid #f59e0b; }
.ex-item.ex-safe { border-left: 4px solid #15a06b; }
.ex-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ex-head b { font-size: 15px; }
.ex-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.ex-expired .ex-badge { background: #e5484d; color: #fff; }
.ex-warn .ex-badge { background: #ff8a00; color: #fff; }
.ex-soon .ex-badge { background: #f59e0b; color: #fff; }
.ex-safe .ex-badge { background: #15a06b; color: #fff; }
.ex-body { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.ex-actions { display: flex; gap: 8px; }

/* ============================================================
   临期登记表单
   ============================================================ */
.expiry-form { display: flex; flex-direction: column; gap: 10px; }
.ef-row1 { display: flex; gap: 10px; flex-wrap: wrap; }
.ef-row2 { display: flex; gap: 10px; align-items: flex-end; }
.ef-name { flex: 2; min-width: 140px; }
.ef-qty { width: 80px; }
.ef-date { width: 150px; }
.ef-note { flex: 1; min-width: 100px; }
.ef-btn { height: 40px; flex: none; padding: 0 20px; white-space: nowrap; }

/* ============================================================
   总部看板
   ============================================================ */
.db-brand-cards {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px;
}
.db-brand-card {
  flex: 1 1 200px; min-width: 180px;
  background: #fff; border-radius: 16px; padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.dbc-head {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px;
}
.dbc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dbc-amt { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: 0.5px; }
.dbc-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dbc-sub b { font-weight: 700; }

.db-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.db-chart-card, .db-top-card { padding: 16px 18px; }
.db-chart-card h3, .db-top-card h3, .db-alert-card h3 { margin: 0 0 12px; font-size: 15px; }

.db-chart {
  display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 4px;
}
.db-bar-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end;
}
.db-bar {
  width: 100%; max-width: 48px; background: linear-gradient(180deg, #ff5a1f 0%, #ff8a3d 100%);
  border-radius: 6px 6px 0 0; min-height: 4px; transition: .3s;
}
.db-bar:hover { opacity: .8; }
.db-bar-val {
  font-size: 10px; color: var(--muted); margin-bottom: 4px; white-space: nowrap;
}
.db-bar-date {
  font-size: 10px; color: var(--muted); margin-top: 6px; white-space: nowrap;
}

.db-alert-card { background: linear-gradient(135deg, #fef2f2, #fff); border: 1px solid #fecaca; }

/* 看板移动端适配 */
@media (max-width: 768px) {
  .db-grid { grid-template-columns: 1fr; }
  .db-brand-cards { flex-direction: column; }
  .db-brand-card { min-width: 0; }
  .db-chart { height: 140px; gap: 4px; }
}

/* ============================================================
   报损原因分布条形图
   ============================================================ */
.reason-bar { padding: 4px 0; }
.rc-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.rc-label { width: 80px; flex-shrink: 0; font-weight: 600; color: var(--text-2); text-align: right; }
.rc-bar-wrap { flex: 1; height: 22px; background: var(--primary-tint); border-radius: 4px; overflow: hidden; }
.rc-bar { height: 100%; background: var(--primary); border-radius: 4px; min-width: 4px; transition: .4s; }
.rc-amt { width: 100px; flex-shrink: 0; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.acc-sel-cell input, #accTable thead input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ===== 团单弹窗 ===== */
.go-modal { max-width: 420px; }
body.has-bottom-nav .sidebar{display:none!important}
body.has-bottom-nav .main{width:100%;max-width:100%;padding:14px;padding-bottom:var(--nav-h,88px)}
/* 软键盘唤起：导航栏钉在底部不动，键盘以浮层覆盖它；
   .main 额外预留 --kb-h，使内容能滚到键盘之上，导航栏与键盘之间不留白 */
body.kb-open.has-bottom-nav .main{padding-bottom:calc(var(--nav-h,88px) + var(--kb-h,0px))}

/* ===== 报损提交完成反馈（舒适、中性、不夸赞） ===== */
.loss-done-mask{position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;background:rgba(18,16,14,.40);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:opacity .22s ease}
.loss-done-mask.show{opacity:1;pointer-events:auto}
.loss-done-card{width:78%;max-width:320px;background:#fff;border-radius:22px;padding:30px 24px 22px;text-align:center;box-shadow:0 20px 54px rgba(0,0,0,.24);transform:translateY(14px) scale(.95);transition:transform .3s cubic-bezier(.2,.85,.25,1)}
.loss-done-mask.show .loss-done-card{transform:none}
.loss-done-check{width:66px;height:66px;margin:0 auto 14px;display:block}
.loss-done-check .ldc-circle{stroke:#2e9e5b;stroke-width:4;fill:none;stroke-dasharray:176;stroke-dashoffset:176;animation:ldcDraw .5s .08s ease forwards}
.loss-done-check .ldc-check{stroke:#2e9e5b;stroke-width:5;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:48;stroke-dashoffset:48;animation:ldcDraw .35s .52s ease forwards}
@keyframes ldcDraw{to{stroke-dashoffset:0}}
.loss-done-title{font-size:17px;font-weight:800;color:#2a2520;margin-bottom:6px}
.loss-done-sub{font-size:13px;color:var(--muted);margin-bottom:20px;line-height:1.5}
.loss-done-btn{width:100%}

/* ===== 门店手机版：底部导航为主 ===== */
body.has-bottom-nav .topbar { height: calc(48px + var(--safe-top)); padding: var(--safe-top) 10px 0; }
body.has-bottom-nav .topbar .logo img { height: 28px; }
body.has-bottom-nav .topbar .logo span { display: none; }
body.has-bottom-nav .topbar .who { display: none; }
body.has-bottom-nav .topbar .btn.btn-sm { height: 32px; min-width: 32px; padding: 0 8px; font-size: 12px; }
body.has-bottom-nav .layout { padding-bottom: 0; }
/* 手机端：约束布局高度，main 作为独立滚动容器，避免 48px 顶栏遮挡页面头部、整页异常滚动 */
@media (max-width: 820px) {
  body.has-bottom-nav .layout {
    min-height: 0;
    height: calc(100vh - 48px);
    height: calc(var(--app-h, 100vh) - 48px - var(--safe-top));
    overflow: hidden;
  }
  body.has-bottom-nav .main {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
body.has-bottom-nav .bottom-nav .bn-cat { min-height: 50px; gap: 2px; }
body.has-bottom-nav .bottom-nav .bn-cat .ic { font-size: 21px; }
body.has-bottom-nav .bottom-nav .bn-cat span { font-size: 11px; }

/* ===== 门店手机版：全局排版统一 ===== */
body.has-bottom-nav input,
body.has-bottom-nav select,
body.has-bottom-nav textarea { font-size: 16px !important; height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; width: 100%; box-sizing: border-box; }
body.has-bottom-nav select { -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%237a7870' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
body.has-bottom-nav textarea { height: auto; min-height: 80px; }
body.has-bottom-nav .field { margin-bottom: 10px; }
body.has-bottom-nav .field label { font-size: 13px; margin-bottom: 4px; }
body.has-bottom-nav .card { padding: 14px; border-radius: 14px; margin-bottom: 12px; }
body.has-bottom-nav .page-title { font-size: 20px; margin: 0 0 4px; }
body.has-bottom-nav .sub { font-size: 12px; margin-bottom: 12px; }
body.has-bottom-nav .btn { height: 44px; font-size: 15px; padding: 0 20px; border-radius: 12px; min-width: 60px; }
body.has-bottom-nav .btn-sm { height: 36px; font-size: 13px; padding: 0 12px; }
body.has-bottom-nav table { font-size: 13px; }
body.has-bottom-nav th, body.has-bottom-nav td { padding: 8px 8px; }
body.has-bottom-nav .row { flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
body.has-bottom-nav .row > .field { flex: 1; min-width: 0; }
body.has-bottom-nav .card .row { flex-direction: row; flex-wrap: wrap; gap: 8px; }

/* 调拨导出：手机端不换行 */
#page-transfer .row.export-row { flex-wrap: nowrap; }
/* 团单弹窗：手机端自适应 */
.go-modal { max-width: 96vw; width: 96vw; max-height: 90vh; overflow-y: auto; border-radius: 14px; padding: 16px !important; }
.go-modal .field { margin-bottom: 8px; }
.go-modal .field label { font-size: 12px; }
.go-modal h3 { font-size: 16px; }
.go-modal .btn { height: 40px; font-size: 14px; }
.go-modal .actions { gap: 8px; }

/* go-modal 紧凑布局 */
.go-modal { max-width: 96vw; width: 96vw; max-height: 80vh !important; border-radius: 14px; padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; }
.go-modal .go-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.go-modal .go-head h3 { font-size: 15px; margin: 0; }
.go-modal .go-body { padding: 12px; overflow-y: auto; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
.go-modal .go-foot { padding: 8px 12px; border-top: 1px solid var(--line); flex-shrink: 0; }
.go-modal .field { margin-bottom: 8px; }
.go-modal .field label { font-size: 11px; margin-bottom: 3px; }
.go-modal input, .go-modal select { height: 36px !important; font-size: 14px; padding: 6px 10px; }
.go-modal .row { gap: 8px !important; }
.go-modal .row .field { width: 100%; flex: none !important; }
.go-modal .btn { height: 38px; font-size: 14px; }
@media (min-width: 768px) {
  .go-modal { max-width: 480px; }
  .go-modal .row .field { flex: 1 !important; width: auto; }
}
.go-modal{max-width:92vw!important;width:92vw!important;max-height:70vh!important}.go-modal .go-head{padding:8px 10px}.go-modal .go-head h3{font-size:14px}.go-modal .go-body{padding:10px}.go-modal input,.go-modal select{height:32px!important;font-size:13px;padding:4px 8px}.go-modal .field{margin-bottom:6px}.go-modal .field label{font-size:10px;margin-bottom:2px}.go-modal .btn{height:36px;font-size:13px}.go-modal .go-foot{padding:7px 10px}@media(min-width:768px){.go-modal{max-width:380px}}

/* ===== iOS 添加到主屏幕引导 ===== */
.ios-tip {
  margin-top: 16px; text-align: center; font-size: 12px; color: var(--muted);
  padding: 8px 14px; background: rgba(255,255,255,0.5); border-radius: 10px;
  border: 1px dashed var(--line); cursor: pointer; transition: .2s;
  display: none; /* 默认隐藏，JS 检测到 iOS 才显示 */
}
.ios-tip:hover { background: var(--primary-tint); border-color: var(--primary); }
.ios-tip-detail {
  display: none; font-size: 11px; color: var(--muted); line-height: 1.6;
  margin-top: 6px; padding: 6px 10px; background: #fff; border-radius: 8px; text-align: left;
}

/* ===== 移动端：禁止页面缩放 ===== */
/* 1) 双击/双指缩放关闭，但保留正常滚动；横向滑动仍可 */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
/* 2) iOS 在输入框 font-size < 16px 时会自动放大整页；统一抬到 16px 关闭该行为 */
input, textarea, select { font-size: 16px !important; }
/* 数字类输入统一唤起数字键盘（整数用 numeric，金额用 decimal） */
input[type="number"] { inputmode: decimal; }

/* ===== 总部日报看板（排行榜 + 异常） ===== */
.board-head { font-size: 14px; font-weight: 700; color: var(--text); margin: 4px 2px 12px; }
.board-sec { margin-bottom: 14px; }
.board-sec-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.board-bars { display: flex; flex-direction: column; gap: 8px; }
.bb-row { display: grid; grid-template-columns: 22px minmax(110px, 1.6fr) 2fr auto; align-items: center; gap: 8px; }
.bb-rank { width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: var(--primary-tint); color: var(--primary-d); font-size: 12px; font-weight: 800; }
.bb-name { font-size: 13px; color: var(--text); line-height: 1.3; word-break: break-all; }
.bb-bar-wrap { background: #f0eee8; border-radius: 999px; height: 12px; overflow: hidden; }
.bb-bar { display: block; height: 100%; border-radius: 999px; transition: width .3s ease; }
.bb-val { font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bb-na { color: var(--muted); font-weight: 600; }

.board-anomaly .anomaly-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.anomaly-col { background: #fff7f6; border: 1px solid #f4d4d0; border-radius: 10px; padding: 8px 10px; }
.anomaly-h { font-size: 12.5px; font-weight: 700; color: #c0392b; margin-bottom: 6px; }
.anomaly-item { font-size: 12.5px; color: var(--text); padding: 3px 0; line-height: 1.4; }
.anomaly-sub { color: var(--muted); font-weight: 600; margin-left: 4px; }
.anomaly-empty { font-size: 12.5px; color: #15a06b; padding: 3px 0; }

@media (max-width: 560px) {
  .board-anomaly .anomaly-cols { grid-template-columns: 1fr; }
}

/* ===== 首页看板 KPI 条与待办 ===== */
.db-kpi-strip { display: flex; gap: 10px; margin: 12px 0; padding: 12px 14px; }
.dk-item { flex: 1; text-align: center; }
.dk-label { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.dk-val { font-size: 20px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.todo-item { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 0; color: var(--text); }
.todo-item b { margin-left: auto; color: #e5484d; }
