/* ==========================================================================
   Data-Dense Dashboard 设计系统（ui-ux-pro-max 推荐）
   方向：精密数据仪表 · 蓝色数据 + 橙色高亮 · Fira Code 等宽数字 · 紧凑高密度
   ========================================================================== */

/* ---------- 字体（本地 woff2，内网可用） ---------- */
@font-face {
  font-family: 'Fira Code';
  src: url('../fonts/fira-code-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Fira Code';
  src: url('../fonts/fira-code-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Fira Code';
  src: url('../fonts/fira-code-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: 'Fira Code';
  src: url('../fonts/fira-code-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Fira Sans';
  src: url('../fonts/fira-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Fira Sans';
  src: url('../fonts/fira-sans-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Fira Sans';
  src: url('../fonts/fira-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}

:root {
  /* 设计系统配色 */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft: #EFF6FF;
  --secondary: #3B82F6;
  --cta: #F97316;              /* 橙色高亮：主操作/激活态点睛 */
  --cta-hover: #EA580C;
  --cta-soft: #FFF7ED;

  --success: #059669;
  --success-soft: #ECFDF5;
  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --purple: #7C3AED;
  --purple-soft: #F5F3FF;
  --cyan: #0891B2;
  --cyan-soft: #ECFEFF;

  /* 中性色（slate） */
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --line: #E2E8F0;
  --line-soft: #EEF2F7;
  --hover: #F1F5F9;
  --text: #1E293B;
  --text-2: #475569;
  --text-3: #94A3B8;

  --mono: 'Fira Code', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Fira Sans', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --r: 3px;                    /* 方正圆角：工程感 */
  --r-lg: 6px;
  --topbar-h: 52px;
  --sidebar-w: 200px;
  --shadow: 0 1px 2px rgba(30, 41, 59, 0.04);
  --shadow-lg: 0 8px 24px rgba(30, 41, 59, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background-color: var(--bg);
  /* 极淡蓝图纸网格：数据氛围 */
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button { font-family: inherit; }

/* 数字统一等宽 */
.num, .k-val, .bs .v, table.data td, .range-tag, .top-meta {
  font-family: var(--mono);
  font-variant-ligatures: none;
}

/* ---------- 入场动画（staggered reveal，respect reduced-motion） ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.main > * , .main .content-narrow > * { animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.main > *:nth-child(1), .main .content-narrow > *:nth-child(1) { animation-delay: 0.02s; }
.main > *:nth-child(2), .main .content-narrow > *:nth-child(2) { animation-delay: 0.07s; }
.main > *:nth-child(3), .main .content-narrow > *:nth-child(3) { animation-delay: 0.12s; }
.main > *:nth-child(4), .main .content-narrow > *:nth-child(4) { animation-delay: 0.17s; }
.main > *:nth-child(5), .main .content-narrow > *:nth-child(5) { animation-delay: 0.22s; }

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

/* ==========================================================================
   顶栏
   ========================================================================== */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar .brand .logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1D4ED8 0%, var(--primary) 55%, var(--secondary) 100%);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar .brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.topbar .brand .bt-name {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.topbar .brand .bt-sub {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
}

.topbar .top-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-3);
}

/* 运行状态点 */
.topbar .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
}

.topbar .live-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.3;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

.menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  border-radius: var(--r);
  color: var(--text-2);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}

.menu-btn:active { background: var(--hover); }

.sidebar-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 290;
  opacity: 0;
  transition: opacity 0.25s;
}

.sidebar-mask.show { display: block; opacity: 1; }

/* ==========================================================================
   布局
   ========================================================================== */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.sidebar {
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--line);
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
}

.sidebar .sidebar-scroll { flex: 1; overflow-y: auto; padding: 10px 0; min-height: 0; }

/* 侧边栏底部：当前版本号 → 更新记录页 */
.sidebar .sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-3);
  font-size: 12.5px;
  transition: background 0.15s, color 0.15s;
}
.sidebar .sidebar-foot:hover { background: var(--hover); color: var(--text-2); text-decoration: none; }
.sidebar .sidebar-foot.active { color: var(--primary); }
.sidebar .sidebar-foot svg { width: 15px; height: 15px; flex-shrink: 0; }
.sidebar .sidebar-foot b { margin-left: auto; font-family: var(--mono); font-weight: 500; font-size: 11.5px; }

.sidebar .nav-sec {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 12px 16px 5px;
}

.sidebar .nav-sec:first-child { padding-top: 4px; }

.sidebar .nav-loading { padding: 6px 16px; font-size: 12px; color: var(--text-3); }

.sidebar a.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 16px;
  color: var(--text-2);
  font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.sidebar a.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }

.sidebar a.nav-item.active {
  background: var(--primary-soft);
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.sidebar a.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

.main { flex: 1; padding: 18px 20px 36px; min-width: 0; }

.content-narrow { max-width: 860px; }

/* ==========================================================================
   页头
   ========================================================================== */
.page-head { margin-bottom: 14px; }
.page-title { font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: 0.2px; }
.page-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* ==========================================================================
   卡片
   ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.card > h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
}

.card > h3::before {
  content: '';
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--primary);
}

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ==========================================================================
   KPI 指标卡
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 13px 14px 12px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

