/* ==========================================================================
   400 来电客户管理系统 · 设计系统
   风格：扁平 · 简约 · 高级感（浅色主题 / 单主色 / 细线分割 / 克制的层次）
   ========================================================================== */

:root {
  /* 主色 */
  --brand: #1677ff;
  --brand-hi: #4a9bff;
  --brand-lo: #0a5ccf;
  --brand-soft: #edf4ff;
  --brand-line: #cfe3ff;

  /* 中性色 */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #f6f8fb;
  --line: #ecedf1;
  --line-2: #e0e3e9;

  /* 文字 */
  --ink-1: #0f1720;
  --ink-2: #39424f;
  --ink-3: #6b7482;
  --ink-4: #9aa2ad;

  /* 语义色 */
  --ok: #0ea472;
  --ok-soft: #e8f8f2;
  --warn: #e8830c;
  --warn-soft: #fef4e6;
  --danger: #e5484d;
  --danger-soft: #fdeded;
  --violet: #7357ff;
  --violet-soft: #f0edff;
  --cyan: #0a9dc4;
  --cyan-soft: #e6f6fb;

  /* 深色侧栏 */
  --side-bg: #0d1b2b;
  --side-bg-2: #101f31;
  --side-line: rgba(255, 255, 255, .07);
  --side-text: #97a6b8;
  --side-text-hi: #ffffff;

  /* 圆角 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;

  /* 阴影 */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --sh-sm: 0 1px 3px rgba(16, 24, 40, .05), 0 1px 2px rgba(16, 24, 40, .03);
  --sh-md: 0 6px 18px rgba(16, 24, 40, .07), 0 1px 3px rgba(16, 24, 40, .04);
  --sh-lg: 0 24px 56px rgba(16, 24, 40, .16);

  --font: "Inter", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-num: "Inter", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;

  /* ---- 全站字阶（同类文字同字体同字号）----
     说明文字 11px / 辅助说明 12px / 次要文本 12.5px / 表格与数值 13px
     正文与按钮 13.5px / 卡片标题 14.5px / 弹窗标题 15.5px / 页面标题 18px */
  --fs-caption: 11px;
  --fs-note: 12px;
  --fs-secondary: 12.5px;
  --fs-table: 13px;
  --fs-body: 13.5px;
  --fs-title: 14.5px;
  --fs-h2: 15.5px;
  --fs-h1: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hidden { display: none !important; }
a { color: var(--brand); text-decoration: none; }
::selection { background: #cfe3ff; color: #0a3d80; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

svg { width: 100%; height: 100%; display: block; }
svg use { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item .ico svg use, .hero-tick svg use { stroke-width: 1.9; }
/* 尺寸随内容变化的容器里，图标必须有固定尺寸，避免被 100% 拉伸 */
.btn > svg { width: 15px; height: 15px; flex: none; }
.btn-sm > svg { width: 14px; height: 14px; }
.step-no > svg { width: 12px; height: 12px; }
.drop-ico > svg { width: 40px; height: 40px; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ==========================================================================
   登录页
   ========================================================================== */
.login-wrap {
  min-height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 28px;
  background:
    radial-gradient(900px 480px at 88% -10%, #dfeaff 0%, transparent 60%),
    radial-gradient(700px 420px at 6% 110%, #e8f6ff 0%, transparent 62%),
    #eff2f7;
}
.login-shell {
  display: grid; grid-template-columns: 1.06fr .94fr;
  width: min(1080px, 100%); min-height: 588px;
  background: var(--surface); border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 32px 80px rgba(16, 32, 64, .16), 0 2px 6px rgba(16, 24, 40, .05);
}

/* --- 左：品牌区 --- */
.login-hero {
  position: relative; overflow: hidden; padding: 46px 44px;
  display: flex; flex-direction: column;
  background: linear-gradient(158deg, #0c1a2b 0%, #101f34 48%, #0f2c52 100%);
  color: #fff;
}
.login-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(600px 420px at 20% 20%, #000, transparent 78%);
}
.hero-glow {
  position: absolute; width: 520px; height: 520px; right: -190px; bottom: -230px; border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 119, 255, .55) 0%, rgba(22, 119, 255, 0) 68%);
  filter: blur(6px);
}
.hero-center {
  position: relative; flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 0;
}
.hero-center .logo-mark {
  width: 74px; height: 74px; border-radius: 21px; font-size: 27px; font-weight: 700;
  box-shadow: 0 14px 38px rgba(22, 119, 255, .42), 0 2px 8px rgba(0, 0, 0, .25);
}
.hero-brand { font-size: 34px; font-weight: 650; letter-spacing: .16em; margin-top: 24px; text-indent: .16em; }
.hero-brand-sub { font-size: 9px; color: #7d93ad; letter-spacing: .22em; text-indent: .22em; margin-top: 12px; white-space: nowrap; }
.hero-foot {
  position: relative; font-size: 11.5px; color: #7d93ad; letter-spacing: .08em;
  padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); text-align: center;
}

/* --- 右：表单区 --- */
.login-panel { display: flex; align-items: center; justify-content: center; padding: 42px 40px; }
.login-card { width: min(340px, 100%); }
.login-head { margin-bottom: 28px; }
.login-head h1 { margin: 0; font-size: 23px; font-weight: 650; color: var(--ink-1); letter-spacing: -.01em; }
.login-head p { margin: 8px 0 0; font-size: var(--fs-table); color: var(--ink-3); }

.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block; font-size: var(--fs-note); font-weight: 500; color: var(--ink-3);
  margin-bottom: 7px; letter-spacing: .02em;
}
.input-wrap { position: relative; display: block; }
.input-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-4); pointer-events: none; transition: color .15s;
}
.input-wrap:focus-within .input-ico { color: var(--brand); }
.input-wrap .input { padding-left: 37px; }

/* ==========================================================================
   表单控件
   ========================================================================== */
.input, .select {
  width: 100%; height: 40px; padding: 0 13px; font-size: var(--fs-body); color: var(--ink-1);
  font-family: inherit; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--ink-4); }
.input:hover, .select:hover { border-color: #cfd5dd; }
.input:focus, .select:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3.5px rgba(22, 119, 255, .12);
}
.select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M2.2 4.4L6 8.2l3.8-3.8' stroke='%239aa2ad' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
input[type="date"], input[type="datetime-local"] { font-family: var(--font-num); font-size: var(--fs-table); }

.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-table); color: var(--ink-2); cursor: pointer; user-select: none; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  height: 36px; padding: 0 15px; font-size: var(--fs-body); font-weight: 500; font-family: inherit;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  color: var(--ink-2); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--sh-xs);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, #2f86ff 0%, var(--brand) 100%);
  border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(22, 119, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--brand) 0%, #0f6ae6 100%); border-color: #0f6ae6; color: #fff; }
