/* 资产管理 · 样式。颜色、字号、间距只取自设计系统（方案文档 15-D9） */
:root {
  --bg: #F3F5F8; --surface: #FFFFFF; --surface-2: #E9EDF2; --line: #DDE3EA; --line-strong: #75859A;
  --text-1: #141C26; --text-2: #4F5B6A; --text-3: #7A8695;
  --brand: #1F4E79; --brand-hover: #183E61; --brand-press: #123049; --brand-weak: #E4EDF6; --on-accent: #FFFFFF;
  --ok: #1B7A4B; --ok-weak: #E3F1E9; --warn: #9A5B00; --warn-weak: #FBEFD9;
  --danger: #B02A1E; --danger-hover: #8E2118; --danger-weak: #FAE6E3;
  --overlay: rgba(20, 28, 38, 0.45); --shadow-float: 0 8px 24px rgba(20, 28, 38, 0.12);
  /* 布局尺寸：页面左右留白跟着浏览器宽度走（最窄 16px，最宽 40px） */
  --topbar-h: 56px; --nav-w: 232px; --gutter: clamp(16px, 2.4vw, 40px);
  /* 图表用色：只用主色，由深到浅五档（不引入新颜色）；-ink 是写在这一档上面的字的颜色。各档之间、字与底之间的对比度都用脚本算过 */
  --viz-1: var(--brand); --viz-2: var(--brand); --viz-3: var(--brand); --viz-4: var(--brand); --viz-5: var(--brand);
  --viz-1-ink: var(--on-accent); --viz-2-ink: var(--on-accent); --viz-3-ink: var(--text-1); --viz-4-ink: var(--text-1); --viz-5-ink: var(--text-1);
  color-scheme: light;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --viz-2: color-mix(in srgb, var(--brand) 82%, var(--surface)); --viz-3: color-mix(in srgb, var(--brand) 64%, var(--surface));
    --viz-4: color-mix(in srgb, var(--brand) 52%, var(--surface)); --viz-5: color-mix(in srgb, var(--brand) 40%, var(--surface));
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F141A; --surface: #171E27; --surface-2: #202A36; --line: #2C3846; --line-strong: #6F7E91;
    --text-1: #E6EBF2; --text-2: #A9B4C2; --text-3: #7C8898;
    --brand: #7FB2E5; --brand-hover: #9CC4EC; --brand-press: #6A9FD4; --brand-weak: #1B2B3D; --on-accent: #0F141A;
    --ok: #5CC08A; --ok-weak: #16301F; --warn: #E0A545; --warn-weak: #33270F;
    --danger: #F0857A; --danger-hover: #F5A199; --danger-weak: #3A1D1A;
    --overlay: rgba(0, 0, 0, 0.6); --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.5);
    --viz-3-ink: var(--on-accent);
    color-scheme: dark;
  }
  @supports (color: color-mix(in srgb, red 50%, blue)) {
    :root {
      --viz-2: color-mix(in srgb, var(--brand) 84%, var(--surface)); --viz-3: color-mix(in srgb, var(--brand) 68%, var(--surface));
      --viz-4: color-mix(in srgb, var(--brand) 50%, var(--surface)); --viz-5: color-mix(in srgb, var(--brand) 34%, var(--surface));
    }
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text-1);
  font: 14px/22px -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; line-height: 28px; font-weight: 600; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--text-2); }
