/* ============================================================
   筑建通 · 建筑公司项目管理系统
   设计令牌：验证过的数据可视化配色 + 专业工程 UI
   ============================================================ */

:root {
  /* 图表 / 表面（来自验证过的参考色板） */
  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --border:         rgba(11, 11, 11, 0.10);

  /* 分类色（固定顺序） */
  --series-1: #2a78d6;  /* blue */
  --series-2: #eb6834;  /* orange */
  --series-3: #1baf7a;  /* aqua/green */
  --series-4: #eda100;  /* yellow */
  --series-5: #e87ba4;  /* magenta */
  --series-6: #008300;  /* green */
  --series-7: #4a3aa7;  /* violet */
  --series-8: #e34948;  /* red */

  /* 状态色 */
  --good:     #0ca30c;
  --warning:  #fab219;
  --serious:  #ec835a;
  --critical: #d03b3b;

  /* 品牌 / 应用 */
  --brand:      #1b4f8a;
  --brand-2:    #256abf;
  --accent:     #eb6834;
  --sidebar-bg: #152238;
  --sidebar-ink:#c8d2e0;

  /* 布局 */
  --sidebar-w: 236px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.18);

  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--page-plane);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--brand-2); }

/* ============ 整体布局 ============ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ============ 侧边栏 ============ */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
}
.brand-logo { font-size: 26px; }
.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.brand-sub {
  font-size: 12px;
  color: #8fa0b8;
  padding: 0 10px 18px;
  margin-top: -2px;
}

