:root {
  --bg: #f5f7fb;
  --bg-grad: #f5f7fb;
  --card: #ffffff;
  --line: #e7ebf3;
  --line-strong: #d8deea;
  --text: #161b26;
  --muted: #717c92;
  --muted-2: #9aa3b5;
  --primary: #2563eb;
  --primary-soft: #eaf0ff;
  --primary-dark: #1d4ed8;
  --success: #15a866;
  --success-soft: #e2f6ec;
  --warn: #ec9a13;
  --warn-soft: #fcf0d8;
  --danger: #e5484d;
  --danger-soft: #fde4e4;
  --violet: #6a4bd6;
  --violet-soft: #ece7fb;
  --shadow: 0 1px 2px rgba(20, 27, 45, 0.04), 0 6px 18px rgba(20, 27, 45, 0.05);
  --shadow-md: 0 2px 6px rgba(20, 27, 45, 0.06), 0 12px 28px rgba(20, 27, 45, 0.08);
  --shadow-lg: 0 20px 60px rgba(20, 27, 45, 0.22);
  --radius-sm: 9px;
  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-grad); background-attachment: fixed; color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
h2, h3 { margin: 0; }
::selection { background: rgba(54,103,255,.18); }

/* ===== Layout：mobile-first，手机默认单列、侧边栏抽屉，桌面 ≥960px 升级两栏 ===== */
.layout { display: flex; min-height: 100vh; flex-direction: column; }
.main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}

/* ===== 侧边栏：手机端不显示，桌面端常驻 ===== */
.sidenav {
  display: none;
  flex-direction: column;
  background: #0f172a; color: #cbd5e1;
}
.sidenav-mask { display: none; }

