/* ==========================================================================
   创想客户售后工单协同管理平台 v1.0
   设计语言：工业信号纸 / Signal Paper — 石墨墨色 + 信号橙 + 暖灰纸面
   ========================================================================== */

@font-face {
  font-family: 'Barlow Condensed';
  src: url('../fonts/barlow-condensed-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('../fonts/barlow-condensed-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #101a21;
  --ink-2: #17252e;
  --ink-3: #21333e;
  --ink-4: #2c4450;
  --paper: #f1eee7;
  --paper-2: #f7f5f0;
  --panel: #ffffff;
  --line: #e1dacd;
  --line-soft: #ece6dc;
  --line-strong: #cfc4b2;
  --text: #1b252c;
  --muted: #6c6961;
  --faint: #9a9386;
  --orange: #ef6530;
  --orange-2: #ff8a4c;
  --orange-soft: #fdeae0;
  --teal: #0e7a6c;
  --teal-soft: #e1f2ed;
  --blue: #2d5f8b;
  --blue-soft: #e5eef5;
  --violet: #66548f;
  --violet-soft: #ece8f4;
  --red: #b93c2c;
  --red-soft: #fbe6e2;
  --warn: #b8730f;
  --warn-soft: #fbf0da;
  --ok: #2f7d52;
  --ok-soft: #e4f1e8;
  --shadow-1: 0 1px 0 rgba(16, 26, 33, .04), 0 8px 24px -18px rgba(16, 26, 33, .35);
  --shadow-2: 0 18px 48px -26px rgba(16, 26, 33, .45);
  --rail-w: 278px;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(16, 26, 33, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 26, 33, .028) 1px, transparent 1px);
  background-size: 34px 34px;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
::selection { background: var(--orange); color: #fff; }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ============================== 布局骨架 ============================== */
.shell { min-height: 100vh; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w); z-index: 60;
  display: flex; flex-direction: column;
  background: var(--ink); color: #dce4e6; overflow: hidden;
}
.rail::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.25) 70%, transparent);
}
.rail::after {
  content: ''; position: absolute; width: 240px; height: 240px; right: -130px; top: 36%;
  border: 1px solid rgba(239, 101, 48, .28); border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(239, 101, 48, .05), 0 0 0 70px rgba(239, 101, 48, .035);
  pointer-events: none;
}
.rail-brand { position: relative; padding: 24px 22px 20px; display: flex; align-items: center; gap: 12px; z-index: 1; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-text strong { display: block; font-family: var(--font-display); font-size: 21px; letter-spacing: .06em; color: #fff; line-height: 1; }
.brand-text span { display: block; margin-top: 7px; font-size: 10px; letter-spacing: .22em; color: #8496a0; text-transform: uppercase; }
.rail-sep { height: 1px; margin: 0 22px 14px; background: linear-gradient(90deg, rgba(255,255,255,.16), transparent); }

.rail-nav { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 2px 12px 16px; scrollbar-width: thin; scrollbar-color: #31464f transparent; }
.rail-nav::-webkit-scrollbar { width: 5px; }
.rail-nav::-webkit-scrollbar-thumb { background: #31464f; border-radius: 4px; }

.nav-group { margin-bottom: 5px; }
.nav-group-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px 7px;
  background: none; border: 0; color: #7f939d; text-align: left;
}
.nav-group-btn .ng-no { font-family: var(--font-mono); font-size: 10px; color: var(--orange); letter-spacing: .06em; }
.nav-group-btn .ng-title { font-size: 11.5px; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group-btn .ng-chev { margin-left: auto; width: 12px; height: 12px; opacity: .5; transition: transform .2s; }
.nav-group.collapsed .ng-chev { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }
.nav-items { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 30px; color: #b7c4ca; border-radius: 3px;
  font-size: 13.5px; letter-spacing: .01em; transition: background .18s, color .18s;
}
.nav-link .ic { width: 16px; height: 16px; color: #6f8792; transition: color .18s; }
.nav-link .nav-note { margin-left: auto; font-size: 9.5px; color: #5d727c; letter-spacing: .05em; opacity: 0; transition: opacity .2s; }
.nav-link:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-link:hover .ic { color: var(--orange-2); }
.nav-link:hover .nav-note { opacity: 1; }
.nav-link.active { background: linear-gradient(90deg, rgba(239, 101, 48, .19), rgba(239, 101, 48, .03)); color: #fff; }
.nav-link.active::before { content: ''; position: absolute; left: 12px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; background: var(--orange); box-shadow: 0 0 0 4px rgba(239, 101, 48, .14); }
.nav-link.active .ic { color: var(--orange-2); }

.rail-foot { position: relative; z-index: 1; padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.09); background: linear-gradient(180deg, transparent, rgba(0,0,0,.24)); }
.rail-company { font-size: 9.5px; color: #5f747e; letter-spacing: .04em; margin-bottom: 9px; }
.rail-user { display: flex; align-items: center; gap: 10px; }
.rail-user .meta { min-width: 0; }
.rail-user strong { display: block; font-size: 13px; color: #fff; font-weight: 600; }
.rail-user span { display: block; font-size: 10.5px; color: #7e929c; margin-top: 2px; }
.rail-user .out { margin-left: auto; color: #7e929c; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 3px; border: 1px solid rgba(255,255,255,.1); }
.rail-user .out:hover { color: #fff; border-color: rgba(255,255,255,.28); }

.workspace { margin-left: var(--rail-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50; height: 68px; flex: none;
  display: flex; align-items: center; gap: 18px; padding: 0 30px;
  background: rgba(241, 238, 231, .9); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.crumb .ic { width: 13px; height: 13px; opacity: .5; }
.crumb strong { color: var(--ink); font-weight: 600; }
.topbar-search {
  margin-left: auto; position: relative; width: min(390px, 30vw);
  display: flex; align-items: center;
}
.topbar-search .ic { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--faint); }
.topbar-search input {
  width: 100%; height: 38px; padding: 0 74px 0 36px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72); border-radius: 2px; outline: none; font-size: 13px;
}
.topbar-search input:focus { border-color: var(--ink-3); background: #fff; }
.topbar-search kbd {
  position: absolute; right: 10px; font-family: var(--font-mono); font-size: 10px;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--faint);
  padding: 2px 5px; border-radius: 2px;
}
.search-pop {
  position: absolute; top: 46px; left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-2); border-radius: 3px; padding: 6px; display: none; z-index: 80; max-height: 380px; overflow: auto;
}
.search-pop.show { display: block; }
.search-result { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 2px; }
.search-result:hover { background: var(--paper-2); }
.search-result .sr-type { font-size: 10px; color: var(--orange); border: 1px solid var(--orange-soft); background: var(--orange-soft); padding: 1px 5px; border-radius: 2px; white-space: nowrap; }
.search-result strong { font-size: 13px; font-weight: 500; }
.search-result span { margin-left: auto; font-size: 11px; color: var(--faint); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid transparent; background: none; border-radius: 3px; color: var(--muted);
}
.icon-btn:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.icon-btn .ping { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: var(--orange); border-radius: 50%; border: 2px solid var(--paper); }
.top-user { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 10px; border-left: 1px solid var(--line); margin-left: 4px; }
.top-user .meta strong { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.1; }
.top-user .meta span { display: block; font-size: 10px; color: var(--faint); margin-top: 2px; }
.top-user .chev { width: 13px; height: 13px; color: var(--faint); }
.user-pop {
  position: absolute; right: 28px; top: 60px; width: 230px; background: #fff; border: 1px solid var(--line);
  border-radius: 3px; box-shadow: var(--shadow-2); padding: 6px; display: none; z-index: 90;
}
.user-pop.show { display: block; animation: popIn .16s ease; }
.user-pop a, .user-pop button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; background: none; border: 0; text-align: left; font-size: 13px; border-radius: 2px; }
.user-pop a:hover, .user-pop button:hover { background: var(--paper-2); }
.user-pop .pop-head { padding: 9px 10px 11px; border-bottom: 1px solid var(--line-soft); margin-bottom: 5px; }
.user-pop .pop-head strong { display: block; font-size: 13px; }
.user-pop .pop-head span { font-size: 11px; color: var(--faint); }

.main { flex: 1; padding: 26px 30px 60px; max-width: 1720px; width: 100%; }
.main.enter > * { animation: rise .34s cubic-bezier(.2,.7,.3,1) both; }
.main.enter > *:nth-child(2) { animation-delay: .04s; }
.main.enter > *:nth-child(3) { animation-delay: .08s; }
.main.enter > *:nth-child(4) { animation-delay: .12s; }
.main.enter > *:nth-child(5) { animation-delay: .15s; }

/* ============================== 页头 ============================== */
.page-head { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head-main { min-width: 0; }
.page-kicker { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 12px; letter-spacing: .26em; color: var(--orange); text-transform: uppercase; }
.kicker-line { width: 26px; height: 2px; background: var(--orange); }
.kicker-group { font-family: inherit; color: var(--faint); letter-spacing: .08em; font-size: 10.5px; padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--line-strong); text-transform: none; }
.page-head h1 { margin: 7px 0 4px; font-size: 27px; letter-spacing: .01em; font-weight: 700; color: var(--ink); }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 720px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================== 按钮 ============================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font-size: 12.5px; font-weight: 500; border-radius: 2px; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.btn .ic { width: 15px; height: 15px; }
.btn:hover { border-color: var(--ink-3); background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: #dc5725; border-color: #dc5725; color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-3); border-color: var(--ink-3); color: #fff; }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover { background: #0b685c; border-color: #0b685c; color: #fff; }
.btn-danger { background: #fff; border-color: #e3b8b0; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-3); background: #fff; }
.btn-quiet { background: none; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: transparent; color: var(--ink); border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-sm .ic { width: 13px; height: 13px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 13.5px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-icon { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; }
.btn .badge-count { background: rgba(255,255,255,.24); padding: 0 5px; font-size: 10px; border-radius: 8px; }

/* ============================== 徽标 / 标签 ============================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px;
  font-size: 11px; letter-spacing: .02em; border-radius: 2px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.tone-ok, .tone-success { background: var(--ok-soft); color: var(--ok); border-color: #cae2d2; }
.tone-warn { background: var(--warn-soft); color: var(--warn); border-color: #ecd9b6; }
.tone-danger, .tone-red { background: var(--red-soft); color: var(--red); border-color: #eed0c9; }
.tone-blue { background: var(--blue-soft); color: var(--blue); border-color: #cbdde9; }
.tone-teal { background: var(--teal-soft); color: var(--teal); border-color: #c6e3dc; }
.tone-violet { background: var(--violet-soft); color: var(--violet); border-color: #d8d0e8; }
.tone-orange { background: var(--orange-soft); color: #c9541f; border-color: #f3d2bf; }
.tone-muted, .tone-slate { background: #efede7; color: #77736a; border-color: #e1dcd1; }
.tone-ink { background: var(--ink); color: #fff; border-color: var(--ink); }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); padding: 2px 7px; border-radius: 2px; background: var(--paper-2); }
.tag .ic { width: 12px; height: 12px; opacity: .75; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px; font-size: 12px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 2px; color: var(--muted); }
.chip .ic { width: 13px; height: 13px; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.time-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.time-chip .ic { width: 12px; height: 12px; opacity: .6; }
.code { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .01em; color: var(--muted); }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }

.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 50%; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  color: #fff; background: var(--ink-3);
}
.avatar.av-a { background: #30474f; }
.avatar.av-b { background: #8a4b2d; }
.avatar.av-c { background: #315f57; }
.avatar.av-d { background: #5a4b74; }
.avatar.av-e { background: #7a6232; }
.avatar.av-f { background: #37556e; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }

/* ============================== KPI ============================== */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  padding: 15px 16px 13px; border-radius: 3px; overflow: hidden; box-shadow: var(--shadow-1);
}
.kpi::before { content: ''; position: absolute; left: 0; top: 0; width: 34px; height: 2px; background: var(--ink-3); }
.kpi.tone-orange::before { background: var(--orange); }
.kpi.tone-teal::before { background: var(--teal); }
.kpi.tone-blue::before { background: var(--blue); }
.kpi.tone-danger::before { background: var(--red); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.kpi-ico { color: var(--faint); }
.kpi-ico .ic { width: 17px; height: 17px; }
.kpi-value { margin-top: 9px; font-family: var(--font-display); font-size: 38px; line-height: .98; font-weight: 600; letter-spacing: .01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value em { font-family: var(--font-display); font-style: normal; font-size: 13px; color: var(--faint); margin-left: 5px; letter-spacing: .04em; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 18px; }
.kpi-foot-text { font-size: 10.5px; color: var(--faint); }
.kpi-spark { margin-left: auto; width: 82px; height: 22px; }
.spark { width: 100%; height: 100%; }
.spark-line { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: rgba(33, 51, 62, .08); stroke: none; }
.spark.tone-orange .spark-line { stroke: var(--orange); }
.spark.tone-orange .spark-area { fill: rgba(239,101,48,.12); }
.spark.tone-teal .spark-line { stroke: var(--teal); }
.spark.tone-teal .spark-area { fill: rgba(14,122,108,.12); }
.spark.tone-danger .spark-line { stroke: var(--red); }
.spark.tone-danger .spark-area { fill: rgba(185,60,44,.1); }
.trend { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-family: var(--font-mono); }
.trend .ic { width: 11px; height: 11px; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--faint); }

/* ============================== 面板 / 栅格 ============================== */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; box-shadow: var(--shadow-1); }
.panel-head { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.panel-title h2 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: .01em; }
.panel-title p { margin: 2px 0 0; font-size: 11px; color: var(--faint); }
.panel-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }
.panel-foot { padding: 10px 18px; border-top: 1px solid var(--line-soft); background: var(--paper-2); }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; }
.grid-main.reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.split-line { height: 1px; background: var(--line-soft); margin: 4px 0; }

/* ============================== 数据表 ============================== */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--paper-2); white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr { transition: background .14s; }
table.data tbody tr:hover { background: #faf8f3; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .name-link { font-weight: 550; color: var(--ink); border-bottom: 1px solid transparent; cursor: pointer; }
table.data .name-link:hover { color: var(--orange); border-bottom-color: rgba(239,101,48,.35); }
table.data .sub { display: block; font-size: 10.5px; color: var(--faint); margin-top: 2px; }
table.data .num, table.data .money { font-variant-numeric: tabular-nums; }
.money { font-family: var(--font-display); font-size: 14px; letter-spacing: .02em; }
.row-actions { display: flex; align-items: center; gap: 2px; opacity: .45; transition: opacity .15s; }
tr:hover .row-actions { opacity: 1; }
.act-btn { width: 27px; height: 27px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 2px; color: var(--muted); }
.act-btn .ic { width: 15px; height: 15px; }
.act-btn:hover { background: var(--paper); color: var(--ink); }
.act-btn.danger:hover { background: var(--red-soft); color: var(--red); }

/* 筛选条 */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.search-field { position: relative; display: flex; align-items: center; flex: 1; min-width: 220px; max-width: 380px; }
.search-field .ic { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--faint); }
.search-field input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line); background: rgba(255,255,255,.8); border-radius: 2px; outline: none; font-size: 13px; }
.search-field input:focus { border-color: var(--ink-3); background: #fff; }
.select-mini { position: relative; display: inline-flex; align-items: center; }
.select-mini select {
  appearance: none; height: 36px; padding: 0 28px 0 11px; border: 1px solid var(--line);
  background: rgba(255,255,255,.8); border-radius: 2px; font-size: 12.5px; color: var(--muted); outline: none; min-width: 110px;
}
.select-mini select:focus { border-color: var(--ink-3); }
.select-mini > .ic { position: absolute; right: 8px; width: 12px; height: 12px; color: var(--faint); pointer-events: none; }
.filter-bar .btn { height: 36px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; gap: 8px; }
.pager-info { font-size: 11.5px; color: var(--faint); font-family: var(--font-mono); }
.pager-btns { display: flex; gap: 3px; }
.pg-btn { min-width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: #fff; font-size: 12px; font-family: var(--font-mono); border-radius: 2px; }
.pg-btn .ic { width: 15px; height: 15px; }
.pg-btn:hover { border-color: var(--ink-3); }
.pg-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pg-btn.disabled { opacity: .35; pointer-events: none; }

/* ============================== 卡片族 ============================== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(322px, 1fr)); gap: 12px; }
.cust-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 3px;
  padding: 16px 16px 0; overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.cust-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.cust-card::after { content: ''; position: absolute; top: 0; right: 0; width: 42px; height: 42px; background: linear-gradient(225deg, var(--paper) 50%, transparent 50%); opacity: .7; }
.cust-top { display: flex; align-items: flex-start; gap: 10px; }
.cust-top .avatar { border-radius: 3px; }
.cust-id { min-width: 0; flex: 1; }
.cust-id h3 { margin: 0; font-size: 14.5px; font-weight: 650; line-height: 1.35; }
.cust-id h3 a:hover { color: var(--orange); }
.cust-id span { display: block; font-size: 11px; color: var(--faint); margin-top: 3px; }
.cust-meta { display: flex; gap: 14px; margin: 12px 0 13px; padding-top: 12px; border-top: 1px dashed var(--line); }
.cust-meta div { min-width: 0; }
.cust-meta label { display: block; font-size: 10px; color: var(--faint); letter-spacing: .05em; }
.cust-meta strong { display: block; font-size: 12.5px; margin-top: 2px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-soft); margin: 0 -16px; }
.cust-stats div { padding: 10px 14px; border-right: 1px solid var(--line-soft); }
.cust-stats div:last-child { border-right: 0; }
.cust-stats span { display: block; font-size: 10px; color: var(--faint); }
.cust-stats strong { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.cust-stats strong small { font-size: 10px; font-family: inherit; color: var(--faint); margin-left: 2px; }
.cust-foot { margin: 0 -16px; padding: 9px 16px; background: var(--paper-2); border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--muted); }
.cust-foot .spacer { margin-left: auto; }

.device-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 15px; transition: border-color .2s, box-shadow .2s; }
.device-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.device-top { display: flex; gap: 10px; align-items: flex-start; }
.device-glyph { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink-3); border-radius: 2px; }
.device-glyph .ic { width: 22px; height: 22px; }
.device-top h3 { margin: 1px 0 2px; font-size: 14px; font-weight: 650; }
.device-top .code { font-size: 10.5px; }
.device-spec { display: flex; gap: 6px; flex-wrap: wrap; margin: 11px 0; }
.warranty { margin-top: 4px; }
.warranty-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); margin-bottom: 5px; }
.warranty-bar { height: 4px; background: #eceae2; border-radius: 4px; overflow: hidden; }
.warranty-bar i { display: block; height: 100%; background: var(--teal); }
.warranty-bar i.warn { background: var(--warn); }
.warranty-bar i.danger { background: var(--red); }
.device-foot { display: flex; align-items: center; gap: 8px; margin: 12px -15px -15px; padding: 9px 15px; border-top: 1px solid var(--line-soft); background: var(--paper-2); font-size: 11px; color: var(--muted); }
.device-foot .spacer { margin-left: auto; }

/* 头像组 */
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* 空状态 */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 46px 20px; text-align: center; }
.empty-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--faint); margin-bottom: 12px; }
.empty-ico .ic { width: 24px; height: 24px; }
.empty-state strong { font-size: 14px; font-weight: 600; }
.empty-state p { margin: 4px 0 0; font-size: 12px; color: var(--faint); max-width: 320px; }

/* ============================== 看板 ============================== */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(268px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kb-col { background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 3px; min-width: 268px; }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.kb-head .kb-dot { width: 7px; height: 7px; border-radius: 50%; }
.kb-head h3 { margin: 0; font-size: 12.5px; font-weight: 650; letter-spacing: .02em; }
.kb-head .kb-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--faint); background: #fff; border: 1px solid var(--line); padding: 0 6px; border-radius: 2px; }
.kb-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; }
.kb-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 2px;
  padding: 10px 11px 10px 14px; cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s;
}
.kb-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong); }
.kb-card.pri-紧急::before { background: var(--red); }
.kb-card.pri-高::before { background: var(--orange); }
.kb-card.pri-中::before { background: var(--blue); }
.kb-card.pri-低::before { background: var(--line-strong); }
.kb-card:hover { border-color: var(--ink-3); transform: translateY(-1px); box-shadow: 0 10px 22px -16px rgba(16,26,33,.5); }
.kb-meta { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.kb-meta .pri { font-family: inherit; }
.kb-card h4 { margin: 5px 0 4px; font-size: 12.8px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-cust { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line-soft); font-size: 10.5px; color: var(--faint); }
.kb-sla { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; }
.kb-sla.danger { color: var(--red); }
.kb-sla.warn { color: var(--warn); }
.kb-sla.ok { color: var(--teal); }
.kb-empty { padding: 18px 10px; text-align: center; font-size: 11px; color: var(--faint); border: 1px dashed var(--line); border-radius: 2px; }

/* ============================== 时间轴 ============================== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, var(--line-strong), var(--line-soft) 88%, transparent); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ''; position: absolute; left: -26px; top: 4px; width: 9px; height: 9px; background: #fff; border: 2px solid var(--line-strong); border-radius: 50%; }
.tl-item.danger::before { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.tl-item.warn::before { border-color: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.tl-item.ok::before { border-color: var(--teal); }
.tl-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); display: block; margin-bottom: 3px; }
.tl-card { background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; }
.tl-card:hover { border-color: var(--line-strong); }
.tl-card h4 { margin: 0 0 3px; font-size: 12.5px; font-weight: 600; }
.tl-card p { margin: 0; font-size: 11.5px; color: var(--muted); }
.tl-card .tl-row { display: flex; align-items: center; gap: 8px; }
.tl-card .tl-row .spacer { margin-left: auto; }

/* 超时监控条 */
.sla-row { display: flex; align-items: stretch; gap: 0; border-bottom: 1px solid var(--line-soft); }
.sla-row:last-child { border-bottom: 0; }
.sla-row:hover { background: #faf8f3; }
.sla-bar { width: 4px; flex: none; background: var(--line); }
.sla-bar.danger { background: var(--red); }
.sla-bar.warn { background: var(--warn); }
.sla-bar.ok { background: var(--teal); }
.sla-main { flex: 1; min-width: 0; padding: 11px 14px; display: flex; align-items: center; gap: 12px; }
.sla-main h4 { margin: 0; font-size: 12.5px; font-weight: 600; }
.sla-main .meta { font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.sla-time { margin-left: auto; text-align: right; }
.sla-time strong { display: block; font-family: var(--font-mono); font-size: 12px; }
.sla-time span { font-size: 10px; color: var(--faint); }
.sla-time.danger strong { color: var(--red); }
.sla-time.warn strong { color: var(--warn); }
.sla-time.ok strong { color: var(--teal); }

/* ============================== 流程 ============================== */
.flow-map { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 14px 4px 8px; }
.flow-node { position: relative; flex: 1; min-width: 116px; text-align: center; padding: 0 6px; }
.flow-node::after { content: ''; position: absolute; top: 21px; left: calc(50% + 22px); right: calc(-50% + 22px); height: 1px; background: var(--line-strong); }
.flow-node:last-child::after { display: none; }
.flow-node .fn-dot { position: relative; z-index: 1; width: 42px; height: 42px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--line-strong); color: var(--faint); }
.flow-node .fn-dot .ic { width: 18px; height: 18px; }
.flow-node.done .fn-dot { background: var(--teal-soft); border-color: #b9dbd3; color: var(--teal); }
.flow-node.done::after { background: var(--teal); opacity: .45; }
.flow-node.current .fn-dot { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 0 0 5px var(--orange-soft); }
.flow-node h4 { margin: 0; font-size: 11.5px; font-weight: 600; }
.flow-node span { display: block; font-size: 10px; color: var(--faint); margin-top: 2px; font-family: var(--font-mono); }
.flow-node.current h4 { color: var(--orange); }

.flow-chain { position: relative; }
.flow-chain-item { display: flex; gap: 14px; }
.fc-rail { width: 34px; flex: none; display: flex; flex-direction: column; align-items: center; }
.fc-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); background: #fff; color: var(--muted); flex: none; }
.fc-dot .ic { width: 15px; height: 15px; }
.fc-line { width: 1px; flex: 1; background: var(--line); margin: 5px 0; min-height: 24px; }
.flow-chain-item:last-child .fc-line { display: none; }
.flow-chain-item.done .fc-dot { background: var(--teal-soft); border-color: #b9dbd3; color: var(--teal); }
.flow-chain-item.current .fc-dot { background: var(--orange); border-color: var(--orange); color: #fff; }
.fc-body { flex: 1; padding-bottom: 16px; }
.fc-body h4 { margin: 3px 0 2px; font-size: 12.5px; }
.fc-body p { margin: 0; font-size: 11.5px; color: var(--muted); }
.fc-body .meta { margin-top: 4px; font-size: 10.5px; color: var(--faint); display: flex; gap: 12px; }

/* ============================== 表单 ============================== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.field label em { color: var(--orange); font-style: normal; margin-left: 2px; }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field input[type=datetime-local], .field select, .field textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line);
  background: #fff; border-radius: 2px; outline: none; transition: border-color .16s, box-shadow .16s;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(33,51,62,.06); }
.field .hint { font-size: 10.5px; color: var(--faint); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2px 12px; border: 1px solid var(--line); padding: 10px 12px; max-height: 220px; overflow: auto; background: #fff; }
.check-item { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 4px 2px; }
.check-item input { accent-color: var(--orange); }
.form-note { font-size: 11.5px; color: var(--faint); background: var(--paper-2); border: 1px dashed var(--line); padding: 9px 12px; border-radius: 2px; }
.form-section-title { grid-column: 1 / -1; font-size: 10.5px; letter-spacing: .14em; color: var(--faint); border-bottom: 1px solid var(--line-soft); padding-bottom: 5px; margin-top: 4px; }

/* 登录 / 注册 */
body.auth { background: #0d151b; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.auth-visual { position: relative; overflow: hidden; background: #0d151b; color: #fff; display: flex; flex-direction: column; padding: 46px 52px; }
.auth-visual::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at 30% 40%, rgba(0,0,0,.9), transparent 75%);
}
.auth-visual::after {
  content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  border: 1px solid rgba(239,101,48,.24); right: -200px; bottom: -180px;
  box-shadow: 0 0 0 60px rgba(239,101,48,.04), 0 0 0 120px rgba(239,101,48,.028), 0 0 0 190px rgba(239,101,48,.018);
}
.auth-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 13px; }
.auth-brand .brand-text strong { font-size: 23px; }
.auth-hero { position: relative; z-index: 2; margin: auto 0; padding: 30px 0; }
.auth-hero .eyebrow { font-family: var(--font-display); letter-spacing: .34em; font-size: 12px; color: var(--orange); }
.auth-hero h1 { margin: 16px 0 14px; font-size: 44px; line-height: 1.22; letter-spacing: .01em; font-weight: 700; max-width: 560px; }
.auth-hero h1 span { color: var(--orange); }
.auth-hero p { color: #a9b7bd; font-size: 14px; line-height: 1.9; max-width: 500px; }
.auth-metrics { display: flex; gap: 38px; margin-top: 38px; }
.auth-metrics div strong { display: block; font-family: var(--font-display); font-size: 34px; font-weight: 600; color: #fff; line-height: 1; }
.auth-metrics div span { display: block; margin-top: 7px; font-size: 11px; color: #7f939d; letter-spacing: .08em; }
.auth-track { position: relative; z-index: 2; display: flex; gap: 0; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; }
.auth-track div { flex: 1; padding-right: 18px; }
.auth-track div + div { border-left: 1px solid rgba(255,255,255,.1); padding-left: 18px; }
.auth-track span { font-family: var(--font-mono); font-size: 10px; color: var(--orange); }
.auth-track strong { display: block; margin-top: 5px; font-size: 12px; font-weight: 500; color: #d9e2e5; }
.auth-track p { margin: 2px 0 0; font-size: 10.5px; color: #6f838d; }

.auth-side { background: var(--paper); display: flex; flex-direction: column; padding: 44px 54px; position: relative; }
.auth-side::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--orange) 0%, var(--orange) 22%, transparent 22%); }
.auth-side-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--faint); }
.auth-side-top .ver { font-family: var(--font-mono); }
.auth-form-wrap { margin: auto 0; width: 100%; max-width: 380px; align-self: center; }
.auth-form-wrap h2 { margin: 0; font-size: 26px; letter-spacing: .01em; }
.auth-form-wrap > p { margin: 8px 0 28px; color: var(--muted); font-size: 12.5px; }
.auth-field { margin-bottom: 15px; }
.auth-field label { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.auth-field .wrap { position: relative; display: flex; align-items: center; }
.auth-field .wrap > .ic { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); }
.auth-field input { width: 100%; height: 44px; padding: 0 40px 0 38px; border: 1px solid var(--line); background: #fff; border-radius: 2px; outline: none; font-size: 13.5px; }
.auth-field input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(33,51,62,.06); }
.auth-field .eye { position: absolute; right: 5px; width: 32px; height: 32px; border: 0; background: none; display: grid; place-items: center; color: var(--faint); }
.auth-field .eye:hover { color: var(--ink); }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 12px; }
.auth-row label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.auth-row input { accent-color: var(--orange); }
.auth-row a { color: var(--orange); }
.auth-submit { width: 100%; height: 46px; background: var(--ink); color: #fff; border: 0; border-radius: 2px; font-size: 14px; letter-spacing: .08em; display: flex; align-items: center; justify-content: center; gap: 8px; }
.auth-submit:hover { background: var(--orange); }
.auth-submit:disabled { opacity: .7; }
.auth-error { display: none; margin-bottom: 14px; border: 1px solid #eccfc8; background: var(--red-soft); color: var(--red); font-size: 12px; padding: 9px 12px; border-radius: 2px; }
.auth-error.show { display: block; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--faint); font-size: 10.5px; letter-spacing: .1em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-switch { text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-switch a { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--orange); }
.auth-foot { font-size: 10.5px; color: var(--faint); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-legal { font-size: 10.5px; color: var(--faint); margin-top: 18px; line-height: 1.8; }
.auth-links { display: flex; gap: 18px; justify-content: center; margin-top: 24px; font-size: 11px; color: var(--faint); }
.auth-links a:hover { color: var(--orange); }

/* ============================== 弹层 ============================== */
.modal-root { position: relative; z-index: 200; }
.modal-layer { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 20px; }
.modal-layer.layer-2 { z-index: 2; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 16, 20, .52); backdrop-filter: blur(7px); animation: fade .2s ease both; }
.modal {
  position: relative; z-index: 1; width: min(760px, 96vw); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid rgba(255,255,255,.6); border-radius: 4px;
  box-shadow: 0 44px 100px -30px rgba(0,0,0,.6); animation: modalIn .26s cubic-bezier(.2,.8,.25,1) both;
  overflow: hidden;
}
.modal::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--orange), var(--orange-2) 40%, transparent 85%); z-index: 2; }
.modal-lg { width: min(1020px, 96vw); }
.modal-xl { width: min(1200px, 97vw); }
.modal-sm { width: min(520px, 94vw); }
.modal-layer.layer-2 .modal { box-shadow: 0 50px 120px -20px rgba(0,0,0,.55); }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 24px 15px; background: var(--paper); border-bottom: 1px solid var(--line); flex: none; }
.modal-head .mh-kicker { font-family: var(--font-display); font-size: 10.5px; letter-spacing: .26em; color: var(--orange); text-transform: uppercase; }
.modal-head h3 { margin: 4px 0 0; font-size: 19px; letter-spacing: .01em; }
.modal-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.modal-close { margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 2px; color: var(--muted); flex: none; }
.modal-close:hover { color: var(--ink); border-color: var(--ink-3); }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal > form .modal-body { flex: 1; }
.modal-body.flush { padding: 0; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 13px 24px; border-top: 1px solid var(--line); background: #fff; flex: none; flex-wrap: wrap; }
.modal-foot .spacer { margin-left: auto; }
.modal-loading { padding: 60px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; }
.spinner { width: 26px; height: 26px; border: 2px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }

/* 详情 */
.detail-hero { display: flex; gap: 16px; align-items: flex-start; }
.detail-hero .dh-main { min-width: 0; flex: 1; }
.detail-hero h2 { margin: 2px 0 6px; font-size: 20px; line-height: 1.35; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.detail-side { text-align: right; flex: none; }
.detail-side .big { font-family: var(--font-display); font-size: 30px; line-height: 1; }
.detail-side .big small { font-size: 11px; color: var(--faint); }
.detail-side .lbl { font-size: 10px; color: var(--faint); letter-spacing: .08em; margin-top: 5px; }
.detail-info { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0; border: 1px solid var(--line); background: #fff; border-radius: 2px; margin-top: 16px; }
.detail-info > div { padding: 10px 13px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); min-width: 0; }
.detail-info > div:nth-child(3n) { border-right: 0; }
.detail-info label { display: block; font-size: 10px; color: var(--faint); letter-spacing: .04em; }
.detail-info strong { display: block; font-size: 12.5px; font-weight: 550; margin-top: 3px; word-break: break-all; }
.detail-info .wide { grid-column: span 3; border-right: 0; }
.user-cell { display: flex; align-items: center; gap: 8px; }
.user-cell strong { font-size: 12.5px; font-weight: 550; display: block; }
.user-cell span { font-size: 10.5px; color: var(--faint); display: block; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0 16px; overflow-x: auto; }
.tab { padding: 9px 14px; border: 0; background: none; font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--orange); border-bottom-color: var(--orange); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeUp .2s ease both; }

/* 确认框 */
.confirm-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); margin-bottom: 12px; }
.confirm-ico.danger { background: var(--red-soft); color: var(--red); }
.confirm-text { font-size: 13.5px; line-height: 1.7; }
.confirm-text strong { color: var(--ink); }

/* Toast */
#toast-root { position: fixed; top: 18px; right: 22px; z-index: 400; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; min-width: 240px; max-width: 400px;
  padding: 11px 14px; background: var(--ink); color: #fff; border-radius: 2px;
  font-size: 12.5px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.6);
  border-left: 3px solid var(--teal); animation: toastIn .28s ease both;
}
.toast.error { border-left-color: var(--orange); }
.toast .ic { width: 16px; height: 16px; color: var(--orange-2); }
.toast.out { animation: toastOut .2s ease both; }

