/* ==========================================================================
 * styles.css — 化销 CRM 设计系统（唯一视觉契约 · docs/UI-KIT.md §1–§3）
 * --------------------------------------------------------------------------
 * 结构：
 *   1. 设计令牌        2. 重置与基础        3. 应用骨架（侧栏/顶栏/内容区）
 *   4. 按钮与图标      5. 徽标/芯片/标签    6. 卡片/KPI/网格
 *   7. 工具条与表单控件 8. 表格/卡片列表/分页 9. 表单
 *   10. 弹层/抽屉/toast  11. 数据展示（时间线/看板/文件/打印/图表/预警）
 *   12. 响应式与打印
 * 不使用任何外部字体、CDN 与第三方库；所有图标由 core.js 内联 SVG 渲染。
 * ========================================================================== */

/* ============================================================ 1. 设计令牌 */
:root {
  --bg: #eef2f1; --surface: #ffffff; --surface-2: #f7faf9; --surface-3: #eef4f2;
  --ink: #12211e; --ink-2: #334a45; --muted: #74857f; --muted-2: #9aa9a4;
  --line: #e0e8e5; --line-strong: #cbd8d4;
  --brand: #0c7a66; --brand-600: #096353; --brand-700: #074d41; --brand-100: #e2f2ee; --brand-50: #f0f8f6;
  --amber: #c5891d; --amber-600: #a87210; --amber-100: #fbf1db;
  --red: #c5493d; --red-100: #fbe9e6;
  --blue: #356a9d; --blue-100: #e9f0f7;
  --violet: #6656a5; --violet-100: #efecf8;
  --green: #2f8a5b; --green-100: #e6f3ec;
  --sidebar: #0a1f1a; --sidebar-2: #0d2721; --sidebar-line: rgba(255, 255, 255, .07);
  --sidebar-text: #a9bdb7; --sidebar-active: #ffffff;
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 42, 35, .06);
  --shadow: 0 1px 2px rgba(15, 42, 35, .05), 0 10px 30px -18px rgba(15, 42, 35, .28);
  --shadow-lg: 0 24px 60px -20px rgba(10, 31, 26, .35);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* 布局扩展令牌 */
  --sidebar-w: 232px; --topbar-h: 58px; --page-pad: 24px;
  --focus-ring: 0 0 0 3px rgba(12, 122, 102, .16);
  --ease: 150ms ease;
}

/* ============================================================ 2. 重置与基础 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { vertical-align: middle; }
svg { flex: none; }
table { border-collapse: separate; border-spacing: 0; }
[hidden] { display: none !important; }
::selection { background: var(--brand-100); color: var(--brand-700); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
html.has-layer { overflow: hidden; }

/* 滚动条（亮色区域） */
* { scrollbar-width: thin; scrollbar-color: rgba(116, 133, 127, .32) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(116, 133, 127, .3);
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(116, 133, 127, .5); background-clip: content-box; }

