/* ==========================================================================
   积流opc · 业务页设计系统
   基调：暖白纸面 + 深墨侧栏 + 墨绿强调色，细描边、克制的阴影、等宽数字
   ========================================================================== */
:root {
  --ink: #14181a;
  --ink-2: #2c3330;
  --paper: #f3f3ef;
  --surface: #ffffff;
  --surface-2: #fafaf7;
  --line: #e4e4de;
  --line-strong: #d3d4cc;
  --muted: #6c726d;
  --muted-2: #8d938e;

  --accent: #145e4c;
  --accent-ink: #0d3d31;
  --accent-soft: #e7f1ed;
  --accent-line: #bcd8ce;

  --amber: #a85b12;
  --amber-soft: #fbf1e2;
  --red: #b02a1f;
  --red-soft: #fbedeb;
  --blue: #1f4f9c;
  --blue-soft: #ecf1fa;
  --gray-soft: #f0f1ee;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 24, 26, 0.05);
  --shadow-lg: 0 12px 32px rgba(20, 24, 26, 0.12);

  --sidebar-w: 236px;
  --topbar-h: 60px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: #cfe6dc; }

.app-root { min-height: 100vh; }

/* ------------------------------- 启动 / 登录 ------------------------------ */
.boot-screen { min-height: 100vh; display: grid; place-content: center; gap: 14px; text-align: center; }
.boot-mark { font-family: var(--font-mono); letter-spacing: 0.32em; font-size: 13px; color: var(--accent); }
.boot-text { color: var(--muted); font-size: 13px; }

.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--paper); }
.login-left {
  background: #101513;
  color: #e9ece7;
  padding: 56px 56px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-left::after {
  content: "";
  position: absolute;
  right: -160px; bottom: -220px;
  width: 520px; height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(127, 209, 185, 0.18);
  box-shadow: 0 0 0 60px rgba(127, 209, 185, 0.04), 0 0 0 140px rgba(127, 209, 185, 0.03);
}
.login-brand { display: flex; align-items: center; gap: 12px; z-index: 1; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: #e9ece7; color: #101513;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
}
.login-brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.login-brand-sub { font-size: 12px; color: #8d9a93; letter-spacing: 0.04em; }
.login-pitch { margin: 48px 0 36px; z-index: 1; max-width: 520px; }
.login-pitch h1 {
  font-size: 40px; line-height: 1.24; margin: 0 0 18px;
  letter-spacing: -0.03em; font-weight: 600;
}
.login-pitch h1 em { font-style: normal; color: #7fd1b9; }
.login-pitch p { color: #a3aea8; font-size: 14px; margin: 0; max-width: 460px; }
.login-stats { display: flex; gap: 40px; z-index: 1; margin-bottom: 40px; }
.login-stat b { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 500; color: #f4f6f2; }
.login-stat span { font-size: 12px; color: #8d9a93; }
.login-note { font-size: 11px; color: #6d7a73; z-index: 1; letter-spacing: 0.02em; }

.login-right { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.02em; }
.login-card > p { color: var(--muted); margin: 0 0 28px; font-size: 13px; }
.demo-accounts { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.demo-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); margin-bottom: 10px; }
.demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.demo-chip {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-sm); padding: 8px 10px; text-align: left;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.demo-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.demo-chip b { display: block; font-size: 12px; font-weight: 600; }
.demo-chip span { font-size: 11px; color: var(--muted); }

/* ---------------------------------- 壳 ---------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.shell.collapsed { grid-template-columns: 68px 1fr; }

.sidebar {
  background: #101513; color: #c9d2cc;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 1px solid #1c2320;
  z-index: 30;
}
.side-brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid #1c2320; flex-shrink: 0;
}
.side-brand .logo-mark { width: 28px; height: 28px; font-size: 11px; }
.side-brand-text { min-width: 0; }
.side-brand-text b { display: block; font-size: 13px; color: #f1f3ef; font-weight: 600; letter-spacing: 0.01em; }
.side-brand-text span { display: block; font-size: 10px; color: #7d8a83; letter-spacing: 0.08em; text-transform: uppercase; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; scrollbar-width: thin; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: #2a322e; border-radius: 3px; }
.nav-group { margin-bottom: 4px; }
.nav-group-label {
  font-size: 10px; letter-spacing: 0.12em; color: #6a776f;
  padding: 12px 10px 6px; text-transform: uppercase; white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: #b6c1ba; border: 1px solid transparent;
  transition: background .14s, color .14s;
  white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: #1a211d; color: #eef1ec; }
.nav-item.active { background: #1e2a24; color: #ffffff; border-color: #2b3a32; }
.nav-item.active .nav-dot { background: #7fd1b9; }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: #3f4b45; flex-shrink: 0; }
.nav-count {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px;
  background: #263029; color: #9fb0a6; padding: 1px 6px; border-radius: 10px;
}
.nav-item.active .nav-count { background: #2f4a3e; color: #c9ece0; }
.side-foot { padding: 12px; border-top: 1px solid #1c2320; flex-shrink: 0; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 7px; cursor: pointer; }
.side-user:hover { background: #1a211d; }
.side-user-meta { min-width: 0; flex: 1; }
.side-user-meta b { display: block; font-size: 12px; color: #eef1ec; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta span { display: block; font-size: 10px; color: #7d8a83; overflow: hidden; text-overflow: ellipsis; }
.collapse-btn {
  width: 100%; margin-top: 6px; background: none; border: 1px solid #232b27;
  color: #7d8a83; border-radius: 6px; padding: 6px; cursor: pointer; font-size: 11px;
}
.collapse-btn:hover { color: #c9d2cc; border-color: #33403a; }
.shell.collapsed .side-brand-text,
.shell.collapsed .nav-group-label,
.shell.collapsed .nav-item span:not(.nav-dot),
.shell.collapsed .nav-count,
.shell.collapsed .side-user-meta,
.shell.collapsed .collapse-btn { display: none; }
.shell.collapsed .nav-item { justify-content: center; padding: 9px; }
.shell.collapsed .side-brand { justify-content: center; padding: 0; }
.shell.collapsed .side-user { justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar-spacer { flex: 1; }
.search-box { position: relative; width: 260px; }
.search-box input {
  width: 100%; height: 32px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface-2); padding: 0 10px 0 30px; font-size: 12.5px; color: var(--ink);
  outline: none; transition: border-color .15s, background .15s;
}
.search-box input:focus { border-color: var(--accent-line); background: #fff; }
.search-box svg { position: absolute; left: 9px; top: 8px; opacity: .45; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 7px; border: 1px solid transparent;
  background: none; display: grid; place-items: center; cursor: pointer; color: var(--muted);
  position: relative;
}
.icon-btn:hover { background: var(--gray-soft); color: var(--ink); }
.dot-badge {
  position: absolute; top: 6px; right: 6px; width: 6px; height: 6px;
  background: var(--red); border-radius: 50%; border: 1.5px solid #fff;
}
.top-user { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid var(--line); cursor: pointer; }
.top-user b { font-size: 12.5px; font-weight: 600; }
.top-user span { font-size: 11px; color: var(--muted); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0;
  background: var(--accent);
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }

.page { padding: 26px 28px 56px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; letter-spacing: -0.025em; font-weight: 600; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.eyebrow { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 6px; }

/* --------------------------------- 组件 --------------------------------- */
.btn {
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: background .14s, border-color .14s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #bfc2b9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--gray-soft); color: var(--ink); }
.btn-danger { color: var(--red); border-color: #eccbc6; background: #fff; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-head .sub { font-size: 11.5px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.split-wide { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi { background: var(--surface); padding: 16px 18px 14px; min-width: 0; }
.kpi-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-family: var(--font-mono); font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin-top: 8px; line-height: 1.2; }
.kpi-value small { font-size: 12px; color: var(--muted); font-family: var(--font-sans); margin-left: 4px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.delta-up { color: var(--accent); font-family: var(--font-mono); }
.delta-down { color: var(--red); font-family: var(--font-mono); }
.spark { margin-top: 8px; height: 26px; }

/* 表格 */
.table-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.input, select.input, textarea.input {
  height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  padding: 0 10px; font-size: 12.5px; color: var(--ink); outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(20, 94, 76, 0.07); }
select.input { padding-right: 24px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4' stroke='%236c726d' fill='none' stroke-width='1.2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
textarea.input { height: auto; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.input.search { padding-left: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%238d938e' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 9px center; }

.table-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.tbl th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 500; padding: 9px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid #efefe9; vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.clickable:hover { background: #fafaf6; }
table.tbl td.num, table.tbl th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl .cell-main { font-weight: 500; color: var(--ink); }
table.tbl .cell-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.table-foot { display: flex; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); gap: 8px; font-size: 12px; color: var(--muted); }
.pager { margin-left: auto; display: flex; gap: 4px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 4px; font-size: 11px; font-weight: 500; white-space: nowrap;
  background: var(--gray-soft); color: var(--muted);
}
.pill.green { background: var(--accent-soft); color: var(--accent); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.dark { background: #e9eae5; color: var(--ink-2); }
.pill .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.tag.accent { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.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); font-weight: 500; }
.field label b { color: var(--red); font-weight: 400; margin-left: 2px; }
.field .hint { font-size: 11px; color: var(--muted-2); }
.field .err { font-size: 11px; color: var(--red); }
.field .input { width: 100%; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.checkline input { accent-color: var(--accent); }

/* 空状态 / 骨架 */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty b { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, #efefe9 25%, #f7f7f2 37%, #efefe9 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 5px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-line { height: 12px; margin-bottom: 8px; }

/* 抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(16, 21, 19, 0.32); z-index: 60; animation: fade .16s ease; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 520px; max-width: 92vw;
  background: var(--surface); z-index: 61; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: slideIn .2s cubic-bezier(.2,.7,.3,1);
}
.drawer.wide { width: 720px; }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.drawer-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.drawer-head .close { margin-left: auto; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }
@keyframes slideIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(16, 21, 19, 0.36); z-index: 70; display: grid; place-items: center; padding: 24px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 12px; width: 560px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-head { padding: 18px 22px 12px; }
.modal-head h2 { margin: 0; font-size: 16.5px; letter-spacing: -0.02em; }
.modal-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 6px 22px 18px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 12px 12px; }
.form-error { background: var(--red-soft); color: var(--red); font-size: 12px; padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; }

/* Toast */
.toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #14181a; color: #f4f5f2; font-size: 12.5px; padding: 9px 16px; border-radius: 7px;
  box-shadow: var(--shadow-lg); animation: toastIn .18s ease; max-width: 90vw;
}
.toast.error { background: #7f1d16; }
.toast.success { background: #12483a; }
@keyframes toastIn { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 提示条 */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 8px; font-size: 12.5px; border: 1px solid var(--line); background: var(--surface-2); align-items: flex-start; }
.alert.warning { background: var(--amber-soft); border-color: #f0dcc0; color: #6f3e0a; }
.alert.danger { background: var(--red-soft); border-color: #f2d3ce; color: #7f1d16; }
.alert.success { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.alert.info { background: var(--blue-soft); border-color: #d6e0f3; color: #173a72; }
.alert b { font-weight: 600; }

/* 进度 / 图表 */
.progress { height: 5px; background: var(--gray-soft); border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.progress.amber > i { background: var(--amber); }
.progress.red > i { background: var(--red); }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 2px; background: currentColor; margin-right: 5px; vertical-align: middle; }

/* 详情定义列表 */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 9px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; color: var(--ink); word-break: break-word; }
.section-label { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); margin: 20px 0 10px; }
.section-label:first-child { margin-top: 0; }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 14px; font-size: 12.5px; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #fff; border: 1.5px solid var(--line-strong); }
.tl-item.done::before { background: var(--accent); border-color: var(--accent); }
.tl-item.active::before { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-time { color: var(--muted-2); font-size: 10.5px; font-family: var(--font-mono); }

/* 指令树 */
.cmd-task { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.cmd-task:last-child { border-bottom: 0; }
.cmd-seq { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); padding-top: 2px; }
.cmd-title { font-size: 13px; }
.cmd-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.cmd-output { margin-top: 6px; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-left: 2px solid var(--accent-line); padding: 7px 10px; border-radius: 0 5px 5px 0; }

/* 会话 */
.chat-list { border-right: 1px solid var(--line); max-height: 620px; overflow-y: auto; }
.chat-item { padding: 13px 16px; border-bottom: 1px solid #f0f0ea; cursor: pointer; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--accent-soft); border-left: 2px solid var(--accent); }
.chat-item b { font-size: 12.5px; display: flex; justify-content: space-between; gap: 8px; }
.chat-item p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-panel { display: flex; flex-direction: column; height: 620px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 76%; padding: 9px 12px; border-radius: 9px; font-size: 12.8px; line-height: 1.6; }
.bubble.customer { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.bubble.ai { background: #e9f2ee; align-self: flex-end; color: var(--accent-ink); }
.bubble.human { background: var(--ink); color: #f2f4ef; align-self: flex-end; }
.bubble.system { background: transparent; color: var(--muted); align-self: center; font-size: 11px; }
.bubble-meta { font-size: 10px; color: var(--muted-2); margin-top: 3px; }
.chat-input { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 8px; background: #fff; }

/* 登录页表单微调 */
.login .field label { font-size: 12px; }

/* 响应式 */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: 68px 1fr; }
  .side-brand-text, .nav-group-label, .nav-item span:not(.nav-dot), .nav-count, .side-user-meta, .collapse-btn { display: none; }
  .nav-item { justify-content: center; }
  .side-brand, .side-user { justify-content: center; }
  .search-box { width: 180px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split-wide { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .page { padding: 18px 16px 44px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .search-box { display: none; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 20px; }
  .drawer { width: 100%; }
}

/* --------------------------- 指令 Hero（响应式） --------------------------- */
.hero-command {
  background: #101513;
  border: 1px solid #1d2622;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.hero-eyebrow .k {
  color: #7fd1b9;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero-eyebrow .v { color: #7d8a83; font-size: 11.5px; }

.hero-input-row { display: flex; gap: 10px; align-items: stretch; }
.hero-input-row .hero-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  background: #1b2320;
  border-color: #2a3531;
  color: #eef1ec;
  font-size: 13.5px;
}
.hero-input-row .hero-input::placeholder { color: #6d7a74; }
.hero-input-row .hero-submit { flex: 0 0 auto; }

.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hero-chip {
  background: transparent;
  border-color: #2a3531;
  color: #9fb0a6;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-chip:hover { border-color: #3b4a44; color: #d7e2db; }

@media (max-width: 820px) {
  .hero-command { padding: 15px 16px; }
  .hero-eyebrow { flex-direction: column; align-items: flex-start; gap: 3px; }
  .hero-input-row { flex-direction: column; gap: 8px; }
  .hero-input-row .hero-input { width: 100%; font-size: 13px; }
  .hero-input-row .hero-submit { width: 100%; }
  .hero-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .hero-chips .hero-chip { flex: 0 0 auto; }
}