.small { font-size: 12px; line-height: 18px; }
.hidden { display: none !important; }
.gap { height: 12px; }
.grow { flex: 1; min-width: 0; }
.r { text-align: right; }
a, .link { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ico { flex: none; display: block; }

/* ---------- 按钮与输入 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 16px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-1);
  font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color 120ms ease-out, border-color 120ms ease-out;
  position: relative;
}
.btn::after { content: ""; position: absolute; inset: -4px 0; }           /* 可点区域补到 44px */
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-accent); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.primary:active { background: var(--brand-press); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.btn.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.mobile-only { display: none; }
.btn.danger-line { color: var(--danger); border-color: var(--danger); }
.btn.danger-line:hover:not(:disabled) { background: var(--danger-weak); }
.btn[disabled] { color: var(--text-3); background: var(--surface-2); border-color: var(--line); cursor: not-allowed; }
.btn.busy { pointer-events: none; opacity: 0.8; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.field { display: block; margin-bottom: 16px; }
.field > .label { display: block; margin-bottom: 4px; font-weight: 600; }
.field .opt { font-weight: 400; color: var(--text-2); }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text-1); font: inherit; transition: border-color 120ms ease-out;
}
.field textarea { min-height: 72px; resize: vertical; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 264px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow-float); }
.picker-list li { display: flex; align-items: baseline; gap: 8px; min-height: 36px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.picker-list li:hover, .picker-list li.on { background: var(--brand-weak); }
.picker-list li .sub { color: var(--text-2); font-size: 12px; }
.picker-list li.none { color: var(--text-2); }
.picker-list li.tip { color: var(--text-2); font-size: 12px; cursor: default; background: none; }
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--text-3); }
.field .hint { display: block; margin-top: 4px; color: var(--text-2); font-size: 12px; line-height: 18px; }
p.err { color: var(--danger); }
.check-field { margin-bottom: 16px; }
.check-field .hint { display: block; margin: 4px 0 0 24px; color: var(--text-2); font-size: 12px; line-height: 18px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--brand); }
.check input:disabled + span { color: var(--text-2); }
.field .err { display: block; margin-top: 4px; color: var(--danger); font-size: 12px; line-height: 18px; }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--danger); background: var(--danger-weak); }
.choice { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.choice input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }

