/* ============================================================
 * admin3.css —— PC 管理后台 3.0 设计系统（覆盖层）
 * ------------------------------------------------------------
 * 设计原则：
 *   1. 只覆盖，不替换。style.css 保持原样，本文件在其后加载。
 *      回滚方式：删掉 index.html 里引用本文件的那一行即可。
 *   2. 所有颜色/圆角/阴影统一走 CSS 变量。原 style.css 的 6 种圆角、
 *      7 档字号、3 个近似蓝在这里收敛成一套（2026-11-26 品牌转暖，蓝色已整体换成品牌橙 #bb4610 系）。
 *   3. 只调"皮肤"与"骨架"，不动任何业务页的 DOM 结构 ——
 *      31 个页面里还有大量内联样式与私有 class（po2-* 等），
 *      覆盖层管不到的地方由各页自行处理，不做全局 !important 硬来。
 * ============================================================ */

/* ================= 1. 设计令牌 ================= */
:root {
  /* 主色：一个色相三个梯度，不再有第二个蓝 */
  --brand: #bb4610;
  --brand-dark: #a8390a;
  --brand-deep: #7a2a06;
  --brand-soft: #fdf0e7;

  /* 中性：5 档文字 + 3 档底色 */
  --text: #2b1b12;
  --text-2: #5c4233;
  --text-3: #786452;
  --text-4: #9a8878;
  --bg: #faf6f1;
  --surface: #ffffff;
  --surface-2: #fdfaf7;
  --border: #ece1d6;
  --border-strong: #ded0c2;
  --gray-soft: #f5f0ea;

  /* 语义色：只用于表达状态，不做装饰 */
  --green: #0b734d;
  --green-soft: #e7f7f1;
  --orange: #a05c00;
  --orange-soft: #fdf4e3;
  --red: #c0342f;
  --red-soft: #fdecec;
  --purple: #7c3aed;
  --purple-soft: #f3eefe;

  /* 圆角：只留 8 / 12 两档（10 用于小控件的中庸值，避免视觉跳变） */
  --r: 12px;
  --r-sm: 8px;
  --r-xs: 6px;

  /* 阴影：只留 2 档 */
  --shadow: 0 1px 2px rgba(64, 32, 10, .05), 0 1px 3px rgba(64, 32, 10, .04);
  --shadow-lg: 0 12px 32px -8px rgba(64, 32, 10, .18), 0 4px 10px -4px rgba(64, 32, 10, .08);

  /* 外壳尺寸 */
  --nav-w: 240px;
  --top-h: 56px;

  /* 字号：6 档 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 22px;
}

/* ================= 2. 基础排版 ================= */
html, body {
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { line-height: 1.55; }

/* 滚动条：细一点的现代观感 */
.sidebar::-webkit-scrollbar,
.view::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.sidebar::-webkit-scrollbar-thumb,
.view::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: #d6dae1; border-radius: 99px; border: 2px solid transparent; background-clip: content-box;
}
.sidebar::-webkit-scrollbar-thumb:hover,
.view::-webkit-scrollbar-thumb:hover { background: #bcc3cd; background-clip: content-box; }
.sidebar::-webkit-scrollbar-track,
.view::-webkit-scrollbar-track { background: transparent; }

/* ================= 3. 应用外壳 ================= */
.app-shell { display: flex; min-height: 100vh; background: var(--bg); }

/* ---------- 3.1 侧栏：白底 240px ---------- */
.sidebar {
  width: var(--nav-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden; /* 内部 nav 自己滚，搜索框与底部固定 */
}

.side-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 0 16px; height: var(--top-h); flex-shrink: 0;
  font-size: var(--fs-md); font-weight: 700; letter-spacing: .2px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text);
}
.side-logo {
  width: 26px; height: 26px; border-radius: var(--r-sm);
  background: var(--brand-soft); padding: 2px; box-sizing: border-box;
  object-fit: contain; flex-shrink: 0;
}
.side-brand-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 版本徽标：原来蓝底蓝字太跳，改成中性 */
#page-ver {
  background: var(--gray-soft) !important;
  color: var(--text-3) !important;
  font-weight: 600 !important;
  font-size: 10px !important;
}