/* ============================== 明细组件 ============================== */
.info-list { display: flex; flex-direction: column; }
.info-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; }
.info-row:last-child { border-bottom: 0; }
.info-row label { width: 94px; flex: none; color: var(--faint); font-size: 11.5px; }
.info-row div { min-width: 0; }
.info-row .wide { flex: 1; }

.stat-strip { display: flex; border: 1px solid var(--line); background: #fff; border-radius: 2px; overflow: hidden; }
.stat-strip div { flex: 1; padding: 11px 14px; border-right: 1px solid var(--line-soft); }
.stat-strip div:last-child { border-right: 0; }
.stat-strip span { display: block; font-size: 10px; color: var(--faint); letter-spacing: .04em; }
.stat-strip strong { display: block; font-family: var(--font-display); font-size: 23px; font-weight: 600; margin-top: 2px; }
.stat-strip strong em { font-style: normal; font-size: 10px; color: var(--faint); margin-left: 3px; font-family: inherit; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-item { display: grid; grid-template-columns: 112px 1fr 56px; align-items: center; gap: 10px; font-size: 12px; }
.bar-item label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; background: #eeebe4; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--ink-3); border-radius: 4px; }
.bar-fill.orange { background: var(--orange); }
.bar-fill.teal { background: var(--teal); }
.bar-fill.blue { background: var(--blue); }
.bar-fill.violet { background: var(--violet); }
.bar-item strong { text-align: right; font-family: var(--font-mono); font-size: 11px; font-weight: 500; }

.chart-box { position: relative; width: 100%; }
.chart-box svg { width: 100%; height: auto; overflow: visible; }
.chart-axis { font-family: var(--font-mono); font-size: 9px; fill: #9a9386; }
.chart-grid { stroke: #e8e3d9; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-line { fill: none; stroke: var(--orange); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.alt { stroke: var(--ink-3); stroke-width: 1.6; stroke-dasharray: 4 4; }
.chart-area { fill: url(#areaGrad); }
.chart-bar { fill: #dfd9cd; }
.chart-bar.active { fill: var(--orange); }
.chart-dot { fill: #fff; stroke: var(--orange); stroke-width: 2; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 10.5px;
  padding: 5px 8px; border-radius: 2px; transform: translate(-50%, -130%); white-space: nowrap; opacity: 0; transition: opacity .12s;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { font-family: var(--font-mono); font-weight: 500; }

.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.donut-legend div { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.donut-legend i { width: 8px; height: 8px; border-radius: 1px; }
.donut-legend strong { margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.donut-center text { font-family: var(--font-display); }

/* 地图 / 轨迹 */
.map-canvas { position: relative; background: #edf0ea; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.map-canvas svg { width: 100%; height: 100%; display: block; }
.map-grid { stroke: #d8ddd2; stroke-width: 1; }
.map-road { stroke: #c9c8bc; stroke-width: 6; fill: none; stroke-linecap: round; }
.map-road.thin { stroke-width: 3; }
.map-track { fill: none; stroke: var(--orange); stroke-width: 2.4; stroke-dasharray: 5 4; stroke-linejoin: round; }
.map-point { fill: #fff; stroke: var(--orange); stroke-width: 2; }
.map-start { fill: var(--teal); stroke: #fff; stroke-width: 2; }
.map-tag { font-family: var(--font-mono); font-size: 8.5px; fill: #6c6961; }
.map-pin-label { font-size: 9px; fill: var(--ink); }
.track-summary { display: flex; gap: 20px; margin-top: 10px; }
.track-summary div span { display: block; font-size: 10px; color: var(--faint); }
.track-summary div strong { font-family: var(--font-mono); font-size: 13px; }

/* 库存 */
.stock-card { background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 14px; position: relative; }
.stock-card:hover { border-color: var(--line-strong); }
.stock-head { display: flex; gap: 10px; align-items: flex-start; }
.stock-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; line-height: 1.4; }
.stock-head .code { margin-top: 2px; display: block; }
.stock-qty { margin: 12px 0 6px; display: flex; align-items: baseline; gap: 5px; }
.stock-qty strong { font-family: var(--font-display); font-size: 30px; line-height: 1; font-weight: 600; }
.stock-qty span { font-size: 10.5px; color: var(--faint); }
.stock-qty .alert-mark { margin-left: auto; }
.stock-bar { height: 5px; background: #efede6; border-radius: 4px; overflow: hidden; display: flex; }
.stock-bar i { display: block; height: 100%; background: var(--teal); }
.stock-bar i.low { background: var(--orange); }
.stock-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--faint); font-family: var(--font-mono); }
.stock-foot { display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-soft); }

/* 调拨审批 */
.approval-card { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 2px; padding: 14px 16px; }
.approval-card.ok { border-left-color: var(--teal); }
.approval-card.reject { border-left-color: var(--red); }
.approval-top { display: flex; align-items: center; gap: 10px; }
.approval-top .code { font-size: 10px; }
.approval-top .spacer { margin-left: auto; }
.approval-route { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 12.5px; }
.approval-route .wh { background: var(--paper-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 2px; }
.approval-route .ic { color: var(--faint); }
.approval-item { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; }
.approval-foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.approval-foot .spacer { margin-left: auto; }

/* 组织结构 */
.org-tree { display: flex; flex-direction: column; }
.org-node { position: relative; }
.org-node-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; text-align: left; border-radius: 2px; font-size: 12.5px; }
.org-node-btn:hover { background: var(--paper-2); }
.org-node-btn.active { background: var(--orange-soft); color: #c9541f; }
.org-node-btn .ic { width: 14px; height: 14px; opacity: .6; }
.org-node-btn .count { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.org-children { margin-left: 16px; border-left: 1px dashed var(--line); padding-left: 6px; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 14px; position: relative; }
.role-card::before { content: ''; position: absolute; left: 0; top: 15px; width: 2px; height: 18px; background: var(--orange); }
.role-card h3 { margin: 0 0 2px; font-size: 13.5px; }
.role-card .code { font-size: 10px; }
.role-card p { color: var(--muted); font-size: 11.5px; margin: 7px 0 10px; line-height: 1.6; }
.role-card .role-foot { display: flex; align-items: center; gap: 8px; }
.role-card .perm-count { font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.perm-matrix { display: flex; flex-wrap: wrap; gap: 5px; }
.perm-matrix span { font-size: 10.5px; color: var(--muted); background: var(--paper-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 2px; }

/* 通知模板 */
.tpl-card { background: #fff; border: 1px solid var(--line); border-radius: 3px; display: flex; flex-direction: column; }
.tpl-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 15px 11px; border-bottom: 1px dashed var(--line-soft); }
.tpl-channel { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 2px; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-3); }
.tpl-head h3 { margin: 1px 0 3px; font-size: 13.5px; }
.tpl-head .code { font-size: 10px; }
.tpl-head .spacer { margin-left: auto; }
.tpl-body { flex: 1; padding: 11px 15px; }
.tpl-body p { margin: 0; font-size: 11.8px; color: var(--muted); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-foot { display: flex; align-items: center; gap: 8px; padding: 9px 15px; border-top: 1px solid var(--line-soft); background: var(--paper-2); }
.tpl-foot .spacer { margin-left: auto; }
.tpl-preview { background: var(--paper-2); border: 1px solid var(--line); border-radius: 2px; padding: 16px; }
.tpl-preview .tp-title { font-size: 13px; font-weight: 650; margin-bottom: 8px; }
.tpl-preview .tp-content { font-size: 12.5px; line-height: 1.9; color: var(--muted); white-space: pre-wrap; }
.phone-frame { max-width: 340px; margin: 0 auto; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; padding: 12px; box-shadow: var(--shadow-2); }
.phone-top { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; color: var(--faint); padding: 0 2px 8px; }
.phone-msg { background: var(--paper); border-radius: 3px; padding: 11px; font-size: 12px; line-height: 1.8; }

/* 搜索 / 图表辅助 */
.mini-select { display: inline-flex; align-items: center; gap: 5px; }
.kv { display: flex; align-items: baseline; gap: 7px; }
.kv strong { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.kv span { font-size: 10px; color: var(--faint); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.orange { color: var(--orange); }
.teal { color: var(--teal); }
.red { color: var(--red); }
.small { font-size: 11px; }
.mono { font-family: var(--font-mono); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.ml-auto { margin-left: auto; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }

/* 载入 */
.skeleton { background: linear-gradient(90deg, #eeeae1 25%, #f7f4ee 37%, #eeeae1 63%); background-size: 400% 100%; animation: shimmer 1.2s ease infinite; border-radius: 2px; }
.page-loading { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.page-loading::after { content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 30%; background: var(--orange); animation: loadbar .9s ease-in-out infinite; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfc7ba; border-radius: 5px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: #b3a99a; }

@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(18px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes loadbar { 0% { left: -30%; } 100% { left: 110%; } }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: .8; transform: scale(1.12); } }

/* 响应式 */
@media (max-width: 1440px) {
  :root { --rail-w: 258px; }
  .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .main { padding: 22px 24px 52px; }
}
@media (max-width: 1240px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-main.reverse { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1024px) {
  .rail { transform: translateX(-100%); transition: transform .26s ease; width: 278px; }
  .rail.open { transform: none; box-shadow: 30px 0 70px rgba(0,0,0,.35); }
  .workspace { margin-left: 0; }
  .topbar { padding: 0 18px; gap: 12px; }
  .main { padding: 20px 18px 46px; }
  .nav-toggle { display: grid !important; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-side { padding: 32px 26px; }
  .kanban { grid-template-columns: repeat(6, 262px); }
}
@media (max-width: 720px) {
  .kpi-grid, .kpi-grid.cols-4, .kpi-grid.cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 22px; }
  .topbar-search { display: none; }
  .topbar { height: 60px; }
  .page-actions { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-info { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-info > div:nth-child(3n) { border-right: 1px solid var(--line-soft); }
  .detail-info > div:nth-child(2n) { border-right: 0; }
  .detail-info .wide { grid-column: span 2; }
  .modal-layer { padding: 2vh 10px; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-foot { padding-left: 16px; padding-right: 16px; }
  .cust-stats { grid-template-columns: repeat(3, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .bar-item { grid-template-columns: 90px 1fr 48px; }
  .sla-main { align-items: flex-start; flex-direction: column; gap: 4px; }
  .sla-time { margin-left: 0; text-align: left; }
  .tpl-card { min-width: 0; }
  .auth-form-wrap h2 { font-size: 23px; }
}
.nav-toggle { display: none; }