/* ---------- 框架：顶栏固定，左边导航跟着屏幕高度，右边内容占满剩下的宽度 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter) 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; color: var(--text-1); text-decoration: none; }
.brand .logo { width: 28px; height: 28px; display: block; }
.menu { position: relative; }
.userbtn { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text-1); font: inherit; cursor: pointer; transition: background-color 120ms ease-out; }
.userbtn:hover { background: var(--surface-2); }
.userbtn .avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: var(--brand-weak); color: var(--brand); font-size: 12px; line-height: 18px; font-weight: 600; }
.userbtn .who { font-weight: 600; }
.userbtn .org { color: var(--text-2); }
.userbtn .ico { color: var(--text-2); }
.menu-panel { position: absolute; right: 0; top: 48px; min-width: 176px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-float); z-index: 40; }
.menu-panel button { display: block; width: 100%; min-height: 44px; padding: 0 12px; text-align: left; background: none; border: 0; border-radius: 8px; color: var(--text-1); font: inherit; cursor: pointer; }
.menu-panel button:hover { background: var(--surface-2); }
.layout { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.nav {
  position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); overflow-y: auto;
  padding: 16px 12px; border-right: 1px solid var(--line); background: var(--surface);
}
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; margin-bottom: 4px; border-radius: 8px; color: var(--text-2); text-decoration: none; transition: background-color 120ms ease-out, color 120ms ease-out; }
.nav a:hover { background: var(--surface-2); color: var(--text-1); }
.nav a.on { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 999px; background: var(--brand); }
.nav .count, .tabs .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn-weak); color: var(--warn); font-size: 12px; line-height: 18px; text-align: center; font-weight: 600; }
.main { min-width: 0; padding: 24px var(--gutter) 48px; }
.page { container: page / inline-size; }                       /* 表格显示哪几列，看的是内容区自己有多宽（旁边开着抽屉时也对） */
.page[data-view="password"], .page[data-view="todos"] { max-width: 880px; }
.crumb { color: var(--text-2); font-size: 12px; line-height: 18px; margin-bottom: 4px; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.head .sub { color: var(--text-2); font-size: 13px; line-height: 20px; }
.bottom-tabs { display: none; }
.banner { display: flex; align-items: center; gap: 8px; padding: 8px 24px; background: var(--warn-weak); color: var(--text-1); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; transition: color 120ms ease-out; }
.tabs a:hover { color: var(--text-1); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- 卡片、数字、清单 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
/* 数字条：一整块，中间用细线分开；格子数量跟着宽度自动换行 */
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 1px; margin-bottom: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--line); overflow: hidden; }
.num { position: relative; display: block; text-align: left; background: var(--surface); border: 0; padding: 16px 24px; color: var(--text-1); font: inherit; cursor: pointer; transition: background-color 120ms ease-out; }
.num:hover { background: var(--surface-2); }
.num:focus-visible { outline-offset: -2px; }
.num span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 13px; line-height: 20px; }
.num b { display: block; margin-top: 4px; font-size: 28px; line-height: 36px; font-weight: 600; font-variant-numeric: normal; }
.num.attn b { color: var(--warn); }
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.todo .what { flex: 1; min-width: 200px; }
.todo .kind { display: inline-block; margin-right: 8px; font-weight: 600; }
.expand { flex-basis: 100%; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.done { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.done .ico { color: var(--ok); }
.done .grow { min-width: 160px; }
.sec { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 32px 0 12px; }
.sec:first-child { margin-top: 0; }
.sec .note { color: var(--text-2); font-size: 12px; line-height: 18px; }

/* 筛选区 */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.filterbar .chips { margin-bottom: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .search { flex: 1; min-width: 200px; }
.searchbox { position: relative; display: flex; flex: 1; min-width: 200px; max-width: 420px; }
.searchbox .ico { position: absolute; left: 10px; top: 50%; margin-top: -8px; color: var(--text-2); pointer-events: none; }
.searchbox input { width: 100%; padding-left: 34px; }
.toolbar select, .toolbar input { min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-1); font: inherit; }
.toolbar .searchbox input { padding-left: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-1); font: inherit; font-size: 13px; cursor: pointer; transition: background-color 120ms ease-out, border-color 120ms ease-out; position: relative; }
.chip::after { content: ""; position: absolute; inset: -8px 0; }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--brand-weak); border-color: var(--brand); color: var(--brand); font-weight: 600; }
/* 分段开关：清单 / 按类型 / 按项目组 */
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-2); }
.seg a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; color: var(--text-2); text-decoration: none; white-space: nowrap; transition: background-color 120ms ease-out, color 120ms ease-out; position: relative; }
.seg a::after { content: ""; position: absolute; inset: -6px 0; }
.seg a:hover { color: var(--text-1); }
.seg a.on { background: var(--surface); border-color: var(--line-strong); color: var(--brand); font-weight: 600; }
/* 表格上方的一行小结：共多少台，各状态多少台 */
.statline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 28px; margin-bottom: 8px; color: var(--text-2); font-size: 13px; line-height: 20px; }
.statline b { color: var(--text-1); font-weight: 600; }
.statline .total { font-size: 14px; color: var(--text-1); }
.statline .stat { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; cursor: pointer; }
.statline .stat:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* 表格 */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table-wrap.sticky-head { overflow: clip; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 20px; }
th { height: 40px; padding: 0 12px; background: var(--surface-2); color: var(--text-2); text-align: left; font-size: 12px; font-weight: 600; white-space: nowrap; }
th.r { text-align: right; }
.sticky-head th { position: sticky; top: var(--topbar-h); z-index: 2; }
td { height: 44px; padding: 4px 12px; border-top: 1px solid var(--line); }
tbody tr:first-child td { border-top: 0; }
td.mono, td .tag, td:first-child { white-space: nowrap; }
td.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legacy-no { margin-left: 8px; color: var(--text-2); font-size: 12px; white-space: nowrap; }
/* 表头里的筛选（数据标记）：看起来还是表头文字，点开是下拉 */
.th-filter { height: 28px; margin: 0 -8px; padding: 0 4px 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.th-filter:hover { border-color: var(--line-strong); background: var(--surface); }
.th-filter.on { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); }
tr.row { cursor: pointer; transition: background-color 120ms ease-out; }
tr.row:hover { background: var(--surface-2); }
tr.row.on { background: var(--brand-weak); }
tr.row:focus-visible { outline-offset: -2px; }
/* 资产清单：内容区越宽，显示的列越多 */
.col-sn, .col-loc { display: none; }
@container page (max-width: 899px) { .col-flags { display: none; } }
@container page (max-width: 759px) { .col-user { display: none; } }
@container page (min-width: 1180px) { .col-sn { display: table-cell; } }
@container page (min-width: 1440px) { .col-loc { display: table-cell; } }
.cards { display: none; }
.acard { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; color: var(--text-1); font: inherit; cursor: pointer; }
.acard .top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pager { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--text-2); }
.empty { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty p { margin-bottom: 16px; }
.skeleton { height: 44px; margin-bottom: 8px; border-radius: 8px; background: var(--surface-2); }

/* ---------- 分组汇总表（按设备类型 / 按项目组） ---------- */
.pivot th, .pivot td { padding: 0 12px; }
.pivot th:first-child, .pivot td:first-child { padding-left: 16px; }
.pivot .r { width: 76px; }
.pivot .tot { width: 84px; }
.pivot .share { width: 18%; min-width: 132px; padding-right: 16px; }
.pivot td.r { color: var(--text-1); }
.pivot td.zero { color: var(--text-2); }
.pivot tr.grp td { height: 48px; font-weight: 600; }
.pivot tr.sub td:first-child { padding-left: 46px; }   /* 16 + 图标 18 + 间隔 12：下级名称与上级名称左对齐 */
.pivot tr.divider td { height: 32px; background: var(--bg); color: var(--text-2); font-size: 12px; line-height: 18px; font-weight: 600; }
.pivot tfoot td { height: 44px; background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--line); }
.pivot .name { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.pivot .name .ico { color: var(--text-2); }
.pivot .name .who { color: var(--text-2); font-size: 12px; font-weight: 400; }
.pivot .cell { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 36px; min-height: 28px; margin-right: -8px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-weight: inherit; cursor: pointer; transition: background-color 120ms ease-out, color 120ms ease-out; }
.pivot .cell:hover { background: var(--brand-weak); color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.pivot tr.row:hover { background: var(--bg); }
.pivot .sharebar { display: flex; align-items: center; gap: 8px; }
.pivot .sharebar .pct { flex: none; width: 40px; text-align: right; color: var(--text-2); font-size: 12px; font-weight: 400; }
@container page (max-width: 899px) { .pivot .share { display: none; } }
.hint-line { margin-top: 8px; color: var(--text-2); font-size: 12px; line-height: 18px; }
/* 条：底是浅灰，里面按份额填主色；分段时主色由深到浅，段与段之间留一条细缝 */
.track { display: block; flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.track .fill { display: flex; gap: 1px; height: 100%; min-width: 2px; }
.track .fill i { display: block; min-width: 2px; background: var(--brand); }
.track.thin { height: 6px; }
.s1 { opacity: 1; } .s2 { opacity: 0.72; } .s3 { opacity: 0.5; } .s4 { opacity: 0.34; } .s5 { opacity: 0.22; }
.sw { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 2px; background: var(--brand); }

/* ---------- 工作台的图表 ---------- */
/* 一张卡一个图；卡片按可用宽度自动排成 1、2、3 列，同一行的卡片一样高 */
.charts { display: flex; flex-wrap: wrap; gap: 24px; }
.chart { display: flex; flex-direction: column; flex: 1 1 100%; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
/* 一行放几张：看内容区宽度。每一行都排满，不留半行空白（最后一行不够数时，那几张自动拉宽） */
@container page (min-width: 760px) { .chart { flex-basis: 40%; } }            /* 一行 2 张 */
@container page (min-width: 1200px) { .chart { flex-basis: 30%; } }           /* 一行 3 张 */
@container page (min-width: 2000px) {
  .chart { flex-basis: 18%; }                                                  /* 一行 5 张，「资料待补全」在下面横着占一整行 */
  .chart.wide { flex-basis: 100%; display: grid; grid-template-columns: repeat(var(--cells, 5), minmax(0, 1fr)); column-gap: 24px; align-items: stretch; }   /* 五格与上面五张卡片一一对齐 */
  .chart.wide .chart-head { display: block; padding: 24px; }
  .chart.wide .chart-body, .chart.wide .tiles { display: contents; }
  .chart.wide .tile, .chart.wide .tile.lead { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; width: auto; min-height: 0; margin: 0; padding: 24px; border-left: 1px solid var(--line); border-radius: 0; }
  .chart.wide .tiles .tile > * { order: 0; }
  .chart.wide .tile .t-name { display: block; color: var(--text-2); font-size: 13px; line-height: 20px; }
  .chart.wide .tile .t-val { min-width: 0; text-align: left; color: var(--text-2); font-size: 14px; line-height: 36px; }
  .chart.wide .tile .t-val b { margin-right: 4px; color: var(--text-1); font-size: 28px; line-height: 36px; font-variant-numeric: normal; }
  .chart.wide .tile .t-bar { height: 8px; margin: 8px 0 4px; }
  .chart.wide .tile .t-note { display: block; color: var(--text-2); font-size: 13px; line-height: 20px; }
  .chart.wide .chart-ok { grid-column: 3 / -1; align-self: stretch; padding: 24px; border-left: 1px solid var(--line); }
}
.chart-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 24px 0; }
.chart-head .link { flex: none; min-height: 24px; font-size: 13px; line-height: 24px; white-space: nowrap; }
.chart-sub { color: var(--text-2); font-size: 13px; line-height: 20px; }
.chart-body { display: flex; flex-direction: column; gap: 16px; flex: 1; padding: 16px 24px 24px; }
.chart-cap { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 12px; line-height: 18px; font-weight: 600; }
.chart-note { color: var(--text-2); font-size: 13px; line-height: 20px; }
.chart-note .link { margin-left: 4px; }
.chart-ok { display: flex; align-items: center; gap: 8px; color: var(--text-1); }
.chart-ok .ico { color: var(--ok); }
.v1 { background: var(--viz-1); color: var(--viz-1-ink); } .v2 { background: var(--viz-2); color: var(--viz-2-ink); } .v3 { background: var(--viz-3); color: var(--viz-3-ink); }
.v4 { background: var(--viz-4); color: var(--viz-4-ink); } .v5 { background: var(--viz-5); color: var(--viz-5-ink); }
/* 大数字 + 一句说明 */
.figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.figure b { font-size: 28px; line-height: 36px; font-weight: 600; font-variant-numeric: normal; }
.figure span { color: var(--text-2); }
/* 分段条：块与块之间留 2px 缝，不描边 */
.segbar { display: flex; gap: 2px; height: 28px; }
.segbar button { display: flex; align-items: center; flex: 1 1 0; min-width: 4px; padding: 0; overflow: visible; border: 0; border-radius: 4px; font: inherit; font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: opacity 120ms ease-out; }
.segbar button span { padding: 0 8px; }
.segbar button:hover { opacity: 0.86; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 0 24px; }
.legend button, .kv button, .hbar { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 8px; margin: 0 -8px; box-sizing: content-box; border: 0; border-radius: 8px; background: none; color: var(--text-1); font: inherit; text-align: left; cursor: pointer; transition: background-color 120ms ease-out; }
.legend button:hover, .kv button:not([disabled]):hover, .hbar:hover { background: var(--bg); }
.legend .sw { flex: none; width: 12px; height: 12px; margin: 0; border-radius: 2px; }
.legend .ico { color: var(--text-2); }
.legend .nm { flex: 1; min-width: 0; }
.legend b, .kv b { font-weight: 600; margin-right: -4px; }
.legend .zero, .kv .zero { color: var(--text-2); }
.legend .zero b, .kv .zero b { font-weight: 400; }
.kv button[disabled] { cursor: default; }
.kv .pct { flex: none; width: 44px; text-align: right; color: var(--text-2); }
/* 占比条（一个比例）：填的是「正常」色，底是它的浅色 */
.meter { height: 12px; border-radius: 999px; background: var(--ok-weak); overflow: hidden; }
.meter i { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--ok); }
/* 一格一项（资料待补全）：窄的时候一行一项——名称、条、台数；超宽屏时横着排（见上面的容器规则） */
.tiles { display: flex; flex-direction: column; }
.tile { display: grid; grid-template-columns: minmax(80px, 32%) minmax(0, 1fr) auto; align-items: center; column-gap: 12px; width: 100%; min-height: 36px; padding: 0 8px; margin: 0 -8px; box-sizing: content-box; border: 0; border-radius: 8px; background: none; color: var(--text-1); font: inherit; text-align: left; transition: background-color 120ms ease-out; }
button.tile { cursor: pointer; }
button.tile:hover { background: var(--bg); }
.chart.wide .tile { box-sizing: border-box; }
.tile .t-bar { order: 1; }
.tile .t-val { order: 2; min-width: 48px; text-align: right; white-space: nowrap; color: var(--text-2); font-size: 12px; }
.tile .t-val b { margin-right: 2px; color: var(--text-1); font-size: 14px; font-weight: 600; }
.tile .t-note { display: none; }
.tile .t-bar { display: block; height: 8px; border-radius: 999px; background: var(--warn-weak); overflow: hidden; }
.tile .t-bar i { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--warn); }
.tile.lead { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; row-gap: 12px; margin-bottom: 12px; }
.tile.lead .t-name { display: none; }
.tile.lead .t-val { order: 1; min-width: 0; text-align: left; }
.tile.lead .t-val b { font-size: 28px; line-height: 36px; font-variant-numeric: normal; }
.tile.lead .t-note { display: block; order: 2; color: var(--text-2); }
.tile.lead .t-bar { order: 3; grid-column: 1 / -1; height: 12px; background: var(--ok-weak); }
.tile.lead .t-bar i { background: var(--ok); }
/* 排行条：从左边的起点线长出来，末端圆 4px，数字跟在末端 */
.hbars { display: flex; flex-direction: column; }
.hbar { display: grid; grid-template-columns: minmax(80px, 32%) minmax(0, 1fr); column-gap: 12px; align-items: stretch; }
.hbar .nm { align-self: center; min-width: 0; line-height: 20px; }
.hbar .nm span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .nm small { display: block; color: var(--text-2); font-size: 12px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .plot { display: flex; align-items: center; gap: 8px; min-width: 0; border-left: 1px solid var(--line-strong); padding: 4px 0; }
.hbar .bar { flex: none; height: 14px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--viz-1); }
.hbar .bar.warn { background: var(--warn); }
.hbar b { font-weight: 600; }
/* 热力表：一格一个数，越深越多 */
.heat { border-spacing: 2px; margin: 0 -2px; width: calc(100% + 4px); font-size: 13px; line-height: 20px; }
.heat th { height: 28px; padding: 0 4px; background: none; text-align: center; }
.heat th.r { text-align: right; padding-right: 0; }
.heat td { height: 36px; padding: 0; border: 0; text-align: center; }
.heat td.nm { padding-right: 8px; text-align: left; }
.heat td.tot { width: 48px; padding-left: 8px; text-align: right; font-weight: 600; }
.heat .hc { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 36px; height: 36px; border: 0; border-radius: 4px; font: inherit; font-weight: 600; cursor: pointer; transition: opacity 120ms ease-out; }
.heat button.hc:hover { opacity: 0.86; }
.heat .hc.z { color: var(--text-2); font-weight: 400; cursor: default; }
.link-plain { min-height: 36px; padding: 0; border: 0; background: none; color: var(--text-1); font: inherit; text-align: left; cursor: pointer; }
.link-plain:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.scale { display: flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 12px; line-height: 18px; }
.scale i { width: 20px; height: 8px; border-radius: 2px; }
.scale i:first-of-type { margin-left: 4px; } .scale i:last-of-type { margin-right: 4px; }
/* 柱状图：柱子最宽 24px，顶上写台数，底下写年份 */
.cols { display: flex; align-items: stretch; height: 208px; }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text-1); font: inherit; cursor: pointer; transition: background-color 120ms ease-out; }
.col:hover { background: var(--bg); }
.col b { font-weight: 600; line-height: 20px; }
.col i { display: block; width: 24px; max-width: 60%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--viz-1); }
.col span { align-self: stretch; padding-top: 4px; border-top: 1px solid var(--line-strong); color: var(--text-2); font-size: 12px; line-height: 20px; text-align: center; }

