/* =========================================================
   装备数据治理平台 · 青瓷态势主题（浅色为主，可切深色）
   保留原有全部类名，模板与业务逻辑无需改动
   ========================================================= */
@font-face { font-family: "Saira Stencil One"; src: url(/static/vendor/fonts/saira-stencil-one-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Share Tech Mono"; src: url(/static/vendor/fonts/share-tech-mono-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Oswald"; font-weight: 500; src: url(/static/vendor/fonts/oswald-latin-500-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Oswald"; font-weight: 700; src: url(/static/vendor/fonts/oswald-latin-700-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "ZCOOL QingKe"; src: url(/static/vendor/fonts/zcool-sub.woff) format("woff"); font-display: swap; }

:root {
  /* 调色板（来自指定色板） */
  --c-navy: #2E4057; --c-steel: #4A6FA5; --c-slate: #6B8E9E; --c-olive: #8D9F87; --c-khaki: #B2A387;
  --c-clay: #C18862; --c-teal: #4F7373; --c-celadon: #8FA6A9; --c-moss: #5F7355; --c-sand: #C2A878;
  --c-brick: #96524F; --c-ochre: #8F5F4E; --c-ink: #3E4C59; --c-warm: #8C8479; --c-army: #4B5A34; --c-almond: #D4BBA8;

  /* 语义变量 · 浅色 */
  --bg: #ECEAE4;
  --bg-tex: url(/static/img/topo-light.webp);
  --panel: #F6F4EF;
  --card: #FFFFFF;
  --card-2: #F8F6F1;
  --line: #DDD7CB;
  --line-2: #ECE8DF;
  --text: #2B3540;
  --ink: #17212C;
  --muted: #6A7077;
  --primary: var(--c-navy);
  --primary-ink: #FFFFFF;
  --primary-soft: #E6E9EE;
  --accent: #B08F52;
  --hud: var(--c-steel);
  --good: var(--c-moss); --good-soft: #E3ECE5;
  --warn: #8A6A33;       --warn-soft: #F4ECDE;
  --red: var(--c-brick); --red-soft: #F3E3E1;
  --info: var(--c-steel);--info-soft: #E2EAF2;
  --side-bg: #1B2633;
  --side-text: #CBD2DA;
  --side-muted: #8592A0;
  --code-bg: #1B2633; --code-text: #DCE3EA;
  --shadow-1: 0 1px 2px rgba(23,33,44,.06);
  --shadow-2: 0 12px 30px -18px rgba(23,33,44,.38);
  --radius: 10px;
  --ease: cubic-bezier(.2,.7,.2,1);

  /* 兼容旧变量名 */
  --navy: var(--c-navy); --navy-2: var(--c-ink); --blue: var(--primary); --blue-soft: var(--primary-soft);
  --green: var(--good); --amber: var(--warn);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #111821;
  --bg-tex: url(/static/img/topo-dark.webp);
  --panel: #151E28;
  --card: #19232F;
  --card-2: #1E2A37;
  --line: #2B3949;
  --line-2: #233040;
  --text: #CDD5DD;
  --ink: #F0EDE6;
  --muted: #8E9AA8;
  --primary: #C9AE7C;
  --primary-ink: #141B23;
  --primary-soft: rgba(201,174,124,.13);
  --accent: #C9AE7C;
  --hud: #8FC2D8;
  --good: #A9BFA2; --good-soft: rgba(141,159,135,.16);
  --warn: #D9BC86; --warn-soft: rgba(194,168,120,.15);
  --red: #D8908B;  --red-soft: rgba(150,82,79,.22);
  --info: #9DB6D8; --info-soft: rgba(74,111,165,.2);
  --side-bg: #0C121A;
  --side-text: #BCC6D0;
  --side-muted: #6F7D8C;
  --code-bg: #0C121A; --code-text: #D2DCE5;
  --shadow-1: 0 1px 0 rgba(255,255,255,.03) inset;
  --shadow-2: 0 18px 40px -22px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bg-tex) center / cover no-repeat; opacity: .55;
}
h1, h2, h3, p { text-wrap: pretty; }
::selection { background: color-mix(in oklch, var(--primary) 30%, transparent); }

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: color-mix(in oklch, var(--primary) 70%, var(--ink)); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.ic { width: 18px; height: 18px; flex: none; stroke-width: 1.7; vertical-align: -3px; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex: none;
  background: var(--side-bg);
  color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(194,168,120,.14);
  isolation: isolate;
}
.sidebar::before { /* 迷彩暗纹 */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url(/static/img/camo-tile.webp) 0 0 / 240px; opacity: .06; mix-blend-mode: screen;
}
.sidebar::after { /* 右侧刻度线 */
  content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 3px;
  background: repeating-linear-gradient(180deg, rgba(194,168,120,.35) 0 1px, transparent 1px 12px);
}

.brand {
  display: flex; gap: 11px; align-items: center;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: relative;
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  background: url(/static/img/emblem.webp) center / contain no-repeat;
  color: transparent; font-size: 0;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.35));
}
.brand-name { color: #fff; font-weight: 700; font-size: 14.5px; letter-spacing: 1px; }
.brand-sub { font-family: "Share Tech Mono", monospace; font-size: 11px; color: var(--c-sand); margin-top: 3px; letter-spacing: 1.5px; }

.nav { padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; min-height: 0; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }

.nav-group {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--side-muted); letter-spacing: 3px;
  padding: 14px 12px 6px;
}
.nav-group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(143,166,169,.3), transparent); }

.nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--side-text);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  position: relative;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav a .ic { color: var(--side-muted); transition: color .18s; }
.nav a:hover { background: rgba(194,168,120,.08); text-decoration: none; color: #fff; }
.nav a:hover .ic { color: var(--c-celadon); }
.nav a.active {
  background: linear-gradient(90deg, rgba(74,111,165,.55), rgba(74,111,165,.14));
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(194,168,120,.28);
}
.nav a.active .ic { color: var(--c-sand); }
.nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  background: var(--c-sand); border-radius: 0 2px 2px 0; box-shadow: 0 0 10px var(--c-sand);
}

.userbox {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 14px 16px 16px;
  font-size: 12px;
  background: rgba(0,0,0,.18);
  display: grid; grid-template-columns: 36px 1fr; gap: 0 10px; align-items: center;
}
.userbox::before {
  content: attr(data-initial); grid-row: span 2;
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--c-sand); color: #1F2B33; font-weight: 700; font-size: 14px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.user-name { color: #fff; font-weight: 600; font-size: 13px; }
.user-role { color: var(--side-muted); margin: 1px 0 0; }
.logout { color: var(--side-muted); font-size: 12px; }
.logout-btn {
  grid-column: 1 / -1; margin-top: 12px; justify-content: center;
  background: transparent !important; border: 1px solid rgba(143,166,169,.35) !important;
  color: var(--side-text) !important;
}
.logout-btn:hover { border-color: var(--c-sand) !important; color: #fff !important; }

.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text); background: var(--card);
  border: 1px solid var(--line); padding: 0 12px; height: 34px; border-radius: 17px;
}
.user-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }

.main { flex: 1; padding: 0 26px 40px; min-width: 0; }

/* 顶部 HUD 条 */
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  padding: 20px 0 16px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.topbar::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 120px; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.topbar-code {
  font-family: "Share Tech Mono", monospace; font-size: 11.5px; color: var(--muted);
  letter-spacing: 2px; display: flex; gap: 10px; align-items: center; margin-bottom: 6px;
}
.topbar-code b { color: var(--hud); font-weight: 400; }
.topbar h1 { margin: 0; font-size: 23px; font-weight: 700; color: var(--ink); letter-spacing: 1px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.top-actions .filters { margin: 0; }

eq-daynight { flex: none; border-radius: 100px; }
eq-daynight:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.top-actions eq-daynight { margin: 0 2px; }
.login-cls eq-daynight { filter: drop-shadow(0 6px 14px rgba(23,33,44,.25)); }
.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--text); display: inline-grid; place-items: center; cursor: pointer;
  transition: border-color .15s, color .15s, transform .25s var(--ease);
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); transform: rotate(20deg); }
.theme-toggle .ic-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ic-moon { display: block; }

