/* ============================================================
   乾堂 OA（V5 骨架）· 深色主题样式
   对齐 02-设计《设计规范.md》V5.0 设计令牌：
     - 单一深色底 + 科技蓝（操作）+ 科技青（选中/联动）
     - 控件统一 H32 / R8，卡片 R12，标签 R999
     - 左栏 232（≥1440）/ 208（1024–1439）/ 抽屉（<1024）
     - 页面级禁止横向滚动，横向滚动只发生在表格容器内
   页面结构由 web/assets/app.js 负责渲染，样式只在本文件维护。
   ============================================================ */

:root {
  color-scheme: dark;

  /* ---- 底色（设计规范 12. 设计令牌） ---- */
  --bg-void: #050810;
  --bg: #080e18;
  --panel: #0d1626;
  --panel-2: #111e33;
  --panel-3: #16263f;
  --line: #1b2c45;
  --line-strong: #2a405d;
  --line-row: #142338;

  /* ---- 文字 ---- */
  --ink: #e8f1fb;
  --ink-2: #b6c8dd;
  --ink-3: #7e93ac;
  --ink-disabled: #54677e;

  /* ---- 品牌与强调 ---- */
  --brand: #1f6feb;
  --brand-hi: #1a66e0;
  --brand-deep: #175bc7;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.14);
  --blue-soft: rgba(47, 125, 255, 0.14);

  /* ---- 语义（只用于状态与图表） ---- */
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --neutral: #94a3b8;

  /* ---- 外形 ---- */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;
  --h-control: 32px;

  /* ---- 光影 ---- */
  --shadow-1: 0 4px 16px rgba(2, 8, 20, 0.45);
  --shadow-2: 0 12px 32px rgba(2, 8, 20, 0.55);
  --shadow-3: 0 24px 64px rgba(2, 8, 20, 0.65);
  --ring: 0 0 0 3px rgba(34, 211, 238, 0.2);
  --glow-cyan: 0 0 0 1px rgba(34, 211, 238, 0.45), 0 0 24px rgba(34, 211, 238, 0.16);
  --inner-hi: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  /* ---- 字体 ---- */
  --font: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", system-ui, "Segoe UI", sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei", sans-serif;

  /* ---- 骨架代码沿用的别名（映射到设计令牌） ---- */
  --text: var(--ink);
  --text-dim: var(--ink-2);
  --muted: var(--ink-3);
  --accent: var(--cyan);
  --accent-2: var(--brand);
  --radius: var(--r-sm);
  --radius-lg: var(--r-md);
  --shadow: var(--shadow-2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 16% -8%, rgba(47, 125, 255, 0.14), transparent 62%),
    radial-gradient(720px 420px at 92% -4%, rgba(34, 211, 238, 0.09), transparent 58%),
    var(--bg);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
  border-radius: var(--r-xs);
}

.muted {
  color: var(--ink-3);
}

/* ============================================================
   布局：左栏 + 顶栏 + 主区
   ============================================================ */
.shell {
  display: flex;
  min-height: 100vh;
}

.rail {
  width: 232px;
  flex: 0 0 232px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.brand .logo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #04121f;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
}

.brand b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand small {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 11px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-title {
  padding: 12px 10px 6px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out;
}

.nav-item:hover {
  background: var(--panel-2);
  color: var(--ink);
  text-decoration: none;
}

.nav-item.active {
  color: var(--ink);
  background: var(--cyan-soft);
  border-color: rgba(34, 211, 238, 0.2);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.nav-item .ni {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
}

.nav-item:hover .ni {
  color: var(--ink-2);
}

.nav-item.active .ni {
  color: var(--cyan);
}

.nav-item .nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  display: inline-grid;
  place-items: center;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
}

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 4px;
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-left: 20px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-size: 13px;
  text-decoration: none;
}

.nav-subitem .sub-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 4px;
}

.nav-subitem:hover {
  background: var(--panel-2);
  color: var(--ink);
  text-decoration: none;
}

.nav-subitem.active {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.16);
  color: var(--cyan);
}