/* ---------- 状态标签 ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.tag .ico { stroke-width: 2; }
.tag.ok { background: var(--ok-weak); color: var(--ok); }
.tag.warn { background: var(--warn-weak); color: var(--warn); }
.tag.danger { background: var(--danger-weak); color: var(--danger); }
.tag.brand { background: var(--brand-weak); color: var(--brand); }

/* ---------- 抽屉 ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100vw; z-index: 21; display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-float); animation: slide-in 200ms ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 8px 8px 24px; border-bottom: 1px solid var(--line); }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.drawer.wide { width: 720px; }
.drawer.xwide { width: min(1120px, 100vw); }
.grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.grid-wrap table { min-width: 980px; }
.grid-wrap td { padding: 4px; height: auto; vertical-align: top; }
.grid-wrap td.n { padding: 10px 8px; color: var(--text-2); text-align: right; }
.grid-wrap input, .grid-wrap select { width: 100%; min-height: 32px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-1); font: inherit; font-size: 13px; }
.grid-wrap tr.bad td.n { color: var(--danger); font-weight: 600; }
.grid-wrap .rowerr td { height: auto; padding: 0 8px 8px; color: var(--danger); font-size: 12px; border-top: 0; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--text-1); font-size: 20px; cursor: pointer; transition: background-color 120ms ease-out; }
.icon-btn:hover { background: var(--surface-2); }
.readonly-bar { padding: 8px 24px; background: var(--warn-weak); border-bottom: 1px solid var(--line); }
.rows { margin: 0 0 16px; }
.rows > div { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rows dt { flex: none; width: 88px; color: var(--text-2); }
.rows dd { margin: 0; flex: 1; min-width: 0; word-break: break-all; }
.section { margin-bottom: 24px; }
.section > h2 { margin-bottom: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-head > h2 { margin: 0; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.acts .full { flex-basis: 100%; }
.act .why { display: block; margin-top: 4px; color: var(--text-2); font-size: 12px; line-height: 18px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 16px; }
.timeline li::before { content: ""; position: absolute; left: -19px; top: 6px; width: 10px; height: 10px; border-radius: 999px; background: var(--line-strong); }
.confirm-box > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.confirm-box b { display: block; margin-bottom: 4px; color: var(--text-2); font-size: 12px; line-height: 18px; }
.secret { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; background: var(--warn-weak); margin: 12px 0; }
.secret code { font-size: 16px; font-weight: 600; letter-spacing: 1px; }

/* ---------- 提示条 ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 8px; background: var(--text-1); color: var(--bg); box-shadow: var(--shadow-float); animation: toast-in 200ms ease-out; }
.toast button { background: none; border: 0; padding: 0; min-height: 24px; color: var(--bg); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 登录页 ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 48px 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 32px; margin: 0; }
.auth .brand { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.auth .btn { width: 100%; }
.org-tree .lv1 { padding-left: 24px; } .org-tree .lv2 { padding-left: 48px; } .org-tree .lv3 { padding-left: 72px; }
.org-row { display: flex; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line); }
.org-row .grow { flex: 1; }

/* ---------- 宽屏：详情抽屉与表格并排，不盖住表格（表格填写、导入这两个宽抽屉照旧盖在上面） ---------- */
@media (min-width: 1440px) {
  body:not(.drawer-over) > .overlay { background: transparent; pointer-events: none; }
  body:not(.drawer-over) > .drawer { top: var(--topbar-h); border-left: 1px solid var(--line); box-shadow: none; }
  body.drawer-open:not(.drawer-over) .main { padding-right: 504px; }
}

