:root {
  /* 中性 */
  --bg: #f6f7fb;
  --bg-2: #eef0f7;
  --panel: rgba(255, 255, 255, 0.78);
  --ink: #1e2233;
  --ink-2: #4a5068;
  --ink-soft: #8a90a6;
  --line: #e6e8ec;
  --line-2: #f2f4f9;

  /* 品牌主色（水蓝 · 玻璃质感） */
  --brand: #0ea5e9;
  --brand-2: #38bdf8;
  --brand-soft: #e0f2fe;
  --brand-ink: #0369a1;
  --brand-grad: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);

  /* 语义强调色（图标底 / 文字 / 柔底 三件套） */
  --c-blue: #3b82f6;  --c-blue-soft: #eaf2ff;
  --c-green: #10b981; --c-green-soft: #e7f8f1;
  --c-purple: #8b5cf6;--c-purple-soft: #f1ecfe;
  --c-pink: #ec4899;  --c-pink-soft: #fdeaf4;
  --c-red: #ef4444;   --c-red-soft: #fdecec;
  --c-amber: #f59e0b; --c-amber-soft: #fef4e6;
  --c-teal: #14b8a6; --c-teal-soft: #e6f7f5;

  /* 兼容旧引用 */
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  /* 圆角 */
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;
  --radius: 14px;

  /* 多层柔影 */
  --sh-1: 0 1px 2px rgba(20, 24, 40, 0.04), 0 2px 6px rgba(20, 24, 40, 0.04);
  --sh-2: 0 4px 14px rgba(20, 24, 40, 0.06), 0 10px 30px rgba(20, 24, 40, 0.05);
  --sh-3: 0 8px 24px rgba(14, 165, 233, 0.18), 0 14px 40px rgba(14, 165, 233, 0.12);
  --sh-h: 0 6px 18px rgba(20, 24, 40, 0.1), 0 16px 40px rgba(20, 24, 40, 0.1);
  --shadow: var(--sh-2);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(165deg, #eef6ff 0%, #f4f9ff 50%, #eafaf7 100%);
  color: var(--ink);
  font-size: 14px;
}

/* ---------- 登录 ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #fff1e6 0%, #f5f6f8 60%);
}
.login-card {
  width: 380px;
  background: var(--panel);
  border-radius: 22px;
  box-shadow: var(--sh-2);
  padding: 38px 34px 34px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.login-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--brand-grad); }
/* 自动登录恢复会话时，淡化并锁定表单，避免闪现输入框 */
.login-card.is-restoring form { opacity: 0.25; pointer-events: none; transition: opacity 0.15s; }
.login-logo { line-height: 0; margin-bottom: 6px; }
.login-logo img { width: 180px; max-width: 70%; height: auto; display: block; margin: 0 auto; }
.login-title { margin: 8px 0 2px; font-size: 22px; }
.login-sub { margin: 0 0 24px; color: var(--ink-soft); letter-spacing: 1px; font-size: 12px; }
.field { display: block; text-align: left; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 13px; }
.field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.login-error { color: var(--danger); font-size: 13px; margin: 4px 0 0; }
.login-foot { margin-top: 18px; color: var(--ink-soft); font-size: 12px; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 250px; max-width: 82vw;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(14, 165, 233, 0.16);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  overflow: hidden;
  /* 全尺寸均使用左侧折叠抽屉：默认收起，点击左上角 ≡ 展开；悬浮胶囊玻璃面板 */
  position: fixed; top: 14px; left: 26px; bottom: 14px; z-index: 380;
  transform: translateX(calc(-100% - 60px));
  transition: transform .22s ease;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(20, 24, 40, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
.sidebar.open { transform: translateX(0); }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px 14px; }
.brand-logo { line-height: 0; flex: 0 0 auto; }
.brand-logo img { height: 34px; width: auto; display: block; }
.brand-name { font-weight: 700; line-height: 1.2; font-size: 14px; text-align: center; }
.brand-name span { font-size: 12px; color: var(--ink-soft); font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: clip; overscroll-behavior: contain; }
.nav-item {
  text-align: left;
  border: none;
  background: transparent;
  padding: 11px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.nav-ai {
  padding: 11px 12px; overflow: visible; position: relative;
  text-align: left;
}
.nav-ai:hover { background: rgba(59,130,246,.08); }
.nav-ai.active { background: var(--brand-soft); }

/* ── AI 智能助手图标（文字右侧出发 → 随机跳到右边 → 回到文字旁）── */
.ai-icon {
  position: absolute;
  left: 62px; top: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  transition: left .35s cubic-bezier(.34,1.56,.64,1), transform .35s cubic-bezier(.34,1.56,.64,1);
  transform: translateY(-50%) rotate(0deg);
  /* 3 层动画叠加：水平移动(left) + 纵向跳跃(translateY) + 旋转 */
  animation:
    aiWander1 5.1s cubic-bezier(.4,0,.2,1) infinite,
    aiWander2 3.8s cubic-bezier(.4,0,.2,1) infinite .8s,
    aiWander3 6.3s cubic-bezier(.4,0,.2,1) infinite 1.6s;
}
.nav-ai:hover .ai-icon {
  filter: drop-shadow(0 0 8px rgba(59,130,246,.5));
}
.nav-ai.active .ai-icon { filter: drop-shadow(0 0 6px rgba(59,130,246,.4)); }

/* 文字标签 — 与一级菜单完全一致 */
.ai-label {
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  transition: color .2s;
  line-height: 1;
}
.nav-ai:hover .ai-label { color: #2563eb; }
.nav-ai.active .ai-label { color: #2563eb; font-weight: 700; }

/* 三层动画：文字旁(62px) ↔ 右边(175px) 往返 + 跳跃 + 旋转 */
@keyframes aiWander1 {
  0%, 100%  { left: 62px; transform: translateY(-50%) rotate(0deg); }
  25%       { left: 175px; transform: translateY(-62%) rotate(12deg); }
  45%       { left: 100px; transform: translateY(-40%) rotate(-6deg); }
  70%       { left: 160px; transform: translateY(-56%) rotate(8deg); }
  85%       { left: 72px; transform: translateY(-44%) rotate(-4deg); }
}
@keyframes aiWander2 {
  0%, 100%  { left: 62px; transform: translateY(-50%) rotate(0deg); }
  30%       { left: 150px; transform: translateY(-58%) rotate(-10deg); }
  55%       { left: 80px; transform: translateY(-42%) rotate(5deg); }
  80%       { left: 170px; transform: translateY(-54%) rotate(-8deg); }
}
@keyframes aiWander3 {
  0%, 100%  { left: 62px; transform: translateY(-50%) rotate(0deg); }
  20%       { left: 130px; transform: translateY(-60%) rotate(7deg); }
  50%       { left: 175px; transform: translateY(-48%) rotate(-12deg); }
  70%       { left: 90px; transform: translateY(-46%) rotate(4deg); }
  90%       { left: 165px; transform: translateY(-55%) rotate(-6deg); }
}

/* 旋转轨道环 */
.ai-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: #3b82f6;
  border-right-color: #60a5fa;
  animation: ringSpin 3s linear infinite;
  box-shadow: 0 0 6px rgba(59,130,246,.15), inset 0 0 6px rgba(59,130,246,.06);
  opacity: 0.7;
}
.ai-ring--2 {
  inset: -4px;
  border-width: 1px;
  border-top-color: #8b5cf6;
  border-right-color: #a78bfa;
  animation: ringSpin 4s linear infinite reverse;
  opacity: 0.5;
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

/* 核心 — 渐变圆底 "AI" 字 */
.ai-core {
  position: relative; z-index: 2;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 40% 35%, #60a5fa, #2563eb 80%);
  border-radius: 50%;
  color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 0.3px;
  box-shadow: 0 2px 10px rgba(37,99,235,.4), 0 0 0 2px rgba(147,197,253,.25);
  animation: corePulse 2.5s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(37,99,235,.4), 0 0 0 2px rgba(147,197,253,.25); }
  50% { box-shadow: 0 2px 16px rgba(37,99,235,.55), 0 0 0 4px rgba(147,197,253,.15); }
}

/* 星光粒子 */
.ai-spark {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #93c5fd;
  box-shadow: 0 0 4px #60a5fa, 0 0 8px rgba(59,130,246,.5);
  animation: sparkFlicker 2s ease-in-out infinite;
  z-index: 3;
}
.ai-spark--1 { top: -1px; left: 14px; animation-delay: 0s; }
.ai-spark--2 { top: 14px; right: -1px; animation-delay: .5s; }
.ai-spark--3 { bottom: -1px; left: 14px; animation-delay: 1s; }
.ai-spark--4 { top: 14px; left: -1px; animation-delay: 1.5s; }

@keyframes sparkFlicker {
  0%, 100% { opacity: 0; transform: scale(0.3); }
  20% { opacity: 1; transform: scale(1.2); }
  40% { opacity: 0.5; transform: scale(0.8); }
  60% { opacity: 0; transform: scale(0.3); }
}

/* 对话泡泡 — 定时冒出 */
.ai-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #f1f5f9;
  font-size: 11px; font-weight: 500;
  padding: 5px 10px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,.15);
  z-index: 10;
}
.ai-bubble::before {
  content: '';
  position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  border-bottom: none;
}

/* 泡泡出现动画 — 每 8 秒出现一次，持续 2 秒 */
.ai-bubble {
  animation: bubblePop 8s ease-in-out infinite;
}
@keyframes bubblePop {
  0%, 85%, 100% { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.9); }
  88% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  95% { opacity: 1; transform: translateX(-50%) translateY(-2px) scale(1.02); }
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; position: relative; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--brand-grad); }
.nav-parent { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-parent .nav-label { flex: 1; }
.nav-parent .caret { transition: transform .2s ease; opacity: .55; flex-shrink: 0; }
.nav-parent:hover .caret { opacity: .9; }
.nav-parent.collapsed .caret { transform: rotate(-90deg); }
.nav-group { display: flex; flex-direction: column; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 2px 14px; padding-left: 12px; border-left: 2px solid var(--line); }
.nav-sub[hidden] { display: none !important; }
.nav-subitem {
  text-align: left; border: none; background: transparent;
  padding: 9px 14px; border-radius: var(--r-pill); font-size: 13.5px; color: var(--ink-soft);
  cursor: pointer; transition: all .15s;
}
.nav-subitem:hover { background: var(--bg); color: var(--ink); }
.nav-subitem.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; position: relative; }
.nav-subitem.active::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--brand-grad); }
/* 三级菜单：门店管理 → 配送汇报 →（配送日报 / 配送月报） */
.nav-subparent {
  text-align: left; border: none; background: transparent;
  padding: 9px 14px; border-radius: var(--r-pill); font-size: 13.5px; color: var(--ink-soft);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.nav-subparent:hover { background: var(--bg); color: var(--ink); }
#sub-deliveryreport { margin-left: 12px; margin-top: 0; }

.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(14, 165, 233, 0.14); padding-top: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.user-chip { min-width: 0; }
.user-meta { text-align: left; min-width: 0; }
.foot-actions { display: flex; align-items: flex-end; gap: 14px; }
.power-btn {
  flex: 0 0 auto; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 1px solid rgba(14, 165, 233, 0.16); border-radius: 50%;
  background: rgba(255, 255, 255, 0.5); color: var(--ink-soft); cursor: pointer;
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}
.power-btn:hover { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 12px rgba(14, 165, 233, .28); }
.power-btn:active { transform: scale(.94); }
.power-btn.active { color: #fff; background: var(--brand); border-color: var(--brand); }
.power-btn svg { width: 18px; height: 18px; display: block; }
.user-name { font-weight: 600; font-size: 13px; text-align: left; }
.user-role { color: var(--ink-soft); font-size: 12px; text-align: left; }

/* ---------- 设置页（原「基础信息」一级菜单） ---------- */
.settings-page { max-width: 760px; margin: 0 auto; }
.settings-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--sh-1); overflow: hidden; }
.setting-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; text-align: left; cursor: pointer; transition: background .15s; }
.setting-row:last-child { border-bottom: 0; }
.setting-row:hover { background: var(--brand-soft); }
.setting-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--brand-soft); }
.setting-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.setting-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.setting-desc { font-size: 12.5px; color: var(--ink-soft); }
.setting-caret { color: var(--ink-soft); font-size: 22px; line-height: 1; flex: 0 0 auto; }