/* 顶部数据色条 */
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--primary));
}

.kpi:hover { border-color: var(--kpi-accent, var(--primary)); box-shadow: var(--shadow-lg); transform: translateY(-1px); }

.kpi.a-blue { --kpi-accent: var(--primary); }
.kpi.a-cyan { --kpi-accent: var(--cyan); }
.kpi.a-orange { --kpi-accent: var(--cta); }
.kpi.a-green { --kpi-accent: var(--success); }
.kpi.a-purple { --kpi-accent: var(--purple); }

.kpi .k-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.kpi .k-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi .k-icon svg { width: 15px; height: 15px; }

.kpi .k-val {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi .k-val .unit { font-size: 11px; font-weight: 400; color: var(--text-3); margin-left: 2px; font-family: var(--sans); }
.kpi .k-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; font-family: var(--mono); }
.kpi .k-label { font-size: 11.5px; color: var(--text-3); margin-top: 5px; letter-spacing: 0.3px; }

/* 图标底色 */
.tint-blue { background: var(--primary-soft); color: var(--primary); }
.tint-green { background: var(--success-soft); color: var(--success); }
.tint-orange { background: var(--cta-soft); color: var(--cta); }
.tint-purple { background: var(--purple-soft); color: var(--purple); }
.tint-cyan { background: var(--cyan-soft); color: var(--cyan); }
.tint-red { background: var(--danger-soft); color: var(--danger); }

/* ==========================================================================
   徽章 / 环比
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 19px;
  letter-spacing: 0.2px;
}

.badge::before { content: ''; width: 5px; height: 5px; border-radius: 1px; background: currentColor; }

.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--cta-soft); color: var(--cta); }
.badge.err { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--primary-soft); color: var(--primary); }

.delta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 2px;
}

.delta.up { color: var(--success); background: var(--success-soft); }
.delta.down { color: var(--danger); background: var(--danger-soft); }

/* ==========================================================================
   表格（数据密集）
   ========================================================================== */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.table-wrap.plain { border: none; border-radius: 0; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

table.data th, table.data td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
}

table.data td { font-size: 12px; }

table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td:first-child { font-family: var(--sans); font-size: 12.5px; }

table.data thead th {
  background: #F1F5F9;
  color: var(--text-2);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
}

table.data tbody tr { transition: background 0.12s; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--primary-soft); }