.nav-aux {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px 0;
  border-top: 1px solid var(--line);
}

.side-link {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-size: 12px;
  text-decoration: none;
}

.side-link:hover {
  background: var(--panel-2);
  color: var(--ink-2);
  text-decoration: none;
}

.rail-foot {
  padding: 10px 16px 14px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.6;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 0 24px;
  background: rgba(8, 14, 24, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.crumb {
  color: var(--ink-3);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb b {
  color: var(--ink);
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

/* 2026-11-24 根因修复（T74 收口）：顶栏动作区原为 flex:0 0 auto，手机档把顶栏顶宽 → 全站 375 溢出。
   改为可收缩 + 收缩到 0 宽，页面级补丁可保留但不再是唯一兜底。 */
@media (max-width: 767px) {
  .top-actions {
    flex-shrink: 1;
    min-width: 0;
    gap: 6px;
    overflow: hidden;
  }
  .top-actions .user-chip {
    max-width: 88px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .top-actions .btn,
  .top-actions button {
    flex-shrink: 1;
  }
}

.user-chip {
  height: var(--h-control);
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}

.content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

/* ============================================================
   页面头
   ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-title {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--ink);
}

.page-desc {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 12px;
}

/* ============================================================
   控件：按钮 / 输入 / 下拉（统一 H32 / R8）
   ============================================================ */
.btn {
  height: var(--h-control);
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: transparent;
  color: #c7d7ea;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}

.btn:hover {
  background: #12203a;
  border-color: #3c5c80;
  color: var(--ink);
  text-decoration: none;
}

.btn:active {
  background: var(--panel-3);
  border-color: var(--cyan);
  color: var(--ink);
}

.btn:disabled {
  border-color: var(--line);
  color: var(--ink-disabled);
  cursor: not-allowed;
  background: transparent;
}

.btn.primary {
  background: var(--brand);
  border-color: transparent;
  color: #ffffff;
  font-weight: 600;
}

.btn.primary:hover {
  background: var(--brand-hi);
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.35);
}

.btn.primary:active {
  background: var(--brand-deep);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
}

.btn.primary:disabled {
  background: #1c3a5e;
  color: #6b7f96;
  border-color: #24425f;
  box-shadow: none;
}

.btn.ghost {
  border-color: transparent;
  color: var(--ink-3);
}

.btn.ghost:hover {
  background: #12203a;
  color: var(--ink);
}

.btn.danger {
  background: #2a151c;
  border-color: #5c2a30;
  color: #fca5a5;
}

.btn.danger:hover {
  background: #3a1b24;
}

.icon-btn {
  width: var(--h-control);
  height: var(--h-control);
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.icon-btn:hover {
  background: #12203a;
  color: var(--ink);
}

.input,
.select {
  height: var(--h-control);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #0a1422;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.input::placeholder {
  color: #6f8299;
}

.input:hover,
.select:hover {
  border-color: #3c5c80;
}

.input:focus,
.select:focus {
  border-color: var(--cyan);
  box-shadow: var(--ring);
}

.select {
  padding-right: 28px;
  cursor: pointer;
}

.select option {
  background: var(--panel-2);
  color: var(--ink);
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1), var(--inner-hi);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 52px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--ink);
}

.card-title .count {
  margin-left: 8px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 400;
}

.card-body {
  padding: 16px;
}

.card-body.flush {
  padding: 0;
}

.error-box .btn {
  margin-top: 10px;
}

.section {
  margin-top: 16px;
}

.section:first-child {
  margin-top: 0;
}

.two-col {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.35fr 1fr;
}

.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.two-col > *,
.grid-2 > * {
  min-width: 0;
}

/* ============================================================
   KPI
   ============================================================ */
.kpi-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.kpi {
  min-height: 96px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1), var(--inner-hi);
}

.kpi .k-label {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 18px;
}

.kpi .k-value {
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kpi .k-sub {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi.accent .k-value {
  color: var(--cyan);
}

/* ============================================================
   表格（表头 40 / 行高 44）
   ============================================================ */
.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th {
  height: 40px;
  padding: 0 12px;
  text-align: left;
  color: #8fa5bc;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: #0b1524;
  border-bottom: 1px solid var(--line);
}

table.data td {
  height: 44px;
  padding: 6px 12px;
  color: #c7d7ea;
  border-bottom: 1px solid var(--line-row);
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr:hover {
  background: #0f1d31;
}

table.data tbody tr.clickable {
  cursor: pointer;
}

table.data .num {
  text-align: right;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data .nowrap {
  white-space: nowrap;
}

/* ============================================================
   标签 / 状态灯
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.badge.status::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}

.badge.green {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
}

.badge.blue {
  color: #7dd3fc;
  background: var(--blue-soft);
  border-color: rgba(47, 125, 255, 0.3);
}

.badge.cyan {
  color: #7de8f7;
  background: var(--cyan-soft);
  border-color: rgba(34, 211, 238, 0.26);
}

.badge.purple {
  color: #c4b5fd;
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.28);
}

.badge.amber {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
}

.badge.red {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
}

.badge.gray {
  color: var(--neutral);
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
}

/* ============================================================
   工具条 / 分页 / 分段控件
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.toolbar .spacer {
  flex: 1;
}

.toolbar .hint {
  color: var(--ink-3);
  font-size: 12px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
}

.pager .info {
  margin-right: auto;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--line);
}

.tab {
  height: var(--h-control);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  color: var(--ink-3);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  background: transparent;
}

.tab.active {
  color: var(--ink);
  border-bottom-color: var(--cyan);
  background: var(--panel-3);
}

/* ============================================================
   详情栅格
   ============================================================ */
.detail-grid {
  display: grid;
  gap: 14px 22px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.field label {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 18px;
}

.field .v {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 22px;
  word-break: break-all;
}

/* ============================================================
   分布条
   ============================================================ */
.bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 44px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.bar-row .label {
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-row .value {
  color: var(--ink-3);
  text-align: right;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--panel-3);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand), var(--cyan));
}

/* ============================================================
   空态 / 加载 / 错误 / 提示
   ============================================================ */
.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}

.loading {
  padding: 24px 16px;
}

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton span {
  display: block;
  height: 12px;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--panel-3) 25%, #1d2f49 37%, var(--panel-3) 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
}

.skeleton span:nth-child(1) {
  width: 92%;
}

.skeleton span:nth-child(2) {
  width: 76%;
}

.skeleton span:nth-child(3) {
  width: 84%;
}

@keyframes sk {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.error-box {
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  border-radius: var(--r-sm);
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
}

.placeholder {
  max-width: 760px;
}

.placeholder .ph-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid rgba(34, 211, 238, 0.2);
  background: var(--cyan-soft);
  color: var(--cyan);
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 700;
}

.placeholder ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--ink-2);
}

.placeholder li {
  margin: 4px 0;
}

.notice {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: #0a1422;
  color: var(--ink-3);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 99;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 13px;
  box-shadow: var(--shadow-2);
}

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(900px 520px at 16% -8%, rgba(47, 125, 255, 0.14), transparent 62%),
    radial-gradient(720px 420px at 92% -4%, rgba(34, 211, 238, 0.09), transparent 58%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-3);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-brand .logo {
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: #04121f;
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
}

.login-brand b {
  display: block;
  font-size: 17px;
  font-weight: 600;
}

.login-brand small {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 12px;
}

.login-form .input {
  width: 100%;
}

.login-form .btn {
  width: 100%;
  margin-top: 2px;
}

.login-error {
  display: none;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: var(--r-sm);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  padding: 8px 12px;
  font-size: 12px;
}

.login-error.show {
  display: block;
}

.login-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.8;
}

.login-hint code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: #0a1422;
  color: var(--ink-2);
  font-family: var(--font-num);
  font-size: 11px;
}