/* 侧栏搜索框 */
.side-search { padding: 10px 12px 4px; flex-shrink: 0; }
.side-search-box {
  display: flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px;
  background: var(--gray-soft); border: 1px solid transparent;
  border-radius: var(--r-sm);
  transition: background .15s, border-color .15s;
}
.side-search-box:focus-within { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.side-search-box svg { width: 14px; height: 14px; stroke: var(--text-3); flex-shrink: 0; }
.side-search-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: var(--fs-sm); color: var(--text);
}
.side-search-input::placeholder { color: var(--text-4); }
.side-search-kbd {
  font-size: 10px; line-height: 1; color: var(--text-4);
  border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 2px 4px; white-space: nowrap;
}

/* 导航滚动区 */
.side-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px 14px; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: #e4d8cc; border-radius: 99px; }

.nav-group { margin-top: 6px; }
.nav-group + .nav-group { margin-top: 2px; }
.nav-group-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .6px;
  color: var(--text-4); text-transform: none;
  padding: 8px 8px 5px; cursor: pointer; user-select: none;
  border-radius: var(--r-xs);
}
.nav-group-label:hover { color: var(--text-2); }
.nav-group-label .chev {
  width: 10px; height: 10px; stroke: currentColor; flex-shrink: 0;
  transition: transform .16s ease;
}
.nav-group.closed .chev { transform: rotate(-90deg); }
.nav-group.closed .nav-group-body { display: none; }
.nav-group-count {
  margin-left: auto; font-size: 10px; font-weight: 600; color: var(--text-4);
  background: var(--gray-soft); border-radius: 99px; padding: 1px 5px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 9px; margin-bottom: 1px;
  border-radius: var(--r-sm);
  color: var(--text-2); cursor: pointer;
  font-size: var(--fs-sm); font-weight: 500;
  transition: background .13s, color .13s;
  user-select: none; position: relative; white-space: nowrap;
}
.nav-item:hover { background: var(--gray-soft); color: var(--text); }
.nav-item.active {
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--brand);
}
/* 图标：emoji 兜底 → 统一放到 16px 盒子里，视觉粗细靠 grayscale 压一档 */
.nav-icon {
  width: 16px; height: 16px; line-height: 16px; text-align: center;
  font-size: 13px; flex-shrink: 0; opacity: .85;
  filter: grayscale(.35);
}
.nav-item.active .nav-icon { opacity: 1; filter: none; }

.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 11px; line-height: 16px; height: 16px;
  border-radius: 99px; padding: 0 6px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nav-group-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--red);
  margin-left: auto; flex-shrink: 0;
}

/* 底部：从大段版权文字压缩成一行 */
.side-foot {
  flex-shrink: 0; padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-4); line-height: 1.6;
}
.side-foot-sub { margin-top: 0; font-size: 11px; color: var(--text-4); }

/* ---------- 3.2 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--top-h); background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
  gap: 16px;
}
/* 顶栏左：面包屑 */
.crumb {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: var(--fs-sm); color: var(--text-3);
}
.crumb-home { display: flex; align-items: center; color: var(--text-4); }
.crumb-home svg { width: 15px; height: 15px; stroke: currentColor; }
.crumb-sep { color: var(--text-4); font-size: 12px; }
.crumb-group { white-space: nowrap; }
.top-title {
  font-size: var(--fs-md); font-weight: 650; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 账号胶囊 */
.admin-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-sm); color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 6px 4px 12px;
  height: 32px;
}
.admin-chip .id-switch-btn {
  height: 24px; padding: 0 8px; font-size: 12px;
  border-radius: 99px; background: var(--gray-soft); border: 0; color: var(--text-2);
}
.admin-chip .id-switch-btn:hover { background: var(--brand-soft); color: var(--brand); }
/* 顶栏的退出按钮：收成一个低调的图标按钮观感 */
#btn-logout {
  height: 32px; padding: 0 10px; font-size: var(--fs-sm);
  border-radius: var(--r-sm); color: var(--text-3);
}
#btn-logout:hover { color: var(--red); background: var(--red-soft); }

/* 内容区 */
.view {
  padding: 20px 24px 40px;
  max-width: 1360px; width: 100%; margin: 0 auto;
  flex: 1;
}