/* ============================================================ 3. 应用骨架 */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
/* 侧栏 */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--sidebar-text);
  background: linear-gradient(180deg, #0b211c 0%, var(--sidebar) 44%, #081a16 100%);
  border-right: 1px solid rgba(0, 0, 0, .22);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: var(--topbar-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--sidebar-line);
  color: #fff;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: #0a1f1a;
  background: linear-gradient(145deg, #4bd3b3, #1fa489);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .38);
}
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.25; }
.brand-text strong { font-size: 13.5px; font-weight: 600; letter-spacing: .2px; color: #fff; }
.brand-text em { font-style: normal; font-size: 10.5px; letter-spacing: .4px; color: rgba(169, 189, 183, .72); }

.nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 14px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); background-clip: content-box; }
.nav-group { padding-bottom: 2px; }
.nav-label {
  padding: 14px 20px 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .6px;
  color: rgba(255, 255, 255, .3);
  white-space: nowrap;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  margin: 1px 10px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--sidebar-text);
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}
.nav-item > span[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: none;
  color: rgba(169, 189, 183, .85);
}
.nav-item > span[data-icon] svg { width: 18px; height: 18px; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-item:hover > span[data-icon] { color: #fff; }
.nav-item.active {
  color: #fff;
  font-weight: 500;
  background: linear-gradient(90deg, rgba(12, 122, 102, .34), rgba(12, 122, 102, .07));
}
.nav-item.active > span[data-icon] { color: #6fe3c8; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #2bb79a;
  box-shadow: 0 0 10px rgba(43, 183, 154, .55);
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--amber);
  color: #231902;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}
.sidebar-foot {
  flex: none;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--sidebar-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent);
}
.user-card { display: flex; align-items: center; gap: 9px; }
.sidebar .avatar {
  background: rgba(255, 255, 255, .1);
  color: #dff3ee;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-meta strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-meta em { font-style: normal; font-size: 10.5px; color: rgba(169, 189, 183, .72); }
.user-card .icon-btn { margin-left: auto; color: var(--sidebar-text); }
.user-card .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.version { margin-top: 8px; font-size: 10.5px; letter-spacing: .3px; color: rgba(255, 255, 255, .26); }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 39;
  display: none;
  background: rgba(8, 24, 20, .46);
  backdrop-filter: blur(1px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

/* 主区与顶栏 */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  height: var(--topbar-h);
  padding: 0 var(--page-pad);
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.menu-btn { display: none; color: var(--ink-2); }
.crumb {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .2px;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 9px; min-width: 0; margin-left: auto; }
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 258px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.search-trigger:hover { border-color: var(--line-strong); background: #fff; color: var(--ink-2); }
.search-trigger > span[data-icon] { display: inline-flex; width: 16px; height: 16px; color: var(--muted-2); }
.search-trigger > span[data-icon] svg { width: 16px; height: 16px; }
.search-trigger kbd {
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.35;
}
.quick-wrap { position: relative; }
.quick-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 168px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.quick-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.quick-menu a:hover { background: var(--surface-2); color: var(--ink); }
.bell { position: relative; }
.dot {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border: 1.5px solid #fff;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 12px;
  text-align: center;
}
.top-avatar { width: 30px; height: 30px; font-size: 12px; box-shadow: inset 0 0 0 1px rgba(12, 122, 102, .16); }

/* 内容区与页面结构 */
.view {
  flex: 1;
  width: 100%;
  max-width: 1560px;
  min-width: 0;
  margin: 0 auto;
  padding: 20px var(--page-pad) 40px;
}
.page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head-main { min-width: 0; }
.page-title { font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.2px; color: var(--ink); }
.page-sub { margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

/* ============================================================ 4. 按钮与文字工具 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.btn:hover { border-color: #b6c8c3; background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 15px; height: 15px; opacity: .85; }
.btn.primary {
  border-color: var(--brand-600);
  background: linear-gradient(180deg, #0d8571, var(--brand) 60%, var(--brand-600));
  color: #fff;
  box-shadow: 0 1px 2px rgba(9, 99, 83, .28), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn.primary:hover { border-color: var(--brand-700); background: linear-gradient(180deg, #0b7a67, var(--brand-600)); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { border-color: transparent; background: var(--surface-3); color: var(--ink); }
.btn.danger { border-color: #e6c4bf; background: #fff; color: var(--red); }
.btn.danger:hover { border-color: #d9a9a2; background: var(--red-100); color: #a83a30; }
.btn.danger.solid {
  border-color: #a83a30;
  background: linear-gradient(180deg, #cf5346, var(--red));
  color: #fff;
  box-shadow: 0 1px 2px rgba(168, 58, 48, .28);
}
.btn.danger.solid:hover { background: #b04035; color: #fff; }
.btn.sm { height: 26px; padding: 0 8px; border-radius: 6px; gap: 4px; font-size: 12px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn.lg { height: 38px; padding: 0 18px; border-radius: 9px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; box-shadow: none; }
.btn.is-loading { opacity: .85; pointer-events: none; }
.btn-spinner {
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink-2); }
.icon-btn.active { background: var(--brand-100); color: var(--brand-700); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn.sm svg { width: 14px; height: 14px; }
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.link:hover { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }

.muted { color: var(--muted); }
.sub { font-size: 12px; color: var(--muted); }
.strong { font-weight: 600; color: var(--ink); }
.num, .money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.money { font-weight: 500; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1 1 auto; }
.divider { height: 1px; margin: 12px 0; background: var(--line); }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.icon-text { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.icon-text svg { opacity: .9; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================ 5. 徽标 / 芯片 / 标签 */
.badge {
  --badge-bg: var(--surface-3);
  --badge-fg: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .1px;
  white-space: nowrap;
}
.badge.teal { --badge-bg: var(--brand-100); --badge-fg: var(--brand-700); }
.badge.blue { --badge-bg: var(--blue-100); --badge-fg: #2b5680; }
.badge.amber { --badge-bg: var(--amber-100); --badge-fg: #8a5f0d; }
.badge.red { --badge-bg: var(--red-100); --badge-fg: #a83a30; }
.badge.gray { --badge-bg: var(--surface-3); --badge-fg: #5d6f6a; }
.badge.violet { --badge-bg: var(--violet-100); --badge-fg: #54468a; }
.badge.green { --badge-bg: var(--green-100); --badge-fg: #256e49; }

.chip-list { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1;
  white-space: nowrap;
}
.chip.active { border-color: rgba(12, 122, 102, .18); background: var(--brand-100); color: var(--brand-700); }
.chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: -3px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.chip-x:hover { background: rgba(15, 42, 35, .09); color: var(--ink); }
.dot-badge { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); vertical-align: middle; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1;
  white-space: nowrap;
}
.tag.teal { background: var(--brand-100); color: var(--brand-700); }
.tag.amber { background: var(--amber-100); color: #8a5f0d; }
.tag.red { background: var(--red-100); color: #a83a30; }
.tag.blue { background: var(--blue-100); color: #2b5680; }
.tag.violet { background: var(--violet-100); color: #54468a; }
.tag.green { background: var(--green-100); color: #256e49; }

/* ============================================================ 6. 卡片 / KPI / 网格 */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .2px;
  user-select: none;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }

.card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
}
.card-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.card-body { padding: 18px; }
.card.tight .card-body, .card-body.tight { padding: 14px; }
.card.flush .card-body { padding: 0; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.section-title .muted { font-size: 12px; font-weight: 400; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.gap-16 { gap: 16px; }

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.stat-clickable { cursor: pointer; }
.stat-clickable:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.stat-label { overflow: hidden; font-size: 12px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--brand-100);
  color: var(--brand-700);
}
.stat-icon.tone-teal { background: var(--brand-100); color: var(--brand-700); }
.stat-icon.tone-blue { background: var(--blue-100); color: #2b5680; }
.stat-icon.tone-amber { background: var(--amber-100); color: #8a5f0d; }
.stat-icon.tone-red { background: var(--red-100); color: #a83a30; }
.stat-icon.tone-violet { background: var(--violet-100); color: #54468a; }
.stat-icon.tone-green { background: var(--green-100); color: #256e49; }
.stat-icon.tone-gray { background: var(--surface-3); color: #5d6f6a; }
.stat-value {
  overflow: hidden;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-value .unit { margin-left: 3px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 16px; font-size: 11.5px; color: var(--muted); }
.stat-foot-text { color: var(--muted); }
.stat-delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }
.stat-delta svg { width: 12px; height: 12px; }

.progress {
  position: relative;
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}
.progress > i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--brand); transition: width 220ms ease; }
.progress.amber > i { background: var(--amber); }
.progress.red > i { background: var(--red); }
.progress.blue > i { background: var(--blue); }
.progress.green > i { background: var(--green); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}
.empty-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--muted-2); opacity: .85; }
.empty-title { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.empty-text { max-width: 440px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.empty-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.empty-error .empty-icon { color: var(--red); }

/* 骨架屏 */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #e4ece9;
  box-shadow: inset 0 0 0 1px rgba(15, 42, 35, .03);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .92), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}
.page-loading { gap: 14px; }
.sk-title { width: 210px; height: 26px; }
.sk-card { height: 88px; border-radius: var(--radius); }
.sk-panel { height: 240px; border-radius: var(--radius); }
.sk-row { height: 12px; margin: 12px 0; }
.sk-row:first-child { margin-top: 0; }

/* ============================================================ 7. 工具条与表单控件 */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.toolbar .spacer { flex: 1 1 auto; }
.toolbar .input, .toolbar .select, .toolbar .date-input { width: auto; min-width: 128px; max-width: 240px; }
.toolbar .search-box { min-width: 180px; }
.toolbar .search-box .input { width: 100%; min-width: 0; }
.toolbar .divider { width: 1px; height: 22px; margin: 0 2px; }
.toolbar .label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.toolbar .toolbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface-3);
}
.seg > button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
}
.seg > button:hover { color: var(--ink-2); }
.seg > button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.field-inline { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.field-inline > label, .field-inline > span:first-child { color: var(--muted); font-size: 12.5px; }
.field-inline .input, .field-inline .select { width: auto; }

.input, .select, .textarea, .date-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:hover, .select:hover, .textarea:hover, .date-input:hover { border-color: #b6c8c3; }
.input:focus, .select:focus, .textarea:focus, .date-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: var(--focus-ring);
}
.input:disabled, .select:disabled, .textarea:disabled, .date-input:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}
.select {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2374857f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.textarea { height: auto; min-height: 88px; padding: 8px 10px; line-height: 1.55; resize: vertical; }
.input.sm, .select.sm, .date-input.sm { height: 26px; font-size: 12px; border-radius: 6px; }
.input.lg, .select.lg { height: 38px; font-size: 13.5px; }
.date-input { color-scheme: light; }

.search-box { position: relative; display: block; min-width: 180px; }
.search-box > svg, .search-box > span[data-icon] {
  position: absolute;
  top: 50%;
  left: 9px;
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  pointer-events: none;
  transform: translateY(-50%);
}
.search-box > span[data-icon] svg { width: 15px; height: 15px; }
.search-box > .input { padding-left: 30px; }

.input-group { display: flex; align-items: stretch; width: 100%; min-width: 0; }
.input-group > .addon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.input-group > .addon:first-child { border-right: 0; border-radius: 8px 0 0 8px; }
.input-group > .addon:last-child { border-left: 0; border-radius: 0 8px 8px 0; }
.input-group > .addon:only-child { border: 1px solid var(--line-strong); border-radius: 8px; }
.input-group > .input, .input-group > .select { flex: 1; width: auto; min-width: 0; border-radius: 0; }
.input-group > .input:first-child, .input-group > .select:first-child { border-radius: 8px 0 0 8px; }
.input-group > .input:last-child, .input-group > .select:last-child { border-radius: 0 8px 8px 0; }
.input-group > .input:only-child, .input-group > .select:only-child { border-radius: 8px; }
.input-group > .input:focus, .input-group > .select:focus { position: relative; z-index: 1; }

/* 复选框 / 单选框 / 开关 */
input[type="checkbox"], input[type="radio"] {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin: 0;
  flex: none;
  vertical-align: -2px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 11px 11px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color var(--ease), border-color var(--ease), box-shadow var(--ease);
}
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--brand); }
input[type="checkbox"]:checked {
  border-color: var(--brand);
  background-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
input[type="radio"] { border-radius: 50%; }
input[type="radio"]:checked { border-color: var(--brand); background-color: var(--brand); box-shadow: inset 0 0 0 3.5px #fff; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .5; cursor: not-allowed; }

.checkbox { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.checkbox input { margin-top: 1px; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.switch input[type="checkbox"] {
  width: 36px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background-color: var(--line-strong);
  background-image: radial-gradient(circle, #fff 6px, transparent 6.5px);
  background-size: 20px 20px;
  background-position: 0% 50%;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 2px rgba(15, 42, 35, .14);
  transition: background-color var(--ease), background-position var(--ease);
}
.switch input[type="checkbox"]:checked {
  border: 0;
  background-color: var(--brand);
  background-image: radial-gradient(circle, #fff 6px, transparent 6.5px);
  background-position: 100% 50%;
  box-shadow: inset 0 1px 2px rgba(9, 99, 83, .3);
}
.switch-text { color: var(--ink-2); }

.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.radio-row > label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); font-weight: 500; }

.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tag-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.tag-opt input { display: none; }
.tag-opt:hover { border-color: #b6c8c3; background: var(--surface-2); }
.tag-opt:has(input:checked), .tag-opt.on { border-color: rgba(12, 122, 102, .45); background: var(--brand-100); color: var(--brand-700); font-weight: 500; }
.tag-picker-empty { font-size: 12px; color: var(--muted); }

.multi-select {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  max-height: 158px;
  overflow: auto;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.multi-select .checkbox { min-width: 0; }
.ms-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================ 8. 表格 / 卡片列表 / 分页 / 标签页 */
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.table-wrap > table { min-width: 100%; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--ink-2); font-size: 13px; }
table.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2px;
  text-align: left;
  white-space: nowrap;
}
table.table thead th.right { text-align: right; }
table.table tbody td { height: 42px; padding: 0 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr { transition: background var(--ease); }
table.table tbody tr:hover { background: var(--surface-2); }
table.table tbody tr.selected { background: var(--brand-50); }
table.table tbody tr.selected:hover { background: var(--brand-100); }
table.table tbody tr.is-clickable { cursor: pointer; }
table.table tbody tr.is-clickable:active { background: var(--surface-3); }
table.table .cell-num { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
table.table th.th-check, table.table td.cell-check { width: 38px; padding-right: 0; padding-left: 14px; text-align: left; }
table.table th.th-actions, table.table td.cell-actions { width: 1%; text-align: right; white-space: nowrap; }
.cell-main { display: flex; flex-direction: column; gap: 1px; line-height: 1.35; white-space: nowrap; }
.cell-main strong, .cell-main .main { color: var(--ink); font-size: 13px; font-weight: 500; }
.cell-main span, .cell-main .sub { color: var(--muted); font-size: 11.5px; }
.cell-sub { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; line-height: 1.3; }
.cell-actions .row-actions { display: inline-flex; align-items: center; gap: 2px; opacity: 0; transition: opacity var(--ease); }
table.table tbody tr:hover .cell-actions .row-actions,
table.table tbody tr:focus-within .cell-actions .row-actions,
.cell-actions .row-actions:focus-within { opacity: 1; }
@media (hover: none) { .cell-actions .row-actions { opacity: 1; } }

table.table th.sortable { position: relative; padding-right: 22px; cursor: pointer; user-select: none; }
table.table th.sortable:hover { color: var(--ink-2); }
table.table th.sortable::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 9px;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-right: 3.5px solid transparent;
  border-bottom: 5px solid var(--muted-2);
  border-left: 3.5px solid transparent;
  opacity: .5;
  transition: opacity var(--ease), border-color var(--ease);
}
table.table th.sort-asc::after { border-bottom-color: var(--brand); opacity: 1; }
table.table th.sort-desc::after { margin-top: -3px; border-top: 5px solid var(--brand); border-bottom: 0; opacity: 1; }

/* 窄屏卡片列表（dataTable 自动生成） */
.data-cards { display: none; flex-direction: column; gap: 10px; }
.data-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.data-card.is-clickable { cursor: pointer; }
.data-card:active { background: var(--surface-2); }
.data-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.data-card-head .cell-main { white-space: normal; }
.data-card-body { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.dc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 1.5; }
.dc-label { flex: none; max-width: 45%; color: var(--muted); }
.dc-value { color: var(--ink-2); text-align: right; word-break: break-all; }
.dc-value.num { font-variant-numeric: tabular-nums; }
.data-card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.data-card-foot .row-actions { opacity: 1; }
.table-empty { border-radius: var(--radius); background: var(--surface); }

.pager { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-top: 12px; }
.pager-info { margin-right: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pager-sep { margin: 0 5px; color: var(--muted-2); }
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.pager-btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); }
.pager-btn.active { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 600; }
.pager-btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.pager-btn svg { width: 14px; height: 14px; }
.pager-gap { padding: 0 2px; color: var(--muted-2); font-size: 12px; }
.pager .pager-text { font-size: 12px; }

.tabs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--ease);
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--ink); font-weight: 600; }
.tab.active::after { content: ""; position: absolute; right: 10px; bottom: -1px; left: 10px; height: 2px; border-radius: 2px; background: var(--brand); }
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count { background: var(--brand-100); color: var(--brand-700); }

/* 行内“更多”菜单 */
.menu { display: flex; flex-direction: column; min-width: 160px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); color: var(--ink); }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: var(--red-100); }
.menu-item svg { width: 15px; height: 15px; color: var(--muted); }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.menu-wrap { position: relative; display: inline-flex; }
.menu-pop { position: absolute; top: calc(100% + 4px); right: 0; z-index: 70; }

/* ============================================================ 9. 表单 */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; min-width: 0; }
.form.cols-1 { grid-template-columns: minmax(0, 1fr); }
.form .field.span-2, .form > .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 12px; font-weight: 500; line-height: 1.4; }
.req { color: var(--red); font-size: 13px; font-weight: 600; line-height: 1; }
.field-hint { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.field-error { color: var(--red); font-size: 11.5px; line-height: 1.45; }
.field.error .input, .field.error .select, .field.error .textarea, .field.error .date-input, .field.error .input-group > .addon { border-color: var(--red); }
.field.error .input:focus, .field.error .select:focus, .field.error .textarea:focus { box-shadow: 0 0 0 3px rgba(197, 73, 61, .12); }
.field-check { flex-direction: row; align-items: center; }
.field-switch { align-items: flex-start; }

/* ============================================================ 10. 弹层 / 抽屉 / toast */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 24, 20, .42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 150ms ease;
}
.modal-mask-out { animation: fadeOut 150ms ease forwards; }
.modal {
  display: flex;
  flex-direction: column;
  width: 560px;
  max-width: 100%;
  max-height: 86vh;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: popIn 180ms cubic-bezier(.2, .8, .3, 1);
}
.modal.sm { width: 420px; }
.modal.lg { width: 720px; }
.modal.xl { width: 920px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head-main { min-width: 0; }
.modal-title { color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.35; }
.modal-sub { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.modal-close { flex: none; margin: -2px -6px 0 0; }
.modal-body { flex: 1; min-height: 0; padding: 18px 20px; overflow: auto; overscroll-behavior: contain; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.modal-foot .spacer { margin-right: auto; }
.form-modal .modal-body { padding-top: 20px; }
.confirm-box { width: 420px; }
.confirm-msg { color: var(--ink-2); font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.confirm-box .modal-foot .btn { min-width: 76px; }

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  background: rgba(8, 24, 20, .38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 150ms ease;
}
.drawer-mask-out { animation: fadeOut 160ms ease forwards; }
.drawer {
  display: flex;
  flex-direction: column;
  width: 560px;
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: slideIn 200ms cubic-bezier(.2, .8, .3, 1);
}
.drawer.sm { width: 420px; }
.drawer.lg { width: 720px; }
.drawer.xl { width: 920px; }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head-main { min-width: 0; }
.drawer-title { color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.35; }
.drawer-sub { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.drawer-close { flex: none; margin: -2px -6px 0 0; }
.drawer-body { flex: 1; min-height: 0; padding: 18px 20px; overflow: auto; overscroll-behavior: contain; }
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.toast-root {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 240px;
  padding: 10px 12px;
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: #16302a;
  color: #eaf5f2;
  box-shadow: 0 12px 32px -14px rgba(10, 31, 26, .55);
  pointer-events: auto;
  animation: toastIn 180ms cubic-bezier(.2, .8, .3, 1);
}
.toast .toast-icon { display: inline-flex; flex: none; margin-top: 1px; color: #8fe3cf; }
.toast .toast-msg { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.5; word-break: break-word; }
.toast .toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  margin: -1px -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(234, 245, 242, .6);
  cursor: pointer;
}
.toast .toast-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.toast.success { border-left-color: #33c7a8; }
.toast.error { border-left-color: #e06a5d; }
.toast.warn { border-left-color: #e0a83c; }
.toast.info { border-left-color: #5b9bd5; }
.toast.error .toast-icon { color: #f3a79d; }
.toast.warn .toast-icon { color: #f0c674; }
.toast.info .toast-icon { color: #9cc7ea; }
.toast-out { animation: toastOut 160ms ease forwards; }

/* ============================================================ 11. 数据展示 */
/* 键值网格 */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; min-width: 0; }
.kv-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-row.span-2 { grid-column: 1 / -1; }
.kv-label { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.kv-value { color: var(--ink); font-size: 13px; line-height: 1.5; word-break: break-word; }
.kv-value.num { font-variant-numeric: tabular-nums; }

/* 时间线 */
.timeline { position: relative; display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 4px 0; list-style: none; }
.timeline::before { content: ""; position: absolute; top: 14px; bottom: 14px; left: 10px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: flex; gap: 10px; min-width: 0; padding: 6px 0 14px 32px; }
.tl-dot {
  position: absolute;
  top: 6px;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  box-shadow: 0 0 0 1px var(--line);
}
.tl-dot svg { width: 11px; height: 11px; }
.timeline-item.amber .tl-dot { background: var(--amber-100); color: #8a5f0d; }
.timeline-item.blue .tl-dot { background: var(--blue-100); color: #2b5680; }
.timeline-item.violet .tl-dot { background: var(--violet-100); color: #54468a; }
.timeline-item.red .tl-dot { background: var(--red-100); color: #a83a30; }
.timeline-item.green .tl-dot { background: var(--green-100); color: #256e49; }
.timeline-item.gray .tl-dot { background: var(--surface-3); color: var(--muted); }
.tl-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.tl-title { color: var(--ink); font-size: 13px; font-weight: 500; }
.tl-time { color: var(--muted-2); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-desc { color: var(--ink-2); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }

/* 看板 */
.kanban { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 6px; }
.kanban-col {
  display: flex;
  flex: 0 0 280px;
  flex-direction: column;
  width: 280px;
  min-width: 0;
  max-height: calc(100vh - 260px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: none;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}
.kanban-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kanban-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 10px; }
.kanban-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.kanban-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.kanban-card-title { color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11.5px; }

/* 一屏四问 */
.q-item { display: flex; gap: 14px; min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.q-item:first-child { padding-top: 0; }
.q-item:last-child { padding-bottom: 0; border-bottom: 0; }
.q-label { display: flex; align-items: flex-start; flex: none; gap: 6px; width: 92px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.q-label svg { width: 14px; height: 14px; margin-top: 2px; color: var(--muted-2); }
.q-value { flex: 1; min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.6; word-break: break-word; }

/* 文档 / 附件 */
.doc-list { display: flex; flex-direction: column; gap: 6px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  transition: background var(--ease), border-color var(--ease);
}
a.file-item:hover { border-color: var(--line-strong); background: var(--surface-2); }
.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink-2);
}
.file-icon svg { width: 16px; height: 16px; }
.file-main { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.file-name { overflow: hidden; color: var(--ink); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: 11.5px; }
.file-badge { flex: none; }

/* 打印页（A4） */
.print-page {
  width: 794px;
  max-width: 100%;
  margin: 0 auto;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.65;
}
.print-page h1 { margin-bottom: 4px; font-size: 20px; font-weight: 600; letter-spacing: -.2px; }
.print-page h2 { margin: 20px 0 8px; font-size: 14px; font-weight: 600; }
.print-page h3 { margin: 14px 0 6px; font-size: 13px; font-weight: 600; }
.print-page p { margin: 4px 0; }
.print-page table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 12px; }
.print-page th, .print-page td { padding: 6px 8px; border: 1px solid var(--line-strong); text-align: left; }
.print-page th { background: var(--surface-2); font-weight: 500; color: var(--ink-2); }
.print-page .print-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.print-page .print-meta { text-align: right; color: var(--muted); font-size: 11.5px; }
.print-page .print-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line-strong); color: var(--muted); font-size: 11.5px; }

/* 图表 */
.chart { width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; max-width: 100%; height: auto; }
.chart-empty .empty { padding: 26px 12px; }
.chart-donut { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.chart-donut > svg { flex: none; width: auto; max-width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.legend-col { flex: 1; flex-direction: column; flex-wrap: nowrap; gap: 7px; min-width: 150px; margin-top: 0; }
.chart-donut .legend-col { flex: 0 0 200px; width: 200px; min-width: 0; }
.chart-donut .legend-item { width: 100%; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.legend-dot { width: 8px; height: 8px; flex: none; border-radius: 2px; }
.legend-label { overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.legend-value { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.sparkline { display: inline-block; vertical-align: middle; }

/* 预警区 */
.risk-list { display: flex; flex-direction: column; gap: 2px; }
.risk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease);
}
a.risk-item:hover { border-color: var(--line); background: var(--surface-2); }
.risk-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(197, 137, 29, .12); }
.risk-item.red .risk-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(197, 73, 61, .12); }
.risk-item.blue .risk-dot { background: var(--blue); box-shadow: 0 0 0 3px rgba(53, 106, 157, .12); }
.risk-item.teal .risk-dot { background: var(--brand); box-shadow: 0 0 0 3px rgba(12, 122, 102, .12); }
.risk-item.violet .risk-dot { background: var(--violet); box-shadow: 0 0 0 3px rgba(102, 86, 165, .12); }
.risk-item.gray .risk-dot { background: var(--muted-2); box-shadow: none; }
.risk-main { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.risk-title { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.risk-meta { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.risk-arrow { display: inline-flex; flex: none; color: var(--muted-2); }
.risk-arrow svg { width: 14px; height: 14px; }

/* 移动端底部导航（可选，默认隐藏） */
.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 35;
  display: none;
  align-items: stretch;
  height: 56px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tabbar a { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 10.5px; text-decoration: none; }
.tabbar a.active { color: var(--brand); font-weight: 500; }
.tabbar a svg { width: 20px; height: 20px; }

/* ============================================================ 12. 响应式 */
/* 1024–1280px：侧栏自动收成 64px 图标栏 */
@media (min-width: 761px) and (max-width: 1280px) {
  .app { --sidebar-w: 64px; }
  .app .brand { justify-content: center; gap: 0; padding: 0; }
  .app .brand-text { display: none; }
  .app .nav-label { height: 1px; margin: 10px 16px; padding: 0; overflow: hidden; background: var(--sidebar-line); color: transparent; font-size: 0; }
  .app .nav-item { justify-content: center; gap: 0; height: 38px; margin: 1px 12px; padding: 0; }
  .app .nav-item > span:not([data-icon]) { display: none; }
  .app .nav-badge { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; margin: 0; padding: 0 3px; border: 1.5px solid var(--sidebar); font-size: 9.5px; line-height: 12px; }
  .app .nav-item.active::before { left: -12px; }
  .app .user-card { justify-content: center; }
  .app .user-meta { display: none; }
  .app .user-card .icon-btn { display: none; }
  .app .sidebar-foot { padding: 10px 0 12px; }
  .app .version { display: none; }
}
/* 显式 .app.rail（由 app.js 控制） */
@media (min-width: 761px) {
  .app.rail { --sidebar-w: 64px; }
  .app.rail .brand { justify-content: center; gap: 0; padding: 0; }
  .app.rail .brand-text { display: none; }
  .app.rail .nav-label { height: 1px; margin: 10px 16px; padding: 0; overflow: hidden; background: var(--sidebar-line); color: transparent; font-size: 0; }
  .app.rail .nav-item { justify-content: center; gap: 0; height: 38px; margin: 1px 12px; padding: 0; }
  .app.rail .nav-item > span:not([data-icon]) { display: none; }
  .app.rail .nav-badge { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; margin: 0; padding: 0 3px; border: 1.5px solid var(--sidebar); font-size: 9.5px; line-height: 12px; }
  .app.rail .nav-item.active::before { left: -12px; }
  .app.rail .user-card { justify-content: center; }
  .app.rail .user-meta { display: none; }
  .app.rail .user-card .icon-btn { display: none; }
  .app.rail .sidebar-foot { padding: 10px 0 12px; }
  .app.rail .version { display: none; }
}

/* ≤1024px */
@media (max-width: 1024px) {
  :root { --page-pad: 16px; }
  .topbar { gap: 8px; }
  .search-trigger { min-width: 220px; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.table { font-size: 12.5px; }
  table.table thead th, table.table tbody td { padding: 0 10px; }
  .tl-desc { font-size: 12px; }
}

/* ≤760px：抽屉侧栏 + 卡片表格 + 单列表单 */
@media (max-width: 760px) {
  :root { --page-pad: 14px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: 272px;
    height: 100%;
    height: 100dvh;
    border-right: 0;
    box-shadow: 0 0 42px rgba(0, 0, 0, .34);
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand { justify-content: flex-start; gap: 10px; padding: 0 16px; }
  .sidebar .brand-text { display: flex; }
  .sidebar .nav-label { height: auto; margin: 0; padding: 14px 20px 6px; overflow: visible; background: none; color: rgba(255, 255, 255, .3); font-size: 11px; }
  .sidebar .nav-item { justify-content: flex-start; gap: 10px; height: 38px; margin: 1px 10px; padding: 0 10px; }
  .sidebar .nav-item > span:not([data-icon]) { display: inline; }
  .sidebar .nav-badge { position: static; min-width: 19px; height: 18px; margin: 0 0 0 auto; padding: 0 5px; border: 0; font-size: 10.5px; line-height: 1; }
  .sidebar .nav-item.active::before { left: -10px; }
  .sidebar .user-card { justify-content: flex-start; }
  .sidebar .user-meta { display: flex; }
  .sidebar .user-card .icon-btn { display: inline-flex; margin-left: auto; }
  .sidebar .sidebar-foot { padding: 10px 12px 12px; }
  .sidebar .version { display: block; }
  .sidebar-scrim { display: block; }
  .app .sidebar.open ~ .sidebar-scrim { opacity: 1; pointer-events: none; }
  .menu-btn { display: inline-flex; }
  .topbar { gap: 6px; height: 54px; padding: 0 14px; }
  .top-actions { gap: 4px; }
  .search-trigger { justify-content: center; width: 32px; min-width: 32px; padding: 0; border-color: transparent; background: transparent; }
  .search-trigger:hover { background: var(--surface-3); }
  .search-trigger > span:not([data-icon]), .search-trigger kbd { display: none; }
  .quick-wrap .btn { height: 30px; padding: 0 10px; }
  .top-avatar { width: 28px; height: 28px; font-size: 11.5px; }
  .view { padding: 14px 14px calc(30px + env(safe-area-inset-bottom, 0)); }
  .page { gap: 12px; }
  .page-title { font-size: 20px; letter-spacing: -.1px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .grid { gap: 10px; }
  .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px; gap: 5px; }
  .stat-value { font-size: 20px; }
  .stat-icon { width: 26px; height: 26px; border-radius: 8px; }
  .stat-icon svg { width: 14px; height: 14px; }
  .card-body { padding: 14px; }
  .card-head { min-height: 44px; padding: 10px 14px; }
  .toolbar { gap: 6px; padding: 8px 10px; }
  .toolbar .input, .toolbar .select, .toolbar .date-input { flex: 1 1 120px; min-width: 0; max-width: none; }
  .toolbar .search-box { flex: 1 1 100%; min-width: 0; }
  .toolbar .toolbar-end { width: 100%; margin-left: 0; }
  .toolbar .divider { display: none; }
  /* dataTable 卡片模式 */
  .data-table[data-mobile="cards"] .table-wrap { display: none; }
  .data-table[data-mobile="cards"] .data-cards { display: flex; }
  .data-table[data-mobile="table"] .data-cards { display: none; }
  .data-table[data-mobile="table"] .table-wrap { display: block; }
  /* 原生表格手动卡片化（.table--stack） */
  table.table.table--stack thead { display: none; }
  table.table.table--stack tbody { display: flex; flex-direction: column; gap: 10px; }
  table.table.table--stack tbody tr { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  table.table.table--stack tbody tr:hover { background: var(--surface); }
  table.table.table--stack tbody td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; height: auto; padding: 0; border: 0; white-space: normal; }
  table.table.table--stack tbody td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; }
  table.table.table--stack tbody td:first-child { display: block; }
  table.table.table--stack tbody td:first-child::before { display: none; }
  table.table { font-size: 12.5px; }
  table.table thead th { height: 32px; padding: 0 10px; font-size: 11.5px; }
  table.table tbody td { height: 40px; padding: 0 10px; font-size: 12.5px; }
  .cell-actions .row-actions { opacity: 1; }
  .pager { padding-top: 10px; }
  .pager-info { width: 100%; margin: 0 0 2px; }
  .pager-btn { flex: none; }
  .pager .pager-text { display: none; }
  .form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .form .field.span-2 { grid-column: auto; }
  .multi-select { grid-template-columns: minmax(0, 1fr); }
  .modal-mask { padding: 12px; }
  .modal { width: 100% !important; max-height: 90vh; border-radius: 14px; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 10px 16px; }
  .drawer { width: 100% !important; }
  .drawer-head { padding: 14px 16px; }
  .drawer-body { padding: 14px 16px; }
  .drawer-foot { padding: 10px 16px; }
  .toast-root { top: 10px; right: 10px; left: 10px; max-width: none; }
  .toast { width: 100%; min-width: 0; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .kv-row.span-2 { grid-column: auto; }
  .timeline-item { padding-left: 30px; }
  .kanban { gap: 10px; }
  .kanban-col { flex-basis: 250px; width: 250px; max-height: none; }
  .chart-donut { justify-content: center; gap: 12px; }
  .legend-col { min-width: 100%; }
  .btn .label { display: none; }
  .q-item { gap: 10px; }
  .q-label { width: 76px; }
  .print-page { padding: 20px; }
  .tabbar { display: flex; }
  .app:has(.tabbar) .view { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0)); }
}

/* ============================================================ 13. 打印 */
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { background: #fff; }
  body { overflow: visible; }
  .sidebar, .sidebar-scrim, .topbar, .tabbar, .toast-root, .modal-root, .drawer-root,
  .page-actions, .toolbar, .pager, .tabs, .menu, .menu-pop, .print-hide { display: none !important; }
  .app { display: block; }
  .main { display: block; min-height: 0; }
  .view { max-width: none; margin: 0; padding: 0; }
  .page { gap: 10px; }
  .card { break-inside: avoid; border-color: #d8d8d8; box-shadow: none; }
  .print-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 11.5px;
  }
  .table-wrap { overflow: visible; }
  table.table { font-size: 11px; }
  table.table thead th { position: static; }
  a[href]::after { content: none; }
  .page-title { font-size: 18px; }
}

/* ============================================================ 14. 动效 */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: .6; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

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

/* ============================================================ 15. 外壳集成补充
 * 说明：以下类由 app.js（全局搜索、移动端抽屉）或登录页使用，
 * 属于共享外壳的一部分，故统一放在 styles.css 维护。
 * ------------------------------------------------------------------------ */

/* 全局搜索弹层 */
.search-modal .modal-body { padding: 0; }
.search-dialog { display: flex; flex-direction: column; min-height: 340px; max-height: 64vh; }
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.search-ico { display: inline-flex; flex: none; color: var(--muted); }
.search-input-wrap .input {
  flex: 1;
  width: auto;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  box-shadow: none;
}
.search-input-wrap .input:focus { border: 0; box-shadow: none; background: transparent; }
.search-kbd {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.4;
}
.search-hint { flex: none; padding: 8px 18px 2px; font-size: 11.5px; }
.search-results { flex: 1; min-height: 0; overflow: auto; padding: 8px 8px 12px; }
.search-empty { padding: 30px 18px; font-size: 12.5px; text-align: center; }
.search-group { margin-top: 2px; }
.search-group-label { padding: 9px 10px 4px; color: var(--muted-2); font-size: 11px; font-weight: 500; letter-spacing: .4px; }
.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--ease);
}
.search-item:hover { background: var(--surface-2); }
.search-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--ink-2);
}
.search-item-icon svg { width: 15px; height: 15px; }
.search-item-main { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.search-item-main strong { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.search-item-main em { overflow: hidden; color: var(--muted); font-size: 11.5px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.search-item > svg { flex: none; color: var(--muted-2); }

/* 移动端抽屉遮罩（app.js 通过 .show 控制可点击关闭） */
@media (max-width: 760px) {
  body.nav-open { overflow: hidden; }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
}

/* 菜单按钮：仅移动端显示（覆盖 .icon-btn 的 inline-flex） */
.topbar .menu-btn { display: none; }
@media (max-width: 760px) {
  .topbar .menu-btn { display: inline-flex; }
}