/* 电脑上开着设备详情时，遮罩不盖左边导航和顶栏：点导航直接去那一页（详情自动关掉），不用先点一下关详情 */
@media (min-width: 1024px) {
  body:not(.drawer-over) > .overlay { top: var(--topbar-h); left: var(--nav-w); }
}
/* ---------- 屏幕变窄：导航收成一条 ---------- */
@media (max-width: 1199px) and (min-width: 1024px) {
  :root { --nav-w: 72px; }
  .nav { padding: 16px 8px; }
  .nav a { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 0; font-size: 12px; line-height: 18px; min-height: 56px; text-align: center; }
  .nav a.on::before { top: 12px; bottom: 12px; }
  .nav .count { margin: 0; }
}
/* ---------- 平板和手机：导航移到底部，表格变成卡片 ---------- */
@media (max-width: 1023px) {
  .layout { display: block; }
  .nav { display: none; }
  .main { padding: 16px var(--gutter) 88px; }
  .topbar { padding: 0 8px 0 16px; }
  .userbtn .org { display: none; }
  .table-wrap:not(.keep) { display: none; }
  .table-wrap.keep { overflow-x: auto; }
  .desktop-only { display: none; }
  .cards { display: block; }
  .hint-line { display: none; }
  .drawer { width: 100vw; }
  .drawer-head { padding-left: 16px; }
  .drawer-body { padding: 16px; }
  .nums { grid-template-columns: repeat(2, 1fr); margin-bottom: 24px; }
  .num { min-height: 72px; padding: 12px 16px; }
  .chart-head { padding: 16px 16px 0; }
  .chart-body { padding: 16px; }
  .charts { gap: 16px; }
  .legend button, .kv button, .hbar, button.tile { min-height: 44px; }
  .tabs { gap: 0; }                                       /* 手机上设置页 5 个标签要一屏放下，不藏到右边 */
  .tabs a { padding: 0 10px; }
  /* 手机上团队、类型两排小按钮各占一行，放不下就左右滑（最后一个露半截，提示还有），把设备列表往上让 */
  .chips.teams, .chips.types { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
  .chips.teams::-webkit-scrollbar, .chips.types::-webkit-scrollbar { display: none; }
  .filterbar .chips.teams { flex: 1 1 100%; min-width: 0; }
  .chips.teams .chip, .chips.types .chip { flex: none; min-height: 36px; }
  /* 资产页：搜索框和「筛选」按钮并排；状态、项目组、类型收在「筛选」里 */
  .mobile-only { display: inline-flex; }
  .fold-host:not(.filters-open) .m-fold { display: none !important; }
  .fold-host .toolbar .searchbox { flex: 1 1 calc(100% - 96px); min-width: 0; }   /* 第一行：搜索框 + 筛选；展开后其余的换到第二行 */
  .fold-host .toolbar select { flex: 1 1 0; min-width: 0; }
  .btn.mobile-only.on { border-color: var(--brand); color: var(--brand); font-weight: 600; }
  .filterbar .seg { width: 100%; }
  .filterbar .seg a { flex: 1; justify-content: center; min-height: 40px; padding: 0 8px; }
  .searchbox { max-width: none; flex-basis: 100%; }
  .bottom-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 56px; padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); }
  .bottom-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); text-decoration: none; font-size: 12px; line-height: 18px; position: relative; }
  .bottom-tabs a.on { color: var(--brand); font-weight: 600; }
  .bottom-tabs .count { position: absolute; top: 4px; left: 55%; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--warn-weak); color: var(--warn); font-weight: 600; }
  .toasts { bottom: 72px; }
  .btn, .field input, .field select { min-height: 48px; }
  .field input, .field select, .field textarea, .toolbar input, .toolbar select { font-size: 16px; }
  .toolbar input, .toolbar select { min-height: 44px; }
  .todo .btn-row { flex-basis: 100%; }
  .todo .btn-row .btn.primary { flex: 1; }
  .auth .card { padding: 24px; }
  /* 分组汇总在手机上：一组一张卡 */
  .gcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
  .gcard button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text-1); font: inherit; text-align: left; cursor: pointer; }
  .gcard button:first-child { border-top: 0; min-height: 56px; font-weight: 600; }
  .gcard button .ico { color: var(--text-2); }
  .gcard button .nm { flex: 1; min-width: 0; }
  .gcard button .nm small { display: block; color: var(--text-2); font-size: 12px; line-height: 18px; font-weight: 400; }
  .gcard button .n { white-space: nowrap; color: var(--text-2); font-size: 12px; }
  .gcard button .n b { color: var(--text-1); font-size: 14px; margin-right: 2px; }
  .gcard-div { margin: 16px 0 8px; color: var(--text-2); font-size: 12px; line-height: 18px; font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 审批入账：规则说明分条列出；每一行明细的几个格子并排，窄屏自动换行 */
.ap-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 4px; }   /* 窄屏时整块换行，不在半截断开 */
ul.rules { margin: 8px 0 0; padding-left: 20px; }
ul.rules li { margin: 2px 0; }
p.err a { margin-left: 8px; color: inherit; font-weight: 600; }
.ap-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