.sidenav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.06);
  flex: 0 0 auto;
}
.sidenav-head .brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sidenav-head .brand > div { min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(140deg, #1e3a8a 0%, #2563eb 55%, #60a5fa 100%);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 18px; letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(37,99,235,.4);
  flex: 0 0 auto;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .3px; color: #fff; }
.brand-sub {
  font-size: 11px; color: rgba(203,213,225,.65); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
.sidenav-toggle {
  background: transparent; border: none; color: rgba(203,213,225,.7);
  width: 28px; height: 28px; border-radius: 6px;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; transition: background .14s, color .14s;
}
.sidenav-toggle svg { width: 16px; height: 16px; transition: transform .2s ease; }
.sidenav-toggle:hover { background: rgba(255,255,255,.06); color: #fff; }

.sidenav-list {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 12px 10px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.sidenav-list::-webkit-scrollbar { width: 6px; }
.sidenav-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.sidenav-section { display: flex; flex-direction: column; gap: 2px; }
.sidenav-section-title {
  padding: 4px 10px 6px; font-size: 11px; font-weight: 700;
  color: rgba(203,213,225,.45); letter-spacing: .6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 8px;
  background: transparent; border: none; color: #cbd5e1;
  font-size: 13.5px; cursor: pointer; transition: background .14s, color .14s;
  text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(37,99,235,.95), rgba(59,130,246,.85));
  color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,.4);
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.22); color: #fff; }
.nav-ic {
  width: 18px; height: 18px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; color: inherit;
}
.nav-ic svg { width: 18px; height: 18px; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  background: rgba(255,255,255,.08); color: #cbd5e1;
  border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700;
  min-width: 22px; text-align: center; line-height: 1.5;
}
.nav-badge.hot { background: rgba(251,191,36,.18); color: #fcd34d; }
.nav-badge.danger { background: rgba(239,68,68,.18); color: #fca5a5; }
.nav-badge.ok { background: rgba(34,197,94,.18); color: #86efac; }
.nav-badge.violet { background: rgba(167,139,250,.18); color: #c4b5fd; }

.sidenav-foot {
  position: relative;
  padding: 12px; border-top: 1px solid rgba(255,255,255,.06);
  flex: 0 0 auto;
}

/* 侧边栏底部的用户胶囊 */
.user-chip {
  display: inline-flex; width: 100%; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.08);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background .14s, border-color .14s;
}
.user-chip:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.18); }
.user-chip.active { background: rgba(37,99,235,.25); border-color: rgba(96,165,250,.55); }
.user-chip-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #2563eb, #60a5fa); color: #fff;
  font-weight: 800; font-size: 12.5px; flex: 0 0 auto;
}
.user-chip-text { color: #fff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.user-chip-caret { color: rgba(255,255,255,.6); font-size: 10px; flex: 0 0 auto; }

/* 用户菜单：从底部向上弹出 */
.topbar-menu {
  position: absolute; left: 12px; right: 12px; bottom: calc(100% + 6px);
  z-index: 40;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.18);
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
  animation: pop .14s ease-out;
}
.menu-item {
  border: none; background: transparent; text-align: left;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--text);
  cursor: pointer; transition: background .12s;
}
.menu-item:hover { background: #f1f4fa; }
.menu-item.menu-danger { color: #b42318; }
.menu-item.menu-danger:hover { background: #fef2f2; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 8px; }

/* ===== 迷你顶栏 ===== */
.mini-topbar {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 22px;
  background: rgba(255,255,255,.94); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  border: 1px solid var(--line-strong); background: #fff; color: var(--muted);
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .14s, color .14s, border-color .14s;
}
.icon-btn:hover { background: #f5f7fb; color: var(--text); border-color: #c6d0e4; }
.icon-btn svg { width: 18px; height: 18px; }
.mini-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 口径胶囊 */
.scope-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  border: 1px solid #d6e0fb; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: background .14s, border-color .14s;
}
.scope-chip:hover { background: #dde7fc; border-color: #b8c8f5; }
.scope-chip.active { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.scope-chip-icon { display: inline-flex; }
.scope-chip-icon svg { width: 14px; height: 14px; }

.btn-sm svg { width: 14px; height: 14px; }

/* 口径弹层 */
.scope-pop {
  position: fixed; top: 64px; right: 24px; z-index: 60;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(15,23,42,.16);
  padding: 16px; max-width: 560px;
  display: flex; flex-direction: column; gap: 14px;
  animation: pop .14s ease-out;
}
.scope-pop .scope-group { flex-wrap: wrap; }

/* ===== 底部 tabbar（手机默认显示）===== */
.bottom-tabbar {
  display: flex; justify-content: space-around;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  background: #fff; border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(15,23,42,.08);
}
.bt-item {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: none; color: var(--muted);
  font-size: 11px; padding: 4px 2px; border-radius: 8px;
  cursor: pointer; transition: color .14s, background .14s;
}
.bt-item:hover { color: var(--text); background: #f5f7fb; }
.bt-item.active { color: var(--primary); }
.bt-item svg { width: 20px; height: 20px; }

/* ===== 手机版页面切换（data-mp 控制）===== */
.mobile-page { padding: 16px 16px 96px; display: none; flex-direction: column; gap: 14px; }

/* 工单页：顶部状态 chip 横向滚动 */
.mobile-status-bar {
  display: none; gap: 8px; padding: 10px 14px;
  background: #fff; border-bottom: 1px solid var(--line);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  position: sticky; top: 52px; z-index: 15;
}
.mobile-status-bar::-webkit-scrollbar { display: none; }
.m-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px 6px 9px; border-radius: 999px;
  background: var(--chip-bg, #f1f4fa);
  color: var(--chip-fg, var(--muted));
  border: 1px solid var(--chip-border, transparent);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background .14s, color .14s, border-color .14s, box-shadow .14s;
}
.m-chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--chip-dot, #94a3b8);
  flex: 0 0 auto;
}
.m-chip-ic { width: 13px; height: 13px; flex: 0 0 auto; opacity: .85; }
.m-chip-label { line-height: 1.1; }
.m-chip .m-chip-count {
  font-size: 11px; padding: 0 6px; border-radius: 999px;
  background: var(--chip-count-bg, rgba(15,23,42,.06));
  color: var(--chip-count-fg, inherit); font-weight: 700;
  min-width: 18px; text-align: center;
}
.m-chip:hover { box-shadow: inset 0 0 0 1px var(--chip-dot, rgba(15,23,42,.18)); }
.m-chip.active {
  background: var(--chip-dot, var(--primary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--chip-shadow, rgba(15,23,42,.18));
}
.m-chip.active .m-chip-dot { background: rgba(255,255,255,.85); }
.m-chip.active .m-chip-ic { opacity: 1; color: #fff; }
.m-chip.active .m-chip-count { background: rgba(255,255,255,.24); color: #fff; }

/* 10 种 tone 配色：浅底 + 圆点同色 */
.m-chip[data-tone="blue"]   { --chip-bg: #eff6ff; --chip-fg: #1d4ed8; --chip-dot: #2563eb; --chip-shadow: rgba(37,99,235,.30); }
.m-chip[data-tone="amber"]  { --chip-bg: #fffbeb; --chip-fg: #b45309; --chip-dot: #f59e0b; --chip-shadow: rgba(245,158,11,.30); }
.m-chip[data-tone="cyan"]   { --chip-bg: #ecfeff; --chip-fg: #0e7490; --chip-dot: #06b6d4; --chip-shadow: rgba(6,182,212,.30); }
.m-chip[data-tone="violet"] { --chip-bg: #f5f3ff; --chip-fg: #6d28d9; --chip-dot: #8b5cf6; --chip-shadow: rgba(139,92,246,.30); }
.m-chip[data-tone="slate"]  { --chip-bg: #f1f5f9; --chip-fg: #475569; --chip-dot: #64748b; --chip-shadow: rgba(100,116,139,.30); }
.m-chip[data-tone="orange"] { --chip-bg: #fff7ed; --chip-fg: #c2410c; --chip-dot: #f97316; --chip-shadow: rgba(249,115,22,.30); }
.m-chip[data-tone="red"]    { --chip-bg: #fef2f2; --chip-fg: #b91c1c; --chip-dot: #ef4444; --chip-shadow: rgba(239,68,68,.35); }
.m-chip[data-tone="green"]  { --chip-bg: #ecfdf5; --chip-fg: #047857; --chip-dot: #10b981; --chip-shadow: rgba(16,185,129,.30); }
.m-chip[data-tone="purple"] { --chip-bg: #faf5ff; --chip-fg: #7e22ce; --chip-dot: #a855f7; --chip-shadow: rgba(168,85,247,.30); }
.m-chip[data-tone="rose"]   { --chip-bg: #fff1f2; --chip-fg: #be123c; --chip-dot: #f43f5e; --chip-shadow: rgba(244,63,94,.30); }

/* 角标在浅底状态下：使用 chip 自己的色调，更易读 */
.m-chip:not(.active) .m-chip-count { background: rgba(255,255,255,.7); color: var(--chip-fg, inherit); }

/* 工具页 / 我页 */
.m-page-head { padding: 4px 4px; }
.m-page-head h2 { font-size: 18px; margin: 0 0 2px; }
.m-page-head p { font-size: 12.5px; color: var(--muted); margin: 0; }

.m-action-list, .m-me-list { display: flex; flex-direction: column; gap: 10px; }
.m-action-card, .m-me-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  cursor: pointer; transition: background .14s, border-color .14s, transform .08s;
  text-align: left; font-family: inherit;
}
.m-action-card:active, .m-me-item:active { transform: scale(.99); }
.m-action-card:hover, .m-me-item:hover { background: #f5f7fb; border-color: #c6d0e4; }

.m-action-ic, .m-me-ic {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.m-action-ic.stats { background: #eaf3ff; color: #2563eb; }
.m-action-ic.daily { background: #f1eafc; color: #7c3aed; }
.m-action-ic.export { background: #e8f6ee; color: #14774a; }
.m-action-ic.complete { background: #fff4e3; color: #b45309; }
.m-action-ic.refresh { background: #2563eb; color: #fff; }
.m-action-ic svg, .m-me-ic svg { width: 20px; height: 20px; }

.m-action-body, .m-me-item > span:nth-of-type(2) {
  flex: 1; min-width: 0;
}
.m-action-body strong { display: block; font-size: 14.5px; color: var(--text); margin-bottom: 2px; }
.m-action-body small { font-size: 12px; color: var(--muted); display: block; }
.m-action-arrow, .m-me-arrow { color: var(--muted-2); font-size: 18px; flex: 0 0 auto; }
.m-action-card.m-action-primary { background: linear-gradient(135deg, #2563eb, #60a5fa); border-color: transparent; }
.m-action-card.m-action-primary .m-action-body strong,
.m-action-card.m-action-primary .m-action-body small,
.m-action-card.m-action-primary .m-action-arrow { color: #fff; }
.m-action-card.m-action-primary .m-action-body small { color: rgba(255,255,255,.85); }

.m-me-item { font-size: 14px; font-weight: 600; }
.m-me-item.m-me-danger { color: #b42318; }
.m-me-item.m-me-danger .m-me-ic { background: #fef2f2; color: #b42318; }

.m-me-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 16px; border-radius: 16px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #60a5fa 100%);
  color: #fff;
}
.m-me-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18); color: #fff;
  font-weight: 800; font-size: 22px; flex: 0 0 auto;
}
.m-me-info strong { display: block; font-size: 16px; }
.m-me-info small { font-size: 12.5px; color: rgba(255,255,255,.78); }

/* 手机页面切换：默认 home。orders/tools/me 时切换显示 */
body[data-mp="home"] .content,
body[data-mp="home"] .mobile-status-bar,
body[data-mp="home"] .mobile-page { display: none; }
body[data-mp="home"] .workbench { display: grid; }

body[data-mp="orders"] .workbench,
body[data-mp="orders"] .mobile-page { display: none; }
body[data-mp="orders"] .mobile-status-bar { display: flex; }
body[data-mp="orders"] .content { display: block; }

body[data-mp="tools"] .workbench,
body[data-mp="tools"] .content,
body[data-mp="tools"] .mobile-status-bar,
body[data-mp="tools"] #mobile-page-me { display: none; }
body[data-mp="tools"] #mobile-page-tools { display: flex; }

body[data-mp="me"] .workbench,
body[data-mp="me"] .content,
body[data-mp="me"] .mobile-status-bar,
body[data-mp="me"] #mobile-page-tools { display: none; }
body[data-mp="me"] #mobile-page-me { display: flex; }

/* 默认设为 home（首次未设置 data-mp 时） */
body:not([data-mp]) .content,
body:not([data-mp]) .mobile-status-bar,
body:not([data-mp]) .mobile-page { display: none; }
body:not([data-mp]) .workbench { display: grid; }

/* ===== 桌面端 ≥960px：升级为左侧栏 + 主内容两栏 ===== */
@media (min-width: 960px) {
  .layout { flex-direction: row; }
  .sidenav {
    display: flex;
    position: sticky; top: 0; height: 100vh;
    width: 240px; flex: 0 0 240px;
    transition: width .2s ease, flex-basis .2s ease;
  }
  .sidenav.collapsed { width: 64px; flex-basis: 64px; }
  .sidenav.collapsed .brand > div,
  .sidenav.collapsed .nav-label,
  .sidenav.collapsed .sidenav-section-title,
  .sidenav.collapsed .user-chip-text,
  .sidenav.collapsed .user-chip-caret,
  .sidenav.collapsed .nav-badge { display: none; }
  .sidenav.collapsed .nav-item { justify-content: center; padding: 10px 0; }
  .sidenav.collapsed .user-chip { padding: 5px; justify-content: center; }
  .sidenav.collapsed .sidenav-head { padding: 14px 8px; }
  .sidenav.collapsed .sidenav-toggle svg { transform: rotate(180deg); }
  .sidenav-mask { display: none !important; }
  .sidenav-toggle { display: inline-flex; }
  .sidenav-trigger { display: none; }
  .bottom-tabbar { display: none; }
  .mobile-status-bar { display: none !important; }
  .mobile-page { display: none !important; }
  .content { padding: 20px 24px 32px; }
  .workbench { margin: 20px 24px 0; gap: 16px; }
  .reminder-grid { grid-template-columns: repeat(5, 1fr); }
  /* 桌面端忽略 data-mp / 默认 home 限制，全部正常显示 */
  body .content { display: block !important; }
  body .workbench { display: grid !important; }
}

/* ===== 登录 ===== */
body.auth-locked .layout {
  display: none !important;
}
.login-mask {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center; padding: 22px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
}
.login-mask::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,.12) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255,255,255,.12) 0%, transparent 50%);
}
body:not(.auth-locked) .login-mask { display: none; }
.login-card {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
  padding: 42px 38px;
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 30px; }
.login-brand h1 { margin: 0; font-size: 22px; }
.login-brand p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.login-field { display: grid; gap: 7px; margin: 14px 0; font-weight: 700; font-size: 13px; }
.login-submit { width: 100%; justify-content: center; margin-top: 16px; }
.login-error {
  color: #b42318; background: #fff1f0; border: 1px solid #ffd0cc;
  border-radius: 10px; padding: 8px 10px; font-size: 13px;
}
.login-tip { margin: 14px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

/* ===== 工作台 Section（欢迎卡 + 提醒卡 合并）===== */
.workbench {
  margin: 18px 22px 0;
  display: grid; gap: 14px;
}
.welcome-panel {
  padding: 20px 26px; border-radius: 18px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #60a5fa 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  box-shadow: 0 10px 28px rgba(37, 99, 235, .20);
  position: relative; overflow: hidden;
}
.welcome-panel::after {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.welcome-text { min-width: 0; }
.welcome-side { position: relative; z-index: 1; flex: 0 0 auto; }
.welcome-kicker { font-size: 12.5px; color: rgba(255,255,255,.82); font-weight: 700; letter-spacing: .3px; }
.welcome-panel h2 { margin: 3px 0 0; font-size: 21px; font-weight: 700; letter-spacing: .2px; }
.welcome-panel p { margin: 4px 0 0; color: rgba(255,255,255,.78); font-size: 12.5px; line-height: 1.55; }
.welcome-badge {
  display: inline-flex; padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24);
  font-weight: 700; font-size: 12.5px; white-space: nowrap;
}

/* ===== 登录后提醒卡片（左图标 + 右文本）===== */
.reminder-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.reminder-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
  padding: 16px 18px; text-align: left; box-shadow: 0 2px 10px rgba(15,23,42,.05);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  cursor: pointer;
}
.reminder-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15,23,42,.10); }
.reminder-icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.reminder-icon svg { width: 22px; height: 22px; }
.reminder-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.reminder-label { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.reminder-card strong { margin-top: 2px; font-size: 26px; line-height: 1.1; letter-spacing: -.5px; font-weight: 800; }
.reminder-card small { margin-top: 4px; color: var(--muted-2); font-size: 12px; }

.reminder-card.todo { border-color: #d8e2ff; }
.reminder-card.todo .reminder-icon { background: #eff6ff; color: #2563eb; }
.reminder-card.todo strong { color: #2563eb; }

.reminder-card.today {
  border-color: #34d39966;
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 60%);
}
.reminder-card.today .reminder-icon { background: #d1fae5; color: #047857; }
.reminder-card.today strong { color: #047857; }

.reminder-card.danger { border-color: #ffd4d4; }
.reminder-card.danger .reminder-icon { background: #fef2f2; color: #dc2626; }
.reminder-card.danger strong { color: #dc2626; }

.reminder-card.warn { border-color: #ffe7b8; }
.reminder-card.warn .reminder-icon { background: #fefce8; color: #d97706; }
.reminder-card.warn strong { color: #d97706; }

.reminder-card.severe { border-color: #e9d5ff; }
.reminder-card.severe .reminder-icon { background: #faf5ff; color: #7c3aed; }
.reminder-card.severe strong { color: #7c3aed; }

/* ===== 按钮 ===== */
.btn {
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .14s ease; box-shadow: 0 1px 1.5px rgba(20,27,45,.04);
}
.btn:hover { background: #f7f9fc; border-color: #c8d0df; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #3b6cff, #2f63f5); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(54,103,255,.28);
}
.btn-primary:hover { background: linear-gradient(135deg, #2f63f5, #2550e0); border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: #eef1f7; color: var(--text); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }

.btn-spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 旧 .tabs / .tab CSS 已删除，导航统一由 .sidenav 提供 */

/* ===== 面包屑（嵌入 mini-topbar）===== */
.crumbs {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 0; margin: 0; min-width: 0; flex: 1;
  font-size: 13px; color: var(--muted);
}
.crumbs:empty::after { content: ""; display: inline-block; }
.crumbs:empty::before { content: "工作台"; color: var(--text); font-weight: 700; }
.crumb { color: #46506a; padding: 2px 4px; border-radius: 6px; transition: background .12s, color .12s; }
.crumb[data-go] { cursor: pointer; }
.crumb[data-go]:hover { color: var(--primary); background: var(--primary-soft); }
.crumb.root { color: var(--primary); font-weight: 600; }
.crumb-sep { color: var(--muted-2); }

/* ===== 全局口径筛选条（受理时间 + 业务大类，驱动全站）===== */
.scope-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  max-width: 1400px; margin: 6px auto 0; padding: 10px 24px;
}
.scope-group { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scope-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.scope-hint { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--primary); }

/* ===== 内容区 ===== */
.content { padding: 16px 16px 96px; margin: 0; }
.view {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 2px 10px rgba(15,23,42,.04);
  padding: 18px 22px 22px;
}
.view-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.view-head h2 { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.view-hint { font-size: 12.5px; color: var(--muted-2); }
.view-head .input { margin-left: auto; }
.view-head .btn-sm { margin-right: 4px; }

.input {
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
  padding: 9px 13px; font-size: 13px; min-width: 240px; outline: none;
  transition: border-color .14s, box-shadow .14s;
}
.input::placeholder { color: var(--muted-2); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ===== 钻取卡片 ===== */
.grid-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 14px;
}
.gm-card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 17px 18px; box-shadow: var(--shadow); cursor: pointer; overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
/* 左侧彩色装饰条 */
.gm-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #3667ff, #5a8bff); opacity: .9;
}
.gm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #c9d4ee; }
.gm-card .gm-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gm-card .gm-name { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.gm-card .gm-branch {
  font-size: 11px; color: var(--primary); background: var(--primary-soft); font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.gm-card .gm-count { margin-top: 14px; display: flex; align-items: baseline; gap: 5px; }
.gm-card .gm-count b {
  font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.5px;
  background: linear-gradient(135deg, #2a3550, #46506a); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gm-card .gm-count span { font-size: 12px; color: var(--muted); }
.gm-card .gm-sub { margin-top: 7px; font-size: 12px; color: var(--muted-2); }
.gm-card .gm-full {
  margin-top: 7px; font-size: 11px; color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gm-card .gm-name.grid-name { font-size: 15px; }
/* 铁通班组卡：暖色装饰条 */
.gm-card.grid::before { background: linear-gradient(180deg, #e8a93a, #f0bd5a); }
.gm-card .gm-branch.tt { color: #8a5b0b; background: var(--warn-soft); }
.gm-card .gm-branch.warn { color: #ac2727; background: var(--danger-soft); }
.gm-card.grid:hover { border-color: #e7cfa0; }
/* 未匹配卡：红色虚线 */
.gm-card.unmatched { border-style: dashed; border-color: #ecc0c0; background: #fffafa; }
.gm-card.unmatched::before { background: linear-gradient(180deg, #e5736f, #ef9b97); }
.gm-card.unmatched:hover { border-color: #de9a9a; }

/* ===== 工单列表 ===== */
.order-list { display: flex; flex-direction: column; gap: 11px; }
.order-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 18px; box-shadow: var(--shadow);
  display: flex; gap: 18px; align-items: center;
  transition: box-shadow .14s ease, border-color .14s ease, transform .14s ease;
}
.order-card:hover { box-shadow: var(--shadow-md); border-color: #d3dcef; transform: translateY(-1px); }
/* 超期未竣工卡片：左侧红条 + 淡红底，醒目预警 */
.order-card.is-overdue { border-color: #f0c6c2; background: #fffaf9; box-shadow: inset 3px 0 0 #d93b32, var(--shadow); }
.order-card.is-overdue:hover { border-color: #e8a8a2; }
.order-main { flex: 1; min-width: 0; }
.order-row1 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.order-community { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.order-account { font-size: 13.5px; margin-bottom: 6px; color: #3c4456; }
.order-account b { font-weight: 700; letter-spacing: .3px; color: var(--text); }
.order-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.order-meta b { color: var(--text); font-weight: 600; }
.order-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.order-side .btn { white-space: nowrap; }
.order-side .side-btns { display: flex; gap: 6px; }
.tel { color: var(--primary); text-decoration: none; font-weight: 600; }
.tel:hover { text-decoration: underline; }

.tag {
  font-size: 11px; padding: 2.5px 9px; border-radius: 7px; font-weight: 600; white-space: nowrap; line-height: 1.45;
}
.tag.yellow { background: var(--warn-soft); color: #8a5b0b; }
.tag.rejected { background: var(--danger-soft); color: #ac2727; }
.tag.installable { background: var(--primary-soft); color: #285ec0; }
.tag.biz { background: var(--violet-soft); color: #5b46b0; }
.tag.missing { background: #eceff3; color: #6b7689; }
.tag.overdue { background: #fbe3e1; color: #b3261e; font-weight: 700; }
.tag.done-tag { background: #dcfce7; color: #15803d; font-weight: 700; }
.tag.revoked { background: #ede9fe; color: #6d28d9; font-weight: 700; }
.tag.vip { background: linear-gradient(135deg, #f6d365, #fda085); color: #6b4a00; font-weight: 800; box-shadow: 0 1px 3px rgba(214,158,46,.3); }
.tag.vip-no { background: #eef1f6; color: #8a93a3; font-weight: 600; }
/* 全球通分档：银卡→金卡→白金卡→钻石卡，档位越高越醒目 */
.tag.vip-l1 { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); color: #475569; box-shadow: none; }          /* 银卡 */
.tag.vip-l2 { background: linear-gradient(135deg, #fde68a, #fcd34d); color: #78500a; }                            /* 金卡 */
.tag.vip-l3 { background: linear-gradient(135deg, #c7d2fe, #a5b4fc); color: #3730a3; }                            /* 白金卡 */
.tag.vip-l4 { background: linear-gradient(135deg, #f0abfc, #c084fc); color: #6b21a8; box-shadow: 0 1px 4px rgba(168,85,247,.35); } /* 钻石卡 */
.stage-tag {
  font-size: 11px; padding: 2.5px 9px; border-radius: 7px; font-weight: 600;
  background: var(--success-soft); color: #1a7a52; white-space: nowrap;
}

/* 已约单状态摘要 */
.decision-chip {
  font-size: 12px; padding: 4px 11px; border-radius: 8px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.decision-chip.scheduled { background: var(--success-soft); color: #14774a; }
.decision-chip.expand { background: var(--violet-soft); color: #4a3db0; }
.decision-chip.hold { background: var(--warn-soft); color: #8a5b0b; }
.decision-chip.cancel { background: var(--danger-soft); color: #ac2727; }

/* ===== 空态 ===== */
.empty {
  padding: 56px 20px; text-align: center; color: var(--muted-2);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .emoji { font-size: 44px; opacity: .55; margin-bottom: 2px; }
.empty p { margin: 0; font-size: 13.5px; }
.empty-cta { margin-top: 8px; }
.empty-hint { font-size: 12.5px; color: var(--muted-2); margin: 0; }
.loading {
  padding: 50px; text-align: center; color: var(--muted-2); font-size: 13px;
}
.loading::before {
  content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px;
  border: 2px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, .42);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 440px; max-width: 100%;
  box-shadow: var(--shadow-lg); animation: pop .14s ease-out; overflow: hidden;
  display: flex; flex-direction: column; max-height: calc(100vh - 40px);
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
  background: linear-gradient(180deg, #fbfcff, #fff);
}
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  border: none; background: transparent; font-size: 22px; color: var(--muted-2); line-height: 1;
  width: 30px; height: 30px; border-radius: 8px; transition: background .12s, color .12s;
}
.modal-close:hover { background: #eef1f7; color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }

.modal-order-summary {
  background: linear-gradient(135deg, #f3f6fd, #eef2fb); border: 1px solid #e4eaf6;
  border-radius: 12px; padding: 13px 15px; margin-bottom: 18px; font-size: 13px;
}
.modal-order-summary .s-account { font-weight: 700; font-size: 14.5px; }
.modal-order-summary .s-meta { color: var(--muted); margin-top: 4px; }

/* 约单四选项 */
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 13px 15px;
  cursor: pointer; transition: all .12s; display: flex; gap: 11px; align-items: flex-start;
}
.option:hover { border-color: #c2d2f4; background: #fafcff; }
.option.active { border-color: var(--primary); background: var(--primary-soft); }
.option .opt-radio {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c5cdda;
  flex-shrink: 0; margin-top: 1px; position: relative;
}
.option.active .opt-radio { border-color: var(--primary); }
.option.active .opt-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary);
}
.option .opt-text { flex: 1; }
.option .opt-title { font-weight: 600; }
.option .opt-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 选项展开的子表单 */
.opt-extra { margin-top: 12px; padding: 14px; background: var(--bg); border-radius: 10px; }
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field-hint { color: #a0a8b6; font-weight: 400; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.halfday-group { display: flex; gap: 8px; }
.halfday-group .seg {
  flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; font-size: 13px; cursor: pointer; transition: all .12s;
}
.halfday-group .seg.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.modal-foot {
  position: sticky; bottom: -20px; margin: 18px -20px -20px; padding: 14px 20px;
  display: flex; gap: 10px; background: #fff; border-top: 1px solid var(--line);
}
.modal-foot .btn { flex: 1; justify-content: center; }

/* ===== Toast ===== */
#toast-host {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: #2c3242; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; box-shadow: var(--shadow-lg); animation: slidein .2s ease-out;
}
.toast.ok { background: #18794e; }
.toast.err { background: #b42424; }
.toast.warn { background: #b4730f; }
@keyframes slidein { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 标记竣工：最近记录回溯列表 ===== */
.complete-records-field { margin-top: 4px; }
.complete-records {
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px; background: #fafbfd;
}
.complete-records-empty { padding: 14px; text-align: center; color: var(--muted-2); font-size: 12.5px; }
.complete-rec {
  display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1.4fr) 64px 92px;
  gap: 8px; align-items: center;
  padding: 8px 12px; font-size: 12px; border-bottom: 1px solid var(--line);
}
.complete-rec:last-child { border-bottom: none; }
.complete-rec .cr-form { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.complete-rec .cr-src { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.complete-rec .cr-op { color: var(--primary); font-weight: 600; text-align: center; }
.complete-rec .cr-time { color: var(--muted-2); text-align: right; }

.muted-cell { color: var(--muted-2); text-align: center !important; padding: 18px !important; }

/* ===== 日历条（近期装机 tab）===== */
.cal-strip-wrap {
  margin: 0 0 14px;
  padding: 10px 12px 4px;
  background: linear-gradient(180deg, #f1f5fb 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.cal-strip-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 0 2px 6px;
}
.cal-strip-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.cal-strip-hint { font-size: 11.5px; color: var(--muted-2); }
.cal-strip {
  display: flex; gap: 8px; padding: 4px 0 10px;
  overflow-x: auto; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cal-strip::-webkit-scrollbar { height: 6px; }
.cal-strip::-webkit-scrollbar-thumb { background: rgba(15,23,42,.12); border-radius: 3px; }
.cal-day {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 70px; padding: 10px 8px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--text);
  cursor: pointer; transition: border-color .14s, background .14s, transform .08s;
  font-family: inherit;
}
.cal-day:hover { border-color: #c6d0e4; background: #f7f9fe; }
.cal-day:active { transform: scale(.97); }
.cal-day.weekend { color: #c2410c; }
.cal-day.today {
  border-color: var(--primary); background: var(--primary-soft);
}
.cal-day.today .cd-week { color: var(--primary); }
.cal-day.empty { color: var(--muted-2); }
.cal-day.empty .cd-count { background: #f1f4fa; color: var(--muted-2); }
.cal-day.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(37,99,235,.32);
}
.cal-day.active .cd-week,
.cal-day.active .cd-date,
.cal-day.active .cd-count { color: #fff; }
.cal-day.active .cd-count { background: rgba(255,255,255,.25); }
.cd-week { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cd-date { font-size: 13.5px; font-weight: 700; }
.cd-count {
  font-size: 12px; font-weight: 800;
  padding: 1px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  min-width: 28px; text-align: center;
}
.user-form-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px;
}
.user-form-grid label { display: grid; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); }
.cfg-actions-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

/* ===== 网格配置弹窗 ===== */
.modal.modal-lg { width: 860px; max-width: 100%; }
.cfg-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.cfg-form-row { display: flex; gap: 10px; }
.cfg-form-row.cfg-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.cfg-form-row.cfg-actions { align-items: center; }
.cfg-form .input { width: 100%; }
.cfg-search { flex: 1; }
.cfg-table-wrap { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.cfg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cfg-table thead th {
  position: sticky; top: 0; background: var(--bg); z-index: 1;
  text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line);
}
.cfg-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cfg-table tbody tr:last-child td { border-bottom: none; }
.cfg-table .cfg-team { color: #51596a; max-width: 360px; }
.cfg-table .cfg-ops { white-space: nowrap; text-align: right; }
.cfg-table .cfg-ops .btn { margin-left: 6px; }
.cfg-loading { text-align: center; color: var(--muted); padding: 20px; }

/* ===== 统计弹窗 ===== */
.modal.modal-xl { width: 1080px; max-width: 100%; }

/* 压单/装机 分段切换 */
.stat-switch { display: inline-flex; background: #eef1f7; border-radius: 10px; padding: 3px; gap: 2px; }
.stat-seg {
  border: none; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600;
  padding: 7px 16px; border-radius: 8px; transition: all .14s;
}
.stat-seg:hover { color: var(--text); }
.stat-seg.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(20,27,45,.1); }

/* 全宽卡（趋势图） */
.stat-card-full { margin-bottom: 14px; }

/* 数字看板 */
.stat-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px;
}
.kpi {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; overflow: hidden; box-shadow: var(--shadow);
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); opacity: .85; }
.kpi.k-pending::before { background: linear-gradient(180deg,#3667ff,#5a8bff); }
.kpi.k-done::before { background: linear-gradient(180deg,#15a866,#3fcf8a); }
.kpi.k-yellow::before { background: linear-gradient(180deg,#e8a93a,#f0bd5a); }
.kpi.k-reject::before { background: linear-gradient(180deg,#e5736f,#ef9b97); }
.kpi.k-rate::before { background: linear-gradient(180deg,#6a4bd6,#9277e6); }
.kpi .kpi-label { font-size: 12px; color: var(--muted); }
.kpi .kpi-value {
  margin-top: 5px; font-size: 27px; font-weight: 800; line-height: 1; letter-spacing: -.5px;
  background: linear-gradient(135deg,#2a3550,#46506a); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kpi .kpi-value .unit { font-size: 13px; font-weight: 600; color: var(--muted); -webkit-text-fill-color: var(--muted); margin-left: 3px; }

/* 图表网格：2 列，左宽右窄；A分局/B经理在左，C决策/D业务在右 */
.stat-charts { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; align-items: start; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 12px; box-shadow: var(--shadow);
}
.stat-card-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.stat-sub { font-size: 11px; font-weight: 600; color: var(--muted-2); background: #f1f4fa; padding: 2px 8px; border-radius: 999px; }
.stat-canvas-wrap { position: relative; height: 240px; }
.stat-canvas-wrap.stat-canvas-tall { height: 360px; }
.stat-empty { padding: 40px; text-align: center; color: var(--muted-2); }

/* ===== 装机日期筛选条 ===== */
.date-filter {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: -6px 0 16px; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.date-filter-label { font-size: 13px; font-weight: 700; color: var(--text); }
.date-quick { display: inline-flex; gap: 2px; background: #eef1f7; padding: 3px; border-radius: 10px; }
.dq-seg {
  border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px; cursor: pointer; transition: all .14s;
}
.dq-seg:hover { color: var(--text); }
.dq-seg.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(20,27,45,.1); }
.date-custom { display: inline-flex; align-items: center; gap: 8px; }
.input-date { min-width: 0; width: 150px; padding: 7px 10px; }
.date-tilde { color: var(--muted-2); }
.date-filter-count { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ===== 导出弹窗 ===== */
.export-tip { font-size: 13px; line-height: 1.7; color: var(--muted); margin-bottom: 18px; }
.export-tip b { color: var(--text); }
.export-field { margin-bottom: 20px; }
.export-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.export-field .input { width: 100%; min-width: 0; }
.export-sub-hint { font-size: 12px; font-weight: 500; color: var(--muted-2); }
.export-mode { display: inline-flex; flex-wrap: wrap; gap: 2px; background: #eef1f7; padding: 3px; border-radius: 10px; }
.em-seg {
  border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: all .14s;
}
.export-scope-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.export-scope-row .input { width: 100%; min-width: 0; }
.em-seg:hover { color: var(--text); }
.em-seg.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(20,27,45,.1); }
.export-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.kind-chk { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; transition: border-color .14s, background .14s; user-select: none; }
.kind-chk:hover { border-color: var(--primary); }
.kind-chk input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.kind-chk span { font-size: 13.5px; font-weight: 600; color: var(--text); }
.kind-chk:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.export-actions { display: flex; justify-content: flex-end; gap: 10px; }
.complete-textarea {
  width: 100%; min-height: 168px; resize: vertical; line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; padding: 10px 12px;
}

/* ===== 手机端 baseline 微调（小尺寸默认）===== */
@media (max-width: 720px) {
  body { font-size: 13.5px; }
  .mini-topbar { height: 52px; padding: 0 14px; gap: 10px; }
  .mini-actions { gap: 6px; }
  .mini-actions .btn-text { display: none; }
  .mini-actions .btn-sm { padding: 7px 10px; }

  .content { padding: 14px 12px 90px; }
  .workbench { margin: 12px 12px 0; gap: 10px; }
  .welcome-panel { padding: 18px 18px; border-radius: 16px; align-items: flex-start; gap: 12px; }
  .welcome-panel h2 { font-size: 19px; }
  .welcome-panel p { font-size: 12px; }
  .welcome-badge { font-size: 12px; padding: 6px 10px; }
  .reminder-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .reminder-card { padding: 12px 12px; border-radius: 14px; gap: 10px; }
  .reminder-card strong { font-size: 22px; }
  .reminder-icon { width: 38px; height: 38px; border-radius: 12px; }
  .reminder-icon svg { width: 18px; height: 18px; }
  .view { padding: 14px 14px 16px; border-radius: 14px; }
  .user-form-grid { grid-template-columns: 1fr 1fr; }
  /* 全局口径条：手机上紧凑——标签+按钮同一行（标签固定窄、按钮占满剩余），
     隐藏自定义日期选择器（快捷按钮已覆盖常用，腾出竖向空间），隐藏口径文字提示 */
  .scope-bar { gap: 8px; padding-top: 7px; padding-bottom: 7px; }
  .scope-group { width: 100%; flex-direction: row; align-items: center; gap: 8px; }
  .scope-label { flex: 0 0 auto; font-size: 11.5px; min-width: 40px; }
  .scope-group .date-quick { flex: 1; min-width: 0; justify-content: space-between; }
  .scope-group .dq-seg { flex: 1; text-align: center; padding: 7px 2px; font-size: 12px; }
  .scope-group .date-custom { display: none; }   /* 手机端隐藏自定义日期选择器 */
  .scope-hint { display: none; }                  /* 手机端隐藏「当前口径」文字 */
  /* 口径弹层：手机端全宽 */
  .scope-pop { left: 12px; right: 12px; top: 60px; max-width: none; }

  /* 底部 tabbar：手机端显示，4 个快捷入口 */
  .bottom-tabbar {
    display: flex; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    background: #fff; border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(15,23,42,.08);
  }
  .bt-item {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: transparent; border: none; color: var(--muted);
    font-size: 11px; padding: 4px 2px; border-radius: 8px;
    cursor: pointer; transition: color .14s, background .14s;
  }
  .bt-item:hover { color: var(--text); background: #f5f7fb; }
  .bt-item.active { color: var(--primary); }
  .bt-item svg { width: 20px; height: 20px; }

  /* 卡片单列、占满宽度，手指友好 */
  .grid-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gm-card { padding: 14px; }
  .gm-card .gm-count b { font-size: 24px; }

  .view-head { gap: 10px; margin-bottom: 14px; }
  .view-head h2 { font-size: 16px; }
  .view-head .input { margin-left: 0; width: 100%; min-width: 0; }
  .view-hint { display: none; }

  /* 工单卡片纵向堆叠，操作区拉满 */
  .order-card { flex-direction: column; gap: 12px; padding: 14px; }
  .order-side { flex-direction: row; align-self: stretch; align-items: center; justify-content: space-between; }
  .order-side .btn[data-act="book"] { flex: 1; justify-content: center; padding: 11px; }
  .order-meta { gap: 12px; }

  /* 弹窗底部置底，更像原生 */
  .modal { width: 100%; border-radius: 16px 16px 0 0; align-self: flex-end; }
  .modal-mask { align-items: flex-end; padding: 0; }

  /* 网格配置：表单纵向、表格横向滚动 */
  .modal.modal-lg { width: 100%; max-height: 92vh; }
  .cfg-form-row, .cfg-form-row.cfg-3 { display: flex; flex-direction: column; }
  .cfg-form-row.cfg-actions { flex-direction: row; }
  .cfg-table-wrap { max-height: 55vh; }
  .cfg-table .cfg-team { max-width: 160px; word-break: break-all; }
  .cfg-table thead th:nth-child(4), .cfg-table tbody td:nth-child(4) { display: none; }

  /* 统计：图表单列堆叠 */
  .modal.modal-xl { width: 100%; max-height: 94vh; }
  .stat-kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi .kpi-value { font-size: 22px; }
  .stat-charts { grid-template-columns: 1fr; }
  .stat-canvas-wrap { height: 220px; }
  .stat-canvas-wrap.stat-canvas-tall { height: 300px; }

  /* 标记竣工回溯列表：手机端两行布局（工单号+账号 / 操作人+时间）*/
  .complete-rec {
    grid-template-columns: 1fr auto;
    grid-template-areas: "form time" "src op";
    row-gap: 3px;
  }
  .complete-rec .cr-form { grid-area: form; }
  .complete-rec .cr-time { grid-area: time; }
  .complete-rec .cr-src { grid-area: src; }
  .complete-rec .cr-op { grid-area: op; text-align: right; }

  /* 日期筛选条纵向堆叠 */
  .date-filter { gap: 10px; }
  .date-quick { width: 100%; justify-content: space-between; }
  .dq-seg { flex: 1; text-align: center; padding: 8px 6px; }
  .date-custom { width: 100%; }
  .input-date { flex: 1; width: auto; }
  .date-filter-count { margin-left: 0; }
}

@media (max-width: 380px) {
  .grid-cards { grid-template-columns: 1fr; }
  .reminder-grid { grid-template-columns: 1fr; }
  .user-form-grid { grid-template-columns: 1fr; }
}