.btn-primary:active { background: var(--brand-lo); }

.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); }
.btn-danger { background: var(--surface); border-color: #f6c7c7; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #f0a8a8; color: #c93a3f; }
.btn-text {
  background: transparent; border-color: transparent; box-shadow: none;
  color: var(--brand); padding: 0 9px; height: 28px; font-size: var(--fs-secondary);
}
.btn-text:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-lo); }
.btn-sm { height: 30px; padding: 0 11px; font-size: var(--fs-secondary); border-radius: var(--r-xs); }
.btn-lg { height: 44px; font-size: var(--fs-title); border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; }
.btn .spinner { width: 13px; height: 13px; border-width: 2px; margin-right: 0; }

.login-error {
  display: flex; align-items: center; gap: 7px;
  background: var(--danger-soft); color: #c93a3f; font-size: var(--fs-secondary);
  padding: 10px 12px; border-radius: var(--r-sm); margin-bottom: 14px;
  border: 1px solid #f7d4d4;
}
.login-tip { margin-top: 20px; font-size: var(--fs-note); color: var(--ink-4); text-align: center; line-height: 1.7; }
.login-tip b { color: var(--ink-3); font-weight: 600; }
.login-remember {
  display: flex; align-items: center; gap: 7px; margin: 2px 0 16px;
  font-size: var(--fs-body); color: var(--ink-3); cursor: pointer; user-select: none; width: fit-content;
}
.login-remember input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.login-remember:hover { color: var(--ink-2); }