/* ============================================================
   响应式：1024–1439 左栏 208；<1024 抽屉；<768 单列
   ============================================================ */
@media (max-width: 1439px) and (min-width: 1024px) {
  .rail {
    width: 208px;
    flex-basis: 208px;
  }
}

@media (max-width: 1023px) {
  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    width: 256px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-3);
  }

  body.nav-open .rail {
    transform: translateX(0);
  }

  .nav-mask {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(5, 8, 16, 0.62);
  }

  body.nav-open .nav-mask {
    display: block;
  }

  .icon-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 16px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .content {
    padding: 12px;
  }

  .topbar {
    min-height: 56px;
    padding: 0 12px;
  }

  .user-chip {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
  }

  .kpi .k-value {
    font-size: 24px;
    line-height: 32px;
  }

  .kpi .k-sub {
    white-space: normal;
  }

  .page-title {
    font-size: 20px;
  }

  .toolbar {
    padding: 10px 12px;
  }

  .toolbar .input,
  .toolbar .select {
    flex: 1 1 100%;
    min-width: 0;
  }

  .card-head,
  .card-body {
    padding: 12px;
  }

  table.data {
    min-width: 760px;
  }

  .login-card {
    padding: 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 2026-11-23 总管修复：hidden 被 .login-form{display:flex} 覆盖，导致登录页登录/改密双表单同屏 */
.login-form[hidden]{display:none !important;}

/* ============================================================
   2026-11-23 T20 移动端规范落地
   依据：04-测试/体验走查报告 Y-2（触控热区 <44px）、Y-3（字号 <12px）、J-3
   1) 触控热区：粗指针（手机/平板触屏）下按钮、下拉、输入、标签、表格行内链接
      统一 ≥44×44px；桌面（pointer:fine）仍是《设计规范》7.1 的 H32，不改桌面视觉。
   2) 字号下限：触屏下辅助文字 ≥12px（《设计规范》3.2 规定 11px 只允许用于数字角标）。
   ============================================================ */

/* 桌面同样生效：样式表里两处 11px 说明文字抬到 12px（Y-3 / J-3） */
.kpi .k-sub { font-size: 12px; line-height: 18px; }
.brand small,
.rail-foot,
.login-brand small { font-size: 12px; }

@media (pointer: coarse) {
  /* ---- 1. 触控热区 ≥44px ---- */
  .btn,
  .icon-btn,
  .tab,
  .input,
  .select,
  .docs-chip,
  .cov-chip,
  .ref-chip,
  .ai-chip,
  .chat-tab,
  .mention-tab,
  .reminder,
  .nav-item,
  .nav-subitem,
  .side-link,
  .sb-crumb,
  .chat-suggest button { min-height: 44px; }

  .icon-btn { width: 44px; height: 44px; }
  .sb-crumb { min-width: 44px; justify-content: center; }

  /* 表格行内链接：44px 热区，行高由 44 放宽到 56，仍符合《设计规范》4.2 的 44–56 */
  table.data td a,
  table.data td button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
  }

  /* 表格之外的行内链接（面包屑、详情字段、灯带机构列表）同样给 44px 热区 */
  #crumb a[href],
  .content a[href]:not(.btn):not(.ref-chip) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  #crumb a[href] { min-width: 44px; justify-content: center; }

  /* ---- 2. 字号下限 12px ---- */
  .kpi .k-sub,
  .sb-kpi .k-sub,
  .corps-derived,
  .corps-hint,
  .corps-node-sub,
  .corps-metrics .m-label,
  .lamp-endpoint,
  .docs-name-ext,
  .sb-notes,
  .sb-hint,
  .lg-note,
  .sb-item .sb-item-main small,
  .chat-side-foot,
  .thread-time,
  .thread-badge,
  .thread-preview,
  .banner-code,
  .chat-gateway,
  .msg-avatar,
  .msg-meta,
  .ref-chip,
  .mention-note,
  .mention-item .m-sub,
  .chat-room-sub,
  .task-table .t-meta,
  .cov-note,
  .cov-note code,
  .cell-sub,
  .cov-tag { font-size: 12px !important; }

  /* 页内 <span style="font-size:11px"> 等内联小字一并兜住（!important 覆盖内联样式） */
  [style*="font-size:11"],
  [style*="font-size:10"] { font-size: 12px !important; }
}