.nav { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.nav-search { padding: 10px 12px 6px; flex: none; }
.nav-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 13px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.nav-search input::placeholder { color: #7c8ea6; }
.nav-search input:focus { border-color: var(--brand-2); background: rgba(255, 255, 255, 0.1); }
.nav-groups { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 12px; }
.nav-empty { padding: 20px 12px; font-size: 13px; color: #7c8ea6; text-align: center; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: none;
  background: transparent;
  color: var(--sidebar-ink);
  font-size: 14px;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active {
  background: var(--brand-2);
  color: #fff;
  font-weight: 600;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

/* 分组导航（可折叠） */
.nav-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 14px;
  color: #9db0c7;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 14px 12px 6px;
  margin-top: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s;
}
.nav-group-label:hover { color: #c8d2e0; }
.nav-group-label:first-child { margin-top: 0; padding-top: 6px; }
.nav-group-label .chev { font-size: 10px; width: 10px; text-align: center; color: #5b6d84; flex: none; }
.nav-group-label .g-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-item.sub { padding-left: 18px; font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
.nav-item.sub.active { background: var(--brand-2); }
.nav-item.soon { color: #6b7d93; opacity: 0.78; cursor: pointer; }
.nav-item.soon:hover { background: rgba(255, 255, 255, 0.04); color: #8fa0b8; }
.nav-item .soon-tag {
  margin-left: auto;
  font-size: 10px;
  color: #7c8ea6;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0 6px;
  border-radius: 999px;
  flex: none;
}

.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}
.foot-note {
  font-size: 11px;
  color: #7c8ea6;
  padding: 0 10px 10px;
}

/* ============ 主区域 ============ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.page-title { font-size: 19px; flex: 1; }
.topbar-right { color: var(--text-secondary); font-size: 13px; display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--text-secondary);
}

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

/* ============ 卡片 ============ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gridline);
}
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-muted); }
.card-body { padding: 18px; }

/* ============ 统计卡片（KPI） ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: none;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.stat-delta {
  font-size: 12px;
  font-weight: 500;
}
.stat-delta.up-good { color: var(--good); }
.stat-delta.down-bad { color: var(--critical); }
.stat-delta.neutral { color: var(--text-muted); }

/* ============ 图表 ============ */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  margin-bottom: 20px;
}
.chart-grid.single { grid-template-columns: 1fr; }

.viz-root { color-scheme: light; }
.svg-wrap { width: 100%; overflow-x: auto; }
.svg-wrap svg { display: block; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}
.legend-val { color: var(--text-primary); font-weight: 600; margin-left: 2px; }

/* 图内工具提示 */
.viz-tooltip {
  position: fixed;
  pointer-events: none;
  background: #0b0b0b;
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s;
}

/* 进度横向条列表 */
.bar-list { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 84px; gap: 12px; align-items: center; }
.bar-name { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track {
  height: 14px;
  background: var(--gridline);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: var(--series-1);
  border-radius: 4px;
}
.bar-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* ============ 预警列表 ============ */
.alert-list { display: flex; flex-direction: column; }
.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--gridline);
}
.alert-row:last-child { border-bottom: none; }
.alert-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.alert-main { flex: 1; min-width: 0; }
.alert-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.alert-src { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .search {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.toolbar .spacer { flex: 1; }
.filter-value, .filter-input {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--text-primary);
  padding: 0 12px;
}
.filter-value { width: 100%; }
.filter-input { width: 100%; min-width: 0; }
.filter-separator { color: var(--text-muted); font-size: 13px; }
.filter-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.th-filter-wrap { display: inline-flex; align-items: center; gap: 5px; }
.column-filter-btn {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  color: #8491a3;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.column-filter-btn:hover { color: var(--primary); background: rgba(42,120,214,.1); }
.column-filter-btn.active { color: #fff; background: var(--primary); box-shadow: 0 4px 12px rgba(42,120,214,.28); }
.column-filter-popover {
  position: fixed;
  z-index: 120;
  padding: 14px;
  border: 1px solid rgba(42,120,214,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 50px rgba(10,31,56,.22);
  backdrop-filter: blur(14px);
}
.column-filter-title { margin-bottom: 12px; color: var(--text-primary); font-size: 14px; font-weight: 750; }
.column-filter-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.mobile-field-filter { display: none; }

/* ============ 表格 ============ */
.table-wrap {
  overflow-x: auto;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--gridline);
  white-space: nowrap;
  background: #f6f6f4;
}
tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--gridline);
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f6f6f4; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td strong { color: var(--text-primary); font-weight: 600; }
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px !important;
}

.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.b-good    { color: var(--good);     background: rgba(12,163,12,0.10); }
.badge.b-warning { color: #9a6a00;         background: rgba(250,178,25,0.16); }
.badge.b-serious { color: #b5542f;         background: rgba(236,131,90,0.16); }
.badge.b-critical{ color: var(--critical); background: rgba(208,59,59,0.10); }
.badge.b-blue    { color: var(--series-1); background: rgba(42,120,214,0.10); }
.badge.b-gray    { color: var(--text-muted); background: rgba(137,135,129,0.14); }

/* ============ 按钮 ============ */
.btn {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: #f0efec; }
.btn-primary {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
}
.btn-primary:hover { background: #1c5cab; }
.btn-danger {
  background: var(--critical);
  border-color: var(--critical);
  color: #fff;
}
.btn-danger:hover { background: #b33030; }
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: #c8d2e0;
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-link {
  background: none;
  border: none;
  color: var(--brand-2);
  padding: 4px 6px;
  font-size: 12px;
}
.btn-link.danger { color: var(--critical); }
.btn-link:hover { text-decoration: underline; }

/* ============ 输入 ============ */
input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(37,106,191,0.14);
}
textarea { resize: vertical; min-height: 70px; }
label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field .req { color: var(--critical); margin-left: 2px; }

/* ============ 表单 ============ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 11, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--surface-1);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-sm { max-width: 400px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gridline);
}
.modal-head h2 { font-size: 16px; }
.modal-close {
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-muted);
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--gridline);
}

/* ============ 提示 ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #0b0b0b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 120;
}
.toast[hidden] { display: none; }
.toast.success { background: #0b3d1f; }
.toast.error { background: #5c1a1a; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 0.2s;
    z-index: 80;
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .chart-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 64px; }
}

/* ============ 移动端侧边栏遮罩 ============ */
.sidebar-mask { display: none; }

/* ============ 手机端（≤600px）专项优化 ============ */
@media (max-width: 600px) {
  /* 侧边栏抽屉遮罩 */
  .sidebar-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(11, 11, 11, 0.42);
    z-index: 70;
  }
  .sidebar-mask[hidden] { display: none; }

  /* 内容区留白收紧 */
  .content { padding: 14px 12px 36px; }

  /* 顶栏：隐藏日期、标题略小 */
  .topbar { padding: 10px 12px; gap: 8px; }
  .page-title { font-size: 16px; }
  .topbar .today { display: none; }
  .topbar-right { gap: 8px; }
  .user-chip { font-size: 12px; }

  /* KPI 卡片两列紧凑 */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 12px 14px; gap: 3px; }
  .stat-value { font-size: 20px; }

  /* 卡片/图表留白 */
  .card-head { padding: 12px 14px; }
  .card-title { font-size: 14px; }
  .card-body { padding: 14px; }
  .chart-grid { gap: 12px; margin-bottom: 14px; }
  .legend { gap: 4px 12px; }
  .svg-wrap svg { max-width: 100%; height: auto; }

  /* 表格 → 卡片化 */
  .table-wrap { border: none; box-shadow: none; background: transparent; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody,
  .table-wrap tr, .table-wrap th, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 4px 14px;
    box-shadow: var(--shadow);
  }
  .table-wrap tbody tr:hover { background: var(--surface-1); }
  .table-wrap td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gridline);
    text-align: right;
  }
  .table-wrap td:last-child { border-bottom: none; }
  .table-wrap td::before {
    content: attr(data-label);
    flex: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
  }
  .table-wrap td.num { text-align: right; }
  .table-wrap td.empty { display: block; text-align: center; }
  .table-wrap td.empty::before { display: none; }
  .row-actions { justify-content: flex-end; }

  /* 工具栏 */
  .toolbar { gap: 8px; }
  .toolbar .search { max-width: none; min-width: 0; flex: 1; }
  .toolbar .spacer { display: none; }
  .mobile-field-filter {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border: 0;
    border-radius: 6px;
    color: var(--text-muted);
    background: transparent;
    font-size: 12px;
    font-weight: 650;
  }
  .mobile-field-filter.active { color: #fff; background: var(--primary); }
  .table-wrap td::before { display: none; }

  /* 弹窗：底部抽屉式全宽 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal-sm { max-width: none; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; }

  /* 触控目标增大 + 防 iOS 聚焦缩放 */
  .nav-item, .nav-group-label { min-height: 44px; }
  .btn { min-height: 40px; }
  input, select, textarea { font-size: 16px; }
}

/* ============ 登录页 ============ */
.app[hidden] { display: none; }

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #152238 0%, #1b4f8a 100%);
  padding: 20px;
}
.login-view[hidden] { display: none; }
.login-card {
  background: var(--surface-1);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  padding: 32px 30px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.login-brand .brand-logo { font-size: 34px; }
.login-brand h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.login-brand p { font-size: 12px; color: var(--text-muted); }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-btn { width: 100%; padding: 11px; font-size: 14px; }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error { font-size: 12px; color: var(--critical); }
.login-error[hidden] { display: none; }
.login-hint { font-size: 11px; color: var(--text-muted); margin-top: 18px; text-align: center; }

.user-chip {
  font-size: 12px;
  color: var(--text-secondary);
  background: #f0efec;
  padding: 4px 10px;
  border-radius: 999px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   2026 高端视觉升级 · 数字建造驾驶舱
   保留原业务结构，仅统一重塑视觉与交互层级
   ============================================================ */
:root {
  --surface-1: rgba(255, 255, 255, .88);
  --page-plane: #eef3f9;
  --text-primary: #0d1b2d;
  --text-secondary: #506176;
  --text-muted: #7e8da0;
  --gridline: rgba(39, 73, 111, .09);
  --border: rgba(40, 78, 120, .12);
  --brand: #0d4f94;
  --brand-2: #1477d4;
  --accent: #ff7a32;
  --sidebar-bg: #07101f;
  --sidebar-ink: #b9c9dc;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(15, 38, 68, .03), 0 12px 30px rgba(27, 65, 105, .07);
  --shadow-lg: 0 28px 80px rgba(4, 15, 30, .24);
}

html, body { font-size: 15px; }
body {
  background:
    radial-gradient(800px 500px at 92% -10%, rgba(20,119,212,.13), transparent 66%),
    radial-gradient(700px 480px at 12% 105%, rgba(255,122,50,.07), transparent 64%),
    var(--page-plane);
  background-attachment: fixed;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(rgba(34,83,132,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,83,132,.04) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(circle at 60% 36%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 60% 36%, #000, transparent 72%);
}

.app { grid-template-columns: 264px 1fr; }
.sidebar {
  width: 264px;
  padding: 22px 16px;
  background:
    radial-gradient(circle at 10% 0%, rgba(28,126,226,.24), transparent 34%),
    linear-gradient(180deg, #0a1729 0%, #07101f 58%, #081321 100%);
  border-right: 1px solid rgba(130,180,235,.12);
  box-shadow: 18px 0 50px rgba(4,15,30,.12);
  overflow: hidden;
}
.sidebar::before {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  right: -150px;
  bottom: 9%;
  border: 1px solid rgba(74,159,247,.16);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(74,159,247,.025), 0 0 0 74px rgba(74,159,247,.018);
  pointer-events: none;
}
.brand { position: relative; padding: 3px 10px; gap: 12px; }
.brand-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 13px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  background: linear-gradient(145deg, #35a2ff, #1265bc 62%, #0d4787);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 10px 25px rgba(20,119,212,.28);
  padding: 0;
  overflow: hidden;
}
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-size: 21px; letter-spacing: .12em; }
.brand-sub { padding-left: 64px; margin-top: -10px; padding-bottom: 22px; font-size: 10px; letter-spacing: .16em; color: #6f88a6; }
.nav-search { padding: 10px 7px 10px; }
.nav-search input {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.nav-group-label { color: #64809f; font-size: 11px; letter-spacing: .14em; padding: 17px 10px 7px; }
.nav-item { border-radius: 11px; padding: 10px 11px; }
.nav-item.sub { font-size: 13px; padding: 9px 11px 9px 16px; }
.nav-item:hover { background: rgba(74,159,247,.09); }
.nav-item.active, .nav-item.sub.active {
  background: linear-gradient(100deg, rgba(31,132,233,.94), rgba(25,104,188,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.17), 0 8px 22px rgba(4,77,151,.24);
}
.sidebar-foot { position: relative; border-color: rgba(255,255,255,.07); }
.foot-note::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #35d197; box-shadow: 0 0 10px #35d197; }

.topbar {
  min-height: 72px;
  padding: 14px 30px;
  background: rgba(247,250,253,.78);
  border-color: rgba(40,78,120,.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: 0 7px 25px rgba(24,59,96,.04);
}
.page-title { font-size: 22px; font-weight: 750; letter-spacing: -.03em; }
.page-title::after { content: 'DIGITAL CONSTRUCTION'; display: block; margin-top: 1px; color: var(--text-muted); font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.today { font-size: 12px; color: var(--text-muted); }
.user-chip { background: rgba(20,119,212,.08); color: var(--brand); border: 1px solid rgba(20,119,212,.11); padding: 6px 12px; font-weight: 650; }
.content { max-width: 1440px; padding: 28px 30px 56px; }

.card, .stat-card, .table-wrap {
  border-color: rgba(52,90,130,.10);
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
}
.card { overflow: hidden; }
.card-head { padding: 17px 20px; background: linear-gradient(90deg, rgba(20,119,212,.035), transparent); }
.card-title { font-size: 16px; color: var(--text-primary); }
.card-body { padding: 20px; }
.stat-grid { gap: 17px; margin-bottom: 22px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  padding: 20px;
  border-radius: 18px;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.stat-card::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, #29a3ff, #1768c3); }
.stat-card::after { content: ''; position: absolute; width: 130px; height: 130px; right: -60px; bottom: -76px; border-radius: 50%; background: radial-gradient(circle, rgba(20,119,212,.13), transparent 68%); }
.stat-card:nth-child(2n)::before { background: linear-gradient(180deg, #ff9d55, #ff6e28); }
.stat-card:nth-child(3n)::before { background: linear-gradient(180deg, #43d5a0, #13a975); }
.stat-card:hover { transform: translateY(-3px); border-color: rgba(20,119,212,.21); box-shadow: 0 18px 42px rgba(25,70,115,.12); }
.stat-label { font-size: 12px; letter-spacing: .04em; }
.stat-value { font-size: 30px; letter-spacing: -.045em; color: #0a315b; }
.chart-grid { gap: 18px; }

.table-wrap { border-radius: 16px; overflow-x: auto; }
table { font-size: 14px; }
thead th { padding: 14px 17px; background: rgba(232,239,247,.68); color: #687b90; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
tbody td { padding: 13px 17px; }
tbody tr { transition: background .18s ease; }
tbody tr:hover { background: rgba(20,119,212,.045); }

.btn { border-radius: 10px; padding: 9px 16px; font-weight: 650; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #1987e9, #0f62b6); box-shadow: 0 8px 18px rgba(20,119,212,.20); }
.btn-primary:hover { background: linear-gradient(135deg, #2794f3, #0e5ba8); box-shadow: 0 11px 24px rgba(20,119,212,.28); }
.btn-danger { background: linear-gradient(135deg, #e75c62, #c8363f); }
input, select, textarea { border-radius: 10px; border-color: rgba(45,80,117,.15); background: rgba(255,255,255,.92); padding: 10px 13px; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(20,119,212,.11); }
.badge { padding: 4px 10px; font-weight: 650; }
.badge::before { box-shadow: 0 0 7px currentColor; }

.modal-mask { background: rgba(2,10,20,.62); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); }
.modal { border-radius: 20px; border: 1px solid rgba(255,255,255,.35); box-shadow: 0 34px 100px rgba(1,9,18,.36); }
.modal-head { padding: 19px 22px; }
.modal-body { padding: 22px; }
.modal-foot { padding: 15px 22px; background: rgba(237,243,249,.55); }
.toast { border-radius: 12px; padding: 12px 20px; background: rgba(7,16,31,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

.login-view {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(24,137,238,.27), transparent 30%),
    radial-gradient(circle at 86% 82%, rgba(255,120,48,.15), transparent 26%),
    linear-gradient(135deg, #050b15 0%, #0a1d34 52%, #0a2c50 100%);
}
.login-view::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(91,166,239,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(91,166,239,.07) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(circle at center, #000, transparent 76%);
  mask-image: radial-gradient(circle at center, #000, transparent 76%);
}
.login-view::after { content: ''; position: absolute; width: 520px; height: 520px; right: -220px; top: -230px; border: 1px solid rgba(90,171,249,.18); border-radius: 50%; box-shadow: 0 0 0 55px rgba(90,171,249,.025), 0 0 0 110px rgba(90,171,249,.018); }
.login-card {
  position: relative;
  z-index: 2;
  max-width: 430px;
  padding: 40px 38px 34px;
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.58);
  box-shadow: 0 38px 100px rgba(0,8,19,.42), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
  backdrop-filter: blur(24px) saturate(1.15);
}
.login-brand { margin-bottom: 31px; }
.login-brand .brand-logo { width: 50px; height: 50px; font-size: 22px; }
.login-brand h1 { font-size: 27px; letter-spacing: .08em; }
.login-brand p { margin-top: 3px; font-size: 12px; letter-spacing: .04em; }
.login-card form { gap: 17px; }
.login-card label { font-size: 12px; font-weight: 700; color: #40546c; }
.login-card input { min-height: 46px; }
.login-btn { min-height: 48px; margin-top: 4px; font-size: 15px; letter-spacing: .18em; }
.login-hint { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 22px; color: #7890a9; }
.secure-dot { width: 6px; height: 6px; border-radius: 50%; background: #19b77d; box-shadow: 0 0 8px rgba(25,183,125,.7); }

.app-loading, .load-error {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--text-secondary);
  text-align: center;
}
.app-loading strong, .load-error strong { color: var(--text-primary); font-size: 17px; }
.app-loading small, .load-error p { color: var(--text-muted); font-size: 13px; }
.loading-ring {
  width: 42px;
  height: 42px;
  margin-bottom: 7px;
  border: 3px solid rgba(20,119,212,.12);
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: loading-spin .75s linear infinite;
}
.load-error { padding: 40px 20px; }
.load-error::before { content: '!'; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; font-size: 23px; font-weight: 800; background: linear-gradient(135deg, #ef777c, #c93c46); box-shadow: 0 12px 28px rgba(201,60,70,.2); }
.load-error .btn { margin-top: 8px; }
@keyframes loading-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: no-preference) {
  .login-card { animation: rise-in .65s cubic-bezier(.2,.8,.2,1) both; }
  .stat-card, .card, .table-wrap { animation: surface-in .45s ease both; }
  @keyframes rise-in { from { opacity: 0; transform: translateY(20px) scale(.98); } }
  @keyframes surface-in { from { opacity: 0; transform: translateY(8px); } }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { width: 276px; }
  .topbar { min-height: 64px; padding: 12px 18px; }
  .content { padding: 20px 18px 46px; }
}

@media (max-width: 600px) {
  html, body { font-size: 14px; }
  .topbar { min-height: 60px; padding: 10px 12px; }
  .page-title { font-size: 18px; }
  .page-title::after { display: none; }
  .content { padding: 15px 12px 38px; }
  .stat-grid { gap: 10px; }
  .stat-card { min-height: 102px; padding: 15px; border-radius: 15px; }
  .stat-value { font-size: 23px; }
  .card, .table-wrap { border-radius: 15px; }
  .card-head { padding: 14px 15px; }
  .card-body { padding: 15px; }
  .table-wrap tbody tr { border-radius: 15px; box-shadow: 0 10px 28px rgba(25,65,105,.08); }
  .modal { border-radius: 22px 22px 0 0; }
  .login-card { max-width: 390px; padding: 32px 24px 27px; border-radius: 22px; }
  .login-brand h1 { font-size: 24px; }
}

/* ============================================================
   20260904.3 · 导航层级与数据看板动效增强
   ============================================================ */
.nav-group-label {
  min-height: 40px;
  padding: 18px 10px 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #91a9c4;
}
.nav-group-label .chev {
  width: 16px;
  font-size: 12px;
  color: #55aafa;
  transition: transform .24s ease, color .24s ease;
}
.nav-group-label:hover { color: #fff; }
.nav-group-label:hover .chev { color: #8ac7ff; transform: translateX(2px); }
.nav-group-label .g-label { text-shadow: 0 0 18px rgba(91,174,255,.08); }

/* 20260905 · 侧边栏科技线性图标 */
.nav-group-label .g-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nav-group-label .g-label > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-tech-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(93, 181, 255, .18);
  border-radius: 9px;
  color: #68baff;
  background: linear-gradient(145deg, rgba(57, 145, 225, .14), rgba(22, 72, 124, .07));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 0 0 rgba(69,165,255,0);
  transition: color .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease, transform .22s ease;
}
.nav-tech-icon::after {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 3px;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: .28;
}
.nav-tech-icon svg { width: 17px; height: 17px; }
.nav-group-label:hover .nav-tech-icon {
  color: #a7d9ff;
  border-color: rgba(105, 190, 255, .46);
  background: linear-gradient(145deg, rgba(56, 159, 247, .24), rgba(19, 88, 157, .12));
  box-shadow: 0 0 18px rgba(55, 161, 255, .18), inset 0 1px 0 rgba(255,255,255,.08);
  transform: translateY(-1px);
}
.nav-group-label:not(.collapsed) .nav-tech-icon {
  color: #d9efff;
  border-color: rgba(78, 172, 255, .54);
  background: linear-gradient(145deg, rgba(34, 137, 231, .36), rgba(13, 83, 153, .2));
  box-shadow: 0 0 20px rgba(44, 150, 246, .2), inset 0 1px 0 rgba(255,255,255,.1);
}

/* 看板表面：柔和的扫描光和空间层次 */
.stat-card, .chart-grid .card, .content > .card { isolation: isolate; }
.stat-card::after {
  width: 180px;
  height: 180px;
  right: -82px;
  bottom: -110px;
  background: radial-gradient(circle, rgba(33,151,247,.20), transparent 67%);
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.stat-card:hover::after { transform: translate(-16px, -16px) scale(1.16); }
.stat-card .stat-value {
  position: relative;
  z-index: 2;
  background: linear-gradient(110deg, #092d54 0%, #116dbf 52%, #2da8f8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-card:nth-child(2n) .stat-value {
  background-image: linear-gradient(110deg, #70310d, #d95a18 55%, #ff984b);
}
.stat-card:nth-child(3n) .stat-value {
  background-image: linear-gradient(110deg, #07573d, #11a575 55%, #42d9a3);
}
.stat-card .stat-value {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-card::before { box-shadow: 0 0 16px rgba(41,163,255,.36); }
.stat-card:nth-child(2n)::before { box-shadow: 0 0 16px rgba(255,110,40,.34); }
.stat-card:nth-child(3n)::before { box-shadow: 0 0 16px rgba(19,169,117,.34); }

.chart-grid .card, .content > .card {
  position: relative;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.chart-grid .card::after, .content > .card::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(480px circle at var(--mx, 70%) var(--my, 0%), rgba(45,164,255,.11), transparent 42%);
  transition: opacity .3s ease;
}
.chart-grid .card:hover, .content > .card:hover {
  transform: translateY(-2px);
  border-color: rgba(31,137,231,.19);
  box-shadow: 0 22px 52px rgba(21,63,107,.11);
}
.chart-grid .card:hover::after, .content > .card:hover::after { opacity: 1; }
.chart-grid .card-head::before, .content > .card .card-head::before {
  content: '';
  width: 5px;
  height: 18px;
  margin-right: 9px;
  border-radius: 5px;
  background: linear-gradient(180deg, #35adff, #126ac0);
  box-shadow: 0 0 13px rgba(53,173,255,.35);
}
.chart-grid .card-head { justify-content: flex-start; }
.chart-grid .card-head > :last-child:not(:first-child) { margin-left: auto; }

.bar-track { height: 15px; border-radius: 999px; background: rgba(25,80,132,.08); }
.bar-fill {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #1269c0, #27a4f4, #42c7ef);
  box-shadow: 0 4px 12px rgba(24,130,219,.18);
}
.bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.5) 45%, transparent 70%);
  transform: translateX(-120%);
}
.alert-dot { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent); }

@media (prefers-reduced-motion: no-preference) {
  .stat-card { animation: dashboard-card-in .55s cubic-bezier(.2,.8,.2,1) both; }
  .stat-card:nth-child(2) { animation-delay: .06s; }
  .stat-card:nth-child(3) { animation-delay: .12s; }
  .stat-card:nth-child(4) { animation-delay: .18s; }
  .stat-card:nth-child(5) { animation-delay: .24s; }
  .stat-card:nth-child(6) { animation-delay: .30s; }
  .bar-fill { animation: bar-grow .9s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
  .bar-fill::after { animation: bar-shine 2.8s ease-in-out infinite 1s; }
  .alert-dot { animation: alert-pulse 2.2s ease-in-out infinite; }
  .viz-root svg { animation: chart-reveal .65s ease both; }
  @keyframes dashboard-card-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
  @keyframes bar-grow { from { transform: scaleX(0); } }
  @keyframes bar-shine { 55%, 100% { transform: translateX(140%); } }
  @keyframes alert-pulse { 50% { transform: scale(1.18); filter: brightness(1.15); } }
  @keyframes chart-reveal { from { opacity: 0; transform: translateY(6px); } }
}

@media (max-width: 900px) {
  .nav-group-label { font-size: 15px; min-height: 44px; }
}

/* 20260906.2 · KPI 金额由货币符号、数值和单位组成，窄卡片自动缩放。 */
.stat-card { container-type: inline-size; }
.stat-card .stat-value {
  min-width: 0;
  font-size: clamp(22px, 16cqw, 30px);
}
.stat-money {
  display: inline-flex;
  max-width: 100%;
  align-items: baseline;
  gap: .08em;
  white-space: nowrap;
  vertical-align: baseline;
}
.stat-money-currency,
.stat-money-unit {
  flex: 0 0 auto;
  color: inherit;
  font-size: .52em;
  font-weight: 750;
  line-height: 1;
}
.stat-money-currency { margin-right: .02em; }
.stat-money-amount {
  min-width: 0;
  font-size: 1em;
  font-weight: 750;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-money.is-compact .stat-money-amount { font-size: .86em; }
.stat-money.is-compact .stat-money-unit { font-size: .48em; }
@container (max-width: 185px) {
  .stat-card .stat-value { font-size: 22px; }
  .stat-money { gap: .04em; }
}