/* 分组汇总行（交付订单统计等分组报表用） */
table.data tr.row-subtotal td { background: var(--success-soft); font-weight: 600; }
table.data tr.row-group td { background: #D1FAE5; font-weight: 600; }
table.data tr.row-grand td { background: var(--primary-soft); font-weight: 700; color: var(--primary); }
table.data tr.row-subtotal:hover td { background: var(--success-soft); }
table.data tr.row-group:hover td { background: #D1FAE5; }
table.data tr.row-grand:hover td { background: var(--primary-soft); }
table.data tr.total-row td {
  font-weight: 600;
  background: #F1F5F9;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   Tabs / 分段控件
   ========================================================================== */
.tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.tabs .tab {
  appearance: none;
  border: none;
  background: none;
  padding: 0 2px 9px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { color: var(--primary); font-weight: 600; }

.tabs .tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--primary);
}

.segmented {
  display: inline-flex;
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2px;
  gap: 2px;
}

.segmented .seg {
  appearance: none;
  border: none;
  background: none;
  padding: 3px 13px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.segmented .seg:hover { color: var(--text); }

.segmented .seg.active {
  background: var(--card);
  color: var(--cta);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(30, 41, 59, 0.12);
}

.range-tag {
  font-size: 11px;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 2px 9px;
  border-radius: 2px;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   表单
   ========================================================================== */
label.field { display: block; margin-bottom: 14px; }
label.field .lab { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
label.field .lab .req { color: var(--danger); margin-left: 2px; }

input[type="text"], input[type="date"], input[type="time"], input[type="password"], select, textarea {
  width: 100%;
  height: 33px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 13px;
  font-family: var(--sans);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="date"], input[type="time"] { font-family: var(--mono); font-size: 12.5px; }

input:hover, select:hover { border-color: #CBD5E1; }

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input::placeholder { color: var(--text-3); }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 33px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--primary);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  user-select: none;
}

.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; }

/* 橙色 CTA：页面唯一主操作 */
.btn.cta { background: var(--cta); }
.btn.cta:hover { background: var(--cta-hover); }

.btn.ghost {
  background: var(--card);
  color: var(--text-2);
  border-color: var(--line);
}
.btn.ghost:hover { color: var(--primary); border-color: var(--primary); background: var(--card); }

.btn.small { height: 27px; padding: 0 11px; font-size: 12px; }

/* ==========================================================================
   上传区
   ========================================================================== */
/* 文件位网格：一行多个，避免长列表滚动 */
.zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 12px 14px;
  margin-bottom: 14px;
}

.zone-grid .field { display: flex; flex-direction: column; }
.zone-grid .field .lab { min-height: 18px; }
.zone-grid .dropzone { flex: 1; }

.dropzone {
  border: 1px dashed #CBD5E1;
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: #FAFCFF;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone .dz-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropzone .dz-icon svg { width: 18px; height: 18px; }
.dropzone .fname { font-size: 12.5px; font-weight: 500; word-break: break-all; }
.dropzone .fhint { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }

.dropzone.has-file { border-color: var(--success); border-style: solid; background: var(--success-soft); }
.dropzone.has-file .dz-icon { background: var(--card); color: var(--success); }
.dropzone.has-file .fname { font-family: var(--mono); font-size: 12px; }

/* ==========================================================================
   开关
   ========================================================================== */
.switch { position: relative; width: 38px; height: 21px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: #CBD5E1; transition: 0.2s; cursor: pointer;
}
.switch .slider::before {
  content: ''; position: absolute; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; left: 2px; top: 2px; transition: 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(17px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ==========================================================================
   首页模块卡
   ========================================================================== */
.module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.module-card:hover { border-color: var(--secondary); box-shadow: var(--shadow-lg); transform: translateY(-1px); }

.module-card .mod-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.module-card .mod-head { display: flex; align-items: center; gap: 11px; min-width: 0; }

.module-card .mod-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.module-card .mod-icon svg { width: 19px; height: 19px; }

.module-card .mod-name { font-size: 14px; font-weight: 600; }
.module-card .mod-desc { color: var(--text-3); font-size: 11.5px; margin-top: 1px; font-family: var(--mono); }

.module-card .big-stats {
  display: flex;
  gap: 32px;
  padding: 16px 16px 0;
  flex-wrap: wrap;
}

.module-card .big-stats .bs { min-width: 0; }

.module-card .big-stats .bs .v {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.module-card .big-stats .bs .l { font-size: 11.5px; color: var(--text-3); margin-top: 3px; letter-spacing: 0.3px; }

.module-card .sub-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 0;
  font-size: 12px;
  color: var(--text-3);
}

.module-card .sub-stats b { color: var(--text); font-weight: 500; font-family: var(--mono); }
.module-card .sub-stats .dot { width: 3px; height: 3px; border-radius: 50%; background: #CBD5E1; }

.module-card .spark { margin-top: 10px; height: 52px; width: 100%; display: block; }

.module-card .mod-empty { padding: 20px 16px 0; color: var(--text-3); font-size: 12.5px; line-height: 1.7; }

.module-card .mod-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-top: 1px solid var(--line-soft);
  background: #FAFCFE;
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--mono);
}

.module-card .mod-foot .links { display: flex; gap: 14px; }
.module-card .mod-foot a { font-size: 12px; font-family: var(--sans); }

/* ==========================================================================
   杂项
   ========================================================================== */
.muted { color: var(--text-3); font-size: 11.5px; line-height: 1.7; }
.mb0 { margin-bottom: 0 !important; }
.mt16 { margin-top: 14px; }
.flex { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }

.toast {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translate(-50%, -8px);
  padding: 9px 16px;
  border-radius: var(--r);
  background: #0F172A;
  color: #F1F5F9;
  font-size: 12.5px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  transition: all 0.25s;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast::before { content: ''; width: 6px; height: 6px; border-radius: 1px; background: var(--secondary); flex-shrink: 0; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error::before { background: var(--danger); }
.toast.success::before { background: var(--success); }

.chart { width: 100%; height: 290px; }

.empty { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 42px 0; }
.empty svg { width: 40px; height: 40px; color: #CBD5E1; display: block; margin: 0 auto 10px; }

.notice {
  display: flex;
  gap: 8px;
  padding: 8px 11px;
  border-radius: var(--r);
  background: var(--warning-soft);
  border: 1px solid #FDE9C8;
  color: #92600A;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.notice svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 3px; }

/* 通用交互性 */
[onclick], .tab, .seg, .nav-item, .dropzone, .btn, .slider { cursor: pointer; }

/* ==========================================================================
   双栏工作台布局（主区 + 侧栏）
   ========================================================================== */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
}

/* ==========================================================================
   步骤标记
   ========================================================================== */
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.step .step-no {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 2px 7px;
  border-radius: 2px;
}

.step .step-t { font-size: 14px; font-weight: 600; }
.step .step-d { font-size: 12px; color: var(--text-3); margin-left: auto; }

/* ==========================================================================
   模块选择卡（单选大卡）
   ========================================================================== */
.module-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.msel {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.msel:hover { border-color: var(--secondary); box-shadow: var(--shadow); }

.msel.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.msel .ms-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msel .ms-icon svg { width: 18px; height: 18px; }
.msel .ms-name { font-size: 13.5px; font-weight: 600; }
.msel .ms-desc { font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }

.msel .ms-check {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 20px;
  height: 20px;
  border-radius: 0 var(--r-lg) 0 var(--r-lg);
  background: var(--primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}

.msel .ms-check svg { width: 11px; height: 11px; }
.msel.active .ms-check { display: flex; }

/* ==========================================================================
   侧栏信息卡
   ========================================================================== */
.side-list { display: flex; flex-direction: column; }

.side-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 12px;
}

.side-item:last-child { border-bottom: none; }

.side-item .si-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 2px;
  height: fit-content;
  margin-top: 1px;
  flex-shrink: 0;
}

.side-item .si-tag.req { background: var(--danger-soft); color: var(--danger); }
.side-item .si-tag.opt { background: var(--hover); color: var(--text-3); }

.side-item .si-name { font-weight: 500; font-size: 12.5px; }
.side-item .si-hint { color: var(--text-3); font-size: 11.5px; margin-top: 1px; line-height: 1.5; }

/* ==========================================================================
   企微连接状态卡
   ========================================================================== */
.wecom-status-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  background: linear-gradient(135deg, #FAFCFF 0%, #F1F5F9 100%);
}

.wecom-status-row .ws-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wecom-status-row .ws-icon svg { width: 21px; height: 21px; }
.wecom-status-row .ws-icon.on { background: var(--success-soft); color: var(--success); }
.wecom-status-row .ws-icon.off { background: var(--hover); color: var(--text-3); }

.wecom-status-row .ws-title { font-size: 13.5px; font-weight: 600; }
.wecom-status-row .ws-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* ==========================================================================
   推送模块配置行
   ========================================================================== */
.push-mod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 13px;
}

.push-mod-head .pm-left { display: flex; align-items: center; gap: 11px; min-width: 0; }

.push-mod-head .pm-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.push-mod-head .pm-icon svg { width: 18px; height: 18px; }
.push-mod-head .pm-name { font-size: 13.5px; font-weight: 600; }
.push-mod-head .pm-state { font-size: 11.5px; margin-top: 1px; font-family: var(--mono); }
.push-mod-head .pm-state.on { color: var(--success); }
.push-mod-head .pm-state.off { color: var(--text-3); }

/* ==========================================================================
   企微成员多选（接收人选择器）
   ========================================================================== */
.picker { position: relative; }

.picker .pk-box {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  cursor: text;
}

.picker .pk-box:focus-within { border-color: var(--primary); }

.picker .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

.picker .chip .x {
  cursor: pointer;
  font-style: normal;
  font-size: 13px;
  line-height: 1;
  opacity: 0.65;
}
.picker .chip .x:hover { opacity: 1; }

.picker .pk-search {
  flex: 1;
  min-width: 90px;
  border: none !important;
  outline: none;
  padding: 3px 2px !important;
  font-size: 12.5px;
  background: transparent;
  box-shadow: none !important;
}

.picker .pk-drop {
  display: none;
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 4px;
}

.picker.open .pk-drop { display: block; }

.picker .pk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 12.5px;
}

.picker .pk-item:hover { background: var(--hover); }
.picker .pk-item.on { color: var(--primary); }
.picker .pk-item .pk-check { width: 14px; color: var(--primary); flex-shrink: 0; }
.picker .pk-item .pk-dept { margin-left: auto; font-size: 11px; color: var(--text-3); }
.picker .pk-empty { padding: 10px; font-size: 12px; color: var(--text-3); text-align: center; }

/* ==========================================================================
   时间线（推送记录 / 流程说明）
   ========================================================================== */
.timeline { position: relative; padding-left: 16px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

.tl-item { position: relative; padding: 7px 0 7px 8px; }

.tl-item::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 13px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--tl-color, var(--text-3));
  outline: 3px solid var(--bg);
}

.tl-item.ok { --tl-color: var(--success); }
.tl-item.err { --tl-color: var(--danger); }
.tl-item.info { --tl-color: var(--primary); }

.tl-item .tl-title { font-size: 12.5px; font-weight: 500; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-item .tl-time { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.tl-item .tl-desc { font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.55; word-break: break-all; }

/* ---------- 更新记录页 ---------- */
.cl-timeline .tl-item { padding: 10px 0 14px 8px; }
.cl-ver { align-items: center; }
.cl-ver .cl-ver-no { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); }
.cl-ver .cl-ver-title { font-size: 13px; font-weight: 500; color: var(--text-2); }
.cl-ver .cl-current { margin-left: 2px; }
.cl-ver .tl-time { margin-left: auto; }
.cl-body { margin-top: 8px; display: flex; flex-direction: column; gap: 9px; }
.cl-group { display: flex; gap: 10px; align-items: flex-start; }
.cl-tag { flex-shrink: 0; margin-top: 2px; }
.cl-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.cl-list li { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
@media (max-width: 640px) {
  .cl-group { flex-direction: column; gap: 4px; }
  .cl-ver .tl-time { margin-left: 0; flex-basis: 100%; }
}

/* ==========================================================================
   历史数据页
   ========================================================================== */
.hist-head { margin-bottom: 12px; }
.hist-head .step { margin-bottom: 0; }

.hist-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.hist-stat {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: linear-gradient(180deg, #FAFCFF 0%, var(--card) 100%);
}

.hist-stat .hs-val { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.2; }
.hist-stat .hs-lab { font-size: 11px; color: var(--text-3); margin-top: 3px; }

.hist-date { font-weight: 600; font-size: 12.5px; }
.hist-brief { font-size: 12px; color: var(--text-2); white-space: nowrap; }

.hist-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.hist-actions .btn { padding: 4px 8px; font-size: 11.5px; }

table.hist-table td:last-child,
table.hist-table th:last-child { text-align: right; }

.export-box { display: flex; flex-direction: column; gap: 10px; font-size: 12px; }

.export-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: start;
  line-height: 1.55;
}

.export-row .export-k {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  padding-top: 1px;
}

.export-note {
  margin-top: 4px;
  padding: 10px 11px;
  border-radius: var(--r);
  background: var(--primary-soft);
  font-size: 11.5px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .hist-summary { grid-template-columns: repeat(2, 1fr); }
  .hist-actions { justify-content: flex-start; }
  table.hist-table td:last-child,
  table.hist-table th:last-child { text-align: left; }
}

/* ==========================================================================
   领导报告页（daily.html）：无工具导航的干净报告排版，手机 / 企微内 / 投屏 / 打印
   ========================================================================== */
.rpt {
  max-width: 920px;
  margin: 0 auto;
  padding: 30px 24px 52px;
}

.rpt-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-3);
}

.rpt-brand img { width: 18px; height: 18px; border-radius: 5px; display: block; }

.rpt-title {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-top: 12px;
  line-height: 1.3;
}

.rpt-date { color: var(--text-2); font-size: 13.5px; margin-top: 5px; }
.rpt-scope { color: var(--text-3); font-size: 12px; margin-top: 3px; font-family: var(--mono); }

.rpt-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 22px 0 16px;
}

.rpt-kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--rk-accent, var(--primary));
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 15px 16px 13px;
}

.rpt-kpi.rk-blue { --rk-accent: var(--primary); }
.rpt-kpi.rk-green { --rk-accent: var(--success); }
.rpt-kpi.rk-orange { --rk-accent: var(--cta); }
.rpt-kpi.rk-purple { --rk-accent: var(--purple); }

.rpt-kpi .v {
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.25;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  word-break: break-all;
}

.rpt-kpi .v.long { font-size: 19px; }
.rpt-kpi .l { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.rpt .card { padding: 18px; }

.rpt-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.rpt-sec-head .t {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rpt-sec-head .t::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
}

.rpt-sec-head .d { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }

/* 占比条 */
.pct {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
}

.pct .bar {
  flex: 1;
  height: 6px;
  background: var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
}

.pct .bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.pct .n { font-family: var(--mono); font-size: 11px; color: var(--text-2); min-width: 42px; text-align: right; }

.rpt-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 20px; }

.rpt-foot {
  margin-top: 28px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 11.5px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
}

@media (max-width: 600px) {
  .rpt { padding: 20px 14px 40px; }
  .rpt-title { font-size: 20px; }
  .rpt-kpis { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .rpt-kpi .v { font-size: 19px; }
  .rpt-kpi .v.long { font-size: 16px; }
  .rpt .card { padding: 14px; }
}

@media print {
  body { background: #fff !important; }
  .rpt-actions, .no-print { display: none !important; }
  .rpt { max-width: none; padding: 0; }
  .rpt .card, .rpt-kpi { box-shadow: none; border-color: #CBD5E1; break-inside: avoid; }
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 960px) {
  .menu-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: auto;
    z-index: 300;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
    padding-top: 12px;
  }

  .sidebar.open { transform: translateX(0); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .main { padding: 14px 14px 30px; }
  .chart { height: 250px; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 10px; }
  .topbar .top-meta { display: none; }
  .topbar .brand .bt-name { font-size: 13.5px; }
  .topbar .brand .bt-sub { display: none; }
  .topbar .brand .logo-mark { width: 27px; height: 27px; border-radius: 7px; }

  .main { padding: 10px 10px 26px; }
  .page-title { font-size: 16px; }
  .card { padding: 12px; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .kpi { padding: 11px 12px 10px; }
  .kpi .k-val { font-size: 18px; }
  .kpi .k-head { margin-bottom: 7px; }
  .kpi .k-icon { width: 27px; height: 27px; }

  .module-card .big-stats { gap: 18px; padding: 12px 12px 0; }
  .module-card .big-stats .bs .v { font-size: 20px; }
  .module-card .mod-top { padding: 12px 12px 0; }
  .module-card .sub-stats { padding: 8px 12px 0; flex-wrap: wrap; }
  .module-card .mod-foot { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }

  .flex-between.page-head { flex-direction: column; align-items: stretch; }
  .flex-between.page-head .btn { width: 100%; }
  .date-nav { justify-content: space-between; }
  .date-nav input[type="date"] { flex: 1; }

  table.data { font-size: 11.5px; }
  table.data th, table.data td { padding: 6px 7px; }

  .segmented { width: 100%; }
  .segmented .seg { flex: 1; text-align: center; }
  .tabs { gap: 14px; overflow-x: auto; }

  .chart { height: 210px; }
}