/* ---------------- 栅格 / 卡片 ---------------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  box-shadow: var(--shadow-1);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
/* HUD 角标：左上 + 右下 */
.card::before, .card::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none;
  border: 1.5px solid var(--hud); opacity: .55; transition: opacity .2s, width .2s, height .2s;
}
.card::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.card::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }
.card:hover { border-color: color-mix(in oklch, var(--hud) 35%, var(--line)); box-shadow: var(--shadow-2); }
.card:hover::before, .card:hover::after { opacity: 1; width: 16px; height: 16px; }

.card-title {
  font-size: 13px; color: var(--ink); font-weight: 600; margin: 0 0 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.card-title > span:first-child, .card-title:not(:has(> *)) { display: inline-flex; align-items: center; gap: 8px; }
.card-title::before {
  content: ""; width: 6px; height: 6px; flex: none; background: var(--accent); transform: rotate(45deg);
  margin-right: -2px;
}
.card-title a { font-weight: 400; margin-left: auto; }
.card-value {
  font-family: "Oswald", "Microsoft YaHei", sans-serif; font-weight: 700;
  font-size: 34px; line-height: 1.1; letter-spacing: .5px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.card-value small { font-family: "Microsoft YaHei", sans-serif; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 4px; letter-spacing: 0; }
.card-foot { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* 指标卡：顶部状态色条 + 斜纹 */
.card-accent, .card-good, .card-warn, .card-red { overflow: hidden; }
.card-accent { --k: var(--primary); }
.card-good { --k: var(--good); }
.card-warn { --k: var(--warn); }
.card-red { --k: var(--red); }
.card-accent, .card-good, .card-warn, .card-red {
  background:
    linear-gradient(var(--k), var(--k)) top / 100% 3px no-repeat,
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in oklch, var(--k) 6%, transparent) 10px 11px) right top / 45% 100% no-repeat,
    var(--card);
}
.card-good .card-value { color: var(--good); }
.card-warn .card-value { color: var(--warn); }
.card-red .card-value { color: var(--red); }

.section { margin-top: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-head h2 { font-size: 15.5px; margin: 0; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.section-head h2::before { content: ""; width: 4px; height: 16px; background: var(--accent); border-radius: 1px; }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
th {
  background: var(--card-2); color: var(--muted); font-weight: 600; font-size: 12px;
  white-space: nowrap; letter-spacing: .5px; border-bottom-color: var(--line);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--primary-soft); }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; overflow-x: auto; background: var(--card); }
.card .table-wrap { background: transparent; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 9px; border-radius: 4px;
  font-size: 12px; line-height: 20px; white-space: nowrap; font-weight: 500;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-good { background: var(--good-soft); color: var(--good); border-color: color-mix(in oklch, var(--good) 25%, transparent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in oklch, var(--warn) 25%, transparent); }
.badge-muted { background: var(--card-2); color: var(--muted); border-color: var(--line); }
.badge-dark { background: color-mix(in oklch, var(--c-ink) 14%, transparent); color: var(--text); border-color: var(--line); }
.badge-blue { background: var(--info-soft); color: var(--info); border-color: color-mix(in oklch, var(--info) 25%, transparent); }
.badge-red { background: var(--red-soft); color: var(--red); border-color: color-mix(in oklch, var(--red) 28%, transparent); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 16px; border-radius: 7px;
  background: var(--primary); color: var(--primary-ink); border: 1px solid var(--primary);
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; line-height: 1.2;
  position: relative; overflow: hidden; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .2s var(--ease), transform .1s;
}
.btn::after { /* 扫光 */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-20deg); transition: left .5s var(--ease);
}
.btn:hover { background: color-mix(in oklch, var(--primary) 86%, #000); text-decoration: none; color: var(--primary-ink); box-shadow: 0 6px 16px -6px color-mix(in oklch, var(--primary) 60%, transparent); }
.btn:hover::after { left: 120%; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-ghost::after { display: none; }
.btn-ghost:hover { background: var(--card); color: var(--primary); border-color: var(--primary); box-shadow: none; }
.btn-danger { background: var(--card); color: var(--red); border-color: color-mix(in oklch, var(--red) 40%, var(--line)); }
.btn-danger::after { display: none; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); box-shadow: none; }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }

form.inline { display: inline; }

/* ---------------- 表单 ---------------- */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px;
  padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.top-actions .filters { padding: 0; background: none; border: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }
input, select, textarea {
  font-family: inherit; font-size: 13px; color: var(--text);
  min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--primary); }
input[type="file"] { padding: 6px; }
input::placeholder, textarea::placeholder { color: color-mix(in oklch, var(--muted) 75%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in oklch, var(--primary) 40%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent); }
input[readonly] { background: var(--card-2); }
textarea { min-height: 84px; resize: vertical; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }

.hint { font-size: 12px; color: var(--muted); }

/* ---------------- 提示 ---------------- */
.alert {
  padding: 10px 14px 10px 38px; border-radius: 8px; margin-bottom: 14px; font-size: 13px;
  position: relative; border: 1px solid;
}
.alert::before {
  content: ""; position: absolute; left: 14px; top: 13px; width: 12px; height: 12px;
  background: currentColor; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.alert-error { background: var(--red-soft); color: var(--red); border-color: color-mix(in oklch, var(--red) 30%, transparent); }
.alert-ok { background: var(--good-soft); color: var(--good); border-color: color-mix(in oklch, var(--good) 30%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in oklch, var(--info) 30%, transparent); }

/* ---------------- 键值 / 时间轴 ---------------- */
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 9px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 0;
  border-left: 2px dotted color-mix(in oklch, var(--hud) 45%, var(--line));
}
.tl-item { position: relative; padding: 0 0 18px 4px; }
.tl-dot {
  position: absolute; left: -22px; top: 5px; width: 11px; height: 11px;
  background: var(--card); border: 2px solid var(--primary); transform: rotate(45deg);
}
.tl-dot.fault { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.tl-time { font-family: "Share Tech Mono", monospace; font-size: 12px; color: var(--muted); }
.tl-title { font-weight: 600; margin: 3px 0; color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-desc { font-size: 12.5px; color: var(--text); opacity: .85; }

/* ---------------- 条形 / 趋势 ---------------- */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.bar-label { width: 44px; color: var(--muted); flex: none; }
.bar-track {
  flex: 1; height: 10px; border-radius: 2px; overflow: hidden; position: relative;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 8px);
}
.bar-fill {
  display: block; height: 100%; background: var(--primary); border-radius: 2px; position: relative;
  background-image: repeating-linear-gradient(90deg, transparent 0 6px, rgba(0,0,0,.12) 6px 8px);
  transition: width .8s var(--ease);
}
.bar-fill.good { background-color: var(--good); }
.bar-fill.warn { background-color: var(--c-clay); }
.bar-fill.muted { background-color: var(--c-slate); }
.bar-fill.red { background-color: var(--red); }
.bar-num { width: 34px; text-align: right; color: var(--ink); font-family: "Share Tech Mono", monospace; font-size: 13px; }

.trend { display: flex; align-items: flex-end; gap: 14px; height: 160px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-bar {
  width: 100%; max-width: 44px; min-height: 3px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--hud), color-mix(in oklch, var(--hud) 45%, transparent));
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--hud) 40%, transparent) inset;
}
.trend-label { font-size: 11.5px; color: var(--muted); }
.trend-val { font-family: "Share Tech Mono", monospace; font-size: 12px; color: var(--ink); }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; gap: 6px; align-items: center; margin-top: 14px; font-size: 12.5px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-family: "Share Tech Mono", monospace; }
.pagination a:hover { border-color: var(--primary); text-decoration: none; }
.pagination .current { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.pagination .muted { border: 0; background: none; font-family: inherit; }

/* ---------------- 代码块 ---------------- */
pre.mono, .code-block {
  background: var(--code-bg) !important; color: var(--code-text) !important;
  border: 1px solid var(--line); border-radius: 8px;
}
.surface-soft { background: var(--card-2) !important; border-color: var(--line) !important; }
.text-red { color: var(--red) !important; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  position: relative; min-height: 100vh; overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in oklch, var(--c-ink) 18%, transparent) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg);
}
.login-stage { position: absolute; inset: 0 400px 0 0; }
.login-wrap::before { /* 标题区柔和遮罩，保证文字可读 */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse 520px 300px at 40px 40px, var(--bg) 0%, color-mix(in oklch, var(--bg) 90%, transparent) 40%, transparent 100%),
    linear-gradient(90deg, color-mix(in oklch, var(--c-navy) 16%, var(--bg)) 0%, color-mix(in oklch, var(--bg) 60%, transparent) 14%, transparent 30%);
}
.login-stage canvas { cursor: grab; }
.login-copy { position: absolute; left: 56px; top: 44px; z-index: 3; max-width: 480px; pointer-events: none; }
.login-pill {
  display: inline-flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px;
}
.login-pill b { font-family: "Share Tech Mono", monospace; font-weight: 400; color: var(--primary); letter-spacing: 1px; }
.login-copy h1 {
  margin: 16px 0 10px; font-family: "ZCOOL QingKe", "Microsoft YaHei", sans-serif; font-weight: 400;
  font-size: clamp(34px, 3.6vw, 50px); line-height: 1.1; color: var(--ink); letter-spacing: 6px;
}
.login-copy h1 em { font-style: normal; display: block; color: var(--primary); }
.login-copy p { font-size: 13.5px; line-height: 1.8; margin: 0; color: var(--text); max-width: 420px; }
.login-feat { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.login-feat span {
  display: inline-flex; gap: 6px; align-items: center; font-size: 12px; padding: 5px 11px;
  background: color-mix(in oklch, var(--card) 80%, transparent); border: 1px solid var(--line); border-radius: 6px;
  backdrop-filter: blur(6px);
}
.login-feat .ic { color: var(--primary); width: 15px; height: 15px; }
.login-card {
  position: absolute; right: 40px; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 340px; padding: 26px 26px 18px; border-radius: 16px;
  background: color-mix(in oklch, var(--card) 90%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--line); box-shadow: 0 30px 70px -30px rgba(31,43,51,.5);
}
.login-card::before, .login-card::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--hud); }
.login-card::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.login-card::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }
.login-head { display: flex; gap: 11px; align-items: center; margin-bottom: 20px; }
.login-head .brand-mark { width: 48px; height: 48px; filter: drop-shadow(0 4px 8px rgba(23,33,44,.22)); }
.login-head b { display: block; color: var(--ink); font-size: 15px; }
.login-head small { font-family: "Share Tech Mono", monospace; font-size: 10.5px; color: var(--muted); letter-spacing: 1px; }
.login-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.login-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 18px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field label { color: var(--text); font-size: 12.5px; }
.login-card input { width: 100%; min-height: 44px; font-size: 14px; padding-left: 38px; border-radius: 9px; }
.login-input { position: relative; }
.login-input .ic { position: absolute; left: 12px; top: 13px; color: var(--muted); pointer-events: none; }
.login-card .btn { width: 100%; margin-top: 6px; min-height: 46px; font-size: 15px; letter-spacing: 6px; border-radius: 9px; background: var(--c-navy); border-color: var(--c-navy); color: #fff; }
html[data-theme="dark"] .login-card .btn { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.demo-users {
  margin-top: 16px; font-size: 11.5px; color: var(--muted); line-height: 1.85;
  border-top: 1px dashed var(--line); padding-top: 12px;
}
.login-foot { position: absolute; left: 56px; bottom: 22px; z-index: 3; display: flex; gap: 18px; font-size: 11.5px; color: var(--muted); }
.login-cls {
  position: absolute; right: 48px; top: 22px; z-index: 5; display: flex; gap: 10px; align-items: center;
}
.login-cls span { font-family: "Share Tech Mono", "Microsoft YaHei", monospace; font-size: 11px; color: var(--red); border: 1px solid var(--red); padding: 3px 10px; letter-spacing: 2px; }
.login-hint { position: absolute; left: 56px; bottom: 50px; z-index: 3; display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); pointer-events: none; }
@media (max-width: 980px) {
  .login-stage { inset: 0; opacity: .35; }
  .login-copy { left: 24px; right: 24px; top: 28px; }
  .login-copy h1 { font-size: 34px; }
  .login-copy p, .login-feat, .login-hint { display: none; }
  .login-card { position: relative; right: auto; top: auto; transform: none; margin: 210px auto 40px; width: min(380px, calc(100% - 32px)); }
  .login-foot { position: static; justify-content: center; padding-bottom: 20px; }
  .login-cls { right: 16px; top: 12px; }
}

/* ---------------- 3D 视图 ---------------- */
.m3d { position: relative; overflow: hidden; min-height: 260px; }
.m3d canvas { cursor: grab; }
.m3d canvas:active { cursor: grabbing; }
.m3d-tip {
  padding: 8px 11px; border-radius: 6px; background: #1F2B33; color: #EEF2EE;
  border: 1px solid rgba(143,211,216,.4);
  font-size: 12px; line-height: 1.5; display: flex; flex-direction: column;
  box-shadow: 0 10px 24px rgba(0,0,0,.3);
}
.m3d-tip b { font-size: 13px; }
.m3d-tip span { opacity: .75; }
.m3d-tip em { font-style: normal; color: var(--c-sand); font-size: 11.5px; margin-top: 2px; }
.m3d-hint {
  position: absolute; left: 14px; bottom: 12px; z-index: 2; pointer-events: none;
  display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted);
}
.m3d-hint .ic { width: 15px; height: 15px; }
.m3d-fallback::after { content: attr(data-m3d-error); position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

/* ---------------- 装备档案卷宗（详情页） ---------------- */
.dossier {
  display: grid; grid-template-columns: minmax(320px, 1.1fr) 1fr; gap: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-2); position: relative; margin-bottom: 18px;
}
.dossier::before { /* 档案装订孔 */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; z-index: 3;
  background: repeating-linear-gradient(180deg, color-mix(in oklch, var(--c-khaki) 55%, transparent) 0 12px, transparent 12px 24px);
}
.dossier-stage {
  position: relative; min-height: 380px;
  background:
    radial-gradient(ellipse at 50% 60%, color-mix(in oklch, var(--hud) 12%, transparent), transparent 70%),
    var(--card-2);
  border-right: 1px dashed var(--line);
}
html[data-theme="dark"] .dossier-stage { background: radial-gradient(ellipse at 50% 60%, rgba(143,211,216,.10), transparent 70%), #121A21; }
.dossier-stage .m3d { position: absolute; inset: 0; }
.dossier-stage .stage-tag {
  position: absolute; left: 20px; top: 16px; z-index: 2; display: flex; flex-direction: column; gap: 4px;
  font-family: "Share Tech Mono", monospace; font-size: 11.5px; color: var(--muted); letter-spacing: 1.5px; pointer-events: none;
}
.dossier-stage .stage-tag b { color: var(--hud); font-weight: 400; }
.dossier-stage .stage-hud {
  position: absolute; right: 16px; top: 16px; z-index: 2; pointer-events: none;
  font-family: "Share Tech Mono", monospace; font-size: 11px; color: var(--muted); text-align: right; line-height: 1.7;
}
.dossier-body { padding: 24px 26px 22px; position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dossier-no { font-family: "Share Tech Mono", monospace; font-size: 12px; color: var(--muted); letter-spacing: 2px; }
.dossier-name { margin: 2px 0 0; font-size: 26px; color: var(--ink); letter-spacing: 1px; line-height: 1.25; }
.dossier-name small { font-family: "Share Tech Mono", monospace; font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 8px; letter-spacing: 1px; }
.dossier-stamp {
  position: absolute; right: 24px; top: 20px; width: 96px; height: 96px; border-radius: 50%;
  border: 2.5px solid var(--red); color: var(--red); display: grid; place-items: center; text-align: center;
  font-family: "ZCOOL QingKe", "Microsoft YaHei", sans-serif; font-size: 15px; line-height: 1.25;
  transform: rotate(-12deg); opacity: .75; pointer-events: none;
}
.dossier-stamp::before { content: ""; position: absolute; inset: 5px; border: 1px solid currentColor; border-radius: 50%; }
.dossier-stamp small { display: block; font-family: "Share Tech Mono", monospace; font-size: 9.5px; letter-spacing: 1px; }
.dossier-stamp.s-good { color: var(--good); border-color: var(--good); }
.dossier-stamp.s-warn { color: var(--warn); border-color: var(--warn); }
.dossier-stamp.s-muted { color: var(--muted); border-color: var(--muted); }
.dossier-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.dossier-specs div { padding: 10px 12px; border-right: 1px dashed var(--line); border-bottom: 1px dashed var(--line); min-width: 0; }
.dossier-specs div:nth-child(3n) { border-right: 0; }
.dossier-specs div:nth-last-child(-n+3) { border-bottom: 0; }
.dossier-specs span { display: block; font-size: 11.5px; color: var(--muted); }
.dossier-specs b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.dossier-specs b.mono { font-weight: 400; }
.dossier-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.dossier-meta b { color: var(--ink); font-weight: 600; }
@media (max-width: 1000px) {
  .dossier { grid-template-columns: 1fr; }
  .dossier-stage { min-height: 300px; border-right: 0; border-bottom: 1px dashed var(--line); }
}

/* ---------------- 工作台快讯条 ---------------- */
.ticker {
  display: flex; align-items: stretch; margin-bottom: 16px; overflow: hidden;
  background: var(--c-navy); color: #DCE5E4; border-radius: 8px; font-size: 12.5px;
  box-shadow: var(--shadow-2);
}
html[data-theme="dark"] .ticker { background: #0F161C; border: 1px solid var(--line); }
.ticker > * { padding: 9px 16px; border-right: 1px solid rgba(255,255,255,.08); display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.ticker .live { background: #A2383A; color: #fff; font-family: "Share Tech Mono", monospace; letter-spacing: 3px; }
.ticker .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #E3F2EF; animation: blink 1.6s infinite; }
.ticker b { font-family: "Share Tech Mono", monospace; font-weight: 400; color: var(--c-sand); font-size: 13px; }
.ticker .scroll { flex: 1; min-width: 0; overflow: hidden; }
.ticker a { color: #DCE5E4; }
.ticker a:hover { color: #fff; }
@keyframes blink { 50% { opacity: .3; } }

/* 待办列表 */
.todo-list { display: flex; flex-direction: column; }
.todo-list a {
  display: grid; grid-template-columns: 34px 1fr auto 16px; gap: 10px; align-items: center;
  padding: 10px 6px; border-bottom: 1px dashed var(--line); color: var(--text); font-size: 13px; border-radius: 6px;
  transition: background .15s;
}
.todo-list a:last-child { border-bottom: 0; }
.todo-list a:hover { background: var(--primary-soft); text-decoration: none; color: var(--ink); }
.todo-list .t-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line); color: var(--primary); }
.todo-list b { font-family: "Oswald", sans-serif; font-size: 22px; color: var(--ink); font-weight: 700; }
.todo-list b.hot { color: var(--red); }
.todo-list .ic-arrow { color: var(--muted); width: 16px; height: 16px; }

/* 状态分段条 */
.seg { display: flex; gap: 3px; height: 14px; margin: 4px 0 16px; }
.seg i { display: block; height: 100%; border-radius: 2px; min-width: 3px; }

/* 空状态 */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 10px; color: var(--muted); font-size: 13px; }
.empty-state img { width: 120px; height: 120px; object-fit: contain; opacity: .9; }
html[data-theme="dark"] .empty-state img { filter: brightness(1.7) saturate(.9); }

/* ---------------- 错误页 ---------------- */
.error-page { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 8px; }
.error-code { font-family: "Saira Stencil One", "Oswald", sans-serif; font-size: 88px; line-height: 1; color: color-mix(in oklch, var(--hud) 45%, transparent); letter-spacing: 6px; }
.error-page h1 { margin: 0; font-size: 20px; color: var(--ink); }
.error-page p { color: var(--muted); margin: 0 0 10px; }
.error-page .btn { justify-self: center; }

/* ---------------- 工具类 ---------------- */
.mono { font-family: "Share Tech Mono", Consolas, "Courier New", monospace; font-size: 12.5px; letter-spacing: .3px; }
.low-row td { background: var(--warn-soft); }

/* 全站智能助手 */
.assistant-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--navy); color: #fff; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; box-shadow: 0 10px 24px rgba(22,50,79,.35);
}
.assistant-fab:hover { background: var(--primary); }
.assistant-panel {
  position: fixed; right: 22px; bottom: 86px; z-index: 91;
  width: 370px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 120px);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px rgba(22,50,79,.28); display: none; flex-direction: column; overflow: hidden;
}
.assistant-panel.open { display: flex; }
.assistant-head {
  background: var(--navy); color: #fff; padding: 12px 14px; display: flex;
  justify-content: space-between; align-items: center; font-size: 13px;
}
.assistant-head small { color: var(--side-muted); font-size: 10.5px; display: block; margin-top: 2px; }
.assistant-close { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
.assistant-body { flex: 1; overflow-y: auto; padding: 12px; background: var(--card-2); }
.assistant-msg {
  max-width: 88%; padding: 9px 11px; border-radius: 10px; margin-bottom: 9px;
  font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.assistant-msg.bot { background: var(--card); border: 1px solid var(--line); color: var(--navy); }
.assistant-msg.user { background: var(--navy); color: #fff; margin-left: auto; }
.assistant-msg a { color: var(--primary); }
.assistant-draft { background: var(--warn-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 9px; font-size: 12.5px; }
.assistant-draft .row { margin-top: 8px; }
.assistant-chips { padding: 8px 10px 0; display: flex; gap: 6px; flex-wrap: wrap; background: var(--card); }
.assistant-chip { font-size: 11px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 14px; padding: 4px 9px; cursor: pointer; }
.assistant-chip:hover { background: var(--primary-soft); }
.assistant-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); background: var(--card); }
.assistant-form input { flex: 1; padding: 8px 10px; font-size: 12.5px; }
.assistant-form button { padding: 8px 12px; font-size: 12.5px; }
.assistant-typing { color: var(--muted); font-size: 11.5px; padding: 0 12px 6px; background: var(--card-2); }


.day-grid { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; }
.day-cell {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px;
  min-height: 82px; font-size: 11px; background: var(--card);
}
.day-cell.idle { background: var(--good-soft); border-color: var(--line); }
.day-cell.reserved { background: var(--info-soft); border-color: var(--line); }
.day-cell.in_use { background: var(--warn-soft); border-color: var(--line); }
.day-date { font-weight: 600; font-size: 12px; }
.day-state { margin-top: 4px; }
.day-label { color: var(--text); line-height: 1.45; margin-top: 3px; }
@media (max-width: 1200px) {
  .day-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stencil { font-family: "Saira Stencil One", "Oswald", sans-serif; letter-spacing: 2px; }

/* ---------------- 入场动效 ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .main > .grid > *, .main > .section, .main > .card, .main > .table-wrap, .main > .dossier, .main > .ticker {
    animation: rise .5s var(--ease) both;
  }
  .main > .grid > *:nth-child(2) { animation-delay: .05s; }
  .main > .grid > *:nth-child(3) { animation-delay: .1s; }
  .main > .grid > *:nth-child(4) { animation-delay: .15s; }
  .main > .section:nth-of-type(2) { animation-delay: .12s; }
  .main > .section:nth-of-type(3) { animation-delay: .18s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .nav { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .nav-group { width: 100%; }
  .main { padding: 0 14px 30px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .top-actions { justify-content: flex-start; }
}

/* ---------------- 打印 ---------------- */
@media print {
  .sidebar, .top-actions, .theme-toggle, .m3d { display: none !important; }
  body::before { display: none; }
  .card, .table-wrap { box-shadow: none; break-inside: avoid; }
}
