/* ============================================================
   学校固定资产管理系统 · 双主题样式（夜间 / 白天）
   纯手写 CSS，无外部字体/图片依赖，内网离线可用

   主题切换：<html data-theme="dark|light">
   字体基准：正文 16px（较上一版整体放大约 15%，照顾年长使用者）
   调整字号只需改下面「字号」一段的变量
   ============================================================ */

:root {
  /* ---------------- 字号（统一在这里调） ---------------- */
  --fs-body: 16px;      /* 正文 */
  --fs-md: 15.5px;      /* 表格单元格、表单控件 */
  --fs-sm: 14px;        /* 次要文字、表单标签 */
  --fs-xs: 13px;        /* 提示、脚注 */
  --fs-cap: 12.5px;     /* 全大写等宽小标签 */

  /* ---------------- 底色 / 背景 ---------------- */
  --bg: #070d19;
  --bg-layer:
    radial-gradient(900px 520px at 12% -8%, rgba(34, 211, 238, .12), transparent 60%),
    radial-gradient(760px 480px at 92% 4%, rgba(139, 92, 246, .14), transparent 62%),
    radial-gradient(900px 700px at 60% 108%, rgba(59, 130, 246, .10), transparent 60%),
    linear-gradient(180deg, #070d1a 0%, #060b16 45%, #050a13 100%);
  --grid-line: rgba(120, 170, 255, .045);

  /* ---------------- 面板 ---------------- */
  --panel-1: rgba(20, 32, 53, .88);
  --panel-2: rgba(10, 17, 30, .88);
  --panel-pure: #0e1728;
  --sub-bg: rgba(13, 23, 40, .62);
  --sub-bg-hover: rgba(24, 44, 70, .82);
  --mark-bg: rgba(12, 22, 38, .82);
  --chip-bg: rgba(12, 22, 38, .62);
  --hm-bg: rgba(8, 16, 29, .66);
  --modal-1: #101b2e;
  --modal-2: #0a1220;

  /* ---------------- 描边 ---------------- */
  --line: rgba(122, 162, 220, .14);
  --line-strong: rgba(122, 172, 255, .28);

  /* ---------------- 文字 ---------------- */
  --text: #e9f0fb;
  --text-strong: #f4f9ff;
  --muted: #a3b8d3;
  --dim: #8ea4c2;

  /* ---------------- 主题色 ---------------- */
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;

  /* 用于「文字」的色值（深色底上偏亮） */
  --ink-blue: #7dd3fc;
  --ink-cyan: #7dd3fc;
  --ink-violet: #c4b5fd;
  --ink-green: #6ee7b7;
  --ink-amber: #fcd34d;
  --ink-red: #fda4af;

  --link: #7dd3fc;
  --link-hover: #a5f3fc;

  /* ---------------- 表单 ---------------- */
  --field-bg: rgba(9, 17, 30, .82);
  --field-bg-focus: rgba(9, 17, 30, .96);
  --field-ph: #8098b8;
  --field-disabled: rgba(20, 30, 46, .75);
  --field-disabled-text: #a3b8d3;
  --option-bg: #0d1729;
  --option-text: #dfeaf8;
  --ring: rgba(34, 211, 238, .16);

  /* ---------------- 表格 ---------------- */
  --th-bg: rgba(23, 37, 60, .8);
  --th-text: #aac0dc;
  --td-text: #dfe9f7;
  --td-line: rgba(122, 162, 220, .12);
  --row-hover: rgba(56, 110, 190, .16);

  /* ---------------- 侧栏 / 顶栏 ---------------- */
  --side-1: rgba(13, 23, 40, .97);
  --side-2: rgba(7, 13, 24, .97);
  --topbar-bg: rgba(8, 15, 27, .82);
  --nav-text: #b3c6de;
  --nav-hover-bg: rgba(56, 110, 190, .18);
  --nav-hover-text: #e3eefc;
  --nav-active-bg: linear-gradient(90deg, rgba(34, 211, 238, .18), rgba(59, 130, 246, .07));
  --nav-active-text: #f0faff;
  --nav-active-border: rgba(34, 211, 238, .3);

  /* ---------------- 阴影 ---------------- */
  --shadow-1: 0 14px 32px rgba(0, 0, 0, .28);
  --shadow-2: 0 22px 50px rgba(0, 0, 0, .38);
  --shadow-3: 0 34px 80px rgba(0, 0, 0, .55);
  --card-shadow: 0 18px 44px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .04);

  /* ---------------- 特殊块 ---------------- */
  --hero-panel:
    radial-gradient(680px 200px at 6% -40%, rgba(34, 211, 238, .22), transparent 70%),
    radial-gradient(520px 220px at 92% 130%, rgba(139, 92, 246, .20), transparent 70%),
    linear-gradient(135deg, rgba(17, 30, 52, .96), rgba(8, 15, 27, .94));
  --hero-grid: rgba(120, 170, 255, .06);
  --donut-hole: radial-gradient(circle at 50% 30%, #101c30, #0a1322);
  --donut-hole-border: rgba(122, 172, 255, .14);
  --num-glow: 0 0 24px rgba(120, 200, 255, .28);
  --brand-title: linear-gradient(100deg, #ffffff 10%, #9fe6f7 55%, #7dd3fc 100%);
  --hero-title: linear-gradient(100deg, #ffffff 20%, #a5e8f7 70%, #7dd3fc 100%);
  --backdrop-bg: rgba(3, 8, 16, .62);
  --selection: rgba(34, 211, 238, .3);

  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;

  color-scheme: dark;
}

/* ============================================================
   白天模式：只换颜色，结构完全一致
   ============================================================ */
html[data-theme="light"] {
  --bg: #eef3fa;
  --bg-layer:
    radial-gradient(900px 520px at 10% -10%, rgba(37, 99, 235, .10), transparent 62%),
    radial-gradient(760px 480px at 92% 0%, rgba(124, 58, 237, .08), transparent 62%),
    linear-gradient(180deg, #f8fbff 0%, #eef3fa 45%, #e7eef8 100%);
  --grid-line: rgba(40, 90, 160, .06);

  --panel-1: #ffffff;
  --panel-2: #fbfdff;
  --panel-pure: #ffffff;
  --sub-bg: #f7faff;
  --sub-bg-hover: #eef4fd;
  --mark-bg: #f4f8ff;
  --chip-bg: #ffffff;
  --hm-bg: rgba(255, 255, 255, .86);
  --modal-1: #ffffff;
  --modal-2: #fbfdff;

  --line: #dce6f3;
  --line-strong: #c4d5ea;

  --text: #17263c;
  --text-strong: #0e1c2e;
  --muted: #4d5f76;
  --dim: #5f7188;

  --cyan: #0891b2;
  --blue: #2563eb;
  --violet: #7c3aed;
  --green: #059669;
  --amber: #b45309;
  --red: #dc2626;

  --ink-blue: #1668b8;
  --ink-cyan: #0e7490;
  --ink-violet: #6d28d9;
  --ink-green: #067a56;
  --ink-amber: #9a6209;
  --ink-red: #be123c;

  --link: #1a5fb4;
  --link-hover: #0b4a94;

  --field-bg: #ffffff;
  --field-bg-focus: #ffffff;
  --field-ph: #8fa0b6;
  --field-disabled: #f1f5f9;
  --field-disabled-text: #5f7188;
  --option-bg: #ffffff;
  --option-text: #17263c;
  --ring: rgba(37, 99, 235, .18);

  --th-bg: #f1f6fd;
  --th-text: #4a5d75;
  --td-text: #22334c;
  --td-line: #e6eef8;
  --row-hover: #eff6ff;

  --side-1: #ffffff;
  --side-2: #f4f9ff;
  --topbar-bg: rgba(255, 255, 255, .9);
  --nav-text: #33465e;
  --nav-hover-bg: #eff5fd;
  --nav-hover-text: #0d2b4d;
  --nav-active-bg: linear-gradient(90deg, #e3f0ff, #f3f9ff);
  --nav-active-text: #0b4a86;
  --nav-active-border: #a9cdf3;

  --shadow-1: 0 8px 20px rgba(30, 64, 120, .07);
  --shadow-2: 0 16px 40px rgba(30, 64, 120, .10);
  --shadow-3: 0 28px 64px rgba(30, 64, 120, .16);
  --card-shadow: 0 10px 28px rgba(30, 64, 120, .08), inset 0 1px 0 #fff;

  --hero-panel: linear-gradient(135deg, #ffffff, #eef5ff 60%, #e9f3ff);
  --hero-grid: rgba(37, 99, 235, .07);
  --donut-hole: radial-gradient(circle at 50% 30%, #ffffff, #f6faff);
  --donut-hole-border: #e2ecf8;
  --num-glow: none;
  --brand-title: linear-gradient(100deg, #0d2a4d 10%, #1a5fb4 58%, #0e7490 100%);
  --hero-title: linear-gradient(100deg, #0f2747 20%, #1b5fc0 70%, #0e7490 100%);
  --backdrop-bg: rgba(16, 40, 70, .38);
  --selection: rgba(37, 99, 235, .18);

  color-scheme: light;
}

* { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 全局背景光晕 + 网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-layer);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

a { text-decoration: none; color: var(--link); }
a:hover { color: var(--link-hover); }

::selection { background: var(--selection); color: var(--text-strong); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ============================================================
   主题切换控件（白天 / 夜间）
   ============================================================ */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--sub-bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}
.theme-switch .ts-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: inherit;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.theme-switch .ts-btn svg { width: 15px; height: 15px; }
.theme-switch .ts-btn:hover { color: var(--text-strong); }
.theme-switch .ts-btn.on {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  color: #fff;
  box-shadow: 0 6px 16px rgba(14, 165, 233, .3);
}
html[data-theme="light"] .theme-switch .ts-btn.on {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  box-shadow: 0 6px 14px rgba(37, 99, 235, .24);
}

/* ============================================================
   登录页 / 安装向导
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  position: relative;
  overflow: hidden;
}

/* 背景放射线 + 扫描光带 */
.login-wrap::before {
  content: "";
  position: absolute;
  width: 1200px; height: 1200px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg,
      rgba(34, 211, 238, .10) 0deg 2deg, transparent 2deg 30deg,
      rgba(59, 130, 246, .08) 30deg 32deg, transparent 32deg 60deg);
  animation: spin 60s linear infinite;
  pointer-events: none;
  opacity: .9;
}
html[data-theme="light"] .login-wrap::before { opacity: .35; }
.login-wrap::after {
  content: "";
  position: absolute;
  left: 0; right: 0; height: 180px;
  top: -200px;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .07), transparent);
  animation: scanDown 7s ease-in-out infinite;
  pointer-events: none;
}

.login-theme { position: absolute; top: 18px; right: 20px; z-index: 6; }

.login-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 26px;
  align-items: stretch;
}
.login-shell > * { min-width: 0; }

/* 左侧品牌区 */
.login-brand {
  padding: 30px 8px 30px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-brand .eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-cap);
  letter-spacing: .26em;
  color: var(--ink-cyan);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.login-brand .eyebrow::before {
  content: "";
  display: inline-block;
  width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  vertical-align: middle;
  margin-right: 10px;
}
.login-brand h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.34;
  margin: 0 0 14px;
  letter-spacing: .5px;
  background: var(--brand-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-brand p.lead {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.95;
  margin-bottom: 22px;
  max-width: 420px;
}
.login-feats { display: grid; gap: 11px; margin-bottom: 22px; }
.login-feat {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.65;
}
.login-feat .fi {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: rgba(34, 211, 238, .12);
  border: 1px solid rgba(34, 211, 238, .28);
  color: var(--ink-cyan);
}
.login-feat .fi svg { width: 15px; height: 15px; }
.login-feat b { color: var(--text-strong); font-weight: 700; }

/* 终端小窗（始终深色，像代码窗口，两种主题都成立） */
.login-term {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 2;
  background: rgba(6, 12, 22, .9);
  border: 1px solid rgba(122, 172, 255, .3);
  border-radius: 12px;
  padding: 13px 15px;
  color: #9dc0dd;
  max-width: 420px;
  box-shadow: inset 0 0 40px rgba(34, 211, 238, .06);
}
.login-term .bar { display: flex; gap: 5px; margin-bottom: 8px; }
.login-term .bar i {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(122, 172, 255, .3);
}
.login-term .bar i:nth-child(1) { background: #f87171; }
.login-term .bar i:nth-child(2) { background: #fbbf24; }
.login-term .bar i:nth-child(3) { background: #34d399; }
.login-term .ok { color: #4ade80; }
.login-term .cmd { color: #7dd3fc; }

/* 右侧登录卡 */
.login-card {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(170deg, var(--panel-1), var(--panel-2));
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  color: var(--text);
}
.login-shell .login-card { max-width: 440px; margin-left: auto; }
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
}
.login-card .card-body { color: var(--text); }

.login-logo {
  width: 62px; height: 62px;
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(34, 211, 238, .18), rgba(59, 130, 246, .22));
  border: 1px solid rgba(34, 211, 238, .38);
  color: var(--ink-cyan);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 0 26px rgba(34, 211, 238, .22), inset 0 0 20px rgba(34, 211, 238, .12);
}
.login-logo svg { width: 30px; height: 30px; }

.login-title { font-size: 20px; font-weight: 700; letter-spacing: .4px; margin-bottom: 6px; color: var(--text-strong); }
.login-sub {
  font-family: var(--font-mono);
  font-size: var(--fs-cap);
  letter-spacing: .16em;
  color: var(--dim);
  text-transform: uppercase;
}

.login-hint {
  background: rgba(59, 130, 246, .1);
  border: 1px dashed rgba(34, 211, 238, .34);
  border-radius: 10px;
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.75;
  padding: 10px 12px;
}

/* 输入框左侧图标 */
.field-ico { position: relative; }
.field-ico > svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--dim);
  pointer-events: none;
}
.field-ico > .form-control { padding-left: 40px; }

/* ============================================================
   布局骨架
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 244px;
  flex: 0 0 244px;
  background: linear-gradient(180deg, var(--side-1), var(--side-2));
  border-right: 1px solid var(--line);
  padding: 18px 13px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 6px 18px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-strong);
  letter-spacing: .3px;
}
.sidebar .brand .dot {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(140deg, rgba(34, 211, 238, .2), rgba(59, 130, 246, .26));
  border: 1px solid rgba(34, 211, 238, .36);
  color: var(--ink-cyan);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px rgba(34, 211, 238, .18);
  flex: 0 0 auto;
}
.sidebar .brand .dot svg { width: 19px; height: 19px; }
.sidebar .brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--dim);
  font-weight: 400;
  margin-top: 3px;
}
.sidebar .nav { gap: 4px; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: 11px;
  color: var(--nav-text);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 3px;
  font-size: 15.5px;
  border: 1px solid transparent;
  position: relative;
  transition: all .16s ease;
}
.sidebar .nav-link .ico {
  width: 22px; text-align: center;
  display: grid; place-items: center;
  color: var(--dim);
}
.sidebar .nav-link .ico svg { width: 18px; height: 18px; }
.sidebar .nav-link:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-text);
  border-color: var(--line-strong);
}
.sidebar .nav-link:hover .ico { color: var(--cyan); }
.sidebar .nav-link.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  font-weight: 700;
  border-color: var(--nav-active-border);
  box-shadow: 0 6px 20px rgba(8, 30, 55, .18);
}
.sidebar .nav-link.active::before {
  content: "";
  position: absolute;
  left: -1px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 3px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}
.sidebar .nav-link.active .ico { color: var(--cyan); }
.sidebar-foot {
  margin-top: 16px; padding: 12px 10px 4px;
  border-top: 1px dashed var(--line-strong);
  font-size: var(--fs-xs);
  color: var(--dim);
  line-height: 1.9;
  font-family: var(--font-mono);
}
.sidebar-foot b { color: var(--text); font-weight: 600; }

.main-area { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
}
.topbar h1 {
  font-size: 19px; font-weight: 700; margin: 0;
  letter-spacing: .4px;
  display: flex; align-items: center; gap: 9px;
  color: var(--text-strong);
}
.topbar h1::before {
  content: "";
  width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  box-shadow: 0 0 10px rgba(34, 211, 238, .6);
}
.topbar .sub {
  font-size: var(--fs-xs); color: var(--dim);
  font-family: var(--font-mono);
  letter-spacing: .04em;
  margin-top: 4px;
  padding-left: 13px;
}
.topbar .clock {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 13px;
  background: var(--chip-bg);
  white-space: nowrap;
}
.topbar .clock .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.topbar-tools { display: flex; align-items: center; gap: 10px; }

.content { padding: 20px 18px 44px; }

@media (max-width: 991.98px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 1045;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-3);
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 14px 12px 64px; }
  .topbar { padding: 10px 14px; }
  .topbar h1 { font-size: 17px; }
  .topbar .clock { display: none; }
  .topbar .sub { display: none; }
  .login-shell { grid-template-columns: 1fr; max-width: 460px; }
  .login-brand { padding: 0 2px; }
  .login-brand h1 { font-size: 24px; }
  .login-feats, .login-term { display: none; }
  .login-wrap { padding: 24px 14px 26px; }
  .login-shell { width: 100%; max-width: 100%; flex: 0 1 100%; }
  .login-shell .login-card { max-width: 460px; width: 100%; margin: 0 auto; }
  .login-theme { top: 10px; right: 10px; }
  .login-theme .ts-btn span { display: none; }
  .login-theme .ts-btn { padding: 5px 9px; }
}

.backdrop {
  display: none;
  position: fixed; inset: 0; background: var(--backdrop-bg); z-index: 1040;
  backdrop-filter: blur(2px);
}
.backdrop.show { display: block; }

/* ============================================================
   面板 / 卡片
   ============================================================ */
.card-box {
  background: linear-gradient(165deg, var(--panel-1), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(8px);
  position: relative;
}
.card-box > .card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.card-box > .card-head h2 {
  font-size: 16px; font-weight: 700; margin: 0;
  letter-spacing: .3px;
  color: var(--text-strong);
  display: flex; align-items: center; gap: 9px;
  flex-wrap: wrap;
}
.card-box > .card-head h2::before {
  content: "";
  width: 3px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), transparent);
  box-shadow: 0 0 8px rgba(34, 211, 238, .5);
}
.card-box > .card-head h2 small {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--dim);
  font-weight: 400;
  text-transform: uppercase;
}
.card-box > .card-body { padding: 18px; }
/* 等高卡片时，让内容在竖直方向居中，避免底部大片留白 */
.card-box.h-100 { display: flex; flex-direction: column; }
.card-box.h-100 > .card-body { flex: 1 1 auto; }
.card-box > .card-body.panel-center { display: flex; flex-direction: column; justify-content: center; }
.card-box > .card-body.panel-center > .donut-wrap { width: 100%; }

/* 统计卡片 */
.stat-card {
  background: linear-gradient(160deg, var(--panel-1), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 17px 18px 16px;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  --accent: var(--blue);
  --accent-soft: rgba(59, 130, 246, .28);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .9;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -46px; top: -46px;
  width: 132px; height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  pointer-events: none;
}
html[data-theme="light"] .stat-card::after { opacity: .5; }
.stat-card .label {
  font-size: var(--fs-cap);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.stat-card .value {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.12;
  color: var(--text-strong);
  letter-spacing: -.02em;
  text-shadow: var(--num-glow);
}
.stat-card .unit {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--dim);
  margin-left: 4px;
  letter-spacing: 0;
}
.stat-card .mark {
  position: absolute; right: 14px; top: 14px;
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--mark-bg);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  box-shadow: 0 0 16px var(--accent-soft);
}
.stat-card .mark svg { width: 18px; height: 18px; }
.stat-card .foot {
  margin-top: 9px;
  font-size: var(--fs-xs);
  color: var(--dim);
  display: flex; align-items: center; gap: 7px;
}
.stat-card .foot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); flex: 0 0 auto; }
.stat-card.blue { --accent: #38bdf8; --accent-soft: rgba(56, 189, 248, .3); }
.stat-card.green { --accent: #34d399; --accent-soft: rgba(52, 211, 153, .28); }
.stat-card.amber { --accent: #d97706; --accent-soft: rgba(251, 191, 36, .3); }
.stat-card.violet { --accent: #8b5cf6; --accent-soft: rgba(167, 139, 250, .3); }
.stat-card.gray { --accent: #64748b; --accent-soft: rgba(148, 163, 184, .24); }

/* 顶部横幅 */
.dash-hero {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  padding: 22px 24px;
  margin-bottom: 16px;
  overflow: hidden;
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between;
  background: var(--hero-panel);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.dash-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(100deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(100deg, #000, transparent 70%);
  pointer-events: none;
}
.dash-hero .hero-left { position: relative; z-index: 1; min-width: 270px; }
.dash-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-cap);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-cyan);
  margin-bottom: 9px;
}
.dash-hero h2 {
  font-size: 25px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: .5px;
  background: var(--hero-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dash-hero .desc { font-size: var(--fs-sm); color: var(--muted); line-height: 1.85; }
.dash-hero .desc b { color: var(--text); font-weight: 700; }

.hero-side {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.hero-metrics { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.hero-metrics .hm {
  min-width: 136px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--hm-bg);
  backdrop-filter: blur(6px);
}
.hero-metrics .hm-v {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -.01em;
}
.hero-metrics .hm-l {
  display: block;
  font-size: var(--fs-cap);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 4px;
  font-family: var(--font-mono);
}
/* 环形图 */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-wrap .donut-legend { min-width: 0; }
.donut {
  width: 148px; height: 148px;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
  display: grid; place-items: center;
  background: conic-gradient(var(--c1, #38bdf8) 0 var(--p1, 60%), var(--c2, #34d399) var(--p1, 60%) 100%);
  box-shadow: 0 0 34px rgba(56, 189, 248, .16);
}
html[data-theme="light"] .donut { box-shadow: 0 8px 22px rgba(30, 64, 120, .12); }
.donut::after {
  content: "";
  position: absolute; inset: 15px;
  border-radius: 50%;
  background: var(--donut-hole);
  border: 1px solid var(--donut-hole-border);
}
.donut .donut-center { position: relative; z-index: 2; text-align: center; }
.donut .dc-v {
  font-family: var(--font-mono);
  font-size: 24px; font-weight: 700; color: var(--text-strong); line-height: 1.1;
}
.donut .dc-l { font-size: 12.5px; color: var(--dim); letter-spacing: .08em; margin-top: 3px; }
.donut-legend { display: grid; gap: 10px; flex: 1 1 140px; }
.donut-legend .lg {
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap;
  font-size: var(--fs-sm); color: var(--text);
}
.donut-legend .lg i {
  width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto;
  box-shadow: 0 0 10px currentColor;
}
.donut-legend .lg .num {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-strong);
  font-size: 15px;
}

/* 条形图 */
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 120px) 1fr auto; gap: 11px; align-items: center; }
.bar-row .bl {
  font-size: var(--fs-sm); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-row .bt {
  height: 9px; border-radius: 6px;
  background: rgba(122, 172, 255, .18);
  overflow: hidden;
  border: 1px solid var(--line);
}
html[data-theme="light"] .bar-row .bt { background: #e8f0fb; }
.bar-row .bf {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #22d3ee, #3b82f6 60%, #8b5cf6);
  box-shadow: 0 0 14px rgba(56, 189, 248, .4);
  width: 0;
  animation: barGrow .9s cubic-bezier(.2, .7, .3, 1) forwards;
}
.bar-row .bv {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  min-width: 72px;
  text-align: right;
  white-space: nowrap;
}
.chart-empty { font-size: var(--fs-sm); color: var(--dim); padding: 16px 0; }

/* 快捷操作 */
.quick-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sub-bg);
  color: var(--text);
  transition: all .18s ease;
  height: 100%;
  font-size: 15px;
  position: relative;
  overflow: hidden;
}
.quick-btn:hover {
  border-color: var(--line-strong);
  background: var(--sub-bg-hover);
  color: var(--text-strong);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.quick-btn .qi {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(34, 211, 238, .12);
  border: 1px solid rgba(34, 211, 238, .26);
  display: grid; place-items: center;
  color: var(--ink-cyan);
  flex: 0 0 auto;
}
.quick-btn .qi svg { width: 17px; height: 17px; }
.quick-btn small { display: block; font-size: var(--fs-cap); color: var(--dim); margin-top: 2px; }

/* 帮助与文档入口（仪表盘） */
.doc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 10px; }
.doc-tile {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 14px;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sub-bg);
  color: var(--text);
  transition: all .18s ease;
}
.doc-tile:hover {
  border-color: var(--line-strong);
  background: var(--sub-bg-hover);
  color: var(--text-strong);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.doc-tile .dt-ico {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(34, 211, 238, .12);
  border: 1px solid rgba(34, 211, 238, .26);
  display: grid; place-items: center;
  color: var(--ink-cyan);
  flex: 0 0 auto;
}
.doc-tile .dt-ico svg { width: 17px; height: 17px; }
.doc-tile .dt-main { flex: 1 1 auto; min-width: 0; }
.doc-tile .dt-title {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 15px; font-weight: 600; color: var(--text-strong);
}
.doc-tile .dt-who {
  font-style: normal; font-weight: 500;
  font-size: var(--fs-cap); letter-spacing: .04em;
  padding: 1px 7px; border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--hm-bg);
  color: var(--muted);
}
.doc-tile .dt-desc {
  display: block; margin-top: 5px;
  font-size: var(--fs-xs); color: var(--dim); line-height: 1.7;
}
.doc-tile .dt-go {
  flex: 0 0 auto; color: var(--dim); font-size: 15px;
  transition: transform .18s ease, color .18s ease;
}
.doc-tile:hover .dt-go { color: var(--ink-cyan); transform: translateX(3px); }

/* 大额数字块 */
.value-block .vb-label {
  font-family: var(--font-mono);
  font-size: var(--fs-cap); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.value-block .vb-num {
  font-family: var(--font-mono);
  font-size: 31px; font-weight: 700; letter-spacing: -.02em;
  color: var(--text-strong);
  text-shadow: var(--num-glow);
  line-height: 1.18;
  word-break: break-all;
}
.value-block .vb-num .cur { font-size: 17px; color: var(--ink-cyan); margin-right: 4px; }
.value-block .vb-note { font-size: var(--fs-xs); color: var(--dim); margin-top: 8px; line-height: 1.7; }
.vb-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line-strong); }
.vb-split .vs-k { font-size: var(--fs-xs); color: var(--dim); }
.vb-split .vs-v { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--text); margin-top: 3px; }

/* 原值构成条 */
.value-bar { margin-top: 16px; }
.value-bar .vb-track {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(122, 172, 255, .14);
  border: 1px solid var(--line);
}
html[data-theme="light"] .value-bar .vb-track { background: #e8f0fb; }
.value-bar .seg-1 { background: linear-gradient(90deg, #22d3ee, #38bdf8); }
.value-bar .seg-2 { background: linear-gradient(90deg, #34d399, #10b981); }
.value-bar .vb-legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 10px; font-size: var(--fs-xs); color: var(--muted);
}
.value-bar .vb-legend i {
  width: 9px; height: 9px; border-radius: 3px;
  display: inline-block; margin-right: 5px;
  vertical-align: middle;
}
.value-bar .vb-legend b { color: var(--text); font-family: var(--font-mono); font-weight: 700; }

/* 系统状态标签 */
.status-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; padding-top: 13px;
  border-top: 1px dashed var(--line-strong);
}
.status-chips .chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: var(--fs-cap);
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--sub-bg);
  font-family: var(--font-mono);
  letter-spacing: .02em;
}
.status-chips .chip b { color: var(--text); font-weight: 600; }
.status-chips .chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
}

/* ============================================================
   表格
   ============================================================ */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--td-text);
  --bs-table-border-color: var(--td-line);
  --bs-table-hover-bg: var(--row-hover);
  --bs-table-hover-color: var(--text-strong);
  font-size: var(--fs-md);
  margin-bottom: 0;
  color: var(--td-text);
}
.table > thead > tr > th {
  background: var(--th-bg);
  color: var(--th-text);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
  padding: 12px 9px;
}
.table > tbody > tr > td {
  padding: 11px 9px;
  vertical-align: middle;
  border-color: var(--td-line);
  color: var(--td-text);
}
.table-hover > tbody > tr:hover > td { background: var(--row-hover); }
.table-sm > :not(caption) > * > * { padding: 8px 10px; }
.table-scroll { overflow-x: auto; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

/* 导入预览：重复行的「更新 / 跳过」选择区 */
.dup-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  background: rgba(34, 211, 238, .08);
  border: 1px solid rgba(34, 211, 238, .28);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.dup-tip-ico { font-size: 14px; }
.dup-tip b { color: var(--ink-cyan); }
.dup-tip .btn { margin-left: auto; }
.dup-tip .btn + .btn { margin-left: 0; }

.dup-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  vertical-align: middle;
}
.dup-seg .dup-btn {
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 2px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.dup-seg .dup-btn + .dup-btn { border-left: 1px solid var(--line); }
.dup-seg .dup-btn:hover { color: var(--text); background: var(--row-hover); }
.dup-seg .dup-btn.is-on { font-weight: 600; }
.dup-seg .dup-btn[data-act="update"].is-on {
  background: rgba(34, 211, 238, .18);
  color: var(--ink-cyan);
}
.dup-seg .dup-btn[data-act="skip"].is-on {
  background: rgba(148, 163, 184, .2);
  color: var(--text);
}
.dup-old { font-size: 12px; margin-top: 3px; }
.dup-dash { font-size: 12.5px; }
.table-import > tbody > tr.is-update > td { background: rgba(34, 211, 238, .06); }

/* 窄屏不挤压列，改为横向滚动 */
.table-assets { min-width: 1088px; }
.table-assets > thead > tr > th:nth-child(2), .table-assets > tbody > tr > td:nth-child(2) { min-width: 200px; }
.table-assets > thead > tr > th:nth-child(3), .table-assets > tbody > tr > td:nth-child(3) { min-width: 86px; }
.table-assets > thead > tr > th:nth-child(7), .table-assets > tbody > tr > td:nth-child(7) { min-width: 110px; }
.table-assets > thead > tr > th:nth-child(8), .table-assets > tbody > tr > td:nth-child(8) { min-width: 76px; }
.table-assets > thead > tr > th:nth-child(9), .table-assets > tbody > tr > td:nth-child(9) { min-width: 88px; white-space: nowrap; }
.table-assets > thead > tr > th:nth-child(10), .table-assets > tbody > tr > td:nth-child(10) { min-width: 56px; }
.table-places { min-width: 900px; }
.table-logs { min-width: 1000px; }
.table-actions { white-space: nowrap; }
/* 关键列给最小宽度，避免中文被拆成一字一行 */
.table-actions .btn { padding: 5px 8px; margin: 2px 1px 2px 0; }

.badge-soft {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: var(--fs-cap);
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-valuable { background: rgba(56, 189, 248, .16); color: var(--ink-blue); border-color: rgba(56, 189, 248, .34); }
.badge-low { background: rgba(52, 211, 153, .16); color: var(--ink-green); border-color: rgba(52, 211, 153, .34); }
.badge-inuse { background: rgba(52, 211, 153, .16); color: var(--ink-green); border-color: rgba(52, 211, 153, .34); }
.badge-scrap { background: rgba(251, 113, 133, .16); color: var(--ink-red); border-color: rgba(251, 113, 133, .34); }
.badge-move { background: rgba(139, 92, 246, .16); color: var(--ink-violet); border-color: rgba(139, 92, 246, .34); }
.badge-num { background: rgba(251, 191, 36, .18); color: var(--ink-amber); border-color: rgba(251, 191, 36, .36); }
.badge-place { background: rgba(148, 163, 184, .18); color: var(--muted); border-color: rgba(148, 163, 184, .3); }

/* 资产大类徽章：教学=蓝 / 办公=青 / 其他=灰，自建大类按顺位轮换这三种色调 */
.badge-group-teach,
.badge-group-x0 { background: rgba(56, 189, 248, .16); color: var(--ink-blue); border-color: rgba(56, 189, 248, .34); }
.badge-group-office,
.badge-group-x1 { background: rgba(139, 92, 246, .16); color: var(--ink-violet); border-color: rgba(139, 92, 246, .34); }
.badge-group-other,
.badge-group-x2 { background: rgba(148, 163, 184, .18); color: var(--muted); border-color: rgba(148, 163, 184, .32); }

/* 列表里的「大类 + 小类」：徽章与后面的文字留一点间距 */
.an-sub .badge-soft { margin-right: 6px; vertical-align: 1px; }

html[data-theme="light"] .badge-valuable { background: #e0f2fe; border-color: #bae6fd; }
html[data-theme="light"] .badge-low,
html[data-theme="light"] .badge-inuse { background: #dcfce7; border-color: #bbf7d0; }
html[data-theme="light"] .badge-scrap { background: #ffe4e6; border-color: #fecdd3; }
html[data-theme="light"] .badge-move { background: #ede9fe; border-color: #ddd6fe; }
html[data-theme="light"] .badge-num { background: #fef3c7; border-color: #fde68a; }
html[data-theme="light"] .badge-place { background: #f1f5f9; border-color: #e2e8f0; }
html[data-theme="light"] .badge-group-teach,
html[data-theme="light"] .badge-group-x0 { background: #e0f2fe; border-color: #bae6fd; }
html[data-theme="light"] .badge-group-office,
html[data-theme="light"] .badge-group-x1 { background: #ede9fe; border-color: #ddd6fe; }
html[data-theme="light"] .badge-group-other,
html[data-theme="light"] .badge-group-x2 { background: #f1f5f9; border-color: #e2e8f0; }

/* ===== 资产分类维护卡片（大类 + 小类） ===== */
.cat-groups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.cat-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px 11px;
}
.cat-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.cat-group-head .g-name { font-weight: 700; color: var(--text-strong); font-size: 14.5px; }
.cat-group-head .g-meta { font-size: var(--fs-cap); color: var(--muted); }
.cat-group-head .g-ops { margin-left: auto; display: flex; gap: 6px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 3px 10px;
  border-radius: 20px;
  font-size: var(--fs-cap);
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .12);
  color: var(--text);
}
.cat-chip .cc-del {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  font-size: 13px;
}
.cat-chip .cc-del:hover { color: #f87171; }
.cat-chip.is-empty { border-style: dashed; color: var(--muted); padding-right: 10px; }
@media (max-width: 575.98px) {
  .cat-groups { grid-template-columns: 1fr; }
}

.asset-id {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-cyan);
  letter-spacing: .02em;
  font-size: var(--fs-md);
}
.text-dim { color: var(--dim) !important; }
.text-danger { color: var(--ink-red) !important; }
.text-success { color: var(--ink-green) !important; }
.text-warning { color: var(--ink-amber) !important; }
.text-primary { color: var(--ink-blue) !important; }

/* 工具栏 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 140px; }
.filter-bar .form-label { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 4px; letter-spacing: .02em; }

/* 结果行里的「每页 X 条」下拉：就地嵌在统计文字中，不改整体行高 */
.per-inline { display: inline-flex; align-items: center; gap: 5px; }
.per-form { display: inline-flex; align-items: center; margin: 0; }
.per-inline .per-select {
  /* 宽度由内容决定 + 左右内边距对称：即使浏览器不支持 select 居中，数字也天然居中 */
  display: inline-block; width: auto; min-width: 0;
  padding: 1px 30px;
  height: 26px; line-height: 24px; font-size: var(--fs-sm);
  border-radius: 7px;
  text-align: center;
  text-align-last: center;
  -moz-text-align-last: center;
  vertical-align: middle;
}
.per-inline b { color: var(--text-strong); font-weight: 600; }

/* 可折叠卡片标题：整条标题可点，右侧箭头指示展开 / 收起 */
.card-fold {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
  text-align: left;
}
.card-fold:hover { color: var(--ink-cyan); }
.card-fold:focus-visible { outline: 2px solid var(--ink-cyan); outline-offset: 3px; border-radius: 4px; }
.card-fold .fold-icon {
  display: inline-block; width: 14px; text-align: center;
  font-size: 10px; color: var(--dim);
  transition: transform .18s ease;
}
.card-fold[aria-expanded="true"] .fold-icon { transform: rotate(90deg); color: var(--ink-cyan); }
.card-fold .fold-hint { font-size: var(--fs-xs); color: var(--dim); font-weight: 400; }
.card-fold[aria-expanded="true"] .fold-hint { display: none; }

/* 地点选择器（楼栋 / 类型 / 关键字筛选） */
.place-picker .pp-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 7px; }
.place-picker .pp-bar .pp-building { width: 140px; }
.place-picker .pp-bar .pp-floor { width: 108px; }
.place-picker .pp-bar .pp-type { width: 128px; }
.place-picker .pp-bar .pp-kw { flex: 1 1 180px; width: auto; min-width: 150px; }
.place-picker .pp-hint { font-size: var(--fs-xs); color: var(--dim); }
.place-picker .pp-hint b { color: var(--ink-cyan); }
@media (max-width: 575.98px) {
  .place-picker .pp-bar > * { width: 100% !important; }
}

/* 弹窗内信息块 */
.info-box {
  background: rgba(56, 110, 190, .1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.75;
}
html[data-theme="light"] .info-box { background: #f4f8fe; }
.info-box b { color: var(--text-strong); }
.num-preview {
  background: rgba(34, 211, 238, .08);
  border-color: rgba(34, 211, 238, .3);
  font-family: var(--font-mono);
  cursor: default;
}
.num-preview b { color: var(--ink-cyan); }

/* ============================================================
   表单
   ============================================================ */
.form-control, .form-select {
  border-radius: 9px;
  font-size: var(--fs-md);
  padding: 8px 12px;
  background-color: var(--field-bg);
  border-color: var(--line-strong);
  color: var(--text);
}
.form-control::placeholder { color: var(--field-ph); }
.form-control:focus, .form-select:focus {
  background-color: var(--field-bg-focus);
  border-color: var(--cyan);
  color: var(--text-strong);
  box-shadow: 0 0 0 .2rem var(--ring);
}
.form-control[readonly], .form-control:disabled, .form-select:disabled {
  background-color: var(--field-disabled);
  color: var(--field-disabled-text);
  border-color: var(--line);
}
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2389a4c8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.form-select option, .form-select optgroup {
  background: var(--option-bg);
  color: var(--option-text);
}
.form-select optgroup { color: var(--ink-cyan); font-style: normal; }
.form-label { font-size: var(--fs-sm); font-weight: 700; color: var(--text); margin-bottom: 6px; letter-spacing: .02em; }
.form-text { font-size: var(--fs-xs); color: var(--dim); }
.form-check-input {
  background-color: var(--field-bg);
  border-color: var(--line-strong);
}
.form-check-input:checked { background-color: #0ea5e9; border-color: var(--cyan); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem var(--ring); }
.form-check-label { color: var(--text); font-size: var(--fs-md); }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(.75); cursor: pointer; }
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: none; }
input[type="number"] { font-family: var(--font-mono); }

/* 文件上传控件（浏览器默认按钮是浅色的，需要跟着主题走） */
input[type="file"].form-control {
  color: var(--text);
  padding: 7px 11px;
  font-size: var(--fs-sm);
}
input[type="file"]::file-selector-button {
  background: rgba(56, 189, 248, .14);
  border: 1px solid rgba(56, 189, 248, .35);
  color: var(--ink-cyan);
  border-radius: 7px;
  padding: 6px 14px;
  margin-right: 12px;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all .16s ease;
}
input[type="file"]::file-selector-button:hover {
  background: rgba(56, 189, 248, .26);
  border-color: rgba(56, 189, 248, .6);
  color: var(--text-strong);
}
input[type="file"]::-webkit-file-upload-button {
  background: rgba(56, 189, 248, .14);
  border: 1px solid rgba(56, 189, 248, .35);
  color: var(--ink-cyan);
  border-radius: 7px;
  padding: 6px 14px;
  margin-right: 12px;
  font-size: var(--fs-sm);
  cursor: pointer;
}
html[data-theme="light"] input[type="file"]::file-selector-button,
html[data-theme="light"] input[type="file"]::-webkit-file-upload-button {
  background: #eaf3ff;
  border-color: #bcd7f5;
  color: #1a5fb4;
}

/* ============================================================
   按钮
   ============================================================ */
.btn { border-radius: 9px; font-size: 15px; border-width: 1px; }
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  border-color: rgba(34, 211, 238, .5);
  color: #fff;
  box-shadow: 0 8px 22px rgba(14, 165, 233, .26), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  border-color: rgba(34, 211, 238, .8);
  color: #fff;
  box-shadow: 0 10px 28px rgba(34, 211, 238, .3);
}
.btn-outline-primary {
  color: var(--ink-blue);
  border-color: rgba(56, 189, 248, .42);
  background: rgba(56, 189, 248, .08);
}
.btn-outline-primary:hover {
  background: rgba(56, 189, 248, .2);
  border-color: rgba(56, 189, 248, .7);
  color: var(--text-strong);
}
html[data-theme="light"] .btn-outline-primary:hover { color: #0b4a94; }
.btn-outline-secondary {
  color: var(--muted);
  border-color: var(--line-strong);
  background: var(--sub-bg);
}
.btn-outline-secondary:hover {
  background: var(--sub-bg-hover);
  border-color: var(--cyan);
  color: var(--text-strong);
}
.btn-outline-danger {
  color: var(--ink-red);
  border-color: rgba(251, 113, 133, .4);
  background: rgba(251, 113, 133, .08);
}
.btn-outline-danger:hover {
  background: rgba(251, 113, 133, .2);
  border-color: rgba(251, 113, 133, .7);
  color: var(--ink-red);
}
html[data-theme="light"] .btn-outline-danger:hover { color: #9f1239; }
.btn-outline-success {
  color: var(--ink-green);
  border-color: rgba(52, 211, 153, .45);
  background: rgba(52, 211, 153, .08);
}
.btn-outline-success:hover {
  background: rgba(52, 211, 153, .2);
  border-color: rgba(52, 211, 153, .75);
  color: var(--ink-green);
}
html[data-theme="light"] .btn-outline-success { color: #047857; border-color: #6ee7b7; background: #ecfdf5; }
html[data-theme="light"] .btn-outline-success:hover { color: #065f46; border-color: #34d399; background: #d1fae5; }
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: rgba(52, 211, 153, .55);
  color: #fff;
  box-shadow: 0 8px 22px rgba(16, 185, 129, .24);
}
.btn-success:hover { background: linear-gradient(135deg, #34d399, #047857); color: #fff; }
.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border-color: rgba(251, 113, 133, .55);
  color: #fff;
  box-shadow: 0 8px 22px rgba(244, 63, 94, .24);
}
.btn-danger:hover { background: linear-gradient(135deg, #fb7185, #be123c); color: #fff; }
.btn:disabled, .btn.disabled { opacity: .5; box-shadow: none; }
.btn-sm { font-size: var(--fs-xs); padding: 5px 11px; border-radius: 8px; }
.btn-lg { border-radius: 11px; font-size: 16px; padding: 11px 20px; }
.btn-close { filter: invert(1) grayscale(1) brightness(1.8); opacity: .65; }
.btn-close:hover { opacity: 1; }
html[data-theme="light"] .btn-close { filter: none; opacity: .5; }

/* ============================================================
   弹窗
   ============================================================ */
.modal-content {
  background: linear-gradient(175deg, var(--modal-1), var(--modal-2));
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  color: var(--text);
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { letter-spacing: .3px; font-size: 18px; color: var(--text-strong); }
.modal-body { font-size: var(--fs-md); }
.modal-backdrop.show { opacity: .72; }
.modal hr { border-color: var(--line); opacity: 1; }

/* ============================================================
   提示 / 徽标 / 分页
   ============================================================ */
.alert {
  border-radius: 11px;
  font-size: var(--fs-sm);
  border-width: 1px;
  padding: 11px 14px;
}
.alert-warning { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .36); color: var(--ink-amber); }
.alert-danger { background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .36); color: var(--ink-red); }
.alert-success { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .34); color: var(--ink-green); }
.alert-info { background: rgba(56, 189, 248, .12); border-color: rgba(56, 189, 248, .34); color: var(--ink-blue); }
.alert code, .alert .code { color: var(--ink-cyan); }
html[data-theme="light"] .alert-warning { background: #fffbeb; border-color: #fde68a; }
html[data-theme="light"] .alert-danger { background: #fff1f2; border-color: #fecdd3; }
html[data-theme="light"] .alert-success { background: #f0fdf4; border-color: #bbf7d0; }
html[data-theme="light"] .alert-info { background: #f0f9ff; border-color: #bae6fd; }

.pagination { --bs-pagination-bg: var(--sub-bg); --bs-pagination-border-color: var(--line); }
.page-link {
  background: var(--sub-bg);
  border-color: var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 7px 12px;
}
.page-link:hover { background: var(--sub-bg-hover); color: var(--text-strong); border-color: var(--line-strong); }
.page-item.active .page-link {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  border-color: rgba(34, 211, 238, .5);
  color: #fff;
}
.page-item.disabled .page-link { background: var(--sub-bg); color: var(--dim); border-color: var(--line); opacity: .6; }

.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 1080; }
.toast {
  background: var(--panel-pure);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--cyan);
  color: var(--text);
  border-radius: 11px;
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(10px);
  font-size: var(--fs-sm);
}
.toast.text-bg-success { border-left-color: var(--green); background: var(--panel-pure); }
.toast.text-bg-danger { border-left-color: var(--red); background: var(--panel-pure); }
.toast.text-bg-warning { border-left-color: var(--amber); background: var(--panel-pure); }
.toast.text-bg-success .toast-body { color: var(--ink-green); }
.toast.text-bg-danger .toast-body { color: var(--ink-red); }
.toast.text-bg-warning .toast-body { color: var(--ink-amber); }
.toast .toast-body { padding: 11px 13px; }

/* 安装向导里的 Bootstrap 卡片 */
.card {
  background: linear-gradient(170deg, var(--panel-1), var(--panel-2));
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 18px;
  box-shadow: var(--shadow-3);
}
.card-body { color: var(--text); }
h4, h5, h6 { color: var(--text-strong); }

/* ============================================================
   扫码页（手机优先，保持浅色，户外更清晰；不随主题变化）
   ============================================================ */
.scan-body {
  background: #eef4fc;
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: #1f2937;
  -webkit-text-size-adjust: 100%;
}
.scan-body::before, .scan-body::after { display: none; }
.scan-body { min-height: 100vh; }
.scan-wrap { max-width: 640px; margin: 0 auto; padding: 14px 12px 34px; }
.scan-head {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
}
.scan-head .loc { font-size: 19px; font-weight: 700; line-height: 1.45; }
.scan-head .sub { font-size: 14px; opacity: .95; margin-top: 7px; line-height: 1.55; }
.scan-head .tag {
  display: inline-block; background: rgba(255,255,255,.22);
  border-radius: 20px; padding: 3px 12px; font-size: 13px; margin-top: 9px;
}
.scan-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 15px;
  margin-bottom: 12px;
  box-shadow: 0 3px 14px rgba(15, 23, 42, .05);
}
.scan-card h3 { font-size: 17px; font-weight: 700; margin: 0 0 10px; color: #1f2937; }
/* 显示模式切换条：独立于「资产清单」卡片之外，位于地点头图下方 */
.scan-mode-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e6eefb; border-radius: 14px;
  padding: 10px 14px; margin-bottom: 12px;
  box-shadow: 0 3px 14px rgba(15, 23, 42, .05);
}
.scan-mode-bar .mb-t { font-size: 14.5px; font-weight: 700; color: #1f2937; }
.scan-mode-bar .mb-h { font-size: 12.5px; color: #8a99ad; margin-top: 2px; line-height: 1.5; }
.scan-mode { display: inline-flex; background: #eef4ff; border: 1px solid #dbeafe; border-radius: 20px; padding: 2px; flex: 0 0 auto; }
.scan-mode .sm-btn {
  display: inline-block; padding: 5px 16px; border-radius: 18px;
  font-size: 14px; font-weight: 700; color: #64748b; text-decoration: none;
}
.scan-mode .sm-btn.on { background: #2563eb; color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.25); }
/* 数量与价格（右侧一列，右对齐） */
.scan-item .amt { text-align: right; flex: 0 0 auto; }
.scan-item .qty { font-size: 16px; font-weight: 700; color: #1d4ed8; white-space: nowrap; }
.scan-item .price { font-size: 13.5px; color: #64748b; margin-top: 3px; white-space: nowrap; }
.scan-item {
  padding: 14px 0;
  border-bottom: 1px dashed #e8eef8;
}
.scan-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.scan-item .row1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.scan-item .name { font-size: 17px; font-weight: 700; color: #1f2937; line-height: 1.4; }
.scan-item .meta { font-size: 14.5px; color: #475569; margin-top: 6px; line-height: 1.7; }
.scan-item .meta .dot { color: #9aa8bb; margin: 0 3px; }
.scan-item .qty { font-size: 16px; font-weight: 700; color: #1d4ed8; white-space: nowrap; }
.scan-item .go { font-size: 14.5px; color: #2563eb; font-weight: 700; white-space: nowrap; }
.scan-sum {
  background: #fff; border-radius: 14px; padding: 14px 16px;
  font-size: 14.5px; color: #475569; line-height: 2;
}
.scan-sum b { color: #1d4ed8; }
.scan-tip { text-align: center; font-size: 13px; color: #8a99ad; margin-top: 16px; line-height: 1.8; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #eef2f9; font-size: 15.5px; color: #1f2937; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: #4b5563; font-size: 14.5px; flex: 0 0 auto; }
.kv .v { font-weight: 700; text-align: right; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid #e2e8f5; margin-left: 5px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 3px;
  width: 9px; height: 9px; border-radius: 50%; background: #2563eb; border: 2px solid #fff;
}
.timeline .t { font-size: 13.5px; color: #64748b; }
.timeline .d { font-size: 15px; margin-top: 3px; line-height: 1.6; }

/* 扫码页的编号与徽标：固定使用浅色底上的深色配色（后台主题变量在此不适用），并统一放大 */
.scan-body .asset-id {
  font-family: Consolas, "Courier New", monospace;
  font-size: 15.5px;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: .02em;
}
.scan-item .asset-id {
  display: inline-block;
  background: #eef4ff;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  padding: 1px 8px;
  margin-right: 2px;
  font-size: 15px;
}
.scan-body .badge-soft {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  padding: 3px 12px;
  vertical-align: 1px;
}
.scan-body .badge-valuable { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.scan-body .badge-low,
.scan-body .badge-inuse { background: #dcfce7; color: #166534; border-color: #86efac; }
.scan-body .badge-scrap { background: #ffe4e6; color: #9f1239; border-color: #fda4af; }

/* ============================================================
   二维码页
   ============================================================ */
.qr-box {
  text-align: center;
  padding: 16px 14px 12px;
  background: #fff;
  border-radius: 14px;
  color: #1f2937;
}
.qr-box canvas { max-width: 100%; height: auto; image-rendering: pixelated; border-radius: 6px; }
.qr-box .qr-brand { font-size: 13px; color: #475569; margin-bottom: 2px; }
.qr-title { font-size: 16px; font-weight: 700; margin-top: 10px; color: #111827; }
.qr-url { font-size: 12px; color: #94a3b8; word-break: break-all; overflow-wrap: anywhere; margin-top: 4px; line-height: 1.7; }

/* 打印：只打印二维码 */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .content { padding: 0; }
  .card-box { background: #fff; border: 0; box-shadow: none; }
  .qr-box { background: #fff; }
  .qr-box canvas { width: 300px !important; }
}

/* ============================================================
   动效
   ============================================================ */
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes scanDown {
  0% { top: -200px; opacity: 0; }
  35% { opacity: 1; }
  100% { top: 105%; opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.7); }
}
@keyframes barGrow { from { width: 0; } }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.rise { animation: riseIn .5s ease both; }

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

/* ============================================================
   响应式收尾
   ============================================================ */
@media (max-width: 991.98px) {
  .hero-side { align-items: flex-start; width: 100%; }
  .hero-metrics { justify-content: flex-start; }
  .donut-wrap { flex-wrap: wrap; gap: 18px; }
  .dash-hero { padding: 18px; }
  .dash-hero h2 { font-size: 22px; }
}
@media (max-width: 575.98px) {
  .stat-card .value { font-size: 29px; }
  .value-block .vb-num { font-size: 26px; }
  .theme-switch .ts-btn { padding: 5px 10px; font-size: 12.5px; }
  .theme-switch .ts-btn svg { width: 14px; height: 14px; }
  .topbar .theme-switch .ts-btn span { display: none; }
  .topbar .theme-switch .ts-btn { padding: 5px 9px; }
  .topbar-tools { gap: 6px; }
  .topbar .clock { display: none; }
}

/* ============================================================
   地点类型字典 / 账号管理
   ============================================================ */
.table-types { min-width: 560px; }
.table-types > tbody > tr > td:first-child { font-size: var(--fs-md); }

.table-admins { min-width: 840px; }
.table-admins > thead > tr > th:nth-child(2),
.table-admins > tbody > tr > td:nth-child(2) { min-width: 130px; }

/* 仪表盘上的「管理账号」跳转标签 */
.status-chips a.chip { text-decoration: none; }
.status-chips a.chip:hover { border-color: var(--line-strong); color: var(--text); }

/* ============================================================
   学校名称 / 筛选栏高度对齐（V1.6）
   ============================================================ */

/* 登录页左侧品牌：学校名称单列一行 */
.login-brand h1 .school {
  display: block;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .14em;
  margin-bottom: 10px;
  color: var(--ink-cyan);
  -webkit-text-fill-color: var(--ink-cyan);
  background: none;
}
@media (max-width: 767.98px) {
  .login-brand h1 .school { font-size: 17px; margin-bottom: 6px; }
}

/* 侧栏品牌副标题别挤成两行 */
.sidebar .brand small { letter-spacing: .06em; white-space: nowrap; }

/* 筛选栏：下拉/输入框与「筛选 / 重置」按钮等高 */
.filter-bar { align-items: flex-end; }
.filter-bar .form-control,
.filter-bar .form-select {
  height: 42px;
  padding-top: 0;
  padding-bottom: 0;
}
.filter-bar .btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

/* ============================================================
   归属人 / 资产照片（V1.7）
   ============================================================ */

/* 资产名称（照片改由点击名称弹大图，列表不再占位放缩略图） */
.asset-name-body { min-width: 0; }
.asset-name-body .an-title { font-size: var(--fs-md); font-weight: 700; color: var(--text-strong); line-height: 1.35; }
.asset-name-body .an-sub { font-size: var(--fs-xs); color: var(--dim); line-height: 1.4; }

/* 有照片的资产名称：可点击，右侧跟一个小相机图标 */
.name-photo-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--text-strong);
  text-align: left;
  cursor: zoom-in;
  border-bottom: 1px dashed transparent;
}
.name-photo-btn:hover { color: var(--ink-cyan); border-bottom-color: currentColor; }
.name-photo-btn svg {
  margin-left: 5px;
  vertical-align: -2px;
  color: var(--ink-cyan);
  opacity: .75;
}
.name-photo-btn:hover svg { opacity: 1; }

/* 移动端把单位并入数量显示，桌面端不显示这个后缀 */
.qty-unit { display: none; }

/* 照片大图弹窗 */
.photo-viewer {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .28);
  border-radius: 0;
  min-height: 200px;
}
.photo-viewer img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 0 0 12px 12px;
}
html[data-theme="light"] .photo-viewer { background: #f1f5fb; }

/* 新增/编辑表单里的照片选择 */
.photo-field { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.photo-preview {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: var(--sub-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { font-size: var(--fs-xs); color: var(--dim); }
.photo-actions { flex: 1 1 240px; min-width: 200px; }

/* 归属人选择器（与地点选择器同一套视觉） */
.owner-picker .pp-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 7px; }
.owner-picker .pp-bar .op-kw { width: 260px; }
.owner-picker .pp-hint { font-size: var(--fs-xs); color: var(--dim); }
.owner-picker.is-empty .pp-hint { color: var(--ink-amber); }

.table-owners { min-width: 780px; }
.table-owners > thead > tr > th:nth-child(2),
.table-owners > tbody > tr > td:nth-child(2) { min-width: 110px; }

/* 仪表盘上的归属人跳转标签 */
.status-chips a.chip { text-decoration: none; }

/* 扫码页：单品照片 */
.scan-photo {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  margin: 2px 0 12px;
  border: 1px solid #e2e8f0;
}

/* 资产表：操作列固定在右侧，横向滚动时按钮始终可见 */
:root {
  --cell-solid: #101b2e;
  --cell-solid-hover: #1a2740;
}
html[data-theme="light"] {
  --cell-solid: #ffffff;
  --cell-solid-hover: #eff6ff;
}
.table-assets > thead > tr > th:last-child,
.table-assets > tbody > tr > td:last-child {
  position: sticky;
  right: 0;
  background: var(--cell-solid);
  box-shadow: -10px 0 14px -10px rgba(0, 0, 0, .45);
}
.table-assets > tbody > tr:hover > td:last-child {
  background: var(--cell-solid-hover);
}

/* 资产页筛选栏：7 个条件 + 2 个按钮排成一行，控件等分剩余宽度 */
.asset-filters > div {
  flex: 1 1 84px;
  min-width: 84px;
  max-width: 200px;
}
.asset-filters > div > .form-select,
.asset-filters > div > .form-control {
  width: 100%;
  min-width: 0;
}
@media (max-width: 991.98px) {
  .asset-filters > div { flex: 1 1 150px; max-width: none; }
}

/* 资产表操作按钮：收紧右侧外边距，避免表格多出 2px 触发横向滚动 */
.table-assets .table-actions .btn { margin-right: 0; }

/* ============================================================
   资产页筛选栏的「新增月份」（V1.8）
   ============================================================ */
.asset-filters > div.filter-month {
  flex: 0 0 128px;
  min-width: 128px;
  max-width: 128px;
}
.asset-filters > div.filter-month > .form-control { width: 100%; min-width: 0; }
/* 搜索框多分一点宽度，避免占位文字被截断 */
.asset-filters > div.filter-kw {
  flex: 1.6 1 110px;
  max-width: 240px;
}
/* 部分浏览器给 month 控件塞了日历图标，统一压一下内边距 */
input[type="month"].form-control { padding-right: 6px; }

/* ============================================================
   仪表盘：归属人名下资产（V1.8）
   ============================================================ */
/* 顶部一条统计带：登记人数 / 有资产人数 / 人均 / 件数 / 原值 / 未指定 */
.owner-sum {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 15px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--line-strong);
}
.owner-sum .osum { min-width: 0; }
.owner-sum .osum-k {
  display: block;
  font-size: var(--fs-cap);
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .02em;
}
.owner-sum .osum-v {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.2;
  white-space: nowrap;
}
.owner-sum .osum-v.small { font-size: 18px; letter-spacing: -.02em; }
.owner-sum .osum-v i {
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  color: var(--dim);
  margin-left: 3px;
}

.owner-bars { display: grid; gap: 11px; }
.owner-bars .bar-row { grid-template-columns: minmax(76px, 150px) 1fr auto; }
.owner-bars .bar-row .bl { font-weight: 600; }
.owner-bars .bar-row .bv { min-width: 96px; }

@media screen and (max-width: 991.98px) {
  .owner-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
}
@media screen and (max-width: 575.98px) {
  .owner-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-sum .osum-v { font-size: 19px; }
  .owner-sum .osum-v.small { font-size: 16px; }
}

/* ============================================================
   二维码台账（打印版，V1.8）
   ============================================================ */
.qrprint-body::before, .qrprint-body::after { display: none; }

.qr-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-tab {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--sub-bg);
}
.qr-tab:hover { color: var(--text-strong); border-color: var(--cyan); }
.qr-tab.on {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  border-color: rgba(34, 211, 238, .5);
  color: #fff;
  box-shadow: 0 8px 22px rgba(14, 165, 233, .24);
}

.qr-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.qr-meta .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--sub-bg);
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.qr-meta .chip b { color: var(--text); font-weight: 700; }
.qr-meta .chip.qr-meta-url { overflow: hidden; text-overflow: ellipsis; display: inline-block; }

.qr-tips { margin-top: 14px; font-size: 12.5px; color: var(--dim); line-height: 2; }

/* 纸张预览 */
.print-wrap { display: flex; justify-content: center; padding-bottom: 20px; }
.print-sheet {
  box-sizing: border-box;
  width: 210mm;
  min-height: 297mm;
  padding: 9mm;
  background: #fff;
  color: #0f172a;
  border-radius: 5px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .38);
}

/* inline-block 排版：打印分页最稳定 */
.qr-grid { font-size: 0; line-height: 0; }

.qr-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  vertical-align: top;
  box-sizing: border-box;
  margin: 0 3mm 3mm 0;
  padding: 2.4mm 1.6mm 1.6mm;
  background: #fff;
  border: 0.3mm solid #d5deea;
  border-radius: 2.5mm;
  text-align: center;
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
  cursor: zoom-in;
  font-size: 3mm;
  line-height: 1.35;
  color: #0f172a;
}
.qr-cell:hover { border-color: #2563eb; }
.qr-cell > * { max-width: 100%; }
.scope-place .qr-cell { width: 60mm; height: 65mm; }
.scope-asset .qr-cell { width: 44mm; height: 40mm; padding: 1.5mm 1.2mm 1.2mm; border-radius: 1.8mm; }

.qr-cell .qc-brand {
  font-size: 2.5mm;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scope-place .qc-qr { width: 36mm; margin: 1.6mm auto 1.8mm; }
.scope-asset .qc-qr { width: 21mm; margin: 0 auto .8mm; }
.qr-cell .qc-qr canvas { display: block; width: 100%; height: auto; }

.qr-cell .qc-title {
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
.scope-place .qc-title { font-size: 4.4mm; }
.scope-asset .qc-title { font-size: 3.0mm; -webkit-line-clamp: 1; margin-top: .2mm; }

.qr-cell .qc-sub {
  margin-top: .6mm;
  font-size: 2.7mm;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scope-asset .qc-sub { font-size: 2.3mm; margin-top: .2mm; }

.qr-cell .qc-note {
  font-size: 2.4mm;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scope-asset .qc-note { font-size: 2.3mm; margin-top: .1mm; color: #334155; }
/* 责任人或归属人没填时用浅灰文字提示，一眼能看出是漏填 */
.qr-cell .qc-note.is-blank { color: #a8b3c4; }

.qr-cell .qc-code {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: .01em;
}
.scope-asset .qc-code { font-size: 3.5mm; margin-bottom: .3mm; }
.qr-cell .qc-code-sm { font-size: 2.6mm; margin-top: 1mm; color: #1d4ed8; }

/* 打印：A4 仅留 9mm 页边距，每页定数换页 */
@media print {
  @page { size: A4; margin: 9mm; }

  html, body { background: #fff !important; }
  body::before, body::after { display: none !important; }
  .no-print, .topbar, .backdrop { display: none !important; }

  .app-shell { display: block; }
  .content { padding: 0 !important; }
  .print-wrap { display: block; padding: 0; }
  .print-sheet {
    width: 192mm;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }
  .qr-cell { border-color: #c9d4e3; }
  .qr-cell, .qr-cell .qc-qr canvas {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .scope-place .qr-cell:nth-child(12n):not(.is-last) { break-after: page; page-break-after: always; }
  .scope-asset .qr-cell:nth-child(24n):not(.is-last) { break-after: page; page-break-after: always; }
}

/* 手机上纸张预览缩放到屏幕宽度（仅屏幕，打印不受影响） */
@media screen and (max-width: 991.98px) {
  .print-sheet { width: 100%; min-height: 0; padding: 4mm; box-shadow: var(--shadow-1); }
  .qr-grid { display: flex; flex-wrap: wrap; gap: 6px; }
  .qr-cell { margin: 0; }
  .scope-place .qr-cell { width: calc(50% - 3px); height: auto; padding: 8px 6px 10px; }
  .scope-asset .qr-cell { width: calc(50% - 3px); height: auto; padding: 8px 6px 10px; }
  .scope-place .qc-qr, .scope-asset .qc-qr { width: 60%; margin: 6px auto 8px; }
}

/* ============================================================
   手机端适配（仅窄屏生效，桌面端与打印均不受影响，V1.8）
   ============================================================ */
@media screen and (max-width: 991.98px) {
  /* 抽屉打开时锁住背景滚动 */
  body.nav-open { overflow: hidden; }
  .sidebar { width: 268px; flex-basis: 268px; }
  .content { padding: 12px 10px calc(70px + env(safe-area-inset-bottom)); }
  .card-box > .card-body { padding: 14px; }
  .card-box > .card-head { padding: 12px 14px; }
  .table-scroll { -webkit-overflow-scrolling: touch; }

  /* 筛选栏：控件铺满一行，按钮并排 */
  .filter-bar { gap: 8px; }
  .filter-bar > div { flex: 1 1 100%; max-width: none !important; min-width: 0 !important; }
  .filter-bar > div > .form-control,
  .filter-bar > div > .form-select { width: 100%; }
  .filter-bar > .btn { flex: 1 1 40%; }

  /* iOS 输入框低于 16px 会在聚焦时自动放大页面 */
  .form-control, .form-select,
  .form-control-sm, .form-select-sm { font-size: 16px; }
  .btn-sm { font-size: 13.5px; padding: 6px 11px; }
}

@media screen and (max-width: 767.98px) {
  /* 表格转卡片：仅带 .table-cards 的列表页 */
  .table-cards { min-width: 0 !important; }
  .table-cards > thead { display: none; }
  .table-cards,
  .table-cards > tbody { display: block; width: 100%; }
  .table-cards > tbody > tr {
    display: block;
    position: relative;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--sub-bg);
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .table-cards > tbody > tr:last-child { margin-bottom: 0; }
  .table-cards > tbody > tr > td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: auto !important;
    min-width: 0 !important;
    padding: 3px 0;
    border: 0;
    text-align: right;
    white-space: normal !important;
  }
  .table-cards > tbody > tr > td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--dim);
    font-size: 12.5px;
    line-height: 1.6;
    text-align: left;
    font-weight: 400;
  }
  .table-cards > tbody > tr > td:empty { display: none; }
  .table-cards > tbody > tr > td.no-label { display: block; text-align: left; }
  .table-cards > tbody > tr > td.no-label::before { content: none; }

  /* 名称列在卡片里当标题用 */
  .table-cards .asset-name-body .an-title { font-size: 16px; }
  .table-cards .asset-name-body .an-sub { font-size: 13px; }

  /* 单位列在手机上并入数量显示 */
  .table-cards > tbody > tr > td.c-unit { display: none; }
  .table-cards .qty-unit { display: inline; margin-left: 3px; font-size: 12.5px; color: var(--dim); }

  /* 操作按钮占一行，靠右 */
  .table-cards > tbody > tr > td.table-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px dashed var(--line-strong);
    position: static !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  .table-cards > tbody > tr > td.table-actions::before { content: none; }
  .table-cards .table-actions .btn { margin: 0; }
  .table-cards > tbody > tr:hover > td:last-child { background: transparent; }

  /* 行悬停底色在卡片模式下会糊成一片，去掉 */
  .table-cards.table-hover > tbody > tr:hover > td { background: transparent; }

  /* 弹窗内边距收紧，按钮好点 */
  .modal-dialog { margin: 10px; }
  .modal-body { padding: 14px; }
  .modal-footer { padding: 10px 14px; }
  .modal-footer .btn { flex: 1 1 auto; }

  /* 卡片头部的按钮组铺满一行 */
  .card-box > .card-head > .d-flex { width: 100%; }
  .card-box > .card-head > .d-flex > .btn { flex: 1 1 auto; }

  /* 仪表盘条形图：名称与数值一行，条形占下一行 */
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-row .bl { grid-column: 1; grid-row: 1; }
  .bar-row .bv { grid-column: 2; grid-row: 1; min-width: 0; }
  .bar-row .bt { grid-column: 1 / -1; grid-row: 2; }
  .owner-bars .bar-row { grid-template-columns: 1fr auto; }

  .donut { width: 132px; height: 132px; }
  .donut .dc-v { font-size: 21px; }
  .hero-metrics { width: 100%; }
  .hero-metrics .hm { flex: 1 1 30%; min-width: 96px; }
  .hero-metrics .hm-v { font-size: 19px; }
  .page-link { padding: 8px 12px; }
}

@media screen and (max-width: 575.98px) {
  .topbar h1 { font-size: 16px; }
  .content { padding: 10px 8px calc(70px + env(safe-area-inset-bottom)); }
  .card-box { border-radius: 13px; }
  .card-box > .card-body { padding: 12px; }
  .stat-card { padding: 14px 14px 13px; }
  .stat-card .value { font-size: 27px; }
  .stat-card .mark { width: 32px; height: 32px; right: 10px; top: 10px; }
  .dash-hero { padding: 15px; }
  .dash-hero h2 { font-size: 20px; }
  .theme-switch .ts-btn { padding: 5px 10px; font-size: 12.5px; }
  .topbar .theme-switch .ts-btn span { display: none; }
  .qr-tab { flex: 1 1 45%; justify-content: center; }
  .photo-viewer img { max-height: 62vh; }
}

@media screen and (max-width: 991.98px) {
  /* 手机上「新增月份」「搜索」与其他筛选控件一样铺满整行，按钮单独占一行 */
  .asset-filters > div.filter-month { flex: 1 1 100%; min-width: 0; max-width: none; }
  .asset-filters > div.filter-kw { flex: 1 1 100%; max-width: none; }
}

/* 归属人条形图里的姓名链接与部门（V1.8） */
.owner-bars .bar-row .bl a { color: var(--text); font-weight: 600; }
.owner-bars .bar-row .bl a:hover { color: var(--ink-cyan); text-decoration: underline; }
.owner-bars .bl-dept { color: var(--dim); font-size: 11.5px; margin-left: 5px; font-weight: 400; }

/* 卡片模式下「数量 + 单位」作为一个整体靠右（V1.8） */
.table-cards .c-val { display: inline-flex; align-items: baseline; gap: 3px; }

/* 二维码台账顶栏：手机上允许换行，按钮不折字（V1.8） */
.qr-top { flex-wrap: wrap; row-gap: 8px; }
.qr-top-left { min-width: 0; }
.qr-back, .qr-print-btn { white-space: nowrap; flex: 0 0 auto; }
.qr-top h1 { white-space: nowrap; }
@media screen and (max-width: 575.98px) {
  .qr-top { padding: 8px 10px; }
  .qr-top h1 { font-size: 15px; }
  .qr-top .topbar-tools { width: 100%; justify-content: space-between; }
  .qr-top .topbar-tools .btn { flex: 1 1 auto; }
}

/* 卡片模式下把「主值 + 副值」打成一个整体，避免被 flex 拆到两端（V1.8） */
.cell-group { display: inline-block; }
.table-cards .ocell { display: block; }
.table-cards .ocell-remark { display: block; font-size: 12.5px; color: var(--dim); font-weight: 400; }
@media screen and (max-width: 767.98px) {
  .table-cards .ocell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; }
}

/* ===== 地点责任人（V1.9）===== */
.keeper-name { font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.table-places td:nth-child(6) { font-size: 13.5px; }

/* ===== 系统维护 / 清空数据库（V1.9）===== */
.reset-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px 10px;
}
.reset-stats .rs-item { min-width: 0; }
.reset-stats .rs-k {
  display: block;
  font-size: var(--fs-cap);
  color: var(--dim);
  letter-spacing: .02em;
}
.reset-stats .rs-v {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.2;
}
.reset-stats .rs-v i {
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  color: var(--dim);
  margin-left: 3px;
}
.reset-stats .rs-sub {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reset-warn {
  border: 1px solid rgba(248, 113, 113, .45);
  background: rgba(248, 113, 113, .09);
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text);
}
.reset-warn b { color: #f87171; }
.reset-warn ul { padding-left: 20px; }
.reset-warn li { margin-top: 2px; }
.reset-warn code { color: var(--ink-cyan); }

.reset-done { border-color: rgba(52, 211, 153, .45); }
.reset-done .reset-done-title {
  font-size: 16px;
  font-weight: 700;
  color: #34d399;
  margin-bottom: 8px;
}
.reset-done code { color: var(--ink-cyan); }

/* 表格里出现的文件名/命令片段 */
.card-box code, .reset-stats code {
  background: var(--field-bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
}

@media screen and (max-width: 991.98px) {
  .reset-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media screen and (max-width: 575.98px) {
  .reset-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reset-stats .rs-v { font-size: 19px; }
}

/* ===== 盘点导出：操作按钮组（V1.9.2）===== */
.export-btns .btn { white-space: nowrap; }
@media screen and (max-width: 575.98px) {
  .export-btns { flex-wrap: wrap; width: 100%; }
  .export-btns .btn { flex: 1 1 100%; }
}