/* ==========================================================================
   框架布局
   ========================================================================== */
.app { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }

.sidebar {
  width: 230px; flex: none; display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  border-right: 1px solid rgba(0, 0, 0, .2);
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: linear-gradient(140deg, #3d92ff, #1668e3);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font: 700 15px/1 var(--font-num); letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(22, 119, 255, .34), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.logo-mark.small { width: 36px; height: 36px; border-radius: 10px; font-size: var(--fs-secondary); box-shadow: 0 4px 12px rgba(22, 119, 255, .3); }
.side-brand-title { color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.side-brand-sub { color: #5c7089; font-size: 8px; letter-spacing: .12em; margin-top: 3px; white-space: nowrap; }

.side-nav { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding-bottom: 10px; }
.side-nav::-webkit-scrollbar { width: 0; }
.nav-group {
  font-size: 10.5px; font-weight: 600; letter-spacing: .16em; color: #4e6076;
  padding: 16px 12px 7px; text-transform: uppercase;
}
.nav-group:first-child { padding-top: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--side-text); font-size: var(--fs-body); cursor: pointer;
  transition: background .16s, color .16s; user-select: none;
}
.nav-item .ico { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #e6edf6; }
.nav-item.active {
  color: var(--side-text-hi); font-weight: 600;
  background: linear-gradient(90deg, rgba(22, 119, 255, .26) 0%, rgba(22, 119, 255, .07) 100%);
}
.nav-item.active .ico { color: #6cb0ff; opacity: 1; }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand); box-shadow: 0 0 10px rgba(22, 119, 255, .8);
}
.nav-badge { margin-left: auto; background: rgba(255, 255, 255, .1); color: #b9cbe1; font-size: var(--fs-caption); padding: 1px 8px; border-radius: 999px; }

/* --- 一二级菜单（一级分组可折叠） --- */
.nav-cat { display: flex; flex-direction: column; gap: 3px; }
.nav-cat-head {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px;
  border-radius: var(--r-sm); color: #c3cfdd; font-size: var(--fs-body); font-weight: 600;
  cursor: pointer; transition: background .16s, color .16s; user-select: none;
}
.nav-cat-head .ico { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav-cat-head .chev { width: 15px; height: 15px; margin-left: auto; flex: none; color: #55677e; transition: transform .18s; }
.nav-cat-head:hover { background: rgba(255, 255, 255, .06); color: #e6edf6; }
.nav-cat.collapsed .nav-sub { display: none; }
.nav-cat.collapsed .chev { transform: rotate(-90deg); }
.nav-sub {
  display: flex; flex-direction: column; gap: 2px;
  margin: 1px 0 3px 19px; padding-left: 9px;
  border-left: 1px solid rgba(255, 255, 255, .09);
}
.nav-sub .nav-item { height: 34px; font-size: var(--fs-table); }
.nav-sub .nav-item.active::before { left: -11px; }

.side-user {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, .045); border: 1px solid var(--side-line);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.side-user:hover { background: rgba(255, 255, 255, .085); border-color: rgba(255, 255, 255, .16); }
.avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, #3d92ff, #1668e3); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--fs-table);
}
.side-user-info { flex: 1; min-width: 0; }
.side-user-name { color: #fff; font-size: var(--fs-table); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-role { color: #5c7089; font-size: 10.5px; margin-top: 2px; letter-spacing: .04em; }
.icon-btn {
  width: 30px; height: 30px; flex: none; padding: 7px; border-radius: var(--r-xs); border: none;
  background: rgba(255, 255, 255, .07); color: #9fb0c4; cursor: pointer; transition: .15s;
}
.icon-btn:hover { background: rgba(229, 72, 77, .22); color: #ff9a9d; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 66px; flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 30px; background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.crumb-wrap { min-width: 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.crumb { font-size: var(--fs-h1); font-weight: 650; color: var(--ink-1); letter-spacing: -.01em; }
.crumb small { font-weight: 400; color: var(--ink-4); font-size: var(--fs-note); letter-spacing: 0; margin-left: 14px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-meta { display: flex; align-items: center; gap: 8px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
}
.meta-chip b { color: var(--ink-1); font-weight: 600; font-family: var(--font-num); }
.meta-chip .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(14, 164, 114, .16);
}
.content { flex: 1; overflow-y: auto; padding: 22px 30px 56px; scroll-behavior: smooth; }
.content > * { animation: rise .3s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   卡片 / 栅格
   ========================================================================== */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--sh-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-bottom: 13px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
}
.card-head:last-child { margin-bottom: 0; }
.card-title { font-size: var(--fs-title); font-weight: 650; color: var(--ink-1); display: flex; align-items: center; gap: 9px; letter-spacing: -.005em; }
.card-title .dot {
  width: 3px; height: 15px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, #5aa8ff, var(--brand));
}
.card-sub { font-size: var(--fs-note); color: var(--ink-4); font-weight: 400; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1240px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* --- 指标卡 --- */
.stat {
  position: relative; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px 17px; box-shadow: var(--sh-sm);
  transition: transform .18s cubic-bezier(.22, .61, .36, 1), box-shadow .18s, border-color .18s;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2.5px;
  background: linear-gradient(90deg, var(--c, var(--brand)) 0%, transparent 72%);
  opacity: .9;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: #e2e6ee; }
.stat-top { display: flex; align-items: center; gap: 9px; }
.stat-ico {
  width: 30px; height: 30px; flex: none; padding: 7px; border-radius: var(--r-sm);
  background: var(--c-soft, var(--brand-soft)); color: var(--c, var(--brand));
}
.stat-label { font-size: var(--fs-secondary); color: var(--ink-3); font-weight: 500; letter-spacing: .01em; }
.stat-value {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 31px; font-weight: 680; color: var(--ink-1);
  margin: 13px 0 5px; letter-spacing: -.025em; line-height: 1.1;
}
.stat-foot { font-size: 11.5px; color: var(--ink-4); line-height: 1.7; }
.stat-foot + .stat-foot { margin-top: 2px; }
.stat-foot .up { color: var(--danger); }
.stat-foot .down { color: var(--ok); }
.stat.compact { padding: 14px 16px 13px; }
.stat.compact .stat-value { font-size: 20px; margin: 8px 0 3px; font-weight: 650; }
.stat.compact .stat-label { font-size: 11.5px; color: var(--ink-4); }
.stat.compact .stat-foot { font-size: var(--fs-caption); }

/* --- 标签 --- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 500;
  background: var(--surface-3); color: var(--ink-3); white-space: nowrap;
  border: 1px solid var(--line);
}
.tag-blue { background: var(--brand-soft); color: #0d5cc4; border-color: var(--brand-line); }
.tag-green { background: var(--ok-soft); color: #0a7d57; border-color: #c6ecdd; }
.tag-orange { background: var(--warn-soft); color: #a55f06; border-color: #f6ddb8; }
.tag-red { background: var(--danger-soft); color: #c93a3f; border-color: #f5cdcd; }
.tag-purple { background: var(--violet-soft); color: #5a3fd6; border-color: #ddd5ff; }

/* ==========================================================================
   表格
   ========================================================================== */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-table); }
table.tbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); color: var(--ink-4);
  font-size: var(--fs-caption); font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  text-align: left; padding: 11px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.tbl tbody td {
  padding: 12px 14px; border-bottom: 1px solid #f3f5f8; color: var(--ink-2); vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover td { background: #f8fbfe; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl .strong { font-weight: 600; color: var(--ink-1); }
table.tbl .muted { color: var(--ink-3); }
table.tbl .right { text-align: right; }
table.tbl td.num, table.tbl th.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.empty { text-align: center; color: var(--ink-4); padding: 52px 0 48px; font-size: var(--fs-table); }
.empty-ico { display: block; width: 54px; height: 54px; margin: 0 auto 14px; color: #d3d9e2; }
.empty b { color: var(--ink-3); font-weight: 500; }
.empty-sub { margin-top: 6px; font-size: var(--fs-note); color: var(--ink-4); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 2px 2px; font-size: var(--fs-secondary); color: var(--ink-3); flex-wrap: wrap; }
.pager b { color: var(--ink-1); font-family: var(--font-num); }
.pager-btns { display: flex; align-items: center; gap: 5px; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 9px; border-radius: var(--r-xs);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  cursor: pointer; font-size: var(--fs-secondary); font-family: inherit; transition: .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }
.page-btn:disabled { opacity: .42; cursor: not-allowed; }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(22, 119, 255, .3); }

/* --- 工具栏 --- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.toolbar .input, .toolbar .select { width: auto; height: 36px; font-size: var(--fs-table); }
.toolbar .input { min-width: 230px; }
.toolbar .spacer { flex: 1; }

/* ==========================================================================
   图表
   ========================================================================== */
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; }
.legend { display: flex; gap: 18px; align-items: center; font-size: var(--fs-note); color: var(--ink-3); flex-wrap: wrap; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 7px; vertical-align: -1px; }
.tip {
  position: absolute; pointer-events: none; z-index: 6; min-width: 132px;
  background: rgba(15, 23, 32, .94); color: #fff; backdrop-filter: blur(6px);
  font-size: var(--fs-note); padding: 9px 12px; border-radius: var(--r-sm);
  transform: translate(-50%, -118%); opacity: 0; transition: opacity .13s;
  box-shadow: 0 10px 28px rgba(16, 24, 40, .3); line-height: 1.75;
}
.tip b { font-family: var(--font-num); }
.tip-title { color: #93a4b8; font-weight: 500; }

/* ==========================================================================
   导入页
   ========================================================================== */
.drop {
  border: 1.5px dashed #cfd8e4; border-radius: var(--r-lg); background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
  padding: 38px 20px; text-align: center; cursor: pointer; transition: .18s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-ico { width: 40px; height: 40px; margin: 0 auto; color: var(--brand); opacity: .82; }
.drop-title { font-size: 14px; font-weight: 600; color: var(--ink-1); margin: 13px 0 6px; }
.drop-sub { font-size: var(--fs-note); color: var(--ink-4); }

.steps { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: var(--fs-table); flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; color: var(--ink-4); font-weight: 500; }
.step-no {
  width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--ink-4);
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600;
  font-family: var(--font-num); padding: 4px;
}
.step-no svg { stroke-width: 2.6; }
.step.active { color: var(--brand); font-weight: 650; }
.step.active .step-no { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(22, 119, 255, .14); }
.step.done { color: var(--ok); }
.step.done .step-no { background: var(--ok-soft); border-color: #c6ecdd; color: var(--ok); }
.step-line { width: 30px; height: 1px; background: var(--line-2); }

.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
@media (max-width: 960px) { .map-grid { grid-template-columns: 1fr; } }
.map-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); transition: .15s;
}
.map-row:hover { border-color: var(--line-2); background: var(--surface); }
.map-row.missing { border-color: #f6ddb8; background: var(--warn-soft); }
.map-row .map-label { width: 96px; flex: none; font-size: var(--fs-table); color: var(--ink-2); font-weight: 500; }
.map-row .map-label b { color: var(--danger); }
.map-row select { flex: 1; min-width: 0; height: 34px; font-size: var(--fs-secondary); }
.map-row .arrow { color: var(--ink-4); font-size: var(--fs-table); }
.map-state { width: 62px; flex: none; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 27px; padding: 0 11px; border-radius: 999px;
  font-size: var(--fs-note); background: var(--surface-3); color: var(--ink-3); border: 1px solid var(--line);
}
.chip.used { background: var(--brand-soft); color: #0d5cc4; border-color: var(--brand-line); }
.chip.ignore { background: #f7f8fa; color: var(--ink-4); border-style: dashed; }
.chip.need { background: var(--danger-soft); color: #c93a3f; border-color: #f5cdcd; }

.note {
  position: relative; background: var(--brand-soft); border: 1px solid var(--brand-line);
  color: #14508f; font-size: var(--fs-secondary); padding: 12px 15px; border-radius: var(--r-md); line-height: 1.9;
}
.note b { color: #0d3f78; }
.note.warn { background: var(--warn-soft); border-color: #f6ddb8; color: #8a5205; }
.note.warn b { color: #6d4104; }
.note.danger { background: var(--danger-soft); border-color: #f5cdcd; color: #a8363a; }

/* --- 区块小标题（数据统计页分组用） --- */
.sec-label {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 2px 11px; font-size: var(--fs-note); font-weight: 650;
  color: var(--ink-2); letter-spacing: .02em;
}
.sec-label::before {
  content: ""; width: 3px; height: 12px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, #5aa8ff, var(--brand));
}

/* --- 危险操作区 --- */
.card.card-danger { border-color: #f5cdcd; }
.card-danger .card-title { color: var(--danger); }
.dot-danger { background: linear-gradient(180deg, #f08a8d, var(--danger)) !important; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.danger-info b { font-size: var(--fs-body); color: var(--ink-1); }
.danger-sub { font-size: var(--fs-note); color: var(--ink-3); margin-top: 4px; line-height: 1.7; }
@media (max-width: 760px) { .danger-row { flex-direction: column; align-items: flex-start; } }

/* ==========================================================================
   弹窗
   ========================================================================== */
.mask {
  position: fixed; inset: 0; z-index: 100; padding: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 32, .42); backdrop-filter: blur(3px);
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: translateY(12px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal {
  width: 580px; max-width: 100%; max-height: 90vh;
  display: flex; flex-direction: column; background: var(--surface);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg); animation: pop .2s cubic-bezier(.22, .61, .36, 1);
}
.modal.wide { width: 920px; }
.modal.narrow { width: 450px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: var(--fs-h2); font-weight: 650; color: var(--ink-1); letter-spacing: -.005em; }
.modal-close {
  width: 28px; height: 28px; flex: none; padding: 7px; border: none; border-radius: var(--r-xs);
  background: transparent; color: var(--ink-4); cursor: pointer; transition: .15s;
}
.modal-close:hover { background: var(--surface-3); color: var(--ink-1); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 22px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.result-item {
  position: relative; overflow: hidden; text-align: center; padding: 18px 10px 16px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line);
}
.result-item::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2.5px; background: var(--rc, var(--brand)); opacity: .85; }
.result-item .v { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 680; letter-spacing: -.03em; color: var(--ink-1); line-height: 1.15; }
.result-item .k { font-size: 11.5px; color: var(--ink-3); margin-top: 7px; }
.result-item.blue { background: var(--brand-soft); border-color: var(--brand-line); } .result-item.blue .v { color: #0d5cc4; } .result-item.blue::before { background: var(--brand); }
.result-item.green { background: var(--ok-soft); border-color: #c6ecdd; } .result-item.green .v { color: #0a7d57; } .result-item.green::before { background: var(--ok); }
.result-item.orange { background: var(--warn-soft); border-color: #f6ddb8; } .result-item.orange .v { color: #a55f06; } .result-item.orange::before { background: var(--warn); }

.kv { display: grid; grid-template-columns: 104px 1fr; row-gap: 11px; column-gap: 12px; font-size: var(--fs-table); align-items: baseline; }
.kv .k { color: var(--ink-4); font-size: var(--fs-secondary); }
.kv .v { color: var(--ink-1); word-break: break-all; }

/* ==========================================================================
   Toast / Loading / 滚动条
   ========================================================================== */
#toast-root { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 540px;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-md);
  box-shadow: var(--sh-md); padding: 11px 16px 11px 13px; font-size: var(--fs-body); color: var(--ink-1);
  animation: pop .2s cubic-bezier(.22, .61, .36, 1);
}
.toast .t-ico {
  width: 20px; height: 20px; flex: none; padding: 4px; border-radius: 50%;
  background: var(--surface-3); color: var(--ink-3);
}
.toast.ok .t-ico { background: var(--ok-soft); color: var(--ok); }
.toast.err .t-ico { background: var(--danger-soft); color: var(--danger); }
.toast.info .t-ico { background: var(--brand-soft); color: var(--brand); }
.toast.ok { border-color: #c6ecdd; }
.toast.err { border-color: #f5cdcd; }
.toast.info { border-color: var(--brand-line); }

.loading { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--ink-4); padding: 56px 0; font-size: var(--fs-table); }
.spinner {
  width: 16px; height: 16px; flex: none; border: 2px solid #e3e7ee; border-top-color: var(--brand);
  border-radius: 50%; display: inline-block; animation: spin .68s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d8dde5; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c3cad4; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1024px) {
  .login-shell { grid-template-columns: 1fr; min-height: 0; width: min(460px, 100%); }
  .login-hero { display: none; }
}
@media (max-width: 860px) {
  .sidebar { width: 68px; padding: 16px 10px 12px; }
  .side-brand-text, .nav-group, .nav-item span, .side-user-info,
  .nav-cat-head span, .nav-cat-head .chev { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-cat-head { justify-content: center; padding: 0; }
  .nav-sub { margin: 1px 0 3px 0; padding-left: 0; border-left: none; align-items: center; }
  .nav-sub .nav-item { height: 38px; width: 44px; justify-content: center; padding: 0; font-size: var(--fs-body); }
  .nav-sub .nav-item.active::before { left: -10px; }
  .nav-item.active::before { left: -10px; }
  .side-user { justify-content: center; padding: 8px; }
  .topbar { padding: 0 18px; }
  .content { padding: 18px 18px 48px; }
  .topbar-meta { display: none; }
}

/* ==========================================================================
   问号字段说明 / 时间选择空态（V4.4）
   ========================================================================== */
.help-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 6px; flex: none;
  border-radius: 50%; background: var(--surface-3); color: var(--ink-3);
  font-size: 10px; font-weight: 650; line-height: 1; cursor: help; user-select: none;
  border: 1px solid var(--line); transition: .15s;
}
.help-dot:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.help-pop {
  position: fixed; z-index: 400; display: none; max-width: 320px; white-space: pre-line;
  background: #1f2b3a; color: #eef3f9; font-size: var(--fs-note); line-height: 1.8;
  padding: 10px 13px; border-radius: var(--r-md); box-shadow: var(--sh-lg);
  pointer-events: none;
}

.dt-field { position: relative; min-width: 188px; max-width: 230px; }
.dt-field .input { width: 100%; }
.toolbar .dt-field .input { min-width: 0; }
.toolbar .input.slim { min-width: 150px; width: 190px; }
.dt-field.ph .input { color: transparent; }
.dt-field.ph .input::-webkit-calendar-picker-indicator { opacity: .5; }
.dt-ph {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); font-size: var(--fs-body); pointer-events: none; display: none;
}
.dt-field.ph .dt-ph { display: block; }