.content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; /* 顶部悬浮胶囊同底部备案条：直接浮于内容之上，不占位 */ }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 26px 0;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(14, 165, 233, 0.16);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(20, 24, 40, .06), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.topbar-row {
  position: fixed; top: 14px; left: 26px; right: 26px; z-index: 300;
  display: flex; align-items: center; gap: 8px;
}
/* 标题小胶囊：只包住标题文字（含副标题），不再通栏 */
.topbar-row .topbar {
  flex: 0 0 auto; width: fit-content; max-width: 100%; min-width: 0; margin: 0;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(14, 165, 233, 0.16);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(20, 24, 40, .06), inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
/* 顶部按钮组：独立胶囊，靠右悬浮 */
.topbar-row .topbar-actions { margin-left: auto; }
.topbar h2 { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.menu-btn {
  display: flex; align-items: center; justify-content: center;
  width: auto; height: auto; aspect-ratio: 1; flex: 0 0 auto;
  border: 1px solid rgba(14, 165, 233, 0.16); background: rgba(255, 255, 255, 0.5); color: var(--ink);
  border-radius: 999px; font-size: 15px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 16px rgba(20, 24, 40, .06), inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
.menu-btn:hover { background: rgba(255, 255, 255, .75); }
.menu-btn:active { background: var(--bg); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 350; }
.sidebar-backdrop.show { display: block; }
.topbar-actions { display: flex; gap: 8px; align-items: center; min-height: 30px; }
/* 胶囊条内控件整体缩小 */
.topbar-actions .btn { padding: 5px 13px; font-size: 13px; border-radius: 999px; }
.topbar-actions .btn-icon-blue { width: 30px; height: 30px; border-radius: 999px; }
.topbar-actions .topbar-search { padding: 7px 32px 7px 34px; font-size: 13px; }

.view { padding: 46px 26px 62px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; /* 底部 62px：为悬浮备案胶囊（高约31px+bottom14px）留位，同顶部胶囊处理方式 */ }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: #d3d6db; background: var(--bg-2); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-primary { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 700; box-shadow: var(--sh-3); transition: all .15s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(14, 165, 233, .28); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 8px; }
.btn-xs.btn-ghost { color: var(--brand); border-color: #eceef2; background: transparent; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: #f3c6c6; }
.btn-danger:hover { background: #fef2f2; }

/* ---------- 看板 ---------- */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
.board-col {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  display: flex; flex-direction: column; min-height: 120px;
  box-shadow: var(--sh-1); transition: box-shadow .18s;
}
.board-col:hover { box-shadow: var(--sh-2); }
.board-col-head {
  padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.board-col-head .count { background: var(--bg); color: var(--ink-soft); border-radius: 20px; padding: 1px 9px; font-size: 12px; }
.board-col-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 14px; cursor: pointer; transition: box-shadow .18s, transform .12s;
  box-shadow: var(--sh-1);
}
.card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.card:active { transform: translateY(0); }
.card-title { font-weight: 600; margin-bottom: 8px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--bg-2); color: var(--ink-soft); font-weight: 600; }
/* 语义徽章（文字 + 颜色双编码，色盲可读） */
.b-orange { background: var(--c-amber-soft); color: #b45309; }
.b-blue { background: var(--c-blue-soft); color: #1d4ed8; }
.b-green { background: var(--c-green-soft); color: #047857; }
.b-purple { background: var(--c-purple-soft); color: #6d28d9; }
.b-pink { background: var(--c-pink-soft); color: #be185d; }
.b-red { background: var(--c-red-soft); color: #b91c1c; }
.b-gray { background: var(--bg-2); color: var(--ink-soft); }
.badge.p-高 { background: #fde8e8; color: var(--danger); }
.badge.p-中 { background: #fff4e0; color: var(--warn); }
.badge.p-低 { background: #e7f6ee; color: var(--ok); }
.badge.badge-danger { background: #fde8e8; color: var(--danger); font-weight: 600; }
.badge.badge-overdue { background: #fde8e8; color: var(--danger); font-weight: 600; }
.badge.badge-today { background: #fff4e0; color: var(--warn); font-weight: 600; }
.badge.badge-near { background: #e7f0ff; color: var(--brand); font-weight: 600; }
.file-link { color: var(--brand); text-decoration: underline; font-weight: 600; cursor: pointer; }
.file-link:hover { opacity: .8; }
.form-file-exist { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; padding: 8px 10px; font-size: 13px; color: var(--ink-soft); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; }
.form-file-exist a { color: var(--brand); font-weight: 600; }
.form-file-exist .ffe-label { flex-shrink: 0; }
.form-file-exist .ffe-remove { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--danger); cursor: pointer; white-space: nowrap; }
.form-file-exist .ffe-remove input { width: auto; margin: 0; }
.form-file-hint { margin-top: 6px; font-size: 12px; color: var(--ink-soft); }
/* 图片上传（主图/详情图）：缩略图网格 + 逐张删除 */
.form-img-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.form-img-cell { display: flex; flex-direction: column; gap: 4px; width: 88px; }
.form-img-cell img { width: 88px; height: 88px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #f5f6f7; }
.form-img-cell .ffe-remove { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--danger); cursor: pointer; }
.form-img-cell .ffe-remove input { width: auto; margin: 0; }
/* 附件预览弹窗：图片自适应，PDF 用 iframe 撑满 */
.modal--preview { width: 900px; max-width: 94vw; height: 86vh; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.preview-head-actions { display: flex; align-items: center; gap: 10px; }
.preview-body { flex: 1; min-height: 0; padding: 16px; overflow: auto; background: #f4f5f8; display: flex; align-items: center; justify-content: center; }
.preview-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 4px 20px rgba(20,24,40,.14); background: #fff; }
.preview-pdf { width: 100%; height: 100%; border: none; border-radius: 8px; background: #fff; }
.preview-none { color: var(--ink-soft); font-size: 14px; }
.tbl td.muted { color: var(--ink-soft); }
.view-subtitle { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.card-progress { height: 6px; background: var(--bg); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.card-progress > i { display: block; height: 100%; background: var(--brand); }
.card-due { font-size: 12px; color: var(--ink-soft); margin-top: 8px; }
.card-due.overdue { color: var(--danger); font-weight: 600; }
.empty {
  color: var(--ink-soft); font-size: 13px; text-align: center; padding: 36px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty::before { content: "\1F4ED"; font-size: 28px; opacity: .7; }

/* ---------- 占位视图（功能建设中） ---------- */
.placeholder-view { display: flex; justify-content: center; padding: 64px 16px; }
.placeholder-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 48px 56px; text-align: center; max-width: 420px; }
.placeholder-emoji { font-size: 48px; margin-bottom: 12px; line-height: 1; }
.placeholder-card h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.placeholder-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ---------- 经营月报 ---------- */
.report-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.report-tab { padding: 8px 18px; border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--r-sm); cursor: pointer; font-size: 14px; color: var(--ink-soft); transition: all .18s; }
.report-tab:hover { border-color: var(--brand); color: var(--brand); }
.report-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 经营月报 - 原生报表样式 */
.rpt-wrap { max-width: 1200px; margin: 0 auto; }
.rpt-header { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); color: #fff; padding: 28px 36px; border-radius: 14px; margin-bottom: 20px; position: relative; overflow: hidden; }
.rpt-header h1 { font-size: 26px; font-weight: 700; letter-spacing: 2px; margin: 0 0 4px; }
.rpt-header .rpt-sub { font-size: 13px; opacity: .9; margin-top: 8px; }

.rpt-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.rpt-kpi-card { background: #fff; border-radius: 12px; padding: 18px 22px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.rpt-kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.rpt-kpi-label { font-size: 12px; color: #9ca3af; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.rpt-kpi-value { font-size: 30px; font-weight: 700; line-height: 1; }
.rpt-kpi-value.red { color: #ef4444; }
.rpt-kpi-value.green { color: #10b981; }
.rpt-kpi-value.blue { color: #3b82f6; }
.rpt-kpi-value.orange { color: #f59e0b; }
.rpt-kpi-sub { font-size: 12px; color: #9ca3af; margin-top: 5px; }
.rpt-icon-red { background: #fef2f2; color: #ef4444; }
.rpt-icon-green { background: #ecfdf5; color: #10b981; }
.rpt-icon-blue { background: #eff6ff; color: #3b82f6; }
.rpt-icon-orange { background: #fffbeb; color: #f59e0b; }
.rpt-icon-purple { background: #f5f3ff; color: #8b5cf6; }

.rpt-section { background: #fff; border-radius: 12px; padding: 22px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.rpt-section-title { font-size: 15px; font-weight: 700; color: #1a1a2e; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid #f0f0f0; display: flex; align-items: center; gap: 8px; }
.rpt-section-title::before { content: ''; width: 4px; height: 16px; background: linear-gradient(180deg, #3b82f6, #8b5cf6); border-radius: 2px; }

.rpt-station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.rpt-station-mini { border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; display: flex; align-items: center; gap: 12px; }
.rpt-station-mini:hover { border-color: #3b82f6; }
.rpt-station-name { font-weight: 600; font-size: 13px; color: #1f2937; }
.rpt-station-meta { display: flex; gap: 14px; margin-top: 4px; font-size: 12px; color: #9ca3af; }
.rpt-station-bar { height: 3px; background: #e2e8f0; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.rpt-station-bar-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, #3b82f6, #8b5cf6); }

.rpt-rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; font-size: 11px; flex-shrink: 0; }
.rpt-rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rpt-rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rpt-rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.rpt-rank-other { background: #f1f5f9; color: #94a3b8; }

.rpt-today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rpt-today-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; }
.rpt-today-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; font-size: 13px; font-weight: 700; color: #1e40af; }
.rpt-today-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rpt-today-card thead th { background: #f8fafc; color: #64748b; font-weight: 600; padding: 6px 10px; border-bottom: 1px solid #e2e8f0; font-size: 11px; text-align: left; }
.rpt-today-card tbody td { padding: 6px 10px; border-bottom: 1px solid #f9fafb; color: #374151; }
.rpt-today-card tbody tr:last-child { font-weight: 700; background: #eff6ff; }
.rpt-today-card td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-today-card .rpt-brand-label { font-size: 12px; font-weight: 600; padding: 0; margin: 0; }
.ganten-logo { height: 26px; width: auto; display: block; margin: 2px 0 4px; }

/* 配送月报站点卡片统一表格 */
.rpt-card-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.rpt-card-table td, .rpt-card-table th { padding: 5px 10px; }
.rpt-card-table td.num, .rpt-card-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-card-table .brand-header td { font-size: 12px; font-weight: 600; padding: 6px 10px 4px; }
.rpt-card-table .col-header th { font-weight: 600; font-size: 11px; padding: 4px 10px; text-align: left; }
.rpt-card-table .col-header th.num { text-align: right; }
.rpt-card-table .rpt-subtotal td { font-weight: 700; border-top: 1px solid; }
.rpt-card-table .rpt-summary td { font-weight: 700; border-top: 2px solid #e5e7eb; padding: 7px 10px; background: #fafafa; }
.rpt-card-table tbody tr:last-child { font-weight: initial; background: initial; }

/* 景田 tbody — 蓝色品牌调 */
.brand-ganten td { background: #eff6ff; border-bottom: 1px solid #dbeafe; color: #1e293b; }
.brand-ganten .brand-header td { background: #eff6ff; color: #1e40af; }
.brand-ganten .col-header th { background: #dbeafe; color: #1e40af; border-bottom: 1px solid #93bbfd; }
.brand-ganten .rpt-subtotal td { background: #dbeafe; color: #1e40af; border-top-color: #93bbfd; }

/* 其他品牌 tbody — 暖灰调 */
.brand-other td { background: #f9fafb; border-bottom: 1px solid #f3f4f6; color: #374151; }
.brand-other .brand-header td { background: #f9fafb; color: #6b7280; }
.brand-other .col-header th { background: #f3f4f6; color: #6b7280; border-bottom: 1px solid #e5e7eb; }
.brand-other .rpt-subtotal td { background: #f3f4f6; color: #4b5563; border-top-color: #e5e7eb; }
@media (max-width: 768px) { .rpt-today-grid { grid-template-columns: 1fr; } }

.rpt-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.rpt-bar-label { width: 200px; font-size: 12px; color: #64748b; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
.rpt-bar-track { flex: 1; height: 20px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.rpt-bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; }
.rpt-bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.rpt-bar-fill.orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.rpt-bar-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.rpt-bar-value { width: 160px; text-align: right; font-size: 12px; font-weight: 600; color: #374151; flex-shrink: 0; white-space: nowrap; }

.rpt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rpt-table thead th { background: #f8fafc; color: #64748b; font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 2px solid #e2e8f0; font-size: 12px; }
.rpt-table tbody tr { border-bottom: 1px solid #f1f5f9; }
.rpt-table tbody tr:hover { background: #f8fafc; }
.rpt-table tbody td { padding: 10px 14px; color: #374151; }
.rpt-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-table td.rank { font-weight: 700; width: 50px; }

.rpt-source-bar { display: flex; height: 22px; background: #dbeafe; border-radius: 4px; overflow: hidden; position: relative; }
.rpt-source-xbkc { background: #93c5fd; display: flex; align-items: center; justify-content: center; color: #1e40af; font-size: 11px; font-weight: 600; }
.rpt-source-rest { background: #3b82f6; height: 100%; flex: 1; }
.rpt-source-total { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: #000; font-size: 11px; font-weight: 700; }

.rpt-footer { text-align: center; padding: 16px; color: #9ca3af; font-size: 12px; }
.rpt-loading { text-align: center; padding: 80px 20px; color: #9ca3af; font-size: 16px; }
.rpt-info { font-size: 12px; color: #9ca3af; margin-bottom: 10px; }

/* ICP 备案号：悬浮玻璃胶囊（与顶部长胶囊条同高同风格，固定悬浮最上层） */
.icp-footer {
  display: inline-flex; align-items: center;
  padding: 5px 14px; font-size: 13.5px; flex-shrink: 0;
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 200;
  border-radius: var(--r-pill);
  border: 1px solid rgba(14, 165, 233, 0.16);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(20, 24, 40, .06), inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
.icp-footer a { color: var(--ink-soft); text-decoration: none; }
.icp-footer a:hover { color: var(--ink); }

/* 分页按钮 */
.rpt-page-btn {
  padding: 6px 16px; border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff; color: #374151; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s ease;
}
.rpt-page-btn:hover:not(:disabled) { background: #f3f4f6; border-color: #9ca3af; }
.rpt-page-btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- 今日待办卡片 ---------- */
.todo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.todo-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sh-1); transition: box-shadow .18s, transform .12s; }
.todo-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.todo-card-title { font-size: 15px; font-weight: 600; line-height: 1.4; }
.todo-card-content-text { font-size: 13px; color: var(--ink-2); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.todo-card-meta { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.todo-card-label { flex: 0 0 auto; color: var(--ink-soft); }
.todo-card-due.overdue { color: var(--danger); font-weight: 600; }
.todo-card-actions { margin-top: 2px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.todo-card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.todo-card-row .todo-card-meta { min-width: 0; }
.todo-card > .todo-card-row:last-child { margin-top: auto; }

/* ---------- 门店巡检 · 配置卡片 ---------- */
.rule-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.rule-card { background: var(--panel); border: 1px solid var(--line-2); border-left: 5px solid var(--brand); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--sh-1); transition: box-shadow .18s, transform .12s; }
.rule-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.rule-card.is-off { border-left-color: var(--line-2); background: var(--bg-2); opacity: .78; }
.rule-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rule-card-title { font-size: 15px; font-weight: 600; line-height: 1.4; word-break: break-word; }
.badge.badge-on { background: #e7f6ee; color: var(--ok); }
.badge.badge-off { background: var(--bg-2); color: var(--ink-soft); }
.rule-cycle { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: var(--r-md, 8px); padding: 10px 12px; }
.rule-cycle-ico { font-size: 16px; line-height: 1; }
.rule-cycle-text { font-size: 14px; font-weight: 600; color: var(--brand); }
.rule-card.is-off .rule-cycle-text { color: var(--ink-soft); }
.rule-fields { display: flex; flex-direction: column; gap: 6px; }
.rule-field { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.rule-k { flex: 0 0 62px; color: var(--ink-soft); }
.rule-v { color: var(--ink-2); word-break: break-word; }
.rule-remark { font-size: 12px; color: var(--ink-soft); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.rule-card-actions { margin-top: auto; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ---------- 巡检任务：按门店卡片 ---------- */
.insp-cards { display: flex; flex-direction: column; gap: 16px; }
.insp-card { background: var(--panel); border: 1px solid var(--line-2); border-left: 5px solid var(--brand); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-1); }
.insp-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.insp-card-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.insp-card-meta { font-size: 13px; color: var(--ink-soft); }
.insp-card-head .insp-submit { margin-left: 0; }
.insp-score { flex-shrink: 0; }
/* 页签行：页签居左，提交按钮居右强制同行（窄屏不换行） */
.insp-tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: nowrap; margin: 12px 0 10px; }
.insp-tabs-row .insp-tabs { margin: 0; flex: 0 0 auto; }
.insp-tabs-row .insp-submit { flex: 0 0 auto; margin-left: auto; white-space: nowrap; }
@media (max-width: 640px) {
  .insp-tabs-row { gap: 4px; }
  .insp-tabs-row .insp-tab { padding: 5px 7px; font-size: 12.5px; }
  .insp-tabs-row .insp-submit { font-size: 12px; padding: 5px 7px; }
}
.insp-tabs { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin: 12px 0 10px; }
.insp-tab { border: 0; background: transparent; color: var(--ink-soft); padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all .15s; }
.insp-tab.active { background: var(--brand); color: #fff; font-weight: 600; }
.insp-list { display: flex; flex-direction: column; gap: 8px; }
.insp-item { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md, 8px); padding: 10px 12px; }
.insp-item-done { background: #e7f6ee; border-color: #bfe6cf; }
.insp-item-main { flex: 1 1 auto; min-width: 0; }
.insp-item-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.insp-item-content { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.insp-item .insp-pass { flex: 0 0 auto; }
/* 巡检待检条目：检查内容在上，按钮行在最下方（未达标居左、达标居右） */
.insp-item--pending { flex-direction: column; align-items: stretch; gap: 8px; }
.insp-btn-group { flex: 0 0 auto; display: flex; flex-direction: row; justify-content: space-between; gap: 8px; }
.insp-btn-group .btn-sm {
  flex: 0 0 auto;
  width: 62px;
  height: 28px;
  padding: 0 6px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--r-md, 8px);
  box-sizing: border-box;
}
/* 完成态徽章：同样固定形状，与按钮视觉对齐 */
.insp-item .badge { flex: 0 0 auto; min-width: 62px; height: 24px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; border-radius: var(--r-pill); }
@media (max-width: 640px) {
  .insp-btn-group .btn-sm { width: 58px; height: 26px; font-size: 12px; padding: 0 5px; }
  .insp-item .badge { min-width: 58px; height: 22px; font-size: 11px; }
}
.insp-pager { margin-top: 12px; }
.empty-sm { padding: 18px; font-size: 13px; color: var(--ink-soft); text-align: center; }

/* 巡检记录只读卡片 */
.insp-records { display: flex; flex-direction: column; gap: 14px; }
.insp-record-card { background: var(--panel); border: 1px solid var(--line-2); border-left: 5px solid var(--brand); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-1); }
.insp-record-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.insp-record-info { display: flex; align-items: center; gap: 10px; }
.insp-record-no { font-size: 15px; font-weight: 700; color: var(--ink); }
.insp-record-store { font-size: 15px; color: var(--brand); font-weight: 600; }
.insp-record-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-soft); }
.insp-record-score { display: flex; align-items: baseline; gap: 6px; padding: 4px 16px; border-radius: 8px; margin-left: auto; }
.insp-record-detail { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.insp-record-detail .tbl { font-size: 13px; }
.insp-record-detail .tbl th { background: var(--bg); font-weight: 600; padding: 8px 10px; }
.insp-record-detail .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.insp-record-actions { margin-top: 10px; display: flex; justify-content: flex-end; }

/* ---------- 项目 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.proj-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-1); transition: box-shadow .18s, transform .12s; }
.proj-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.proj-card h4 { margin: 0 0 6px; font-size: 15px; }
.proj-card .desc { color: var(--ink-soft); font-size: 13px; min-height: 20px; }
.proj-meta { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--ink-soft); }
.bar { height: 8px; background: var(--bg); border-radius: 5px; margin-top: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #bae6fd); }

/* ---------- 仪表盘 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--sh-1); transition: box-shadow .18s, transform .12s;
}
.stat:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.stat .num { font-size: 30px; font-weight: 700; }
.stat .label { color: var(--ink-soft); margin-top: 4px; }
.stat.accent .num { color: var(--brand); }
.panel-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 18px; margin-bottom: 18px; box-shadow: var(--sh-1); }
.panel-card h3 { margin: 0 0 14px; font-size: 15px; }
.kv { display: flex; flex-direction: column; gap: 10px; }
.kv-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.kv-row .name { width: 90px; color: var(--ink-soft); }
.kv-bar { flex: 1; height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.kv-bar > i { display: block; height: 100%; background: var(--brand); }
.kv-row .val { width: 40px; text-align: right; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- 弹窗 ---------- */
[hidden] { display: none !important; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,24,40,.45);
  display: none; align-items: center; justify-content: center; z-index: 400;
}
.modal-mask:not([hidden]) { display: flex; }
.modal {
  width: 520px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--sh-h);
}
/* 新建订单弹窗：加宽成横版长方形 */
.modal--wide { width: 760px; max-width: 94vw; border-radius: 12px; }
.modal--order { width: 900px; max-width: 94vw; max-height: 88vh; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
/* 还款弹窗：左二维码 + 右表单 */
.repay-layout { display: flex; gap: 24px; align-items: flex-start; }
.repay-qr-side { flex: 0 0 240px; text-align: center; }
.repay-qr-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--sh-1); }
.repay-qr-hint { margin-top: 8px; font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.repay-form-side { flex: 1; min-width: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff8f1, #ffffff); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: transparent; font-size: 24px; cursor: pointer; color: var(--ink-soft); line-height: 1; }
.modal-body { padding: 20px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 13px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; outline: none;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-row textarea { resize: vertical; min-height: 64px; }
.form-readonly { padding: 8px 10px; background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; color: var(--ink-soft); font-size: 13px; }
.form-row input[readonly] { background: var(--bg); color: var(--ink-soft); cursor: not-allowed; }
/* 可输入 + 弹出选择窗口的组合框（客户编号） */
.combobox { position: relative; display: flex; align-items: center; }
.combobox-input { padding-right: 32px; }
.combobox-arrow { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 30px; border: none; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 13px; line-height: 1; z-index: 2; }
.combobox-arrow:hover { color: var(--brand); }
.combobox-panel { position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 60; padding: 4px; }
.combobox-opt { display: flex; gap: 12px; align-items: baseline; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.combobox-opt:hover { background: var(--bg); }
.combobox-opt .cb-no { font-weight: 600; color: var(--brand); min-width: 74px; font-variant-numeric: tabular-nums; }
.combobox-opt .cb-name { color: var(--ink); }
.combobox-empty { padding: 12px; text-align: center; color: var(--ink-soft); font-size: 13px; }
/* 多选字段：复选框组，带滚动与勾选高亮 */
.multiselect {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px; max-height: 220px; overflow-y: auto;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}
.ms-opt {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  font-size: 13px; cursor: pointer; user-select: none; transition: border-color .15s, background .15s;
}
.ms-opt:hover { border-color: var(--brand); }
.ms-opt input { width: auto; margin: 0; accent-color: var(--brand); }
.ms-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid > .form-row { margin-bottom: 0; }
/* 订单编号 + 订单日期：置顶并排一行 */
.form-grid-head { margin-bottom: 14px; align-items: end; }
.form-grid-head.form-head-plain { grid-template-columns: 1fr auto; gap: 8px; justify-items: end; }
.form-grid-head .form-readonly { padding: 10px 12px; }
.form-head-plain-input { width: 100%; padding: 10px 12px; border: none; border-radius: 9px; font-size: 14px; background: transparent; color: var(--text); box-sizing: border-box; }
.form-head-plain-input[readonly] { background: transparent; color: var(--ink-soft); }
.form-head-plain-input:focus { outline: none; }
.form-head-plain-input[type="date"] { text-align: right; max-width: 150px; }
/* 配送日报：站点置顶居中，大字加粗 */
.form-station-hero { text-align: center; margin-bottom: 18px; }
.station-hero-select {
  font-size: 20px; font-weight: 700; text-align: center; text-align-last: center;
  padding: 10px 24px; max-width: 320px; width: 100%;
  border: none; background: transparent; color: var(--text, #1d1d1f);
  appearance: none; -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='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.station-hero-select:focus { outline: none; }
.station-hero-select:disabled { opacity: 0.6; cursor: not-allowed; background: transparent; }
/* 订单字段两两并排成行 */
.form-grid-row { margin-bottom: 14px; }
/* 订单弹窗基础信息：上行内联标签:值展示，不用框 */
.form-info-row {
  display: flex; flex-wrap: wrap; gap: 0 28px; margin-bottom: 8px;
  padding: 2px 0;
}
.form-info-item { display: flex; align-items: center; gap: 4px; padding: 4px 0; }
.form-info-label { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.form-info-text { font-size: 14px; color: var(--ink); }
.form-info-input {
  font-size: 14px; font-family: inherit; border: none; border-bottom: 1px solid var(--line);
  padding: 4px 2px; outline: none; background: transparent; color: var(--ink); min-width: 120px;
}
.form-info-input:focus { border-bottom-color: var(--brand); }
.form-info-input.combobox-input {
  padding-right: 26px;
}
/* 只读信息字段：无边框，看起来像纯文本 */
.form-info-readonly {
  font-size: 14px; font-family: inherit; border: none; padding: 4px 2px;
  outline: none; background: transparent; color: var(--ink); min-width: 60px;
  cursor: default;
}
.form-info-readonly::placeholder { color: var(--ink-soft); }
/* 待办「类型 + 重复周期(+月份+日)」内联同行：隐藏字段自动塌缩，可见字段排在同行 */
.form-inline { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.form-inline > .form-row { flex: 1 1 150px; min-width: 140px; margin-bottom: 0; }
.form-grid-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: flex-end; height: 100%; }
@media (max-width: 420px) {
  .form-grid-head { grid-template-columns: 1fr; gap: 10px; }
}
#order-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.order-items-wrap { margin-bottom: 6px; }
.oi-head { display: grid; grid-template-columns: 1fr 92px 92px 80px 34px; gap: 8px; align-items: center; padding: 0 2px 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.oi-head .oi-amt-head { text-align: right; }
.order-item { display: grid; grid-template-columns: 1fr 92px 92px 80px 34px; gap: 8px; align-items: center; }
.order-item select, .order-item input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.order-item .oi-amount { text-align: right; font-variant-numeric: tabular-nums; }
.order-item .oi-price { text-align: left; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; align-self: center; }
.order-item .oi-del { padding: 6px 0; line-height: 1; }
/* 小程序订单只读明细行 */
.order-item.oi-ro .oi-ro-text { font-size: 14px; color: var(--ink); align-self: center; padding: 9px 10px; }
.order-item.oi-ro .oi-ro-amt { text-align: right; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; align-self: center; padding: 9px 10px; }
.order-total { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.order-total b { color: var(--ink); font-size: 16px; }
#add-item, #dd-add-item, #ds-add-item, #dl-add-item { margin-top: 2px; }
/* ─── 订单编辑弹窗：分区卡片布局 ─── */
.modal--order { display: flex; flex-direction: column; overflow: hidden; }
.modal--order .modal-body { padding: 16px 20px 20px 20px; flex: 1; overflow-y: auto; max-height: calc(88vh - 110px); display: flex; flex-direction: column; gap: 0; background: var(--bg); }
.modal--order .modal-body .order-section,
.modal--order .modal-body .order-bal-row,
.modal--order .modal-body .modal-actions { margin-bottom: 20px; flex-shrink: 0; }
.modal--order .modal-body .modal-actions { margin-bottom: 0; }
.modal--order .modal-head { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px; border-radius: 12px 12px 0 0; }
.modal--order .modal-head h3 { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 0; }
/* 分区通用：卡片样式 */
.order-section { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.order-section--auto { background: #f8fafc; border-color: #e2e8f0; display: flex; flex-direction: column; gap: 12px; }
.order-section__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-section__dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.order-section__dot--muted { background: #cbd5e1; }
/* 字段网格：3 列，响应式 */
.order-input-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 20px;
}
.order-input-grid--2col { grid-template-columns: repeat(2, 1fr); }
.order-input-grid--4col { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px) { .order-input-grid { grid-template-columns: repeat(2, 1fr); } .order-input-grid--4col { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .order-input-grid { grid-template-columns: 1fr; } .order-input-grid--2col { grid-template-columns: 1fr; } .order-input-grid--4col { grid-template-columns: 1fr; } }
.order-input-row { margin-top: 10px; }
.order-card-field--wide { grid-column: 1 / -1; }
.order-card-field--right { justify-self: end; }
/* 字段样式保持 */
.order-card-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.order-card-label { font-size: 12px; color: var(--ink-soft); }
.order-card-control { min-width: 0; }
.order-card-input, .order-card-select {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--ink); background: #fff;
  outline: none; transition: border-color .15s; box-sizing: border-box;
}
.order-card-input:focus, .order-card-select:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.order-card-input--readonly { background: #f8fafc; border-color: #e8ecf0; padding-left: 10px; color: var(--ink); }
.order-card-select { appearance: none; -webkit-appearance: none; cursor: pointer; 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='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 26px; }
/* 卡片内组合框 */
.order-section .combobox { position: relative; display: flex; align-items: center; }
.order-section .combobox-input { padding-right: 28px; }
.order-section .combobox-arrow { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border: none; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 12px; line-height: 1; z-index: 2; }
/* 预约配送时间：输入框 + 选择按钮组合 */
.appointment-time-control { display: flex; gap: 6px; align-items: stretch; }
.appointment-time-control .appointment-time-input { flex: 1; min-width: 0; cursor: pointer; }
.appointment-time-control .appointment-time-btn { flex: 0 0 auto; white-space: nowrap; }
/* 预约配送时间选择弹窗：左日期列表 + 右时段网格 */
.appointment-modal { width: 560px; max-width: 94vw; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.appt-picker { display: flex; gap: 0; min-height: 0; overflow: hidden; }
.appt-dates {
  flex: 0 0 128px; display: flex; flex-direction: column; gap: 4px; padding: 10px 8px;
  border-right: 1px solid var(--line); background: #fafbfc; overflow-y: auto;
}
.appt-date {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border: none; border-radius: 10px; background: transparent;
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.appt-date:hover { background: #eef1f6; }
.appt-date.is-active { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.appt-date.is-active .appt-date__wd { color: rgba(255,255,255,.85); }
.appt-date__md { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.appt-date__wd { font-size: 11px; color: var(--ink-soft); }
.appt-date--today .appt-date__md { color: var(--brand); }
.appt-date--today.is-active .appt-date__md { color: #fff; }
.appt-slots {
  flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 12px; overflow-y: auto; align-content: start;
}
.appt-slot {
  padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 13px; font-family: inherit; color: var(--ink); cursor: pointer;
  text-align: center; font-variant-numeric: tabular-nums; transition: border-color .15s, background .15s;
}
.appt-slot:hover { border-color: var(--brand); }
.appt-slot.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
@media (max-width: 560px) {
  .appointment-modal { width: 94vw; }
  .appt-dates { flex-basis: 96px; }
  .appt-slots { grid-template-columns: repeat(2, 1fr); }
}
.order-section__summary { font-size: 13px; color: var(--ink-soft); }
.order-section__summary b { color: var(--ink); }
.order-section__summary .order-section__amount { color: var(--c-red); font-size: 16px; }
.order-section__summary--footer { text-align: right; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
/* 底部操作栏：状态字段在左侧，按钮在右侧 */
.modal--order .modal-actions { padding: 12px 18px; margin-top: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; align-items: center; gap: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
/* 余额标签行（水票/充值/欠桶，商品明细上方）— 气泡样式，非卡片化 */
.order-bal-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px 4px;
}
.order-bal-row .tag-chip {
  margin: 0;
  padding: 6px 16px;
  border-radius: 24px;
  font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--line);
  background: linear-gradient(135deg, #fafbfd 0%, #f0f3f8 100%);
  color: var(--ink-soft);
  box-shadow: 0 2px 6px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  cursor: default; user-select: none;
  transition: all .2s ease;
  position: relative;
}
.order-bal-row .tag-chip::before { content: none; }
.order-bal-row .tag-chip::after {
  content: ''; position: absolute; top: 6px; left: 8px; right: 30px;
  height: 40%; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.8) 0%, transparent 100%);
  pointer-events: none;
}
.order-bal-row .tag-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  border-color: var(--brand);
  color: var(--brand);
}
/* 备注字段在底部操作栏：桌面固定宽度居左，小屏自适应铺满防溢出 */
.order-card-field--remark { flex: 0 1 auto; min-width: 0; }
.order-card-field--remark textarea.order-card-input,
.order-card-field--remark input.order-card-input { width: 360px; max-width: 100%; box-sizing: border-box; }
/* 小屏：底部操作栏允许换行，备注独占一行铺满 */
@media (max-width: 640px) {
  .modal-actions--order-foot { flex-wrap: wrap; }
  .modal-actions--order-foot .order-card-field--remark { order: -1; flex: 1 1 100%; }
  .order-card-field--remark.order-card-field--inline .order-card-control { flex: 1 1 auto; min-width: 0; }
  .order-card-field--remark textarea.order-card-input,
  .order-card-field--remark input.order-card-input { width: 100%; }
}
.order-card-field--inline { display: flex; align-items: center; gap: 8px; }
.order-card-field--inline .order-card-label {
  font-size: 13px; white-space: nowrap; flex: 0 0 auto;
  color: var(--ink);
}
.order-card-field--inline .order-card-control { min-width: 0; flex: 0 0 auto; }
.order-card-field--inline .order-card-select {
  min-width: 0; width: auto; padding: 4px 26px 4px 8px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; line-height: 1.4;
}
/* ─── 客户配送信息卡片 ─── */
.customer-delivery-section { margin: 16px 0; }
.customer-delivery-section__head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.customer-delivery-section__head::before {
  content: ''; display: inline-block; width: 3px; height: 14px;
  background: var(--brand); border-radius: 2px;
}
.delivery-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.delivery-card:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.delivery-card__body { flex: 1 1 auto; min-width: 0; }
.delivery-card__label {
  font-size: 12px; color: var(--ink-soft); margin-bottom: 6px;
}
.delivery-card__address {
  font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.45;
  word-break: break-word; margin-bottom: 8px;
}
.delivery-card__contact {
  font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.delivery-card__arrow {
  flex: 0 0 auto; font-size: 22px; color: var(--ink-soft);
}
.delivery-card__empty {
  color: var(--ink-soft); font-size: 14px; padding: 6px 0;
}
/* 地址管理弹窗 */
.modal--delivery-address { display: flex; flex-direction: column; overflow: hidden; }
.modal--delivery-address .modal-body {
  padding: 16px 20px 20px; flex: 1; overflow-y: auto;
  max-height: calc(88vh - 110px); display: flex; flex-direction: column; gap: 14px;
}
.address-list { display: flex; flex-direction: column; gap: 12px; }
.address-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.address-item--default { border-color: var(--brand); background: #f6fbff; }
.address-item__main { font-size: 14px; color: var(--ink); line-height: 1.5; word-break: break-word; }
.address-item__detail { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.address-item__contact {
  font-size: 13px; color: var(--ink-2); margin-top: 8px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.address-item__actions {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.address-item__actions label {
  display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.address-item__actions input[type="radio"] { cursor: pointer; }
.address-item__btn {
  font-size: 13px; color: var(--brand); background: transparent; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.address-item__btn:hover { background: var(--brand-soft); }
.address-item__btn--danger { color: var(--danger); }
.address-item__btn--danger:hover { background: #fee2e2; }
.address-edit {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px; background: #f8fafc; border-radius: 10px;
}
.address-edit__row { display: flex; flex-direction: column; gap: 4px; }
.address-edit__row label { font-size: 12px; color: var(--ink-soft); }
.address-edit__row input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; box-sizing: border-box;
}
.address-edit__row input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); outline: none; }
.address-edit__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.address-empty { text-align: center; color: var(--ink-soft); padding: 30px 10px; font-size: 14px; }
/* 地址编辑行：输入框 + 地图选点按钮 */
.address-edit__addrline { display: flex; gap: 8px; align-items: stretch; }
.address-edit__addrline input { flex: 1; min-width: 0; }
.map-picker-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  align-self: center;
  background: var(--brand-soft);
  color: var(--brand-ink);
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 12px;
  line-height: 1.6;
  transition: background .15s ease, box-shadow .15s ease;
}
.map-picker-btn:hover { background: #bae6fd; color: var(--brand-ink); box-shadow: 0 0 0 3px rgba(14,165,233,.14); }
/* 地图选点弹窗 */
.modal--map-picker {
  width: min(620px, 94vw); max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal--map-picker .modal-body { padding: 0; display: flex; flex-direction: column; overflow-y: auto; max-height: calc(92vh - 57px); }
.map-picker-search { position: relative; padding: 12px 16px 10px; }
.map-picker-search input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff;
  box-sizing: border-box; outline: none;
}
.map-picker-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.map-picker-tips {
  position: absolute; top: calc(100% - 2px); left: 16px; right: 16px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  max-height: 220px; overflow-y: auto; box-shadow: 0 8px 28px rgba(0,0,0,.14);
}
.map-picker-tip { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.map-picker-tip:last-child { border-bottom: none; }
.map-picker-tip:hover { background: var(--brand-soft); }
.map-picker-tip__name { font-size: 14px; color: var(--ink); line-height: 1.4; }
.map-picker-tip__dist { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.map-picker-map-wrap {
  position: relative; flex: 1 1 auto; min-height: 180px; max-height: 360px; margin: 0 16px;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #f1f5f9;
}
.map-picker-container { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-picker-pin {
  pointer-events: none; width: 30px; height: 38px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
}
.map-picker-result {
  margin: 10px 16px 0; padding: 10px 12px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
}
.map-picker-result__label { font-size: 12px; color: var(--ink-soft); }
.map-picker-result__addr { font-size: 14px; color: var(--ink); margin-top: 2px; line-height: 1.5; word-break: break-all; }
.map-picker-result__hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.map-picker-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px 16px; }
/* 门店电子围栏地图视图 */
.fence-map-view { display: flex; flex-direction: column; height: 100%; }
.fence-map-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); background: var(--panel); flex-shrink: 0;
}
.fence-map-hint { font-size: 13px; color: var(--ink-soft, #6b7280); }
.fence-map-wrap { flex: 1; position: relative; overflow: hidden; }
.fence-map-container { width: 100%; height: 100%; }
/* 围栏工具栏：玻璃胶囊按钮 */
.fence-btn {
  padding: 6px 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: rgba(255,255,255,0.5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.fence-btn:hover { background: rgba(255,255,255,0.7); border-color: #d3d6db; }
.fence-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.fence-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fence-btn-primary {
  background: rgba(14,165,233,0.1); border-color: rgba(14,165,233,0.2); color: var(--brand);
}
.fence-btn-primary:hover { background: rgba(14,165,233,0.18); border-color: rgba(14,165,233,0.35); }
.fence-toolbar-divider { width: 1px; height: 20px; background: var(--line); flex-shrink: 0; }
/* 门店名称标签（地图上） */
.fence-store-label {
  padding: 3px 10px; background: rgba(219,234,254,0.92);
  border: 1px solid rgba(59,130,246,0.35); border-radius: 999px;
  font-size: 12px; color: #1e40af; white-space: nowrap; line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08); transform: translateX(-50%);
}
/* ─── 汇报：笔记式三块卡片布局 ─── */
.rpt-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.rpt-card-title {
  font-size: 13px; font-weight: 600; color: var(--brand);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.rpt-card-title::before { content: ''; display: inline-block; width: 3px; height: 14px; background: var(--brand); border-radius: 2px; }
.rpt-card-total {
  margin-top: 8px; font-size: 13px; color: var(--ink-soft);
}
.rpt-card-total--prominent {
  text-align: right; font-size: 14px; font-weight: 600; color: var(--ink);
}
.rpt-card-total--prominent b { color: var(--ink); font-size: 17px; font-weight: 700; }
.rpt-card-total b { color: var(--ink); font-size: 15px; }
/* 销售卡：暖色背景；配送卡：冷色背景 */
.rpt-card--sales { background: #fef9f0; }
.rpt-card--delivery { background: #f0f6ff; }
/* 配送明细容器（共享） */
#sales-items, #delivery-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
/* 门店线下销售行：商品/数量/单价/金额/× */
.oi-head.ds-head { grid-template-columns: 1fr 80px 80px 68px 34px; }
.order-item.ds-item { grid-template-columns: 1fr 80px 80px 68px 34px; }
/* 配送详情行：同销售行 5 列保证商品下拉框宽度一致；删除按钮固定第 5 列 */
.oi-head.dl-head { grid-template-columns: 1fr 80px 80px 68px 34px; }
.order-item.dl-item { grid-template-columns: 1fr 80px 80px 68px 34px; }
.order-item.dl-item .oi-del { grid-column: 5; }
@media (max-width: 640px) {
  .oi-head { grid-template-columns: 1fr 70px 70px 65px 30px; gap: 6px; }
  .order-item { grid-template-columns: 1fr 70px 70px 65px 30px; gap: 6px; }
  .oi-head.ds-head { grid-template-columns: 1fr 62px 62px 52px 28px; gap: 6px; }
  .order-item.ds-item { grid-template-columns: 1fr 62px 62px 52px 28px; gap: 6px; }
  .oi-head.dl-head { grid-template-columns: 1fr 62px 62px 52px 28px; gap: 6px; }
  .order-item.dl-item { grid-template-columns: 1fr 62px 62px 52px 28px; gap: 6px; }
}
/* 客户标签 chip */
.tag-chips { display: flex; gap: 8px; align-items: center; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--line); background: #f8f9fb; color: var(--ink-soft);
  cursor: pointer; user-select: none; transition: all .18s ease;
}
.tag-chip:hover { border-color: var(--brand); color: var(--brand); }
.tag-chip.active {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.tag-chip::before {
  content: '+'; display: inline-block; width: 14px; height: 14px; line-height: 14px;
  text-align: center; font-size: 12px; font-weight: 700; border-radius: 50%;
  background: transparent; transition: background .18s;
}
.tag-chip.active::before { content: '✓'; background: rgba(255,255,255,.25); }
.tag-chip--readonly { cursor: default; }
.tag-chip--readonly:hover { border-color: var(--brand); color: #fff; }
.tag-chip--warn {
  background: linear-gradient(135deg, #fff8f0, #fff3e0);
  border-color: #f0c080;
  color: #b85c00;
}
.tag-chip--warn:hover { border-color: #e69900; color: #994d00; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
/* 退出登录确认弹窗：按钮收紧尺寸、与右边缘留出间距，避免贴边过大 */
.modal-actions--logout { padding: 4px 20px 16px; gap: 8px; }
.modal-actions--logout .btn { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: #1f2430; color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; z-index: 500; box-shadow: var(--sh-2);
  border-left: 4px solid var(--brand);
  animation: toast-in .25s ease both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(8px); }
}
.toast.toast-success { border-left-color: #2eaf6a; background: #143524; }
.toast.toast-error { border-left-color: #e5533c; background: #3a1a16; }

/* ---------- 基础信息 / 通用表格 ---------- */
.tabs-wrap { margin-bottom: 16px; }
.tabs {
  display: inline-flex; gap: 4px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 4px;
}
.tab {
  border: none; background: transparent; padding: 8px 18px; border-radius: 8px;
  font-size: 14px; color: var(--ink-soft); cursor: pointer; transition: all .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--brand); color: #fff; font-weight: 600; }
.toolbar-wrap { margin-bottom: 10px; }
.toolbar-wrap-flex { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toolbar-wrap-flex .btn-icon-blue { align-self: flex-end; } /* 图标按钮与搜索框底部对齐 */
.topbar-actions .btn-icon-blue { align-self: flex-end; } /* 配送工作台：图标按钮与搜索框底部对齐 */
/* 搜索框旁按钮与搜索框同高（38px，2026-08-15） */
.toolbar .topbar-search { height: 38px; box-sizing: border-box; padding: 0 36px 0 38px; }
.toolbar-wrap-flex > .btn-icon-blue { width: 38px; height: 38px; }
.toolbar-wrap-flex > .btn { height: 38px; box-sizing: border-box; }
.courier-main .topbar-actions > .btn-icon-blue { width: 38px; height: 38px; }
.courier-main .topbar-actions > .btn { height: 38px; box-sizing: border-box; }
.toolbar { position: relative; display: inline-block; max-width: 100%; }
.toolbar .topbar-search {
  padding: 10px 36px 10px 38px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 14px; width: 300px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a90a6' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat 14px center;
  transition: border-color .15s, box-shadow .15s;
}
.toolbar .topbar-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.toolbar .search-clear {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: #c2c8d6; color: #fff;
  font-size: 15px; line-height: 1; padding: 0; cursor: pointer; box-shadow: none;
  transition: background .15s;
}
.toolbar .search-clear:hover { background: #e63946; }
.toolbar .search-clear[hidden] { display: none; }
.tbl-wrap {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1);
}
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line-2); }
.tbl th { background: linear-gradient(180deg, #fff8f1, #fdf6f1); color: var(--brand-ink); font-weight: 600; font-size: 12.5px; letter-spacing: .3px; }
/* 长编号单元格自动换行，列宽收缩以容纳更多列（2026-08-15） */
.tbl .cell-break { word-break: break-all; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--brand-soft); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .row-actions { display: flex; gap: 8px; white-space: nowrap; }
/* 列表图片缩略图（file/imageOnly 字段，如 小程序商城-首页 图片列） */
.tbl .cell-thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f5f6f7; display: block; }
/* 弹窗内的表格不受移动端 .tbl min-width:640px 影响（否则数量/合计列被挤出屏幕） */
.modal .tbl { min-width: 0; }
.modal .tbl td, .modal .tbl th { word-break: break-all; }

/* ---------- 配送月报 ---------- */
.rpt-month-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 22px 2px 8px; }
.rpt-month-head:first-child { margin-top: 4px; }
.rpt-month-title { font-size: 15px; font-weight: 700; color: var(--brand-ink); }
.rpt-month-sum { font-size: 12.5px; color: var(--ink-soft); }
.tbl-sum-row { background: var(--bg); }
.tbl-sum-row td { font-weight: 600; color: var(--ink); border-top: 2px solid var(--line-2); }
.tbl-grand { margin-top: 8px; }
.tbl-grand .tbl-grand-row { background: linear-gradient(180deg, #fff8f1, #fdf6f1); }
.tbl-grand .tbl-grand-row td { font-size: 14.5px; color: var(--brand-ink); border-top: 2px solid var(--brand-grad); }

/* ---------- 导入弹窗 ---------- */
.import-modal { display: flex; flex-direction: column; gap: 14px; }
.imp-tabs { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px; align-self: flex-start; }
.imp-tab {
  border: none; background: transparent; padding: 8px 16px; border-radius: 8px;
  font-size: 14px; color: var(--ink-soft); cursor: pointer; transition: all .15s;
}
.imp-tab.active { background: var(--panel); color: var(--brand-ink); font-weight: 600; box-shadow: var(--shadow); }
.imp-pane { display: flex; flex-direction: column; gap: 8px; }
.imp-pane input[type="file"] { font-size: 13px; }
.imp-pane textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-family: inherit; resize: vertical; }
.hint { color: var(--ink-soft); font-size: 12px; margin: 0; }
#imp-map p { font-size: 13px; margin: 0 0 10px; }
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.map-row { display: flex; flex-direction: column; gap: 4px; }
.map-row label { font-size: 12px; color: var(--ink-soft); }

/* 配送单分页标签（配送中 / 完成） */
.subtabs { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px; align-self: flex-start; }
.subtabs-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.subtabs-bar .subtabs-spacer { flex: 1; }
.subtab { border: none; background: transparent; padding: 8px 16px; border-radius: 8px; font-size: 14px; color: var(--ink-soft); cursor: pointer; transition: all .15s; }
.subtab:hover { background: var(--panel); color: var(--brand-ink); }
.subtab.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; padding: 6px 0; flex-wrap: wrap; row-gap: 8px; }
.pager-btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); padding: 8px 18px; border-radius: 10px; font-size: 14px; cursor: pointer; transition: all .15s; }
.pager-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-info { font-size: 13px; color: var(--ink-soft); }
/* 批量分派工具栏 */
.batch-toolbar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.batch-check-all { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.batch-check-all input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.col-check { width: 40px; text-align: center; }
.col-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.batch-toolbar .btn:disabled { opacity: .45; cursor: not-allowed; }

/* 第三方订单显隐开关（拟物拨动） */
.tp-switch {
  margin-left: auto;
  padding: 0; border: 0; background: transparent;
  cursor: pointer; user-select: none; line-height: 1;
}
.tp-switch-track {
  position: relative;
  display: inline-flex; align-items: center;
  width: 50px; height: 22px;
  border-radius: 11px;
  background: linear-gradient(180deg, #b8b8b8 0%, #d6d6d6 100%);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,.25),
    inset 0 -.5px 1px rgba(255,255,255,.6),
    0 .5px 1px rgba(0,0,0,.1);
  transition: background .25s ease, box-shadow .25s ease;
  overflow: hidden;
}
.tp-switch.active .tp-switch-track {
  background: linear-gradient(180deg, #2cb845 0%, #4cd964 100%);
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,.2),
    inset 0 -.5px 1px rgba(255,255,255,.35),
    0 .5px 1px rgba(0,0,0,.1);
}
.tp-switch-label {
  position: absolute;
  right: 6px;
  font-size: 8px; font-weight: 700; letter-spacing: .3px;
  color: rgba(255,255,255,.92);
  text-shadow: 0 -.5px 0 rgba(0,0,0,.15);
  transition: opacity .2s ease;
}
.tp-switch.active .tp-switch-label {
  right: auto; left: 6px;
}
.tp-switch-knob {
  position: absolute;
  left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #e8e8e8 100%);
  box-shadow:
    0 1px 3px rgba(0,0,0,.28),
    inset 0 .5px .5px rgba(255,255,255,.9),
    inset 0 -.5px .5px rgba(0,0,0,.08);
  transition: transform .25s cubic-bezier(.4, .0, .2, 1);
}
.tp-switch.active .tp-switch-knob {
  transform: translateX(28px);
}
.tp-switch-icon {
  position: absolute; top: 50%; left: 50%;
  width: 8px; height: 8px;
  transform: translate(-50%, -50%);
  color: #666;
  transition: color .25s ease;
}
.tp-switch.active .tp-switch-icon {
  color: #2cb845;
}
.tp-switch:hover .tp-switch-knob {
  background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
}
.tp-switch:active .tp-switch-knob {
  box-shadow:
    0 .5px 2px rgba(0,0,0,.28),
    inset 0 .5px .5px rgba(255,255,255,.9),
    inset 0 -.5px .5px rgba(0,0,0,.08);
}
.map-row select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--panel); }

/* ---------- 配送单卡片式移动端视图 ---------- */
.courier-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.courier-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; font-size: 14px; transition: box-shadow .18s, transform .12s; }
.courier-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.cc-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.cch-shop { font-size: 15px; font-weight: 600; color: var(--brand-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cch-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--ink-soft); white-space: nowrap; flex: none; }
.cch-no { color: var(--ink); font-weight: 500; }
.cc-customer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed var(--line); }
.cc-cust-main { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1; overflow: hidden; }
.cc-cust-name { font-size: 16px; font-weight: 400; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-cust-count { font-size: 12px; color: var(--ink-soft); white-space: nowrap; flex: none; }
.cc-phone { display: inline-flex; align-items: center; font-size: 16px; font-weight: 400; color: var(--ink); flex: none; }
.cc-address { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.5; }
.cc-addr-text { flex: 1; color: var(--ink); font-size: 16px; font-weight: 700; line-height: 1.5; }
.cc-copy { border: none; background: transparent; color: var(--brand-ink); font-size: 13px; font-weight: 500; cursor: pointer; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.cc-copy:hover { background: var(--brand-soft); }
.cc-nav { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--brand-ink); flex-shrink: 0; transition: background 0.15s; border: none; background: transparent; cursor: pointer; font: inherit; padding: 0; }
.cc-nav:hover { background: var(--brand-soft); }
.cc-addr-pin { display: block; }
.cc-product { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px dashed var(--line); }
.cc-prod-info { flex: 1; min-width: 0; }
.cc-prod-name { font-size: 17px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-prod-total { font-size: 18px; font-weight: 700; color: var(--ink); flex: none; white-space: nowrap; }
.cc-product { flex-wrap: wrap; }
.cc-prod-line { flex: 1 1 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cc-prod-line + .cc-prod-line { margin-top: 4px; }
.cc-prod-line .cc-prod-name { font-size: 15px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-prod-line .cc-prod-total { font-size: 15px; font-weight: 700; color: var(--ink); flex: none; }
.cc-extra { padding: 4px 14px; border-bottom: 1px dashed var(--line); }
.cc-remark { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.5; color: var(--danger); font-weight: 600; word-break: break-word; }
.cc-remark-label { flex: none; font-weight: 700; color: var(--danger); }
.cc-appointment { display: flex; gap: 4px; align-items: baseline; padding: 8px 14px; border-bottom: 1px dashed var(--line); }
.cc-apt-label { font-size: 13px; color: var(--ink-soft); font-weight: 400; }
.cc-apt-value { font-size: 15px; color: var(--danger); font-weight: 700; }
.cc-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); }
.cc-status { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); }
.cc-status.cc-完成 { background: #dcfce7; color: #15803d; }
.cc-status.cc-待接单 { background: #fef3c7; color: #b45309; }
.cc-status.cc-取消 { background: #f1f5f9; color: #64748b; }
.cc-return { display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; font-size: 15px; color: var(--ink-soft); border-bottom: 1px dashed var(--line); }
.cc-return-label { color: var(--ink-soft); }
.cc-return-num { color: var(--ink); font-size: 15px; font-weight: 600; }
.cc-return-unit { color: var(--ink-soft); }
.courier-card-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 14px; }
.courier-card-foot .btn-sm { padding: 6px 18px; font-size: 14px; }
.courier-card-foot .btn-call { margin-right: auto; display: inline-flex; align-items: center; gap: 5px; }
.cc-call-svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--accent, #2563eb);
}
@media (max-width: 640px) {
  .cc-header, .cc-customer, .cc-address, .cc-product, .cc-meta, .cc-return, .courier-card-foot { padding-left: 12px; padding-right: 12px; }
  .cc-cust-name { font-size: 15px; }
  .cc-phone { font-size: 15px; }
  .cc-prod-total { font-size: 16px; }
}

/* ---------- 移动端布局微调 ---------- */
@media (max-width: 900px) {
  .topbar-row { top: 10px; left: 12px; right: 12px; margin: 0; gap: 6px; }
  .topbar { padding: 5px 10px; }
  .topbar h2 { font-size: 13px; }
  .menu-btn { font-size: 14px; }
  .icp-footer { bottom: 10px; padding: 5px 10px; font-size: 13px; }
  .topbar-actions { min-height: 28px; gap: 6px; }
  .topbar-actions .btn { padding: 4px 11px; font-size: 12.5px; }
  .topbar-actions .btn-icon-blue { width: 28px; height: 28px; }
  /* 移动端：侧边栏胶囊悬浮边距收紧 */
  .sidebar { top: 10px; left: 12px; bottom: 10px; border-radius: 20px; padding: 16px 12px; }
  .view { padding: 40px 14px 56px; /* 底部 56px：为悬浮备案胶囊留位，勿改回 14px（否则移动端内容被胶囊遮挡） */ }
  /* 移动端分页文字缩小 */
  .pager { gap: 8px; margin-top: 12px; padding: 4px 0; flex-wrap: wrap; row-gap: 6px; }
  .pager-btn { padding: 5px 10px; font-size: 12px; border-radius: 8px; flex-shrink: 0; white-space: nowrap; }
  .pager-info { font-size: 10px; flex-shrink: 0; white-space: nowrap; }
  /* 移动端：订单/配送单页签两行显示 + 左右滑动 */
  .subtabs-bar { gap: 4px; flex-wrap: nowrap; margin-bottom: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .subtabs-bar::-webkit-scrollbar { display: none; }
  .subtabs-bar .subtab {
    flex: 0 0 auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px;
    padding: 5px 12px; font-size: 12px; line-height: 1.25;
    border-radius: 8px;
  }
  .subtabs-bar .subtab-count { font-size: 11px; opacity: .78; font-variant-numeric: tabular-nums; }
  .subtabs-bar .subtabs-spacer { display: none; }
}

/* ---------- 主页（概览仪表盘） ---------- */
.home { max-width: 920px; margin: 0 auto; position: relative; padding: 4px 0; }
/* 卡片下方不再垫任何背景层：概览区域与页面背景完全一致 */

/* ===== 欢迎横幅：胶囊形 ===== */
.home-welcome {
  font-size: 18px; color: var(--ink); margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-radius: 50px; padding: 22px 34px; line-height: 1.5;
  box-shadow: 0 8px 24px rgba(20, 24, 40, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  position: relative; overflow: hidden;
}
.home-welcome::after {
  content: ''; position: absolute; top: 0; right: 0; width: 240px; height: 100%;
  background: radial-gradient(circle at 75% 50%, rgba(14, 165, 233, 0.08), transparent 70%);
  pointer-events: none;
}
.home-welcome b { color: var(--brand-ink); font-weight: 800; }

/* ===== Bento 网格容器 ===== */
.home-bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

/* ===== 图表卡片：大块，跨 4 列 2 行，不对称圆角 ===== */
.home-chart-card {
  grid-column: span 4;
  grid-row: span 2;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.40);
  border-radius: 28px 28px 28px 12px;
  padding: 22px 26px;
  box-shadow: 0 8px 32px rgba(20, 24, 40, 0.04), 0 2px 8px rgba(20, 24, 40, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: flex; flex-direction: column;
}
.home-chart-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.home-chart-title { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.home-chart-month { font-size: 13px; color: var(--ink-soft); background: rgba(14, 165, 233, 0.1); padding: 3px 12px; border-radius: 20px; }
.home-chart-wrap { position: relative; height: 100%; min-height: 200px; width: 100%; flex: 1; }
.home-chart-empty { display: flex; align-items: center; justify-content: center; height: 200px; color: var(--ink-soft); font-size: 14px; }
/* 图表卡加载态复用全系统 .data-loading（圆形转圈 + 文字），在此绝对居中填满卡片 */
.home-chart-wrap .data-loading { position: absolute; inset: 0; z-index: 2; }

/* ===== 英雄统计卡：跨 2 列 2 行，竖向布局，主题色底 ===== */
.stat-card--hero {
  grid-column: span 2;
  grid-row: span 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 28px 12px 28px 28px !important;
  padding: 24px 16px !important;
}
.stat-card--hero .stat-ico { width: 52px; height: 52px; border-radius: 16px; font-size: 26px; margin-bottom: 16px; }
.stat-card--hero .stat-num { font-size: 36px; }
.stat-card--hero .stat-label { font-size: 14px; margin-top: 8px; }

/* ===== 普通统计卡：跨 2 列 ===== */
.stat-card {
  grid-column: span 2;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.40);
  border-radius: 20px;
  padding: 18px 16px; text-align: center; cursor: pointer;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 8px 24px rgba(20, 24, 40, 0.04), 0 2px 6px rgba(20, 24, 40, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.stat-card:hover {
  border-color: rgba(14, 165, 233, 0.30);
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 36px rgba(14, 165, 233, 0.10), 0 4px 12px rgba(20, 24, 40, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* ===== 概览卡片入场动画：从左右方向弹现（仅首次进入概览触发，回填不重播） ===== */
@keyframes cardInLeft {
  from { opacity: 0; transform: translateX(-26px) scale(.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes cardInRight {
  from { opacity: 0; transform: translateX(26px) scale(.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes cardInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* backwards：仅入场前应用 from 态，动画结束后回落到基态，不锁死 transform，hover 上浮仍可用 */
@media (prefers-reduced-motion: no-preference) {
  .home-anim-left  { animation: cardInLeft  .72s cubic-bezier(.34, 1.42, .64, 1) backwards; }
  .home-anim-right { animation: cardInRight .72s cubic-bezier(.34, 1.42, .64, 1) backwards; }
  .home-anim-down  { animation: cardInDown  .66s ease backwards; }
}

/* 配送员角色：统计卡片仅作展示，不可点击 */
.stat-card--static { cursor: default; }
.stat-card--static:hover { border-color: rgba(255, 255, 255, 0.40); transform: none; background: rgba(255, 255, 255, 0.10); box-shadow: 0 8px 24px rgba(20, 24, 40, 0.04), 0 2px 6px rgba(20, 24, 40, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.stat-num { font-size: 28px; font-weight: 700; color: var(--brand-ink); line-height: 1.1; }
/* 概览骨架态：数字占位 shimmer（bootstrap 未到时显示，到位后替换为真实数字） */
.stat-num--skeleton {
  width: 54px; height: 26px; border-radius: 6px;
  background: linear-gradient(90deg, #eef1f6 25%, #e2e7f0 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: statSkeletonShimmer 1.3s ease-in-out infinite;
}
.stat-card--wide .stat-num--skeleton { width: 44px; height: 24px; }
@keyframes statSkeletonShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.stat-label { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.stat-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; margin: 0 auto 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.stat-ico.stat--brand { background: linear-gradient(135deg, #38bdf8, #0ea5e9); color: #fff; }
.stat-ico.stat--blue { background: linear-gradient(135deg, #60a5fa, #3b82f6); color: #fff; }
.stat-ico.stat--green { background: linear-gradient(135deg, #34d399, #10b981); color: #fff; }
.stat-ico.stat--purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: #fff; }
.stat-ico.stat--pink { background: linear-gradient(135deg, #f472b6, #ec4899); color: #fff; }
.stat-ico.stat--amber { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.stat-ico.stat--teal { background: linear-gradient(135deg, #2dd4bf, #14b8a6); color: #fff; }
.stat-ico.stat--orange { background: linear-gradient(135deg, #fb923c, #f97316); color: #fff; }
.stat-sub { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

/* ===== 合并宽卡：跨 4 列，三段式 ===== */
.stat-card--wide {
  grid-column: span 4;
  display: flex; align-items: stretch;
  padding: 18px 8px !important;
  border-radius: 20px;
}
.stat-wide-item {
  flex: 1; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background .2s;
  border-radius: 14px; padding: 4px 6px;
}
.stat-wide-item:hover { background: rgba(255,255,255,0.15); }
.stat-wide-item .stat-ico { width: 38px; height: 38px; border-radius: 11px; font-size: 19px; margin-bottom: 8px; }
.stat-wide-item .stat-num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-wide-item .stat-label { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.stat--amber-text { color: #f59e0b; }
.stat--orange-text { color: #f97316; }
.stat--blue-text { color: #3b82f6; }
.stat-wide-sep { width: 1px; background: rgba(0,0,0,0.08); margin: 4px 0; }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ===== 门店库存预警卡片：横跨全宽 ===== */
.home-alert-card {
  grid-column: span 2;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.40);
  border-radius: 20px 20px 20px 20px;
  padding: 14px 18px 10px;
  box-shadow: 0 8px 24px rgba(20, 24, 40, 0.04), 0 2px 6px rgba(20, 24, 40, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.home-alert-title { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }
.home-alert-list { display: flex; flex-wrap: wrap; gap: 6px; }
.home-alert-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 12px; border-radius: 20px; background: rgba(239, 68, 68, 0.06);
  cursor: pointer; transition: all .2s;
}
.home-alert-row:hover { background: rgba(239, 68, 68, 0.10); transform: translateY(-1px); }
.home-alert-store { font-size: 13px; color: #b91c1c; font-weight: 600; }
.home-alert-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: linear-gradient(135deg, #f87171, #dc2626); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 9px; line-height: 1;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

/* ---------- 配送汇报便签卡片 ---------- */
.dd-sticky-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; padding: 4px 0; }
.dd-sticky {
  background: linear-gradient(172deg, #fffef9 0%, #fef9ed 100%);
  border: 1px solid #e8dfc8; border-radius: 3px 3px 8px 8px;
  box-shadow: 0 2px 8px rgba(80, 60, 30, .08), 0 1px 3px rgba(80, 60, 30, .06);
  overflow: hidden; transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column; cursor: default;
}
.dd-sticky:nth-child(odd)  { transform: rotate(-0.6deg); }
.dd-sticky:nth-child(even) { transform: rotate(0.5deg); }
.dd-sticky:nth-child(3n)  { transform: rotate(0.8deg); }
.dd-sticky:nth-child(5n)  { transform: rotate(-1deg); }
.dd-sticky:hover {
  transform: rotate(0deg) translateY(-4px) !important;
  box-shadow: 0 8px 24px rgba(80, 60, 30, .14), 0 4px 10px rgba(80, 60, 30, .1);
  z-index: 2;
}
.dd-sticky-bar {
  height: 5px;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9, #7dd3fc);
  flex: none;
}
.dd-sticky-body {
  padding: 16px 18px 14px; flex: 1; display: flex; flex-direction: column; gap: 10px;
  /* 写字本横线效果 */
  background-image:
    repeating-linear-gradient(to bottom,
      transparent, transparent 26px,
      rgba(180, 160, 125, 0.15) 26px,
      rgba(180, 160, 125, 0.15) 27px);
  background-position: 0 8px;
}
.dd-sticky-head { margin-bottom: 2px; }
.dd-sticky-station { font-size: 17px; font-weight: 700; color: #0369a1; line-height: 1.2; }
.dd-sticky-footer { font-size: 11px; color: #a69b82; margin-top: auto; padding-top: 8px; border-top: 1px dashed #e0d5bc; display: flex; align-items: center; justify-content: space-between; }
.dd-sticky-edit { font-size: 11px; color: #7c6f5e; background: rgba(0,0,0,.05); border: none; border-radius: 3px; padding: 2px 8px; cursor: pointer; transition: background .15s, color .15s; }
.dd-sticky-edit:hover { background: #e0d5bc; color: #4a3f32; }
.dd-sticky-meta { text-align: right; }
.dd-sticky-sections { display: flex; flex-direction: column; gap: 8px; }
.dd-sticky-section {
  border-radius: 4px; padding: 8px 10px;
  border-left: 3px solid transparent;
  background: rgba(255, 255, 255, 0.55);
  position: relative; z-index: 1;
}
.dd-sticky-section--sales {
  border-left-color: #14b8a6;
  background: rgba(20, 184, 166, 0.06);
}
.dd-sticky-section--delivery {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}
.dd-sticky-section-hd { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.dd-sticky-section-label { font-size: 11px; font-weight: 600; color: #8a7e66; letter-spacing: .5px; text-transform: uppercase; }
.dd-sticky-section-amount { font-size: 16px; font-weight: 700; color: #0f766e; line-height: 1; }
.dd-sticky-section-stats-inline { font-size: 12px; font-weight: 600; color: #b45309; }
.dd-sticky-section-content { font-size: 13px; color: #5c5548; line-height: 1.75; }
.dd-sticky-item-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dd-sticky-item-info { flex: 1; min-width: 0; word-break: break-word; font-size: 11px; }
.dd-sticky-item-price { white-space: nowrap; flex-shrink: 0; font-size: 11px; color: #7a6e56; }
.dd-sticky-unit-price { font-size: 11px; }
.dd-sticky-item-amount { font-size: 13px; font-weight: 700; }
.dd-sticky-products { font-size: 13px; color: #5c5548; line-height: 1.55; word-break: break-word; }
.dd-sticky-empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--ink-soft); font-size: 15px; }

@media (max-width: 640px) {
  .dd-sticky-grid { grid-template-columns: 1fr; gap: 14px; }
  .dd-sticky:nth-child(n) { transform: rotate(0deg) !important; }
}

/* ─── 概览页骨架屏 ─── */
.skel-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
  border-radius: 10px;
}
@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.home-skeleton { max-width: 920px; margin: 0 auto; position: relative; }
.home-skeleton .skel-welcome {
  height: 64px; border-radius: 50px; margin-bottom: 16px;
}
.home-skeleton .skel-chart-card {
  background: rgba(255, 255, 255, 0.4); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 28px 28px 28px 12px;
  padding: 22px 26px; margin-bottom: 16px;
}
.home-skeleton .skel-chart-bar {
  height: 210px; border-radius: 12px; margin-top: 12px;
}
.home-skeleton .skel-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.home-skeleton .skel-stat {
  background: rgba(255, 255, 255, 0.4); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 20px;
  padding: 20px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.home-skeleton .skel-stat-icon {
  width: 40px; height: 40px; border-radius: 12px;
}
.home-skeleton .skel-stat-num {
  width: 56px; height: 24px;
}
.home-skeleton .skel-stat-label {
  width: 80px; height: 14px;
}
@media (max-width: 640px) {
  .home-skeleton .skel-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (max-width: 768px) {
  .home-bento { grid-template-columns: repeat(4, 1fr); }
  .home-chart-card { grid-column: span 4; grid-row: span 1; }
  .stat-card--hero { grid-column: span 2; grid-row: span 1; flex-direction: column; justify-content: center; padding: 18px 16px !important; border-radius: 20px !important; }
  .stat-card--hero .stat-ico { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; margin-bottom: 10px; }
  .stat-card--hero .stat-num { font-size: 28px; }
  .stat-card { grid-column: span 2; }
  .stat-card--wide { grid-column: span 4; }
  .home-alert-card { grid-column: span 4; }
}
@media (max-width: 480px) {
  .home-bento { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .home-chart-card { grid-column: span 2; border-radius: 20px; }
  .stat-card--hero { grid-column: span 1; border-radius: 16px !important; }
  .stat-card { grid-column: span 1; border-radius: 16px; }
  .stat-card--wide { grid-column: span 2; border-radius: 16px; }
  .home-alert-card { grid-column: span 2; }
  .home-welcome { font-size: 16px; padding: 18px 22px; border-radius: 40px; }
  .home-chart-card { padding: 18px 20px; }
  .stat-num { font-size: 22px; }
}
@media (max-width: 640px) {
  .toolbar { width: 100%; }
  .toolbar .topbar-search { width: 100%; }
  .repay-layout { flex-direction: column; align-items: center; }
  .repay-qr-side { flex: none; }
  .tbl-wrap { overflow-x: auto; }
  .tbl { min-width: 640px; }
}
/* ---- 知识库 ---- */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 4px 0;
}
.kb-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.kb-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.kb-card-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #6366f1, #8b5cf6);
  flex: none;
}
.kb-card-body {
  padding: 14px 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kb-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.kb-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-ink);
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}
.kb-card-cat {
  font-size: 11px;
  background: var(--brand-bg);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex: none;
  font-weight: 500;
}
.kb-card-excerpt {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kb-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.kb-tag {
  font-size: 10px;
  background: #f1f5f9;
  color: #64748b;
  padding: 1px 7px;
  border-radius: 3px;
}
.kb-card-attach {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--brand);
  padding: 4px 8px; background: var(--brand-bg);
  border-radius: 5px; cursor: pointer;
  transition: background .15s;
}
.kb-card-attach:hover { background: #e0e7ff; }
.kb-card-attach svg { flex: none; width: 14px; height: 14px; }
.kb-card-attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-card-meta {
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
/* 知识库详情 */
.kb-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kb-detail-divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}
.kb-content {
  font-size: 14px;
  color: var(--brand-ink);
  line-height: 1.75;
}
.kb-content h1 { font-size: 22px; font-weight: 700; margin: 16px 0 8px; }
.kb-content h2 { font-size: 18px; font-weight: 700; margin: 14px 0 6px; }
.kb-content h3 { font-size: 15px; font-weight: 600; margin: 12px 0 4px; }
.kb-content p { margin: 0 0 10px; }
.kb-content ul, .kb-content ol { padding-left: 20px; margin: 0 0 10px; }
.kb-content li { margin-bottom: 4px; }
.kb-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 10px;
}
.kb-content code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .9em;
  color: #e11d48;
}
.kb-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.kb-content blockquote {
  border-left: 3px solid var(--brand);
  padding: 4px 12px;
  margin: 0 0 10px;
  color: var(--ink-soft);
  background: var(--brand-bg);
  border-radius: 0 4px 4px 0;
}
.kb-content a { color: var(--brand); text-decoration: underline; }
@media (max-width: 640px) {
  .kb-grid { grid-template-columns: 1fr; gap: 12px; }
}
/* 知识库页签 */
/* 聊天搜索 */
#view-basic.kb-chat-mode {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#kb-chat-area {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--panel); overflow: hidden;
}
#kb-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
/* 微信式聊天气泡 */
.kb-chat-row { display: flex; align-items: flex-start; gap: 10px; }
.kb-chat-row--user { flex-direction: row-reverse; }
.kb-chat-avatar {
  width: 36px; height: 36px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
  background: #f0f2f5;
}
.kb-chat-msg {
  max-width: 78%; padding: 10px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.55; word-break: break-word;
}
.kb-chat-msg--user {
  align-self: flex-end;
  background: var(--brand-grad); color: #fff;
  border-bottom-right-radius: 4px;
}
.kb-chat-msg--sys {
  align-self: flex-start;
  background: #f1f5f9; color: var(--ink);
  border-bottom-left-radius: 4px;
  max-width: 88%;
}
.kb-chat-empty { color: var(--ink-soft); font-size: 13px; }
.kb-chat-typing {
  display: flex; align-items: center; gap: 4px;
}
.kb-chat-typing::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  background: var(--ink-soft); border-radius: 50%;
  animation: kb-blink 1.4s infinite both;
}
.kb-chat-typing::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  background: var(--ink-soft); border-radius: 50%;
  animation: kb-blink 1.4s .2s infinite both;
}
.kb-chat-typing{ position:relative }
.kb-chat-typing::before,.kb-chat-typing::after{ position:static }
@keyframes kb-blink { 0%,80%,100%{opacity:.3} 40%{opacity:1} }
.kb-chat-results { display: flex; flex-direction: column; gap: 8px; }
.kb-chat-results-hint { font-size: 12px; color: var(--ink-soft); margin-bottom: 2px; }
.kb-chat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; transition: box-shadow .2s;
}
.kb-chat-card:hover { box-shadow: var(--sh-1); }
.kb-chat-card-title { font-size: 14px; font-weight: 700; color: var(--brand-ink); margin-bottom: 4px; }
.kb-chat-card-excerpt { font-size: 12px; color: var(--ink-soft); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kb-chat-card-meta { font-size: 10px; color: var(--ink-soft); margin-top: 4px; }
.kb-chat-input-wrap {
  display: flex; gap: 10px; padding: 16px 20px;
  border-top: 1px solid var(--line); background: #fafbfc;
}
.kb-chat-input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; font-size: 15px; outline: none;
  transition: border-color .2s; background: #fff;
  min-height: 48px; max-height: 160px;
  resize: none; overflow-y: auto;
  font-family: inherit; line-height: 1.5;
}
.kb-chat-input:focus { border-color: var(--brand); }
.kb-chat-input-wrap .toolbar { align-items: flex-end; }
/* AI 回答 */
.kb-chat-answer { margin-bottom: 12px; }
.kb-chat-answer-label { font-size: 12px; color: var(--brand); font-weight: 600; margin-bottom: 8px; }
.kb-chat-answer-text { font-size: 14px; color: var(--brand-ink); line-height: 1.7; word-break: break-word; }
.kb-chat-answer-text strong { color: var(--brand-ink); }
/* 来源引用 */
.kb-chat-sources {
  border-top: 1px solid var(--line);
  padding-top: 10px; margin-top: 4px;
}
.kb-chat-sources-label { font-size: 11px; color: var(--ink-soft); margin-bottom: 6px; font-weight: 600; }
.kb-chat-source {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border-radius: 6px; cursor: pointer; transition: background .15s;
  font-size: 12px;
}
.kb-chat-source:hover { background: #f0f3ff; }
.kb-chat-source-idx { color: var(--brand); font-weight: 700; min-width: 22px; }
.kb-chat-source-title { color: var(--brand-ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-chat-source-cat { font-size: 10px; color: var(--ink-soft); background: #f0f2f5; padding: 1px 6px; border-radius: 3px; }
.kb-chat-source-file { font-size: 14px; }
/* 保留旧卡片样式（资料浏览页用） */
.kb-chat-results { display: flex; flex-direction: column; gap: 8px; }
.kb-chat-results-hint { font-size: 12px; color: var(--ink-soft); margin-bottom: 2px; }
.kb-chat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; transition: box-shadow .2s;
}
.kb-chat-card:hover { box-shadow: var(--sh-1); }
.kb-chat-card-title { font-size: 14px; font-weight: 700; color: var(--brand-ink); margin-bottom: 4px; }
.kb-chat-card-excerpt { font-size: 12px; color: var(--ink-soft); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kb-chat-card-meta { font-size: 10px; color: var(--ink-soft); margin-top: 4px; }
@media (max-width: 640px) {
  .kb-chat-msg { max-width: 90%; }
}

/* ===== 门店库存卡片 ===== */
.si-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.si-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.si-card-head { display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.si-store-name { font-size: 15px; font-weight: 700; color: var(--brand-ink); }
.si-store-count { font-size: 12px; color: var(--ink-soft); }
.si-card-body { padding: 0 0 8px; }
.si-header-row, .si-item { display: grid; grid-template-columns: 1fr auto;
  align-items: center; padding: 8px 18px; gap: 8px; }
.si-header-row { font-size: 11px; color: var(--ink-soft); font-weight: 600;
  border-bottom: 1px solid var(--line); padding-bottom: 6px; background: var(--bg-2); }
.si-item { font-size: 14px; color: var(--ink); }
.si-item-alt { background: var(--bg); }
.si-cat-chip-line { padding: 9px 18px 2px; line-height: 1; }
.si-cat-chip { display: inline-block; color: #fff; font-size: 10px; line-height: 1; padding: 3px 6px;
  border-radius: 3px; margin-right: 8px; font-weight: 600; vertical-align: middle;
  flex-shrink: 0; letter-spacing: 0.3px; }
.si-product { display: flex; align-items: center; min-width: 0; overflow: visible; }
.si-product-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.si-qty { text-align: right; font-weight: 600; color: var(--brand-ink); padding-right: 6px; }
.si-warn-badge { display: inline-block; background: #fdecea; color: #c0392b; font-size: 11px;
  padding: 1px 6px; border-radius: 3px; margin-left: 8px; font-weight: 600; vertical-align: middle;
  animation: warnPulse 1.6s ease-in-out infinite; }
@keyframes warnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.35); transform: scale(1); }
  50% { box-shadow: 0 0 0 6px rgba(192,57,43,0); transform: scale(1.06); }
}
.si-item-edit, .si-item-del { background: none; border: none; cursor: pointer;
  font-size: 16px; padding: 2px 4px; border-radius: 4px; transition: background .15s; }
.si-item-edit { color: var(--brand); }
.si-item-edit:hover { background: var(--bg-2); }
.si-item-del { color: #ef4444; }
.si-item-del:hover { background: #fef2f2; }
.si-empty { padding: 20px 18px; text-align: center; color: var(--ink-soft); font-size: 13px; }

/* ---------- 库存盘点 ---------- */
.check-items-wrap { margin-bottom: 6px; }
.check-items-head { display: grid; grid-template-columns: 1fr 120px 120px; gap: 8px;
  font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 0 12px 6px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.check-items-head span:not(:first-child) { text-align: center; }
.check-item { display: grid; grid-template-columns: 1fr 120px 120px; gap: 8px;
  align-items: center; padding: 6px 12px; border-radius: 8px; border-left: 5px solid transparent; }
.check-product-name { font-weight: 500; font-size: 14px; }
.check-pre-qty { text-align: center; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.check-post-qty { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.check-post-qty:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); outline: none; }

/* 第三方商品对应表 - 大卡片布局 */
.mapping-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin: 0 0 16px;
}
.mapping-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.mapping-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.mapping-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.mapping-card-idx {
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.mapping-card-source {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}
.mapping-card-body {
  padding: 16px;
}
.mapping-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mapping-card-row + .mapping-card-row {
  margin-top: 12px;
}
.mapping-card-label {
  flex-shrink: 0;
  width: 64px;
  font-size: 13px;
  color: var(--ink-soft);
}
.mapping-card-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mapping-external {
  flex: 1;
  min-width: 0;
}
.mapping-card-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.mapping-linked {
  flex: 1;
  min-width: 0;
}
.mapping-linked-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  background: #eff6ff;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mapping-prod-select {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: var(--panel);
  color: var(--ink);
}
.mapping-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: auto;
}
.mapping-badge-bound {
  background: #dcfce7;
  color: #166534;
}
.mapping-badge-pending {
  background: #fef3c7;
  color: #92400e;
}
/* 第三方商品对应表：忽略按钮（尺寸与「待绑定」徽标一致） */
.btn-mapping-ignore {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.4;
}
.btn-mapping-ignore:hover {
  background: #e5e7eb;
  color: #374151;
}
/* 采购入库／出库列表中未绑定的第三方商品名 */
.prod-unmapped {
  color: #d97706;
  background: #fffbeb;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.88em;
  cursor: help;
  border: 1px dashed #f59e0b;
}
.prod-unmapped:hover {
  background: #fef3c7;
}
.mapping-card-bound {
  border-left: 3px solid #16a34a;
}
.mapping-card-pending {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
}
.mapping-prod-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  outline: none;
}
.mapping-bind,
.mapping-unbind {
  flex-shrink: 0;
}
/* 第三方商品对应表：批量绑定 */
.mapping-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand);
}
.mapping-check-spacer {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.mapping-batchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.mapping-batch-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.mapping-batch-chk input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}
.mapping-sel-count {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.mapping-batch-select {
  flex: 1;
  min-width: 0;
  max-width: 360px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: var(--panel);
  color: var(--ink);
}
.mapping-batch-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  outline: none;
}

/* =========================================================
   水 · 玻璃质感主题增强
   基于 --panel 已设为半透明白，叠加毛玻璃模糊形成通透玻璃观感
   ========================================================= */
/* 持久层 + 主要卡片：毛玻璃 */
.topbar, .sidebar, .modal, .card, .panel-card, .settings-card, .todo-card,
.rule-card, .insp-card, .insp-record-card, .proj-card, .courier-card,
.placeholder-card, .si-card, .stat-card, .combobox-panel {
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
/* 顶栏 / 侧栏：水色描边，强化通透感 */
.topbar { border-color: rgba(14, 165, 233, 0.16); }
.sidebar { border-color: rgba(14, 165, 233, 0.16); }
/* 活跃导航项左侧水色指示条 */
.nav-item.active::before,
.nav-subitem.active::before { background: var(--brand-grad); }

/* ---------- 门店日历组件 ---------- */
.calendar-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-bottom: 1px solid #e0e8f0;
}
.calendar-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e3a5f;
  min-width: 140px;
  text-align: center;
}
.cal-nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.cal-nav-btn:hover {
  background: #0ea5e9;
  color: #fff;
  border-color: #0ea5e9;
}
.cal-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid #e0e8f0;
}
.cal-header-cell {
  padding: 10px 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
}
.cal-header-cell:first-child,
.cal-header-cell:last-child {
  color: #ef4444; /* 周日/周六标红 */
}
.cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-day {
  min-height: 90px;
  padding: 4px 6px;
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  transition: background 0.12s;
}
.cal-day:hover {
  background: #f8fafc;
}
.cal-day--empty {
  background: #fafbfc;
}
.cal-day--today {
  background: #fffbeb;
}
.cal-day--today:hover {
  background: #fef3c7;
}
.cal-day-num {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 4px;
  text-align: right;
}
.cal-day--today .cal-day-num {
  color: #d97706;
  font-weight: 700;
}
.cal-day:first-child .cal-day-num,
.cal-day:last-child .cal-day-num {
  color: #ef4444;
}
/* 日历事件标签 — 圆形大标签 / 醒目胶囊 */
.cal-leave-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #fecaca;
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.25;
  cursor: default;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.07);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  max-width: 100%;
}
.cal-leave-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
}
/* 左侧圆形类型徽标（醒目如 App 图标） */
.cal-tag-badge {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
}
/* 周日自动店休：独立徽章（无胶囊容器），稍大一圈 */
.cal-tag-badge--solo {
  width: 26px;
  height: 26px;
  font-size: 14px;
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  cursor: default;
  margin: 2px 0;
}
.cal-leave-sub {
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
/* 值班：橙红渐变 */
.cal-leave-tag--duty {
  background: linear-gradient(135deg, #fff7ed 0%, #fff1f2 100%);
  border-color: #fdba74;
}
.cal-leave-tag--duty .cal-tag-badge {
  background: linear-gradient(135deg, #fb7185 0%, #f97316 100%);
}
/* 活动：蓝紫渐变 */
.cal-leave-tag--event {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border-color: #93c5fd;
}
.cal-leave-tag--event .cal-tag-badge {
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
}
/* 门店休息：醒目浅灰框线胶囊 */
.cal-leave-tag--rest {
  background: #f8fafc;
  border: 1.5px solid #94a3b8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(15, 23, 42, 0.07);
}
.cal-leave-tag--rest .cal-tag-badge {
  background: #475569;
}
.calendar-loading {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
  font-size: 14px;
}

/* 响应式：小屏日历单元格高度自适应 */
@media (max-width: 768px) {
  .cal-day { min-height: 70px; }
  .calendar-title { font-size: 17px; min-width: 110px; }
  .calendar-head { padding: 12px 14px; gap: 10px; }
  .cal-leave-tag { font-size: 11px; padding: 2px 8px 2px 3px; gap: 5px; }
  .cal-tag-badge { width: 19px; height: 19px; font-size: 11px; }
  .cal-tag-badge--solo { width: 22px; height: 22px; font-size: 12px; }
}

/* ---------- 地址导航页 ---------- */
#view-nav {
  position: fixed;
  inset: 0;
  z-index: 420; /* 高于顶部胶囊(300)、侧边栏(380)、弹窗遮罩(400) */
  background: #f6f7fb;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
#view-nav[hidden] { display: none !important; }
.nav-page {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.nav-page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-1);
  flex: 0 0 auto;
}
.nav-back {
  width: 36px; height: 36px;
  border: none; background: transparent;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s;
}
.nav-back:active { background: var(--line-2); }
.nav-page-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  text-align: center;
  padding-right: 36px;
}
.nav-address-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.nav-address-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border-radius: var(--r-pill);
  padding: 8px 12px;
  min-width: 0;
}
.nav-address-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.nav-address-input input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
}
.nav-address-clear {
  width: 22px; height: 22px;
  border: none; background: #cbd5e1;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.nav-go-btn {
  flex: 0 0 auto;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-map-wrap {
  flex: 1 1 auto;
  position: relative;
  min-height: 300px;
  overflow: hidden;
}
.nav-map-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-2);
  font-size: 14px;
  background: #f1f5f9;
}
.nav-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: nav-spin 0.8s linear infinite;
}
@keyframes nav-spin { to { transform: rotate(360deg); } }

/* 全系统统一「数据加载中」：概览页同款圆形转圈 + 文字 */
.data-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px;
  color: var(--ink-soft, #8a90a6); font-size: 14px; text-align: center;
}
.data-loading .nav-spinner { width: 28px; height: 28px; border-width: 3px; }
.data-loading--inline { flex-direction: row; gap: 10px; padding: 20px; font-size: 13px; }
.data-loading--inline .nav-spinner { width: 18px; height: 18px; border-width: 2px; }
.nav-map-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.nav-marker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: max-content;
  pointer-events: none;
}
.nav-marker-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 6px;
  background: linear-gradient(135deg, #ffffff 0%, #eaf5ff 100%);
  border: 1.5px solid var(--brand);
  color: var(--brand-ink);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 3px 14px rgba(22,119,255,0.18), 0 0 0 1px rgba(22,119,255,0.08);
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}
.nav-marker-label::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--brand);
}
.nav-marker-dot {
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.18);
  flex-shrink: 0;
}
.nav-marker-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 26px;
  height: 34px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.22));
}
.amap-logo, .amap-copyright {
  opacity: 0.75 !important;
}
@media (max-width: 768px) {
  .nav-address-bar { padding: 10px 12px; }
  .nav-go-btn { padding: 8px 14px; }
  .nav-page-title { font-size: 16px; }
}

/* ===== 角色权限管理 ===== */
.perm-page {
  padding: 0 0 24px 0;
}
.perm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 0 16px 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  margin-bottom: 16px;
}
.perm-role-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-field, #f3f4f6);
  border-radius: 10px;
  padding: 3px;
}
.perm-role-tab {
  padding: 6px 18px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s;
}
.perm-role-tab:hover {
  color: var(--text-primary, #1a1a2e);
}
.perm-role-tab.active {
  background: #fff;
  color: var(--accent, #2563eb);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.perm-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.perm-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  user-select: none;
}
.perm-select-all input {
  width: 16px;
  height: 16px;
}
.perm-groups { display: flex; flex-direction: column; gap: 8px; }
/* 特殊功能权限块（角色权限页顶部，如批量导入开关） */
.perm-features-block {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.perm-features-head {
  display: flex; align-items: center;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(14,165,233,.08), rgba(14,165,233,0));
  border-bottom: 1px solid var(--line, #f0f2f5);
}
.perm-features-title { font-size: 13px; font-weight: 700; color: var(--brand, #0ea5e9); }
.perm-features-block .perm-mod-row { padding-left: 16px; }
.perm-group { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; overflow: hidden; transition: border-color .15s; }
.perm-group.open { border-color: var(--brand, #2563eb); }
.perm-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; cursor: pointer; user-select: none;
  background: #f9fafb; transition: background .15s;
}
.perm-group-head:hover { background: #f3f4f6; }
.perm-group-arrow { font-size: 11px; color: var(--ink-soft, #6b7280); flex: none; transition: transform .2s; }
.perm-group-label { font-weight: 700; font-size: 14px; color: var(--ink, #111827); flex: 1; }
.perm-group-count { font-size: 12px; color: var(--ink-soft, #6b7280); flex: none; background: #e5e7eb; padding: 2px 8px; border-radius: 999px; }
.perm-group-body { padding: 4px 0; }
.perm-mod-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 8px 36px; transition: background .1s;
}
.perm-mod-row:hover { background: #f9fafb; }
.perm-mod-label { font-size: 14px; color: var(--ink, #111827); }
.perm-mod-switches { display: flex; gap: 16px; align-items: center; flex: none; }
.perm-switch-col { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.perm-switch-cap { font-size: 11px; color: var(--ink-soft, #6b7280); line-height: 1; }
/* 开关式 toggle */
.perm-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.perm-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.perm-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #d1d5db;
  transition: 0.2s;
  border-radius: 24px;
}
.perm-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.2s;
  border-radius: 50%;
}
.perm-switch input:checked + .perm-slider {
  background-color: var(--accent, #2563eb);
}
.perm-switch input:checked + .perm-slider::before {
  transform: translateX(20px);
}

/* 概览页卡片显示权限区（角色权限页内） */
.perm-cards-block {
  margin: 2px 14px 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px dashed var(--line, #e6e8ec);
  border-radius: 8px;
}
.perm-cards-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.perm-cards-title { font-size: 13px; font-weight: 700; color: var(--ink, #1e2233); flex: 1; }
.perm-cards-all {
  font-size: 12px;
  color: var(--ink-soft, #6b7280);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}
.perm-cards-all input { margin: 0; accent-color: var(--brand, #0ea5e9); }
.perm-cards-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-card-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink, #1e2233);
  background: #fff;
  border: 1px solid var(--line, #e6e8ec);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, color .15s;
}
.perm-card-chip:hover { border-color: var(--brand, #0ea5e9); }
.perm-card-chip input { margin: 0; accent-color: var(--brand, #0ea5e9); }
.perm-card-chip input:checked + span { color: var(--brand, #0ea5e9); font-weight: 600; }
.perm-card-chip.disabled { opacity: .5; cursor: not-allowed; }

/* 蓝色图标按钮（配送总量等入口） */
.btn-icon-blue {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand, #0ea5e9);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14, 165, 233, .25);
  transition: all .15s;
}
/* 刷新中：图标旋转动画，给点击明确的视觉反馈 */
.btn-icon-blue.refreshing svg { animation: xb-spin .7s linear infinite; }
.btn-icon-blue.refreshing { opacity: .6; pointer-events: none; }
@keyframes xb-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.btn-icon-blue:hover { background: #38bdf8; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(14, 165, 233, .35); }
.btn-icon-blue:active { transform: translateY(0); }
.btn-icon-blue svg { display: block; }

/* ---------- 订单分布弹窗 ---------- */
.dist-modal {
  width: 100vw; max-width: 100vw; max-height: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden; border-radius: 0;
}
.dist-modal .modal-body.dist-modal-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 0; padding: 0; }
.dist-map-wrap {
  flex: 1 1 52%; min-height: 260px; min-width: 0; position: relative;
  background: #f0f4f8;
}
.dist-map-container { width: 100%; height: 100%; min-height: 260px; }
.dist-edit-drag-hint {
  font-size: 12px; color: var(--muted, #94a3b8); text-align: center;
  padding: 8px 0; border-top: 1px solid var(--border, #e2e8f0);
  background: var(--bg, #f8fafc); flex: none;
}
.dist-list {
  flex: 1 1 48%; max-height: 48%;
  overflow-y: auto; padding: 10px 14px; gap: 8px;
  background: var(--bg, #f8fafc);
  border-top: 1px solid var(--border, #e2e8f0);
}
.dist-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px solid #e2e8f0;
  cursor: grab; transition: all .15s;
  margin-bottom: 8px; user-select: none;
}
.dist-list-item:hover { border-color: var(--brand, #0ea5e9); box-shadow: 0 2px 8px rgba(14,165,233,.15); }
.dist-list-item.active { border-color: var(--brand, #0ea5e9); background: #f0f9ff; }
.dist-list-item.dragging { opacity: .55; box-shadow: 0 4px 16px rgba(14,165,233,.3); border-color: var(--brand, #0ea5e9); }
.dist-list-item.drag-over { border-color: var(--brand, #0ea5e9); border-top: 3px solid var(--brand, #0ea5e9); padding-top: 8px; }
.dist-drag-handle {
  font-size: 18px; color: #94a3b8; flex: none; cursor: grab;
  padding: 8px 6px; margin: -8px -4px; /* 扩大触控热区，不改变布局 */
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.dist-drag-handle:active { cursor: grabbing; color: var(--brand, #0ea5e9); }
.dist-num {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--brand, #0ea5e9);
}
.dist-list-item .dist-info { flex: 1; min-width: 0; }
.dist-list-item .dist-addr { font-size: 13px; color: var(--ink, #1e293b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-list-item .dist-prods { font-size: 12px; color: var(--muted, #64748b); margin-top: 2px; }
.dist-list-item .dist-dist { font-size: 11px; color: var(--muted, #94a3b8); white-space: nowrap; }

/* 地图数字标记 */
.dist-marker {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand, #0ea5e9); color: #fff;
  font-size: 13px; font-weight: 700; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.dist-marker-home {
  background: #ef4444; width: 32px; height: 32px; font-size: 14px;
}

/* 配送卡片序号标签（待接单/配送中）：底部与操作按钮对齐，居左 */
.cc-route-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 6px; font-size: 12px; font-weight: 700;
  background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
  flex: none;
  align-self: flex-end; /* 与「刷新」等按钮底部对齐 */
  margin-right: auto;   /* 居左（按钮组靠右） */
}

/* 桌面表格序号徽章 */
.route-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 5px; font-size: 12px; font-weight: 700;
  background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
}

/* 订单详情小弹窗（仅地址+商品） */
.dist-info-popup {
  position: fixed; z-index: 410;
  background: #fff; border-radius: 12px; padding: 14px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  min-width: 240px; max-width: 86vw;
}
.dist-info-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dist-info-num {
  min-width: 26px; height: 26px; padding: 0 6px;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; background: var(--brand, #0ea5e9);
}
.dist-info-close {
  border: none; background: none; font-size: 20px; line-height: 1;
  color: var(--muted, #94a3b8); cursor: pointer; padding: 0 2px;
}
.dist-info-close:hover { color: var(--ink, #1e293b); }
.dist-info-addr { font-size: 14px; font-weight: 600; color: var(--ink, #1e293b); margin-bottom: 10px; word-break: break-all; }
.dist-info-prods { display: flex; flex-direction: column; gap: 4px; }
.dist-info-prod-item { font-size: 13px; color: var(--ink, #1e293b); }
.dist-info-prod-item b { color: var(--brand, #0ea5e9); }
.dist-drag-arrows { display: flex; flex-direction: column; gap: 2px; flex: none; }
.dist-drag-arrows button {
  width: 24px; height: 20px; border: 1px solid #d1d5db; border-radius: 4px;
  background: #f8fafc; color: var(--muted, #64748b); font-size: 9px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
}
.dist-drag-arrows button:hover:not(:disabled) { background: var(--brand, #0ea5e9); color: #fff; border-color: var(--brand, #0ea5e9); }
.dist-drag-arrows button:disabled { opacity: .3; cursor: not-allowed; }

@media (max-width: 640px) {
  .dist-map-wrap { flex: 1 1 40%; min-height: 200px; }
  .dist-map-container { min-height: 200px; }
  .dist-list { flex: 1 1 60%; max-height: 60%; padding: 8px 10px; }
}

/* ---------- 自定义确认弹窗（替代原生 confirm，去除"JavaScript"标题） ---------- */
.cf-overlay {
  position: fixed; inset: 0; z-index: 420;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; transition: opacity .15s;
}
.cf-overlay.show { opacity: 1; }
.cf-box {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 340px;
  padding: 20px 22px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
  transform: scale(.92); transition: transform .15s;
}
.cf-overlay.show .cf-box { transform: scale(1); }
.cf-title { font-size: 16px; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.cf-msg { font-size: 14px; color: #475569; line-height: 1.6; margin-bottom: 18px; word-break: break-all; }
.cf-btns { display: flex; gap: 10px; justify-content: flex-end; }
.cf-btns .btn { min-width: 84px; justify-content: center; }
.cf-btns .cf-cancel { background: #f1f5f9; border-color: transparent; color: #475569; }
.cf-btns .cf-danger { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 14px rgba(239, 68, 68, .3); }

/* ---------- 小程序会员卡片 ---------- */
.mpu-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; margin-top: 12px; }
.mpu-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; transition: box-shadow .18s, transform .12s; }
.mpu-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.mpu-card-top { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.mpu-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--line-2); }
.mpu-avatar-default { display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); border: 2px solid var(--brand-soft); }
.mpu-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mpu-row { display: flex; align-items: baseline; gap: 8px; }
.mpu-label { font-size: 12px; color: var(--ink-faint); flex-shrink: 0; min-width: 42px; }
.mpu-value { font-size: 14px; color: var(--ink); word-break: break-all; }
.mpu-oid { font-size: 12px; color: var(--ink-soft); font-family: monospace; }
.mpu-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.mpu-card-addr { padding: 12px 18px 14px; }
.mpu-addr-title { font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; font-weight: 600; }
.mpu-addr { padding: 8px 10px; border-radius: 8px; background: var(--bg-2, #f8f9fb); margin-bottom: 6px; }
.mpu-addr:last-child { margin-bottom: 0; }
.mpu-addr-default { border: 1px solid var(--brand-soft); }
.mpu-addr-line1 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mpu-addr-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.mpu-addr-phone { font-size: 13px; color: var(--ink-soft); }
.mpu-addr-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); }
.mpu-addr-text { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.mpu-muted { color: var(--ink-faint); font-size: 13px; }

/* ---------- 活动票券卡片（水票套餐 / 优惠券） ---------- */
.tk-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; transition: box-shadow .18s, transform .12s; }
.tk-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.tk-card-top { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; }
.tk-card-icon { font-size: 32px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.tk-card-cover { width: 110px; height: 110px; object-fit: contain; border-radius: var(--r-md); flex-shrink: 0; border: 1px solid var(--line-2); background: #ffffff; }
.tk-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tk-card-name { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 4px; word-break: break-all; }
.tk-card-row { display: flex; align-items: baseline; gap: 8px; }
.tk-amounts-row { justify-content: space-between; flex-wrap: nowrap; white-space: nowrap; }
.tk-amounts-left, .tk-amounts-right { display: flex; align-items: baseline; gap: 6px; flex-shrink: 0; white-space: nowrap; }
.tk-amounts-row .tk-label { min-width: 0; }
.tk-amounts-row .tk-value { word-break: normal; white-space: nowrap; }
.tk-label { font-size: 12px; color: var(--ink-faint); flex-shrink: 0; min-width: 56px; }
.tk-value { font-size: 14px; color: var(--ink); word-break: break-all; }
.tk-orig { color: var(--ink-soft); text-decoration: line-through; }
.tk-disc { color: #e25050; font-weight: 600; }
.tk-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.tk-badge { font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.tk-badge-on { background: #e8f5e9; color: #2e7d32; }
.tk-badge-off { background: #f5f5f5; color: #999; }
.tk-card-actions { display: flex; flex-direction: column; gap: 6px; }

/* 销售看板排名奖牌动效（冠军/亚军/季军轻轻跳动 + 光晕呼吸） */
/* 子弹图（PC / PET 双指标）：渐变实际条 + 目标刻度线 */
.tech-bullet-track {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: var(--bg);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.05);
}
.tech-bullet-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 6px;
  transform-origin: left center;
  animation: bulletGrow .85s cubic-bezier(.22, 1, .36, 1) both;
}
.tech-bullet-target {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 18px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--ink);
  opacity: .55;
  animation: bulletMark .5s ease .7s both;
}
.tech-bullet-target::after {
  content: '';
  position: absolute;
  left: -2px;
  bottom: -5px;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--ink);
  opacity: .55;
  transform: rotate(45deg);
}
@keyframes bulletGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bulletMark { from { opacity: 0; } to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .tech-bullet-fill, .tech-bullet-target { animation: none; }
}
/* 圆角长方体行表格：销量目标完成情况明细 / 销售明细 / 销售排名 共用
   注意：全部用 > 直接子代，避免穿透到「销售明细」行内嵌的商品微表 */
.tc-pill { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.tc-pill > thead > tr > th {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.10), rgba(59, 130, 246, 0.03));
  border-top: 1px solid rgba(59, 130, 246, 0.22);
  border-bottom: 1px solid rgba(59, 130, 246, 0.22);
}
.tc-pill > thead > tr > th:first-child {
  border-left: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 10px 0 0 10px;
  padding-left: 16px;
}
.tc-pill > thead > tr > th:last-child {
  border-right: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 0 10px 10px 0;
  padding-right: 16px;
}
.tc-pill > tbody > tr > td {
  padding: 11px 16px;
  font-size: 13px;
  vertical-align: middle;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background .15s ease, border-color .15s ease;
}
.tc-pill > tbody > tr > td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
  padding-left: 16px;
}
.tc-pill > tbody > tr > td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
  padding-right: 16px;
}
.tc-pill > tbody > tr.tc-alt > td { background: var(--bg); }
.tc-pill > tbody > tr.tc-top > td { background: rgba(255, 193, 7, 0.07); border-color: rgba(255, 193, 7, 0.28); }
.tc-pill > tbody > tr.tc-sum > td { background: rgba(59, 130, 246, 0.06); border-color: rgba(59, 130, 246, 0.25); font-weight: 700; }
.tc-pill > tbody > tr:hover > td { background: rgba(59, 130, 246, 0.06); border-color: rgba(59, 130, 246, 0.28); }
.tc-pill > tbody > tr > td.tc-empty {
  padding: 22px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
/* 商品明细：销售明细胶囊内嵌的微表（无边框、紧凑、数字等宽右对齐） */
.tc-pill table.tc-sub { width: 100%; border-collapse: collapse; }
.tc-pill table.tc-sub td {
  padding: 3px 0;
  font-size: 12.5px;
  font-weight: 400;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-variant-numeric: tabular-nums;
}
.tc-pill table.tc-sub tr.tc-sub-sum td { border-top: 1px solid var(--line-2); padding-top: 5px; font-weight: 700; }
/* 微表表头（放在 thead 的 th 内）：与商品行同宽，逐列对齐；视觉上弱化为列名 */
.tc-pill table.tc-sub.tc-sub-head td {
  padding: 2px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
@keyframes rankFloat {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 transparent); }
  50% { transform: translateY(-2.5px) scale(1.07); filter: drop-shadow(0 2px 5px var(--mc, #c8901a)); }
}
.rank-medal { animation: rankFloat 1.8s ease-in-out infinite; will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .rank-medal { animation: none; }
}

/* ---------- 销售看板 · 科技感卡片 ---------- */
.tech-card {
  background:
    linear-gradient(135deg, var(--panel) 0%, var(--panel) 52%, rgba(59, 130, 246, 0.035) 100%);
  border: 1px solid var(--line);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 10px 26px -14px rgba(37, 99, 235, 0.22);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .28s ease, border-color .28s ease;
  will-change: transform;
}
.tech-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 2px 4px rgba(16, 24, 40, 0.05),
    0 18px 40px -16px rgba(37, 99, 235, 0.32);
  border-color: rgba(59, 130, 246, 0.32);
}
/* 月活跃柱状图柱体悬浮 */
.tech-bar { transition: opacity .2s ease, filter .2s ease; opacity: .92; }
.tech-bar:hover { opacity: 1; filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.55)); }
@media (prefers-reduced-motion: reduce) {
  .tech-card, .tech-bar { transition: none; }
}