/* 演示模式标识条：顶栏上方的通栏提示（普通文档流，不遮挡任何内容） */
.demo-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 24px; background: #fffaeb;
  border-bottom: 1px solid #fedf89;
  font-size: var(--fs-sm); color: #93370d;
  flex-shrink: 0;
}
.demo-banner-tag {
  background: #f79009; color: #fff; border-radius: 4px;
  padding: 1px 6px; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.demo-banner-text strong { color: #b42318; }

/* ================= 4. 通用组件 ================= */

/* ---------- 4.1 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-sm); font-weight: 500; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
}
.btn:hover { background: var(--surface-2); border-color: #cfd5dd; }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 550;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
/* ghost = 次要按钮：默认是有边框的实体按钮（用户要能看出"这是能点的"）。
 * 只有表格行内/操作组里才去掉边框（一列 5 个按钮都描边会像一排筹码）。 */
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.table .btn-ghost, .actions .btn-ghost, .nb-pc-actions .btn-ghost {
  background: transparent; border-color: transparent;
}
.table .btn-ghost:hover, .actions .btn-ghost:hover, .nb-pc-actions .btn-ghost:hover {
  background: var(--gray-soft); border-color: transparent;
}
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-danger-ghost { background: var(--surface); color: var(--red); border-color: #f5c2c2; }
.btn-danger-ghost:hover { background: var(--red-soft); border-color: var(--red); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #0b8a5f; border-color: #0b8a5f; }
.btn-sm { height: 28px; padding: 0 10px; font-size: var(--fs-sm); border-radius: var(--r-xs); }
.btn-mini { height: 26px; padding: 0 9px; font-size: 12px; border-radius: var(--r-xs); }
.btn-block { width: 100%; }

/* 兼容历史写法：views-lock.js / views-parking-ops.js 里有 11 处把主按钮
 * 写成 class="btn primary"，而 style.css 只定义了 .btn-primary ——
 * 这些按钮长期没有主色（开锁、添加设备、创建车场都是白底）。
 * 这里补一条别名，不去逐个改模板。 */
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 550;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
}
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* 表格行内按钮组：主操作实心、次操作描边、危险操作收进「⋯」 */
.act-group { display: inline-flex; align-items: center; gap: 4px; }
.act-link {
  border: 0; background: transparent; font: inherit; font-size: var(--fs-sm);
  color: var(--brand); cursor: pointer; padding: 3px 6px; border-radius: var(--r-xs);
}
.act-link:hover { background: var(--brand-soft); }
.act-link.muted { color: var(--text-2); }
.act-link.muted:hover { background: var(--gray-soft); color: var(--text); }
.act-link.danger { color: var(--red); }
.act-link.danger:hover { background: var(--red-soft); }

/* ---------- 4.2 卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: var(--fs-md); font-weight: 650; color: var(--text);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  line-height: 1.4;
}
.card-title .link, .card-title .auth-link {
  margin-left: auto; font-size: var(--fs-sm); font-weight: 500;
}

/* ---------- 4.3 表格 ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
  text-align: left; padding: 10px 14px;
  background: var(--surface-2);
  color: var(--text-3); font-weight: 600; font-size: var(--fs-xs);
  letter-spacing: .2px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fdfaf7; }
.table .actions { white-space: nowrap; text-align: right; }
.table .strong { font-weight: 600; color: var(--text); }
.table .sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- 4.4 表单控件 ---------- */
.input, .select, .textarea {
  height: 34px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: var(--fs-sm);
  transition: border-color .14s, box-shadow .14s;
}
.textarea { height: auto; min-height: 76px; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a929e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.field-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field-hint { font-size: var(--fs-xs); color: var(--text-3); margin-top: 5px; line-height: 1.5; }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span-2 { grid-column: span 2; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .input, .input-row .select { flex: 1; min-width: 0; }

/* 工具条 */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar .spacer { flex: 1; }
.toolbar .select, .toolbar .input { width: auto; min-width: 140px; }
.toolbar-search {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 10px; min-width: 200px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface);
}
.toolbar-search svg { width: 14px; height: 14px; stroke: var(--text-3); flex-shrink: 0; }
.toolbar-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: var(--fs-sm);
}
.toolbar-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 页签 */
.tabs {
  display: inline-flex; gap: 2px; background: var(--gray-soft);
  border-radius: var(--r-sm); padding: 3px;
}
.tab {
  padding: 6px 14px; border-radius: var(--r-xs); cursor: pointer;
  font-size: var(--fs-sm); color: var(--text-2); font-weight: 500;
  transition: background .14s, color .14s; white-space: nowrap; border: 0;
  background: transparent; font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: 0 1px 2px rgba(64, 32, 10, .08);
}

/* 徽标 */
.badge {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 7px; border-radius: var(--r-xs);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  white-space: nowrap;
}
.badge-blue { background: var(--brand-soft); color: var(--brand-dark); }
.badge-green { background: var(--green-soft); color: #067647; }
.badge-orange { background: var(--orange-soft); color: #93370d; }
.badge-red { background: var(--red-soft); color: #b42318; }
.badge-gray { background: var(--gray-soft); color: var(--text-2); }
.badge-purple { background: var(--purple-soft); color: #5b21b6; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: var(--r-xs); font-size: var(--fs-xs);
  background: var(--gray-soft); color: var(--text-2);
}
.tag-blue { background: var(--brand-soft); color: var(--brand-dark); }

/* 空状态：小、矮、给去处，不占半屏 */
.empty-box {
  text-align: center; color: var(--text-3);
  padding: 26px 16px; font-size: var(--fs-sm); line-height: 1.7;
}
.empty-box .icon {
  font-size: 22px; margin-bottom: 8px; opacity: .5;
  filter: grayscale(1);
}
.empty-box .empty-title { color: var(--text-2); font-weight: 600; margin-bottom: 2px; font-size: var(--fs-sm); }
.empty-box .empty-act { margin-top: 8px; font-size: var(--fs-xs); color: var(--brand); cursor: pointer; }
.empty-box .empty-act:hover { text-decoration: underline; }

/* 加载 */
.loading-block, .loading-box {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 40px 0; color: var(--text-3); font-size: var(--fs-sm);
}

/* 分页 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 12px 2px 0; font-size: var(--fs-sm); color: var(--text-3); }
.pager .btn { height: 28px; padding: 0 10px; font-size: var(--fs-sm); }

/* ---------- 4.5 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(64, 32, 10, .42);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow-lg); width: 520px; max-width: 100%;
  max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  border: 1px solid var(--border);
}
.modal.wide { width: 720px; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: var(--fs-lg); font-weight: 650; color: var(--text); }
.modal-close {
  margin-left: auto; width: 28px; height: 28px; border-radius: var(--r-xs);
  border: 0; background: transparent; color: var(--text-3);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--gray-soft); color: var(--text); }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 20px 16px; border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--r) var(--r);
}
.modal-error {
  background: var(--red-soft); color: #b42318; border: 1px solid #f5c2c2;
  border-radius: var(--r-sm); padding: 8px 12px; font-size: var(--fs-sm);
  margin-bottom: 12px; line-height: 1.6;
}

/* 消息条 */
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 180px; max-width: 380px; padding: 10px 14px;
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); line-height: 1.5;
  background: #2b1b12; color: #fff;
  animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.toast.ok { background: #2b1b12; }
.toast.err { background: var(--red); }
.toast.warn { background: #b54708; }

/* 身份切换菜单 */
.id-switch-menu {
  position: fixed; z-index: 120; width: 260px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px;
}
.id-switch-item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px; border-radius: var(--r-xs); cursor: pointer;
}
.id-switch-item:hover { background: var(--gray-soft); }
.id-switch-item-on { background: var(--brand-soft); }
.id-switch-item .strong { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.id-switch-item .sub { font-size: var(--fs-xs); color: var(--text-3); }
.id-switch-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ================= 5. 工作台 ================= */

/* 5.1 页头：问候（3.0 去掉了 2026-10-11 那层深蓝渐变横幅）
 * 深蓝横幅的问题：它把页头做成一张"主角卡"，但页头信息量最小、
 * 真正的主角是下面的待办和 KPI；而且横幅里的次要文字是半透明白，
 * 换成浅色体系后对比度直接不够。3.0 改为纯文字页头，不占卡片。 */
.dash-hello {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--text);
}
.dash-hello .dash-hello-text { color: var(--text); }
.dash-hello .dash-hello-meta, .dash-hello .dash-hello-dot { color: var(--text-3); }
.dash-hello .dash-hello-focus {
  background: var(--brand-soft); color: var(--brand-dark); font-weight: 600;
  border-radius: 99px; padding: 3px 10px;
}
.dash-hello-text { font-size: var(--fs-xl); font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.dash-hello-dot { color: var(--text-4); }
.dash-hello-meta { font-size: var(--fs-sm); color: var(--text-3); }
.dash-hello-focus {
  font-size: var(--fs-xs); color: var(--brand-dark); background: var(--brand-soft);
  border-radius: 99px; padding: 3px 10px; margin-left: 2px;
}
.dash-hello-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* 5.2 区块标题 */
.dash-section { margin-bottom: 14px; }
.dash-section-head {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px;
}
.dash-section-title { font-size: var(--fs-md); font-weight: 650; color: var(--text); }
.dash-section-sub { font-size: var(--fs-xs); color: var(--text-3); }
.dash-section-head .more {
  margin-left: auto; font-size: var(--fs-sm); color: var(--brand); cursor: pointer;
}

/* 5.3 KPI 卡：图标 + 数字 + 环比 */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px;
}
.kpi {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 16px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  min-width: 0;
}
.kpi:hover { border-color: #e8cbb6; box-shadow: 0 4px 12px -4px rgba(64, 32, 10, .12); transform: translateY(-1px); }
.kpi-ico {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft);
}
.kpi-ico svg { width: 17px; height: 17px; stroke: var(--brand); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi-ico.warn { background: var(--orange-soft); }
.kpi-ico.warn svg { stroke: var(--orange); }
.kpi-ico.bad { background: var(--red-soft); }
.kpi-ico.bad svg { stroke: var(--red); }
.kpi-ico.ok { background: var(--green-soft); }
.kpi-ico.ok svg { stroke: var(--green); }
.kpi-body { min-width: 0; flex: 1; }
.kpi-num {
  font-size: 24px; font-weight: 700; line-height: 1.15; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.kpi-num.warn { color: var(--orange); }
.kpi-num.bad { color: var(--red); }
.kpi-label { font-size: var(--fs-sm); color: var(--text-2); margin-top: 1px; }
.kpi-sub { font-size: var(--fs-xs); color: var(--text-4); margin-top: 3px; }
.kpi-sub .up { color: var(--red); }
.kpi-sub .down { color: var(--green); }

/* 5.4 待办清单：左侧 2/3 */
/* 待办清单：整行宽、内部两列 —— 项少时两列各占一半不显空，项多时也不撑高 */
.todo-list {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 28px;
}
.todo-row {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 6px; margin: 0 -6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; border-radius: var(--r-xs);
  transition: background .12s;
}
.todo-row:last-child { border-bottom: 0; }
.todo-row:hover { background: var(--surface-2); }
.todo-row-title { font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
.todo-row-tag {
  font-size: 11px; color: var(--text-3); background: var(--gray-soft);
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.todo-row-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--text-4); }
.todo-row-dot.audit { background: #f0b429; }
.todo-row-dot.property { background: var(--brand); }
.todo-row-dot.business { background: var(--purple); }
.todo-row-dot.access { background: #12b5a5; }
.todo-row-dot.bad { background: var(--red); }
.todo-row-num {
  margin-left: auto;
  font-size: var(--fs-md); font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; min-width: 28px; text-align: right;
}
.todo-row-num.zero { color: var(--text-4); font-weight: 500; }
.todo-row-go {
  font-size: var(--fs-xs); color: var(--brand); opacity: 0;
  transition: opacity .12s; white-space: nowrap;
}
.todo-row:hover .todo-row-go { opacity: 1; }


/* 待办卡底部说明：让"高度富余"变成有内容的页脚，而不是一块空白 */
.todo-foot {
  margin-top: auto; padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: var(--fs-xs); color: var(--text-4);
}

/* 5.5 快捷入口（右侧卡片） */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quick-item {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 9px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--text-2);
  cursor: pointer; transition: background .13s, color .13s;
  min-width: 0;
}
.quick-item:hover { background: var(--brand-soft); color: var(--brand-dark); }
.quick-ico {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-soft); font-size: 12px;
}
.quick-item:hover .quick-ico { background: #fff; }
.quick-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 5.6 经营数据带：一条卡，内部分格 */
.biz-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 14px;
}
.biz-cell {
  padding: 13px 16px; border-right: 1px solid var(--border);
  min-width: 0;
}
.biz-cell:last-child { border-right: 0; }
.biz-label { font-size: var(--fs-xs); color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.biz-value {
  font-size: 19px; font-weight: 700; color: var(--text); margin-top: 3px;
  font-variant-numeric: tabular-nums; letter-spacing: -.3px;
}
.biz-value.brand { color: var(--brand); }
.biz-value.warn { color: var(--orange); }
.biz-note { font-size: var(--fs-xs); color: var(--text-4); margin-top: 2px; }
.biz-note.warn { color: var(--orange); }

/* 5.7 两列卡片区 */
.dash-cols {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px; align-items: start;
}
.dash-cols .card { margin-bottom: 0; }

/* 迷你列表（报修/申请/记录共用） */
.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  min-width: 0;
}
.mini-row:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-main { flex: 1; min-width: 0; }
.mini-title {
  font-size: var(--fs-sm); color: var(--text); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }

/* 平台概况：小格子 */
.scale-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scale-cell {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px;
}
.scale-cell .n { font-size: var(--fs-lg); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.scale-cell .l { font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }

/* 旧 stat-bar 兜底：万一还有页面在用，把它也修干净 */
.stat-bar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
}
.stat-bar-item {
  padding: 12px 16px; border-right: 1px solid var(--border);
  cursor: pointer; transition: background .13s;
}
.stat-bar-item:last-child { border-right: 0; }
.stat-bar-item:hover { background: var(--surface-2); }
.stat-bar-num { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-bar-num.warn { color: var(--orange); }
.stat-bar-num.bad { color: var(--red); }
.stat-bar-label { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }

/* ================= 6. 通用排版辅助 ================= */
.section-title { font-size: var(--fs-md); font-weight: 650; color: var(--text); margin: 18px 0 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }

/* ================= 7. 响应式 ================= */
@media (max-width: 1320px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .biz-strip { grid-template-columns: repeat(2, 1fr); }
  .biz-cell:nth-child(2) { border-right: 0; }
  .biz-cell:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 1100px) {
  :root { --nav-w: 216px; }
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
  .todo-list { grid-template-columns: minmax(0, 1fr); }
  .view { padding: 16px 16px 32px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 840px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .biz-strip { grid-template-columns: 1fr; }
  .biz-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .biz-cell:last-child { border-bottom: 0; }
  .crumb-group, .crumb-sep { display: none; }
  .side-search-kbd { display: none; }
}

/* 平台概况小格的告警色 */
.scale-cell .n.warn { color: var(--orange); }
.scale-cell .n.bad { color: var(--red); }

/* ================= 8. 表格操作列与旧组件对齐 ================= */

/* 🔴 表格整体不折行（2026-11-23）：住户列表 10 列、设备 9 列，
 * 窗口一窄每列都挤成两行 —— 姓名「程江/河」、房号「1号楼1单元/101室」
 * 全被拆断，行高从 44 涨到 88，看着像表格坏了。
 * 统一 nowrap + 容器横向滚动（.table-wrap 已有 overflow:auto），
 * 宁可滚一下也不让字段折断。需要换行的长文本（公告正文等）不在表格里展示。 */
/* 旧表把按钮包在 <div class="actions"> 里，而 style.css 给它 flex-wrap: wrap ——
 * 列一窄就竖着堆。这里改成不换行、不收缩，表格整体横向滚动。 */
.table .actions { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; }
.table .actions .btn { flex: 0 0 auto; }
.table td:last-child { white-space: nowrap; }
.table td:last-child .btn {
  height: 26px; padding: 0 9px; font-size: 12px; border-radius: var(--r-xs);
}
.table td:last-child .btn + .btn { margin-left: 4px; }
/* 删除按钮降视觉权重：和「编辑」长得一样最容易误点 */
.table [data-act="del"], .table .btn-danger-ghost { color: var(--red); }
.table [data-act="del"]:hover, .table .btn-danger-ghost:hover { background: var(--red-soft); }

/* 车场运营 / 锁控设备页自带的 KPI 条（po2-kpis），与工作台 KPI 统一观感 */
.po2-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.po2-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 16px; box-shadow: var(--shadow);
}
.po2-kpi .k { font-size: var(--fs-xs); color: var(--text-3); }
.po2-kpi .v {
  font-size: 22px; font-weight: 700; margin-top: 2px;
  font-variant-numeric: tabular-nums; letter-spacing: -.3px;
}

.table th, .table td { white-space: nowrap; }

/* ================= 9. 工具栏「管理 ▾」下拉（原生 details，无 JS 依赖） ================= */

/* 账单页等工具栏按钮太多（推送设置/平台联系/费用分类…），低频配置项收进
 * 下拉后工具栏只留高频操作。用 <details>/<summary> 实现，不引入新 JS。 */
.more-menu { position: relative; }
.more-menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-xs);
  background: var(--surface); color: var(--text-2);
  font-size: var(--fs-sm);
  transition: background .12s, border-color .12s;
}
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary:hover { background: var(--surface-2); color: var(--text); }
.more-menu[open] > summary {
  background: var(--surface-2); color: var(--text);
  border-color: var(--brand);
}
.more-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 150px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-lg, 0 8px 24px rgba(15, 23, 42, .12));
}
.more-panel .btn {
  justify-content: flex-start; width: 100%;
  border: 0; background: transparent; box-shadow: none;
}
.more-panel .btn:hover { background: var(--surface-2); }

/* ================= 10. ghost 按钮的两种语境 ================= */

/* 表格行内：ghost 无边框更干净（一列 5 个按钮，每条都描边会像一排筹码）。
 * 工具栏 / 弹层里：ghost 必须有边框，否则「搜索」「刷卡记录」「房间管理」
 * 看起来像一行文字链接，用户点之前不知道那是按钮。 */
.toolbar .btn-ghost,
.modal .btn-ghost,
.form-actions .btn-ghost,
.card > .btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}
.toolbar .btn-ghost:hover,
.modal .btn-ghost:hover,
.form-actions .btn-ghost:hover,
.card > .btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-strong, #cfd5dd);
  color: var(--text);
}

/* 折叠式说明（账号中心「账号体系与授权规则」等）：默认收起，不占首屏 */
.acc-help { margin-top: 10px; }
.acc-help > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-sm); color: var(--brand-dark);
}
.acc-help > summary::-webkit-details-marker { display: none; }
.acc-help > summary::before { content: '？'; display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
  font-size: 10px; font-weight: 700; }
.acc-help[open] > summary { margin-bottom: 2px; }

/* ================= 11. 宽表格：操作列右侧吸附 ================= */

/* 设备/住户这类 9~10 列的表格，窗口不够宽时整表横向滚动，
 * 「操作」列（开门、编辑、删除）会滚出屏幕 —— 主操作被藏起来是最糟的体验。
 * 让最后一列吸附在右侧，内容向左滚、操作永远可见。 */
.table-wrap { position: relative; }
.table th:last-child,
.table td:last-child {
  position: sticky; right: 0; z-index: 2;
  background: var(--surface);
}
.table thead th:last-child { z-index: 3; }
.table tbody tr:hover td:last-child { background: #fdfaf7; }
/* 吸附列左侧一条淡阴影，提示"这一列是固定的" */
.table th:last-child::before,
.table td:last-child::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  transform: translateX(-100%);
  background: linear-gradient(to right, rgba(15, 23, 42, 0), rgba(15, 23, 42, .06));
  pointer-events: none;
}

/* 宽表密度微调：单元格左右内边距 12→10，让 10 列的表更容易塞进一屏 */
.table th, .table td { padding-left: 10px; padding-right: 10px; }
.table th:first-child, .table td:first-child { padding-left: 14px; }
/* 吸附列左侧 1px 分隔线，滚动时能看清"这一列是固定的" */
.table th:last-child, .table td:last-child { border-left: 1px solid var(--border); }

/* 人脸审核缩略图（2026-11-24） */
.face-thumb { width: 56px; height: 70px; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; background: #f5f0ea; }
