/* 明亮模式 · 现代办公风 */
:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --bg-page: #f0f2f5;
  --bg-elevated: #ffffff;
  --text: #1d2129;
  --text-secondary: #4e5969;
  --text-tertiary: #86909c;
  --border: #e5e6eb;
  --border-light: #f2f3f5;
  --primary: #165dff;
  --primary-hover: #0e42d2;
  --primary-soft: #e8f3ff;
  --nav-bg: #ffffff;
  --subnav-bg: #ffffff;
  --success: #34c759;
  --success-soft: #e8f8ec;
  --warning: #ff9500;
  --warning-soft: #fff4e6;
  --danger: #f54a45;
  --danger-soft: #ffece8;
  --shadow-xs: 0 1px 2px rgba(31, 35, 41, 0.04);
  --shadow-sm: 0 2px 8px rgba(31, 35, 41, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 35, 41, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --nav-h: 60px;
  --subnav-w: 216px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition: 0.18s ease;
}

* { box-sizing: border-box; }
html {
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5715;
  overflow-x: hidden;
  min-width: 0;
}
.app-shell,
.body-row,
.page-main,
.page-content {
  min-width: 0;
  max-width: 100%;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ========== 顶栏 · 主菜单 ========== */
.top-nav {
  height: var(--nav-h);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px 0 20px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03), 0 4px 16px rgba(29, 33, 41, 0.04);
}
.brand-block {
  display: flex; align-items: center; gap: 12px;
  margin-right: 28px; flex-shrink: 0;
  padding-right: 20px;
  border-right: 1px solid var(--border-light);
}
.brand-logo {
  width: 38px; height: 38px; flex-shrink: 0;
  background: linear-gradient(145deg, #165dff 0%, #4080ff 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.28);
}
.brand-text { line-height: 1.25; }
.brand-name {
  display: block; font-size: 15px; font-weight: 600;
  color: var(--text); letter-spacing: -0.02em;
}
.brand-tag {
  display: block; font-size: 11px; color: var(--text-tertiary);
  margin-top: 2px;
}
.top-nav-items {
  display: flex; align-items: center; gap: 2px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
  padding: 0 4px;
}
.top-nav-items::-webkit-scrollbar { display: none; }
.top-nav-items a {
  display: flex; align-items: center;
  height: 36px;
  padding: 0 16px;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
  border-radius: 8px;
  font-weight: 500;
  position: relative;
  transition: color var(--transition), background var(--transition);
}
.top-nav-items a:hover {
  color: var(--primary);
  background: #f7f8fa;
}
.top-nav-items a.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.top-nav-items a.active::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: -12px;
  height: 3px; border-radius: 3px 3px 0 0;
  background: var(--primary);
}
.top-nav-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-secondary); flex-shrink: 0;
}
.theme-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 999px;
  font-size: 12px; color: #d48806;
  font-weight: 500;
}
.theme-pill::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: #fadb14;
  box-shadow: 0 0 6px #fadb14;
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 4px;
  background: #f7f8fa;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #165dff, #14c9c9);
  color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.top-nav-right a.logout-link {
  color: var(--text-tertiary);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.top-nav-right a.logout-link:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ========== 布局 · 子菜单 ========== */
.body-row { display: flex; flex: 1; min-height: calc(100vh - var(--nav-h)); }

.sub-nav {
  width: var(--subnav-w);
  background: var(--subnav-bg);
  border-right: 1px solid var(--border);
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sub-nav-head {
  padding: 16px 16px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-light);
  background: #fafbfc;
}
.sub-nav-list { padding: 10px 10px 16px; flex: 1; }
.sub-nav a {
  display: flex; align-items: center;
  min-height: 40px;
  padding: 0 14px;
  color: var(--text-secondary);
  font-size: 14px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.sub-nav a:hover {
  color: var(--text);
  background: #f7f8fa;
  border-color: var(--border-light);
}
.sub-nav a.active {
  color: var(--primary);
  background: #ffffff;
  font-weight: 600;
  border-color: #bedaff;
  box-shadow: 0 1px 4px rgba(22, 93, 255, 0.08);
}
.sub-nav a.active::before {
  content: "";
  width: 3px; height: 16px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 10px;
  margin-left: -4px;
  flex-shrink: 0;
}

.page-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-page); }
.project-context-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 20px;
  background: #e8f3ff;
  border-bottom: 1px solid #bedaff;
  font-size: 13px;
  color: var(--text);
}
.project-context-label { color: var(--muted); }
/* 全站页头 · 合同详情英雄区风格 */
.page-hero {
  background: linear-gradient(135deg, #165dff 0%, #4080ff 48%, #6aa1ff 100%);
  box-shadow: 0 4px 20px rgba(22, 93, 255, 0.18);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.page-hero::after {
  content: "";
  position: absolute; right: -40px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.page-hero-inner {
  padding: 16px 28px 18px;
  position: relative;
  z-index: 1;
}
.page-hero-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.35;
}
.page-content {
  padding: 20px 24px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.page-content > .flash { margin: 0 0 4px; flex-shrink: 0; }
.page-content > .card:only-child,
.page-content > .card:last-child { margin-bottom: 0; }

/* ========== 卡片 · 合同详情面板风格 ========== */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card.padded { padding: 20px 24px; }
.card-flush { padding: 0; }
.card-section { padding: 0; margin-bottom: 16px; }
.card-title {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding-left: 10px;
  border-left: 3px solid var(--primary);
  line-height: 1.4;
}
.card > .list-toolbar + .table-wrap,
.card > .page-toolbar + .table-wrap {
  border-top: none;
}
.card > .table-wrap .data-table { margin: 0; }
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}

/* ========== 表格 ========== */
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  background: #f7f8fa;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  text-align: left;
}
.th-sort { padding: 0 !important; white-space: nowrap; }
.th-sort-link {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 10px 12px; width: 100%; min-height: 40px;
  color: var(--text-secondary); text-decoration: none;
}
.th-sort-link:hover { color: var(--primary); background: rgba(22, 93, 255, 0.04); }
.th-sort.is-active .th-sort-link { color: var(--primary); font-weight: 600; }
.sort-arrows {
  display: inline-flex; flex-direction: column; justify-content: center;
  gap: 2px; margin-left: 2px; flex-shrink: 0;
}
.sort-up, .sort-down {
  display: block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  opacity: 0.35;
}
.sort-up { border-bottom: 5px solid var(--text-tertiary); }
.sort-down { border-top: 5px solid var(--text-tertiary); }
.sort-up.sort-on { opacity: 1; border-bottom-color: var(--primary); }
.sort-down.sort-on { opacity: 1; border-top-color: var(--primary); }
table.data-table th:not(.th-sort) {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text);
}
table.data-table tbody tr { transition: background var(--transition); }
table.data-table tbody tr:hover td { background: #f7f9fc; }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px; font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer; font-family: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(22, 93, 255, 0.28);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-link {
  border: none; background: none; box-shadow: none;
  color: var(--primary); padding: 0 8px;
}
.btn-link:hover { background: transparent; text-decoration: underline; }
.btn-link.action-danger { color: #f53f3f; }
.btn-link.action-danger:hover { color: #cb2634; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ========== 标签 ========== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 20px;
}
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-green { background: var(--success-soft); color: #1b7f37; }
.badge-orange { background: var(--warning-soft); color: #b86e00; }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-gray { background: #f0f1f3; color: var(--text-secondary); }

/* ========== 表单 ========== */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text); margin-bottom: 6px;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%; max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit;
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-row input:hover, .form-row select:hover, .form-row textarea:hover {
  border-color: #c9cdd4;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
}
.form-row input.readonly, .form-row input[readonly] {
  background: #f7f8fa;
  color: var(--text-secondary);
  cursor: default;
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }

/* ========== 项目编辑表单（钉钉风格） ========== */
.project-form-card { padding: 0; overflow: hidden; }
.project-form { padding: 24px 28px 28px; }
.project-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 32px;
}
.project-field {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.project-field-full { grid-column: 1 / -1; }
.project-field > label {
  font-size: 13px;
  color: var(--text-secondary);
  padding-top: 9px;
  text-align: right;
  white-space: nowrap;
}
.project-field > label .req { color: var(--danger); margin-right: 2px; }
.project-field .field-body { min-width: 0; }
.project-field input,
.project-field select,
.project-field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-elevated);
  color: var(--text);
}
.project-field input.readonly {
  background: #f7f8fa;
  color: var(--text-secondary);
  cursor: default;
}
.project-field textarea { resize: vertical; min-height: 72px; }
.project-field .char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.project-field .field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-tertiary);
}
.project-field .multi-select { min-height: 88px; }
.project-form-actions {
  display: flex;
  gap: 12px;
  padding-top: 24px;
  margin-top: 8px;
}
.invoice-items-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.invoice-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.invoice-items-table input,
.invoice-items-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.invoice-items-table .readonly {
  background: #f7f8fa;
}
.invoice-items-table .line-actions {
  white-space: nowrap;
}
.payment-form-panel .payment-items-section {
  margin: 20px -20px 0;
  padding: 16px 20px 0;
  width: calc(100% + 40px);
  border-top: 1px solid var(--border-light);
}
.payment-items-section .table-wrap {
  width: 100%;
  overflow-x: auto;
}
.payment-items-table {
  table-layout: fixed;
  width: 100%;
}
.payment-items-table .col-no { width: 48px; }
.payment-items-table .col-name { width: 12%; }
.payment-items-table .col-spec { width: 14%; }
.payment-items-table .col-unit { width: 7%; }
.payment-items-table .col-qty { width: 7%; }
.payment-items-table .col-price { width: 9%; }
.payment-items-table .col-amount { width: 9%; }
.payment-items-table .col-remark { width: 26%; }
.payment-items-table .col-act { width: 56px; }
.payment-items-table td input.cell-input {
  min-width: 0;
  box-sizing: border-box;
}
.payment-items-table .text-right { text-align: right; }
.payment-form-panel .readonly {
  background: #f7f8fa;
}
.pay-internal-highlight label::after {
  content: "（转账必填）";
  font-size: 11px;
  color: var(--warning);
  font-weight: normal;
  margin-left: 4px;
}
.amount-upper {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.photo-upload-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.photo-thumb {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-add {
  width: 88px;
  height: 88px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 28px;
  background: #fafbfc;
  transition: border-color var(--transition), color var(--transition);
}
.photo-add:hover { border-color: var(--primary); color: var(--primary); }
.amount-upper {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.switch-line input { width: auto; margin: 0; }

/* ========== 提示 ========== */
.flash {
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.flash-ok { background: var(--success-soft); border: 1px solid #b7eb8f; color: #1b7f37; }
.flash-err { background: var(--danger-soft); border: 1px solid #ffccc7; color: #c02a26; }

/* ========== 统计卡片 ========== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .stat-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.stat-card .label { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.stat-card .value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }

.progress-bar {
  height: 6px; background: var(--border-light);
  border-radius: 999px; overflow: hidden;
}
.progress-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary), #4080ff);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.empty {
  text-align: center; padding: 56px 24px;
  color: var(--text-tertiary); font-size: 14px;
}

/* ========== 列表工具栏 ========== */
.list-toolbar,
.page-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap; gap: 12px;
  background: var(--bg-elevated);
}
.toolbar-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

/* ========== 现代筛选栏（列表 / 卡片通用） ========== */
.modern-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}
.filter-field {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 12px 0 10px;
  background: #f7f8fa;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(229, 230, 235, 0.95);
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.filter-field:hover {
  background: #fff;
  box-shadow: inset 0 0 0 1px #d0d3da;
}
.filter-field:focus-within {
  background: #fff;
  border-color: rgba(22, 93, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1), inset 0 0 0 1px rgba(22, 93, 255, 0.35);
}
.filter-field-prefix {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; color: var(--text-tertiary); flex-shrink: 0;
}
.filter-field-prefix svg { width: 16px; height: 16px; display: block; }
.filter-date-range {
  display: flex; align-items: center; gap: 4px;
}
.filter-date-arrow {
  width: 12px; height: 12px; flex-shrink: 0; opacity: 0.45;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M2 6h7M6.5 3.5 9 6l-2.5 2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M2 6h7M6.5 3.5 9 6l-2.5 2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--text-tertiary);
}
.filter-input-date,
.filter-input-search,
.filter-input-select {
  border: none; background: transparent; font-family: inherit;
  font-size: 13px; color: var(--text);
}
.filter-input-date {
  width: 132px; height: 38px; padding: 0 2px;
  color-scheme: light;
}
.filter-input-date:focus,
.filter-input-search:focus,
.filter-input-select:focus { outline: none; }
.filter-input-date::-webkit-calendar-picker-indicator {
  opacity: 0.55; cursor: pointer;
}
.filter-field-search {
  flex: 1; min-width: 180px; max-width: 280px; padding-right: 14px;
}
.filter-field-search-sm { min-width: 140px; max-width: 200px; }
.filter-input-search {
  flex: 1; min-width: 0; height: 38px; padding: 0;
}
.filter-input-search::placeholder { color: var(--text-tertiary); }
.filter-field-select { min-width: 220px; max-width: 320px; padding-right: 8px; }
.filter-field-select-sm { min-width: 108px; max-width: 132px; }
.filter-or {
  font-size: 12px; padding: 0 2px; user-select: none;
}
.filter-input-select {
  flex: 1; min-width: 0; height: 38px; padding: 0 24px 0 0;
  cursor: pointer; appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386909c' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E") no-repeat right 2px center;
}
.filter-field-actions {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 2px;
}
.btn-filter-primary {
  height: 40px; padding: 0 18px;
  border: none; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #165dff 0%, #4080ff 100%);
  color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(22, 93, 255, 0.28);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.btn-filter-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 4px 14px rgba(22, 93, 255, 0.34);
  color: #fff;
}
.btn-filter-primary:active { transform: scale(0.98); }
.btn-filter-ghost {
  height: 40px; padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn-filter-ghost:hover {
  background: #f7f8fa;
  border-color: #c9cdd4;
  color: var(--text);
}
@media (max-width: 900px) {
  .modern-filter-bar { gap: 8px; }
  .filter-field-date,
  .filter-field-select,
  .filter-field-search { width: 100%; max-width: none; }
  .filter-field-actions { width: 100%; }
  .filter-field-actions .btn-filter-primary,
  .filter-field-actions .btn-filter-ghost { flex: 1; justify-content: center; }
}

.table-wrap { overflow-x: auto; }
.amount-orange { color: #e67e00; font-weight: 600; font-variant-numeric: tabular-nums; }
.amount-warn { color: #d46b08; font-weight: 600; font-variant-numeric: tabular-nums; }
.amount-link { color: var(--primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.amount-link:hover { color: var(--primary-hover); text-decoration: underline; }
.amount-green { color: #00b42a; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ========== 公司运营收支 ========== */
.company-ops-toolbar .toolbar-actions {
  gap: 10px;
}
.company-ops-table {
  table-layout: auto;
}
.company-ops-table thead th {
  white-space: nowrap;
}
.company-ops-table thead th.col-category {
  min-width: 200px;
  padding: 11px 16px;
  vertical-align: middle;
}
.company-ops-table thead th.col-order {
  min-width: 120px;
  padding-left: 24px;
}
.company-ops-table thead th.col-title {
  min-width: 140px;
}
.company-ops-table .ops-category-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.company-ops-table .ops-th-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.company-ops-table .ops-category-filter select {
  min-width: 120px;
  max-width: 160px;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg-elevated);
  cursor: pointer;
}
.company-ops-table tbody td.col-order {
  padding-left: 24px;
}
.company-ops-table tbody td.col-category {
  min-width: 200px;
}
.company-ops-form-panel {
  padding: 20px 28px 24px;
  border-bottom: 1px solid var(--border-light);
  background: #fafbfc;
}
.company-ops-form-panel .form-grid {
  gap: 0 28px;
  max-width: 960px;
}
.company-ops-items-section { margin-top: 0; }
.company-ops-form-panel .company-ops-items-section {
  margin: 0 -28px;
  padding: 0 28px;
}
.company-ops-items-table {
  table-layout: fixed;
  width: 100%;
}
.company-ops-items-table .col-no { width: 44px; }
.company-ops-items-table .col-cat { width: 11%; }
.company-ops-items-table .col-title { width: 12%; }
.company-ops-items-table .col-amt { width: 9%; }
.company-ops-items-table .col-date { width: 11%; }
.company-ops-items-table .col-party { width: 11%; }
.company-ops-items-table .col-method { width: 8%; }
.company-ops-items-table .col-inv { width: 9%; }
.company-ops-items-table .col-remark { width: auto; }
.company-ops-items-table .col-act { width: 52px; }
.company-ops-items-table td input.cell-input,
.company-ops-items-table td select.cell-input {
  min-width: 0;
  box-sizing: border-box;
}
.company-ops-items-table .text-right { text-align: right; }

.payment-batch-form-panel .payment-batch-header {
  padding: 0 24px 16px;
}
.payment-batch-form-panel .payment-batch-section {
  margin-top: 0;
  padding: 0 24px 24px;
}
.payment-batch-table {
  width: 100%;
  min-width: 960px;
}
.payment-batch-table .col-no { width: 44px; }
.payment-batch-table .col-type { width: 11%; }
.payment-batch-table .col-date { width: 11%; }
.payment-batch-table .col-payee { width: 11%; }
.payment-batch-table .col-name { width: 13%; }
.payment-batch-table .col-spec { width: 9%; }
.payment-batch-table .col-unit { width: 6%; }
.payment-batch-table .col-qty { width: 6%; }
.payment-batch-table .col-price { width: 7%; }
.payment-batch-table .col-amount { width: 8%; }
.payment-batch-table .col-remark { width: auto; }
.payment-batch-table .col-act { width: 52px; }
.payment-batch-table td input.cell-input,
.payment-batch-table td select.cell-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.payment-batch-table .text-right { text-align: right; }
.company-ops-card .table-wrap .data-table th,
.company-ops-card .table-wrap .data-table td {
  padding: 12px 16px;
}
.company-ops-card .table-wrap .data-table th:last-child,
.company-ops-card .table-wrap .data-table td:last-child {
  padding-right: 24px;
}
.company-ops-card .data-table .col-category .badge {
  margin: 0;
}
.company-ops-summary-grid .data-table th,
.company-ops-summary-grid .data-table td {
  padding: 12px 18px;
}
.company-ops-summary-grid .data-table th:first-child,
.company-ops-summary-grid .data-table td:first-child {
  padding-left: 20px;
}
.company-ops-summary-grid .data-table .col-category {
  min-width: 100px;
  padding-left: 20px !important;
  font-weight: 500;
}
.company-ops-summary-grid .data-table th:last-child,
.company-ops-summary-grid .data-table td:last-child {
  padding-right: 20px;
}
.company-ops-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 24px;
}
.company-ops-stats-4 {
  grid-template-columns: repeat(4, 1fr);
}
.ops-stat-card {
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ops-stat-income { border-left: 4px solid #00b42a; }
.ops-stat-expense { border-left: 4px solid #ff7d00; }
.ops-stat-balance { border-left: 4px solid var(--primary); }
.ops-stat-label { font-size: 13px; color: var(--text-secondary); }
.ops-stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.ops-stat-sub { font-size: 12px; }
.company-ops-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 0 24px 24px;
}
@media (max-width: 900px) {
  .company-ops-stats,
  .company-ops-stats-4 { grid-template-columns: 1fr; }
  .company-ops-summary-grid { grid-template-columns: 1fr; }
}

.summary-row td {
  background: #f7f8fa !important;
  font-weight: 500;
}
.table-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
  background: #fafbfc;
}
.bulk-bar { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); }
.pager { display: flex; gap: 6px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.pager-page-info { white-space: nowrap; }
.pager-per-select { height: 28px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; background: #fff; }
.pager-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; color: var(--text-secondary); }
.pager-jump { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.pager .btn-primary { pointer-events: none; }
.muted { color: var(--text-tertiary); }

.search-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-bar input, .search-bar select {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px;
  background: var(--bg-elevated);
}

/* ========== 项目经营分析 ========== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 2px 0;
}
.filter-item label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.filter-item input, .filter-item select {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px;
  background: var(--bg-elevated);
}
.filter-actions { display: flex; gap: 8px; padding-bottom: 2px; }

.overview-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.overview-row.overview-row-6 { grid-template-columns: repeat(6, 1fr); }
.overview-row.overview-row-4 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1200px) { .overview-row.overview-row-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1200px) { .overview-row.overview-row-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .overview-row { grid-template-columns: 1fr; } }
.stats-page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  margin: -20px -24px 0;
  background: linear-gradient(135deg, #165dff 0%, #4080ff 48%, #6aa1ff 100%);
  box-shadow: 0 4px 20px rgba(22, 93, 255, 0.18);
  position: relative;
  overflow: hidden;
}
.stats-page-head::after {
  content: "";
  position: absolute; right: -40px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.stats-page-title {
  margin: 0; font-size: 20px; font-weight: 600; color: #fff;
  letter-spacing: -0.02em;
  position: relative; z-index: 1;
}
.stats-page-actions {
  display: flex; gap: 8px; flex-shrink: 0;
  position: relative; z-index: 1;
}
.stats-page-actions .btn {
  background: rgba(255, 255, 255, 0.95);
  border-color: transparent;
  color: var(--text);
}
.stats-page-actions .btn:hover { background: #fff; }
.page-content:has(.stats-page-head) { padding-top: 20px; }
.page-content:has(.finance-advance-page) {
  padding-left: 20px;
  padding-right: 20px;
  max-width: none;
}
.table-section-head {
  padding: 14px 20px; font-size: 14px; font-weight: 600;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  background: #fafbfc;
  border-left: 3px solid var(--primary);
  padding-left: 17px;
}
.amount-cell { text-align: right; font-variant-numeric: tabular-nums; }
.stats-account-table th.amount-col,
.stats-account-table td.amount-cell { text-align: right; }
.stats-account-table th.name-col,
.stats-account-table td.name-col { text-align: left; min-width: 160px; }
.stats-account-table .col-index { width: 48px; text-align: center; color: var(--text-tertiary); }
.stats-project-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.stats-supplier-project-card .table-section-head { margin: 0; }

/* ========== 费用类型概览 ========== */
.expense-type-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}
@media (max-width: 1100px) { .expense-type-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .expense-type-grid { grid-template-columns: repeat(2, 1fr); } }
.expense-type-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: inherit;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.expense-type-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  color: inherit;
}
.expense-type-name { font-size: 13px; color: var(--text-secondary); }
.expense-type-amt { font-size: 18px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.expense-type-cnt { font-size: 12px; }
.field-inline { display: flex; align-items: center; width: 100%; }
.inline-add-panel {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.expense-filter-bar {
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  padding: 0;
}
.expense-filter-bar .filter-bar { padding: 12px 20px; }

/* ========== 施工日志表格 ========== */
.daily-log-table .daily-content-cell { max-width: 420px; min-width: 200px; }
.daily-content-preview {
  max-height: 72px; overflow: hidden;
  font-size: 13px; line-height: 1.5;
  color: var(--text-secondary);
  word-break: break-word;
}
.daily-log-table td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; }
.overview-row:not(.overview-row-6) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.overview-hint, .metric-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.4;
}
.profit-band .band-title { border-left: 4px solid #00b42a; padding-left: 14px; }

.profit-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.profit-summary-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  border-left: 3px solid #c9cdd4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.profit-summary-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.profit-summary-label { font-size: 12px; color: var(--text-tertiary); }
.profit-summary-value { font-size: 15px; font-weight: 600; }
.profit-summary-main {
  grid-column: span 1;
  border-left-color: var(--success);
  background: var(--success-soft);
}
.profit-summary-main .profit-summary-value { color: #1b7f37; font-size: 18px; }
.profit-summary-hint { font-size: 11px; color: var(--text-tertiary); }

.advance-summary-panel {
  margin: 0;
  padding: 16px 20px 4px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}
.advance-summary-head { margin-bottom: 10px; }
.advance-summary-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.advance-summary-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.advance-summary-wrap { overflow-x: auto; }
.finance-advance-page .card { width: 100%; }
.finance-advance-project-card .advance-summary-wrap {
  padding: 0;
}
.finance-advance-project-card .advance-balance-table {
  width: 100%;
}
table.advance-balance-table {
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  width: 100%;
}
table.advance-balance-table col.col-person { width: 12%; }
table.advance-balance-table col.col-loan-ic { width: 22%; }
table.advance-balance-table col.col-money { width: 18%; }
table.advance-balance-table col.col-act { width: 12%; }
table.advance-balance-table th,
table.advance-balance-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.advance-balance-table thead th {
  background: #f7f8fa;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}
table.advance-balance-table th.col-money,
table.advance-balance-table td.col-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.advance-balance-table th.col-act,
table.advance-balance-table td.col-act {
  text-align: right;
  white-space: nowrap;
}
table.advance-balance-table .summary-row td {
  background: #f7f8fa;
}
table.advance-balance-table tbody tr:last-child td { border-bottom: none; }
table.advance-balance-table tbody tr:hover td { background: #f7f9fc; }
table.advance-balance-table tbody tr.summary-row:hover td { background: #f7f8fa; }
.advance-summary-sub td { background: #fafbfc; font-size: 13px; }
.advance-summary-sub .muted { color: var(--text-secondary); }

.payment-list-scope-hint {
  margin: 0;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  background: #f8fbff;
  border-bottom: 1px solid var(--border-light);
}
.profit-ops-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}
.profit-ops-item { display: flex; flex-direction: column; gap: 6px; }
.profit-formula-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
}
.profit-formula-card { margin-top: 16px; }

.overview-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  border-left: 3px solid #c9cdd4;
  transition: box-shadow var(--transition), transform var(--transition);
}
.overview-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.overview-row .overview-card:nth-child(1) { border-left-color: var(--primary); }
.overview-row .overview-card:nth-child(1) .overview-value { color: var(--primary); }
.overview-label { font-size: 12px; color: var(--text-tertiary); margin-bottom: 6px; }
.overview-value { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }

.analysis-band {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.band-title {
  padding: 12px 18px; font-weight: 600; font-size: 13px;
  background: #fafbfc; border-bottom: 1px solid var(--border);
}
.income-band .band-title { border-left: 4px solid var(--primary); padding-left: 14px; }
.expense-band .band-title { border-left: 4px solid var(--warning); padding-left: 14px; }
.band-metrics { display: flex; flex-wrap: wrap; }
.metric-cell {
  min-width: 110px; flex: 1;
  padding: 14px 16px;
  border-right: 1px solid var(--border-light);
}
.metric-cell:last-child { border-right: none; }
.metric-label { font-size: 12px; color: var(--text-tertiary); margin-bottom: 6px; }
.metric-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.stats-table-wrap { max-width: 100%; border-radius: 0 0 var(--radius-md) var(--radius-md); }
.stats-wide-table { min-width: 2200px; font-size: 12px; }
.stats-wide-table th, .stats-wide-table td.num { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.stats-wide-table td.col-fixed, .stats-wide-table th:nth-child(2) {
  text-align: left; position: sticky; left: 0;
  background: var(--bg-elevated); z-index: 1;
  box-shadow: 4px 0 8px rgba(31, 35, 41, 0.04);
}
.stats-wide-table .summary-row td { background: #f7f8fa !important; }

.alert-item {
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border-left: 4px solid var(--warning);
  background: var(--bg-elevated);
  transition: box-shadow var(--transition);
}
.alert-item:hover { box-shadow: var(--shadow-xs); }
.alert-item.severe { border-left-color: var(--danger); }

/* 内嵌表单区 · 合同详情分组风格 */
.form-panel {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-elevated);
}
.form-panel-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.form-panel-muted,
.company-ops-form-panel {
  background: #fafbfc;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-light);
}
.analytics-toolbar-card {
  margin-bottom: 16px;
  overflow: hidden;
}
.analytics-toolbar-card .analytics-toolbar { border-bottom: none; }
.analytics-toolbar-foot {
  padding: 0 18px 14px;
  font-size: 13px;
  color: var(--text-secondary);
}
.analytics-toolbar-foot p { margin: 0; }
.card > .form-panel:first-child { border-top: none; }
.form-section-title {
  margin: 20px 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}
.form-section-title:first-of-type { margin-top: 0; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .form-grid-3 { grid-template-columns: 1fr; }
}
.list-toolbar-hint { font-size: 13px; color: var(--text-secondary); }
.list-toolbar-hint a { color: var(--primary); }

.payroll-ops-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin: 0;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(90deg, rgba(22, 93, 255, 0.06) 0%, #fff 60%);
}
.payroll-ops-pending { margin: 8px 0 0; font-size: 13px; color: #b86e00; }
.payroll-ops-ok { margin: 8px 0 0; font-size: 13px; color: #1b7f37; }

/* 组织人员 */
.users-page-card .users-summary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  background: #fafbfc;
}
.users-page-card .users-summary-bar strong { color: var(--text); }
.users-table .table-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.users-table .table-user-avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
  flex-shrink: 0;
}
.users-table .table-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.users-table .table-user-name {
  font-weight: 500;
  color: var(--text);
}
.users-table .table-user-meta .sub {
  font-size: 12px;
  color: var(--text-tertiary);
}
.users-table tr.users-row-self {
  background: linear-gradient(90deg, rgba(22, 93, 255, 0.04) 0%, transparent 100%);
}
.users-table tr.users-row-self td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

/* ========== 首页工作台 · 全屏模式 ========== */
.home-full-mode .page-content-home {
  max-width: none;
  padding: 16px 28px 28px;
  min-height: calc(100vh - var(--nav-h));
  flex: 1;
}
.home-full-mode .home-layout {
  min-height: calc(100vh - var(--nav-h) - 44px);
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: stretch;
}
.home-full-mode .home-aside {
  position: sticky;
  top: calc(var(--nav-h) + 12px);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 28px);
  overflow: auto;
}
@media (min-width: 1400px) {
  .home-full-mode .app-grid { grid-template-columns: repeat(5, 1fr); }
  .home-full-mode .home-layout { grid-template-columns: minmax(0, 1fr) 360px; }
}

/* ========== 首页工作台 ========== */
.page-content-home {
  padding-top: 16px;
  max-width: 1280px;
}
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-aside { order: 3; }
}
@media (max-width: 640px) {
  .home-hero-inner { flex-direction: column; align-items: flex-start; }
  .home-hero-meta { align-items: flex-start; width: 100%; }
  .home-hero-actions { justify-content: flex-start; }
}
.home-main { display: flex; flex-direction: column; gap: 20px; }
.home-aside { display: flex; flex-direction: column; gap: 16px; }

/* 欢迎区 */
.home-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(22, 93, 255, 0.12);
  box-shadow: var(--shadow-sm);
  background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 52%, #eef4ff 100%);
}
.home-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 420px 180px at 92% -20%, rgba(22, 93, 255, 0.14), transparent 70%),
    radial-gradient(ellipse 280px 140px at 8% 110%, rgba(52, 199, 89, 0.08), transparent 70%);
  pointer-events: none;
}
.home-hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  flex-wrap: wrap;
}
.home-hero-user { display: flex; align-items: center; gap: 16px; min-width: 0; }
.home-hero-avatar {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, #165dff 0%, #4080ff 100%);
  color: #fff;
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(22, 93, 255, 0.28);
}
.home-hero-greet {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.home-hero-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.home-hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.home-hero-date {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.home-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}
.home-action-btn:hover {
  color: var(--primary);
  border-color: #bedaff;
  background: #fff;
}
.home-action-primary {
  color: #fff;
  background: linear-gradient(135deg, #165dff 0%, #4080ff 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.25);
}
.home-action-primary:hover {
  color: #fff;
  box-shadow: 0 6px 16px rgba(22, 93, 255, 0.32);
  transform: translateY(-1px);
}

/* 统计卡片 */
.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 900px) {
  .home-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .home-stats { grid-template-columns: 1fr; }
}
.home-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  color: inherit;
  position: relative;
  overflow: hidden;
}
.home-stat-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--stat-accent, #c9cdd4);
  border-radius: 3px 0 0 3px;
}
.home-stat-card:not(.home-stat-static):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
  color: inherit;
}
.home-stat-static { cursor: default; }
.home-stat-card.tone-blue { --stat-accent: var(--primary); }
.home-stat-card.tone-green { --stat-accent: #00b42a; }
.home-stat-card.tone-orange { --stat-accent: #ff7d00; }
.home-stat-card.tone-purple { --stat-accent: #722ed1; }
.home-stat-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--stat-accent) 10%, transparent);
  color: var(--stat-accent);
}
.home-stat-icon svg { width: 22px; height: 22px; display: block; }
.home-stat-body { min-width: 0; }
.home-stat-val {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.home-stat-val em {
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
  margin-left: 2px;
  color: var(--text-tertiary);
}
.home-stat-val.val-positive { color: #00b42a; }
.home-stat-val.val-negative { color: #f53f3f; }
.home-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.home-stat-label small {
  font-size: 11px;
  opacity: 0.85;
}

/* 区块标题 */
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.home-section-title { margin-bottom: 12px; }
.home-section-head .home-section-title { margin-bottom: 0; }
.home-section-link {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  transition: color var(--transition);
}
.home-section-link:hover { color: var(--primary); }

/* 常用应用 */
.home-apps-card { margin-bottom: 0; }
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .app-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .app-grid { grid-template-columns: repeat(2, 1fr); } }
.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #fafbfc;
  transition: all var(--transition);
  color: var(--text);
}
.app-item:hover {
  background: #fff;
  border-color: color-mix(in srgb, var(--app-color, var(--primary)) 35%, var(--border));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--app-color, var(--primary)) 12%, transparent);
  transform: translateY(-2px);
  color: var(--text);
}
.app-icon {
  --app-color: var(--primary);
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  background: color-mix(in srgb, var(--app-color) 12%, #fff);
  color: var(--app-color);
  transition: transform var(--transition);
}
.app-item:hover .app-icon { transform: scale(1.06); }
.app-icon svg { width: 24px; height: 24px; display: block; }
.app-label {
  font-size: 13px;
  text-align: center;
  font-weight: 500;
  line-height: 1.35;
}

/* 项目列表 */
.home-projects-card { margin-bottom: 0; }
.project-mini-list { list-style: none; margin: 0; padding: 0; }
.project-mini-list li + li { margin-top: 6px; }
.project-mini-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f7f8fa;
  color: var(--text);
  font-size: 13px;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.project-mini-list a:hover {
  background: var(--primary-soft);
  border-color: #bedaff;
  color: var(--primary);
}
.project-mini-avatar {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  background: color-mix(in srgb, var(--proj-color, var(--primary)) 14%, #fff);
  color: var(--proj-color, var(--primary));
  border: 1px solid color-mix(in srgb, var(--proj-color, var(--primary)) 22%, transparent);
}
.project-mini-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.project-mini-list .pname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: inherit;
}
.project-mini-status {
  font-size: 11px;
  line-height: 1.2;
}
.project-mini-arrow {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--text-tertiary);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition);
}
.project-mini-list a:hover .project-mini-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--primary);
}

/* 空状态 */
.home-empty {
  text-align: center;
  padding: 28px 16px 20px;
}
.home-empty-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}
.home-empty p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* 数据看板入口 */
.home-viz-banner {
  position: relative;
  overflow: hidden;
  border: none;
  background: linear-gradient(145deg, #0f1729 0%, #1a2d5a 48%, #162447 100%);
  margin-bottom: 0;
}
.home-viz-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 200px 120px at 85% 15%, rgba(0, 242, 255, 0.18), transparent 70%),
    radial-gradient(ellipse 160px 100px at 10% 90%, rgba(22, 93, 255, 0.22), transparent 70%);
  pointer-events: none;
}
.home-viz-content {
  position: relative;
  padding: 20px 22px 22px;
  color: #fff;
}
.home-viz-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #00f2ff;
  background: rgba(0, 242, 255, 0.12);
  border: 1px solid rgba(0, 242, 255, 0.25);
  margin-bottom: 10px;
}
.home-viz-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}
.home-viz-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}
.home-viz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.home-viz-btn-ghost {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.home-viz-btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.table-empty-state.cv-empty { padding: 40px 20px; }
.table-empty-state.cv-empty span { font-size: 15px; color: var(--text-secondary); }
.empty-icon { font-size: 40px; opacity: 0.35; margin-bottom: 8px; }

.base-cat-list { list-style: none; margin: 0; padding: 0; }
.base-cat-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
}
.base-cat-list li:hover { background: #f7f8fa; }
.base-cat-list li:last-child { border-bottom: none; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.base-cat-list .muted { margin-left: auto; color: var(--text-tertiary); }

.page-main:has(.expense-claim-page) {
  min-height: calc(100vh - var(--nav-h));
  height: calc(100vh - var(--nav-h));
}
.page-content:has(.expense-claim-page) {
  padding: 0;
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-elevated);
}

/* ========== 费用报销 · 全屏表单 ========== */
.expense-claim-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}
.ecf-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.ecf-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  min-height: 0;
}

.ecf-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  flex-shrink: 0;
}
.ecf-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: 18px;
  text-decoration: none;
  flex-shrink: 0;
  transition: all var(--transition);
}
.ecf-back:hover {
  color: var(--primary);
  border-color: #bedaff;
  background: var(--primary-soft);
}
.ecf-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.ecf-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.ecf-crumb a { color: var(--text-secondary); text-decoration: none; }
.ecf-crumb a:hover { color: var(--primary); }
.ecf-crumb span:last-child { color: var(--text-secondary); }

.ecf-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ecf-form-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.ecf-section {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-light);
}
.ecf-section-last { border-bottom: none; padding-bottom: 8px; }
.ecf-section-table { padding-top: 20px; }
.ecf-section-title {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ecf-section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}
.ecf-section-title .req { color: var(--danger); font-size: 14px; }

.ecf-grid {
  display: grid;
  gap: 20px 24px;
}
.ecf-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ecf-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1400px) {
  .ecf-grid-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ecf-grid-align { align-items: end; }
.ecf-field-span { grid-column: 1 / -1; }
.ecf-field-grow { flex: 1; min-width: 0; }
.ecf-field-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ecf-field-row .ecf-label { margin-bottom: 0; min-width: 112px; }

.ecf-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.ecf-label .req { color: var(--danger); margin-right: 2px; }

.ecf-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ecf-input:hover { border-color: #c9cdd4; }
.ecf-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}
.ecf-input::placeholder { color: #c9cdd4; }
.ecf-readonly {
  background: #f7f8fa !important;
  color: var(--text-secondary);
  cursor: default;
}
.ecf-textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}
.ecf-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-tertiary);
}

.ecf-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 4px;
  background: #f7f8fa;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  font-size: 13px;
  color: var(--text);
}
.ecf-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #165dff, #4080ff);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecf-amount-box {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px 32px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f7f9ff 0%, #fafbfc 100%);
  border: 1px solid #e8f0ff;
  border-radius: 10px;
}
.ecf-amount-num {
  font-size: 16px;
  font-weight: 600;
  color: #ff7d00;
}
.ecf-upper-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 8px;
}
.ecf-upper-label {
  font-size: 12px;
  color: var(--text-tertiary);
}
.ecf-upper-value {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.ecf-table-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.ecf-table-scroll { overflow-x: auto; }
.ecf-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.ecf-lines-table thead th {
  padding: 12px 10px;
  background: #f7f8fa;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ecf-lines-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.ecf-lines-table tbody tr:hover td { background: #fafbfc; }
.ecf-lines-table tbody tr:last-child td { border-bottom: none; }
.ecf-lines-table .req { color: var(--danger); }

.col-no { width: 4%; }
.col-amt { width: 11%; }
.col-type { width: 12%; }
.col-desc { width: 28%; }
.col-inv { width: 11%; }
.col-photo { width: 8%; }
.col-act { width: 26%; }

.line-no-cell {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
}

.cell-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #f7f8fa;
  color: var(--text);
  transition: all var(--transition);
}
.cell-input:hover { background: #f2f3f5; border-color: var(--border); }
.cell-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}
.cell-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386909c' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}

.desc-wrap { position: relative; }
.desc-wrap .line-desc { padding-right: 48px; }
.desc-count {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #c9cdd4;
  pointer-events: none;
}

.photo-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  max-width: 64px;
}
.photo-chip {
  font-size: 10px;
  color: var(--text-tertiary);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-upload-box {
  width: 40px;
  height: 40px;
  border: 1px dashed #c9cdd4;
  border-radius: 8px;
  background: #fafbfc;
  color: var(--primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--transition);
}
.photo-upload-box:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.photo-upload-box.has-file {
  border-style: solid;
  border-color: #bedaff;
  background: var(--primary-soft);
}

.action-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
}
.action-link {
  padding: 0 6px;
  border: none;
  background: none;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.action-link:first-child { padding-left: 0; }
.action-link:hover { text-decoration: underline; }
.action-link:disabled,
.action-link.action-danger:disabled {
  color: #c9cdd4;
  cursor: not-allowed;
  text-decoration: none;
}
.action-link.action-danger { color: #f53f3f; }
.action-links .action-link + .action-link {
  border-left: 1px solid var(--border);
}

.expense-alloc-row td {
  background: #fafbfc;
  padding: 0 !important;
  border-bottom: 1px solid var(--border-light) !important;
}
.alloc-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 16px 12px 48px;
}
.alloc-label {
  font-size: 12px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.alloc-list { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 280px; }
.alloc-item { display: flex; gap: 8px; align-items: center; }
.alloc-item select,
.alloc-item input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.alloc-item select { flex: 1; min-width: 140px; }
.alloc-item input { width: 110px; }

.ecf-table-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
  background: #fafbfc;
}
.pager-nav { display: flex; align-items: center; gap: 6px; }
.pager-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  padding: 0;
  transition: all var(--transition);
}
.pager-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pager-cur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}
.pager-input {
  width: 36px;
  height: 26px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
}

.ecf-add-row {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-top: 1px dashed var(--border);
  background: #fff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}
.ecf-add-row:hover { background: var(--primary-soft); }

.ecf-switch { position: relative; display: inline-flex; cursor: pointer; }
.ecf-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ecf-switch-track {
  width: 44px;
  height: 24px;
  background: #c9cdd4;
  border-radius: 12px;
  position: relative;
  transition: background var(--transition);
}
.ecf-switch-dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.ecf-switch input:checked + .ecf-switch-track { background: var(--primary); }
.ecf-switch input:checked + .ecf-switch-track .ecf-switch-dot { transform: translateX(20px); }

.ecf-foot {
  flex-shrink: 0;
  z-index: 50;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 -4px 16px rgba(29, 33, 41, 0.06);
}
.ecf-foot-inner {
  display: flex;
  gap: 12px;
  padding: 14px 32px;
  width: 100%;
}
.ecf-btn-save {
  min-width: 96px;
  height: 38px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(22, 93, 255, 0.25);
}
.ecf-btn-cancel {
  height: 38px;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .ecf-grid-2, .ecf-grid-3 { grid-template-columns: 1fr; }
  .ecf-section { padding: 20px 16px; }
  .ecf-head { padding: 16px; }
  .ecf-foot-inner { padding: 14px 16px; }
  .ecf-table-pager { flex-wrap: wrap; }
  .action-links { flex-direction: column; align-items: flex-start; gap: 4px; }
  .action-links .action-link + .action-link { border-left: none; padding-left: 0; }
}

/* ========== 登录页 ========== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(22, 93, 255, 0.08), transparent),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(20, 201, 201, 0.06), transparent),
    #f5f7fa;
}
.login-card {
  width: min(420px, 100%);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.login-card .sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 28px; line-height: 1.6; }
.login-card .form-row input { max-width: none; }
.login-card .btn-primary { width: 100%; padding: 10px; margin-top: 8px; font-size: 14px; }

/* ========== 合同详情 (cv) ========== */
/* 保留顶栏+侧栏，主内容区铺满剩余高度 */
.page-main:has(.cv-fill) {
  min-height: calc(100vh - var(--nav-h));
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}
.page-content-contract-view {
  padding: 0;
  margin: 0;
  max-width: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-page);
}
.cv { display: flex; flex-direction: column; gap: 16px; }
.cv-fill {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  gap: 0;
}

/* 顶部英雄区 */
.cv-hero {
  background: linear-gradient(135deg, #165dff 0%, #4080ff 48%, #6aa1ff 100%);
  border-radius: var(--radius-lg);
  padding: 0;
  color: #fff;
  box-shadow: 0 8px 28px rgba(22, 93, 255, 0.22);
  overflow: hidden;
  position: relative;
}
.cv-fill .cv-hero {
  flex-shrink: 0;
  border-radius: 0;
  box-shadow: none;
}
.cv-hero::after {
  content: "";
  position: absolute; right: -60px; top: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.cv-hero-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; position: relative; z-index: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.cv-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255, 255, 255, 0.92); font-size: 13px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.cv-back:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.cv-hero-actions .btn {
  background: rgba(255, 255, 255, 0.95); border-color: transparent; color: var(--text);
}
.cv-hero-actions .btn:hover { background: #fff; }
.cv-hero-body {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 20px 24px 24px; position: relative; z-index: 1;
}
.cv-hero-text { flex: 1; min-width: 0; }
.cv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.cv-chip {
  font-size: 12px; padding: 2px 10px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.18); color: #fff;
}
.cv-chip-dir { background: rgba(255, 255, 255, 0.28); font-weight: 600; }
.cv-chip-muted { opacity: 0.9; }
.cv-chip-code { font-family: ui-monospace, monospace; letter-spacing: 0.02em; }
.cv-hero .badge-green { background: rgba(52, 199, 89, 0.25); color: #e8fff0; }
.cv-title {
  margin: 0 0 8px; font-size: 22px; font-weight: 600; line-height: 1.35;
  letter-spacing: -0.02em; color: #fff;
}
.cv-project { margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.82); }
.cv-project-label { opacity: 0.75; margin-right: 6px; }
.cv-hero-side {
  flex-shrink: 0; display: flex; align-items: center; gap: 20px;
  background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(8px);
  padding: 16px 20px; border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.cv-ring {
  --ring-size: 72px;
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 50%;
  background: conic-gradient(
    #fff 0deg,
    #fff calc(var(--pct, 0) * 3.6deg),
    rgba(255, 255, 255, 0.22) calc(var(--pct, 0) * 3.6deg),
    rgba(255, 255, 255, 0.22) 360deg
  );
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cv-ring-inner {
  width: calc(var(--ring-size) - 14px);
  height: calc(var(--ring-size) - 14px);
  border-radius: 50%;
  background: rgba(14, 66, 210, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
.cv-ring-inner strong { font-size: 15px; color: #fff; }
.cv-ring-inner span { font-size: 10px; color: rgba(255, 255, 255, 0.85); margin-top: 2px; }
.cv-mini-stats { display: flex; flex-direction: column; gap: 10px; }
.cv-mini-stats div { display: flex; flex-direction: column; gap: 2px; }
.cv-mini-stats em { font-style: normal; font-size: 11px; color: rgba(255, 255, 255, 0.75); }
.cv-mini-stats strong { font-size: 14px; color: #fff; font-variant-numeric: tabular-nums; }
.cv-amount-key { font-size: 13px !important; }

/* 指标卡片 */
.cv-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.cv-fill .cv-metrics {
  flex-shrink: 0;
  gap: 0;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
}
.cv-fill .cv-metric {
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-right: 1px solid var(--border-light);
  box-shadow: none;
  margin: 0;
}
.cv-fill .cv-metric:last-child { border-right: none; }
.cv-fill .cv-metric:hover { transform: none; box-shadow: none; }
.cv-metric {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  border-left: 3px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.cv-metric:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.cv-metric-label { display: block; font-size: 12px; color: var(--text-tertiary); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-metric-value { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.cv-metric--primary { border-left-color: var(--primary); }
.cv-metric--primary .cv-metric-value { color: var(--primary); }
.cv-metric--success { border-left-color: var(--success); }
.cv-metric--success .cv-metric-value { color: #1b7f37; }
.cv-metric--violet { border-left-color: #722ed1; }
.cv-metric--violet .cv-metric-value { color: #722ed1; }
.cv-metric--warning { border-left-color: var(--warning); background: var(--warning-soft); }
.cv-metric--warning .cv-metric-value { color: #d46b08; }
.cv-metric--neutral { border-left-color: #c9cdd4; }

/* 主面板 */
.cv-panel { padding: 0 !important; overflow: hidden; border-radius: var(--radius-lg); }
.cv-fill .cv-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
}
.cv-tabs-wrap {
  padding: 0 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.cv-fill .cv-tabs-wrap { flex-shrink: 0; }
.cv-tabs { display: flex; gap: 4px; min-width: max-content; }
.cv-tab {
  padding: 14px 16px; font-size: 13px; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: color var(--transition);
}
.cv-tab:hover { color: var(--primary); }
.cv-tab.is-active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.cv-tab-count {
  display: inline-block; margin-left: 6px; min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 5px; font-size: 11px; font-weight: 600; text-align: center;
  background: var(--primary-soft); color: var(--primary); border-radius: 9px;
}
.pv-quick-links-inner {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.cv-body { padding: 8px 24px 28px; min-height: 320px; }
.cv-fill .cv-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 24px 24px;
  -webkit-overflow-scrolling: touch;
}

/* 分组描述列表 */
.cv-section { padding: 20px 0 8px; border-bottom: 1px solid var(--border-light); }
.cv-section:last-child { border-bottom: none; padding-bottom: 0; }
.cv-section-title {
  margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--text);
  padding-left: 10px; border-left: 3px solid var(--primary);
}
.cv-desc {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; margin: 0; border: 1px solid var(--border-light); border-radius: var(--radius-md); overflow: hidden;
}
.cv-desc-item {
  display: grid; grid-template-columns: 108px 1fr; gap: 0;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  margin: 0; background: #fff;
}
.cv-desc-item:nth-child(3n) { border-right: none; }
.cv-desc-item--block { grid-column: 1 / -1; border-right: none; }
.cv-desc-item dt {
  margin: 0; padding: 12px 14px; font-size: 13px; font-weight: normal;
  color: var(--text-tertiary); background: #f7f8fa;
  border-right: 1px solid var(--border-light);
}
.cv-desc-item dd {
  margin: 0; padding: 12px 14px; font-size: 13px; color: var(--text);
  word-break: break-word; line-height: 1.6;
}
.cv-desc-item--block dd { min-height: 48px; }
.cv-money { color: #d46b08 !important; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 表格区 */
.cv-table-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 12px; gap: 12px; flex-wrap: wrap;
}
.cv-table-head h3 { margin: 0; font-size: 15px; font-weight: 600; flex: 1; min-width: 120px; }
.cv-table-sum { font-size: 13px; color: var(--text-secondary); }
.cv-table-sum strong { color: var(--primary); font-size: 15px; margin-left: 4px; }
.cv-table { border-radius: var(--radius-md); border: 1px solid var(--border-light); overflow: hidden; }
.cv-code {
  font-size: 12px; padding: 2px 6px; background: #f2f3f5;
  border-radius: 4px; color: var(--text-secondary);
}

/* 空状态 */
.cv-empty {
  padding: 40px 20px; text-align: center; color: var(--text-tertiary);
}
.cv-empty span { display: block; font-size: 15px; color: var(--text-secondary); margin-bottom: 6px; }
.cv-empty p { margin: 0; font-size: 13px; }
.cv-empty--page { padding: 72px 20px; }
.cv-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.6; }

/* ========== 详情侧栏抽屉（收款/付款登记） ========== */
.se-drawer {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.se-drawer.is-open { pointer-events: auto; }
.se-drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(29, 33, 41, 0.45);
  opacity: 0;
  transition: opacity var(--transition);
}
.se-drawer.is-open .se-drawer-mask { opacity: 1; }
.se-drawer-panel {
  position: relative;
  width: min(720px, 92vw);
  max-width: 100%;
  height: 100%;
  background: var(--bg-elevated);
  box-shadow: -8px 0 32px rgba(29, 33, 41, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}
.se-drawer.is-open .se-drawer-panel { transform: translateX(0); }
.se-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  flex-shrink: 0;
}
.se-drawer-head-main { flex: 1; min-width: 0; }
.se-drawer-head-main .badge { margin-right: 6px; margin-bottom: 6px; }
.se-drawer-title {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
.se-drawer-sub { margin: 4px 0 0; font-size: 12px; }
.se-drawer-actions { display: flex; gap: 8px; flex-shrink: 0; }
.se-drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}
.se-drawer-tab {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.se-drawer-tab:hover { color: var(--primary); }
.se-drawer-tab.is-active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.se-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 24px;
  -webkit-overflow-scrolling: touch;
}
.se-drawer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f7f8fa;
}
.se-drawer-metric {
  padding: 12px 14px;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.se-drawer-metric:nth-child(3n) { border-right: none; }
.se-drawer-metric:nth-last-child(-n+3) { border-bottom: none; }
.se-drawer-metric-label { display: block; font-size: 11px; color: var(--text-tertiary); margin-bottom: 4px; }
.se-drawer-metric-value { display: block; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.se-drawer-desc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.se-drawer-desc-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  margin: 0;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  background: #fff;
}
.se-drawer-desc-item:nth-child(2n) { border-right: none; }
.se-drawer-desc-item--block {
  grid-column: 1 / -1;
  border-right: none;
}
.se-drawer-desc-item dt {
  margin: 0;
  padding: 11px 12px;
  font-size: 12px;
  font-weight: normal;
  color: var(--text-tertiary);
  background: #f7f8fa;
  border-right: 1px solid var(--border-light);
}
.se-drawer-desc-item dd {
  margin: 0;
  padding: 11px 12px;
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
  line-height: 1.5;
}
.se-drawer-money { color: #f53f3f !important; font-weight: 600; font-variant-numeric: tabular-nums; }
.se-drawer-upper { color: #d46b08 !important; font-weight: 500; }
.se-drawer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  flex-shrink: 0;
}
.se-drawer-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.se-drawer-table-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.se-drawer-table {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover td { background: #f0f6ff !important; }
.drawer-open-link { font-weight: 500; }
@media (max-width: 640px) {
  .se-drawer-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .se-drawer-metric:nth-child(3n) { border-right: 1px solid var(--border-light); }
  .se-drawer-metric:nth-child(2n) { border-right: none; }
  .se-drawer-desc { grid-template-columns: 1fr; }
  .se-drawer-desc-item { border-right: none !important; }
}

@media print {
  .top-nav, .sub-nav, .page-hero, .page-header, .stats-page-head, .cv-hero-actions, .cv-back,
  .se-drawer-mask, .se-drawer-actions, .se-drawer-foot, .se-drawer-tabs { display: none !important; }
  .se-drawer { position: static; pointer-events: auto; }
  .se-drawer-panel { width: 100%; box-shadow: none; transform: none !important; }
  .cv-tabs-wrap { display: none; }
  .page-content-contract-view { padding: 0; max-width: none; }
  .cv-hero { background: #fff; color: #000; box-shadow: none; }
  .cv-title, .cv-mini-stats strong, .cv-ring-inner strong { color: #000; }
}

/* ========== 响应式 ========== */
/* 中等屏 / 小笔记本（约 1280–1400）：压缩顶栏与指标列，避免挤扁 */
@media (max-width: 1400px) {
  .top-nav { padding: 0 14px 0 12px; }
  .brand-block { margin-right: 14px; padding-right: 12px; }
  .brand-tag { display: none; }
  .top-nav-items a { padding: 0 12px; font-size: 13px; }
  .cv-metrics,
  .cv-fill .cv-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cv-fill .cv-metric { border-bottom: 1px solid var(--border-light); }
  .cv-fill .cv-metric:nth-child(4n) { border-right: none; }
  .cv-fill .cv-metric:nth-child(n + 5) { border-bottom: none; }
  .cv-metric-value { font-size: 14px; }
  .page-hero-inner { padding: 14px 20px 16px; }
}

/* 平板 / 小分辨率（≤1100）：侧栏改顶栏横滑，避免主区过窄 */
@media (max-width: 1100px) {
  .body-row { flex-direction: column; }
  .sub-nav {
    width: 100%;
    flex-direction: column;
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--nav-h);
    z-index: 150;
    background: var(--subnav-bg);
  }
  .sub-nav-head { display: none; }
  .sub-nav-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .sub-nav a {
    display: inline-flex;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 34px;
    padding: 0 12px;
  }
  .sub-nav a.active::before { display: none; }
  .theme-pill { display: none; }
  .user-chip { padding-right: 4px; }
  .user-chip > span:not(.user-avatar) { display: none; }
  .top-nav-items a.active::after { display: none; }
  .page-content { padding: 16px; }
  .cv-metrics,
  .cv-fill .cv-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cv-desc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-desc-item:nth-child(3n) { border-right: 1px solid var(--border-light); }
  .cv-desc-item:nth-child(2n) { border-right: none; }
  .cv-body,
  .cv-fill .cv-body { padding-left: 16px; padding-right: 16px; }
  .page-main:has(.cv-fill),
  .page-main:has(.expense-claim-page) {
    height: auto;
    min-height: calc(100vh - var(--nav-h));
    overflow: visible;
  }
  .page-content-contract-view,
  .page-content:has(.expense-claim-page) {
    overflow: visible;
  }
  .cv-fill { height: auto; }
  .cv-fill .cv-body { overflow: visible; }
}

@media (max-width: 900px) {
  .cv-metrics,
  .cv-fill .cv-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-fill .cv-metric { border-bottom: 1px solid var(--border-light); }
  .cv-fill .cv-metric:nth-child(2n) { border-right: none; }
  .cv-fill .cv-metric:nth-last-child(-n + 2) { border-bottom: none; }
  .cv-hero-body { flex-direction: column; }
  .cv-hero-side { width: 100%; justify-content: space-between; }
  .login-card { padding: 32px 22px; }
}

@media (max-width: 768px) {
  :root { --nav-h: 52px; }
  .brand-block { margin-right: 10px; padding-right: 10px; border-right: none; }
  .brand-name { font-size: 14px; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-nav { padding: 0 8px; height: var(--nav-h); }
  .top-nav-items a { padding: 0 8px; font-size: 12px; height: 32px; }
  .page-content { padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .project-form-grid { grid-template-columns: 1fr; }
  .project-field { grid-template-columns: 1fr; }
  .project-field > label { text-align: left; padding-top: 0; }
  .cv-desc { grid-template-columns: 1fr; }
  .cv-desc-item { grid-template-columns: 96px 1fr; border-right: none !important; }
  .cv-desc-item:nth-child(3n) { border-right: none; }
  .cv-title { font-size: 18px; }
  .cv-hero-bar { flex-wrap: wrap; gap: 8px; }
  .table-toolbar,
  .list-toolbar { gap: 8px; }
  .payment-batch-table { min-width: 720px; }
}

@media (max-width: 480px) {
  .cv-metrics,
  .cv-fill .cv-metrics { grid-template-columns: 1fr 1fr; }
  .home-stat-card { padding: 12px 14px; }
  .home-stat-val { font-size: 18px; }
  .login-wrap { padding: 16px; }
  .login-card { padding: 24px 16px; border-radius: 12px; }
  .logout-link { padding: 6px 6px; }
}

/* 矮屏：避免固定视口高度把内容裁切 */
@media (max-height: 820px) {
  .page-main:has(.cv-fill),
  .page-main:has(.expense-claim-page) {
    height: auto;
    min-height: calc(100vh - var(--nav-h));
    overflow: visible;
  }
  .page-content-contract-view,
  .page-content:has(.expense-claim-page) {
    overflow: visible;
  }
  .cv-fill { height: auto; }
  .cv-fill .cv-body { overflow: visible; }
}


/* ========== 数据可视化看板（深色大屏） ========== */
.board-viz-mode {
  --viz-bg: #000c17;
  --viz-panel: rgba(6, 16, 36, 0.88);
  --viz-border: rgba(0, 242, 241, 0.28);
  --viz-glow: rgba(0, 242, 241, 0.5);
  --viz-text: #e8f4ff;
  --viz-muted: #5a7a9a;
  --viz-cyan: #00f2f1;
  --viz-green: #00e676;
  --viz-orange: #ff9f2a;
  --viz-gold: #ffd54f;
  --viz-purple: #c084fc;
}
.board-viz-mode .top-nav,
.board-viz-mode .project-context-bar { display: none; }
.board-viz-mode .sub-nav { display: none; }
.board-viz-mode .body-row .page-main {
  margin-left: 0;
  width: 100%;
  background: var(--viz-bg);
}

.page-content-board {
  position: relative;
  padding: 0;
  max-width: none;
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(0, 242, 241, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 241, 0.02) 1px, transparent 1px),
    radial-gradient(ellipse 80% 50% at 50% -5%, rgba(0, 100, 200, 0.22), transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(0, 60, 120, 0.15), transparent 70%),
    var(--viz-bg);
  background-size: 36px 36px, 36px 36px, 100% 100%, 100% 100%, 100% 100%;
  overflow: hidden;
}
.page-content-board::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 242, 241, 0.012) 3px, rgba(0, 242, 241, 0.012) 4px);
  z-index: 0;
}

.board-screen {
  position: relative;
  z-index: 1;
  padding: 14px 18px 18px;
  color: var(--viz-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶栏 */
.board-screen-header {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 12px;
  padding-bottom: 12px;
}
.board-exit-btn {
  position: absolute;
  left: 0;
  top: 8px;
  z-index: 3;
  font-size: 12px;
  color: var(--viz-muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(0, 242, 241, 0.2);
  background: rgba(0, 242, 241, 0.05);
  transition: color .2s, border-color .2s;
}
.board-exit-btn:hover { color: var(--viz-cyan); border-color: var(--viz-cyan); }

.board-title-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 720px;
  margin: 0 auto;
}
.board-title-wing {
  flex: 1;
  height: 2px;
  max-width: 180px;
  background: linear-gradient(90deg, transparent, var(--viz-cyan));
  position: relative;
}
.board-title-wing-r {
  background: linear-gradient(90deg, var(--viz-cyan), transparent);
}
.board-title-wing::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--viz-cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--viz-glow);
}
.board-title-wing-l::after { right: 0; }
.board-title-wing-r::after { left: 0; }

.board-title-core {
  position: relative;
  padding: 10px 36px 12px;
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 242, 241, 0.1) 0%, rgba(0, 242, 241, 0.02) 100%);
  border: 1px solid rgba(0, 242, 241, 0.25);
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
  box-shadow: 0 0 30px rgba(0, 242, 241, 0.12), inset 0 0 20px rgba(0, 242, 241, 0.05);
}
.board-screen-title {
  margin: 0;
  font-size: clamp(20px, 2.8vw, 32px);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 242, 241, 0.5);
}
.board-screen-sub {
  margin: 6px 0 0;
  font-size: 10px;
  color: var(--viz-muted);
  letter-spacing: 0.25em;
}

.board-header-tools {
  position: absolute;
  right: 0;
  top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
}
.board-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--viz-green);
  border: 1px solid rgba(0, 230, 118, 0.35);
  padding: 2px 8px;
}
.board-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--viz-green);
  box-shadow: 0 0 8px var(--viz-green);
  animation: boardPulse 2s ease infinite;
}
@keyframes boardPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.board-header-time {
  font-size: 11px;
  font-family: "SF Mono", Consolas, monospace;
  color: var(--viz-muted);
}
.board-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
  color: var(--viz-cyan);
  border: 1px solid rgba(0, 242, 241, 0.35);
  background: rgba(0, 242, 241, 0.06);
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
.board-tool-btn:hover {
  background: rgba(0, 242, 241, 0.14);
  box-shadow: 0 0 12px rgba(0, 242, 241, 0.2);
}
.board-tool-primary { font-size: 11px; font-weight: 600; }
.board-loading #boardRefreshBtn { animation: boardSpin .8s linear infinite; }
@keyframes boardSpin { to { transform: rotate(360deg); } }

/* 顶栏 KPI 条 */
.board-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.board-kpi-cell {
  padding: 8px 12px;
  border: 1px solid rgba(0, 242, 241, 0.14);
  background: rgba(0, 242, 241, 0.04);
  text-align: center;
}
.board-kpi-cell-label {
  display: block;
  font-size: 10px;
  color: var(--viz-muted);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.board-kpi-cell-val {
  font-size: 18px;
  font-weight: 700;
  font-family: "SF Mono", Consolas, monospace;
  color: #fff;
}
.board-kpi-cell-val em {
  font-style: normal;
  font-size: 10px;
  font-weight: 400;
  color: var(--viz-muted);
  margin-left: 2px;
}
.board-kpi-cell.tone-cyan .board-kpi-cell-val { color: var(--viz-cyan); }
.board-kpi-cell.tone-orange .board-kpi-cell-val { color: var(--viz-orange); }
.board-kpi-cell.tone-gold .board-kpi-cell-val { color: var(--viz-gold); }
.board-kpi-cell.tone-green .board-kpi-cell-val { color: var(--viz-green); }
.board-kpi-cell.tone-red .board-kpi-cell-val { color: #ff6b6b; }

.board-trend-up { color: var(--viz-green); }
.board-trend-down { color: #ff6b6b; }
.tone-green { color: var(--viz-green) !important; }
.tone-red { color: #ff6b6b !important; }
.tone-gold { color: var(--viz-gold) !important; }

/* 三栏 */
.board-screen-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(200px, 0.95fr) minmax(340px, 2.1fr) minmax(200px, 0.95fr);
  gap: 10px;
  min-height: 0;
}
.board-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

/* 面板 + 四角框 */
.board-widget {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--viz-panel);
  border: 1px solid rgba(0, 242, 241, 0.16);
  box-shadow: inset 0 0 40px rgba(0, 242, 241, 0.03), 0 0 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}
.board-brackets {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.board-brackets i {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--viz-cyan);
  opacity: 0.85;
  box-shadow: 0 0 6px rgba(0, 242, 241, 0.3);
}
.board-brackets i:nth-child(1) { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.board-brackets i:nth-child(2) { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.board-brackets i:nth-child(3) { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.board-brackets i:nth-child(4) { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.board-widget-head {
  padding: 8px 14px 6px 18px;
  border-bottom: 1px solid rgba(0, 242, 241, 0.12);
  background: linear-gradient(90deg, rgba(0, 242, 241, 0.08), transparent 80%);
}
.board-widget-title {
  position: relative;
  font-size: 12px;
  font-weight: 600;
  color: var(--viz-cyan);
  letter-spacing: 0.08em;
}
.board-widget-sub {
  margin-top: 2px;
  font-size: 9px;
  color: var(--viz-muted);
  letter-spacing: 0.04em;
}
.board-widget-mark {
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 8px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--viz-cyan);
  vertical-align: middle;
  filter: drop-shadow(0 0 4px var(--viz-glow));
}
.board-widget-body {
  padding: 10px 12px 12px;
  min-height: 100px;
}
.board-widget-scroll { overflow: auto; max-height: 168px; }
.board-widget-wide { flex: 0 0 auto; }

/* 中央地图区 */
.board-map-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 420px;
  border: 1px solid rgba(0, 242, 241, 0.14);
  background:
    radial-gradient(ellipse at center, rgba(0, 80, 160, 0.2), transparent 65%),
    rgba(0, 8, 20, 0.5);
  overflow: hidden;
}
.board-map-kpis {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: clamp(32px, 8vw, 100px);
  padding: 12px 16px 4px;
}
.board-hero-kpi { text-align: center; }
.board-hero-label {
  display: block;
  font-size: 11px;
  color: var(--viz-muted);
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}
.board-hero-num {
  display: block;
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 800;
  font-family: "DIN Alternate", "SF Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.board-hero-gold {
  color: var(--viz-gold);
  text-shadow: 0 0 28px rgba(255, 213, 79, 0.6);
}
.board-hero-orange {
  color: var(--viz-orange);
  text-shadow: 0 0 28px rgba(255, 159, 42, 0.55);
}
.board-hero-sub {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-style: normal;
  color: rgba(0, 242, 241, 0.75);
  font-family: monospace;
}

.board-map-scene {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 400px;
  min-height: 400px;
  overflow: hidden;
}
.board-geo-platform {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 72%;
  height: 38%;
  transform: translateX(-50%) perspective(500px) rotateX(72deg);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(0, 242, 255, 0.18), transparent 68%),
    repeating-radial-gradient(circle at center, rgba(0, 242, 255, 0.08) 0 1px, transparent 1px 18px);
  border: 1px solid rgba(0, 242, 255, 0.22);
  box-shadow: 0 0 40px rgba(0, 242, 255, 0.15), inset 0 0 30px rgba(0, 100, 200, 0.2);
  pointer-events: none;
  z-index: 1;
  animation: geoPlatformPulse 4s ease-in-out infinite;
}
@keyframes geoPlatformPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.board-geo-chart {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  min-height: 400px;
}
.board-geo-chart canvas {
  width: 100% !important;
  height: 100% !important;
}
.board-map-empty {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(6, 11, 24, 0.82);
  text-align: center;
  padding: 20px;
}
.board-map-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--viz-cyan);
}
.board-map-empty span {
  font-size: 11px;
  color: var(--viz-muted);
  max-width: 280px;
  line-height: 1.5;
}
.board-map-empty[hidden] { display: none !important; }
@keyframes mapDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes mapRingExpand {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}
.board-map-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 242, 241, 0.06) 50%, transparent 100%);
  background-size: 100% 40%;
  animation: mapScan 6s linear infinite;
  pointer-events: none;
  z-index: 3;
  opacity: 0.35;
}
@keyframes mapScan {
  0% { background-position: 0 -40%; }
  100% { background-position: 0 140%; }
}
.board-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid rgba(0, 242, 241, 0.1);
  background: rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}
.board-map-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 10px;
  color: var(--viz-muted);
}
.board-map-stats strong {
  color: var(--viz-cyan);
  font-family: monospace;
  margin-left: 2px;
}
.board-map-legend {
  display: flex;
  gap: 12px;
  font-size: 9px;
  color: var(--viz-muted);
}
.board-map-legend span { display: inline-flex; align-items: center; gap: 4px; }

/* 双柱对比 */
.board-dual-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 118px;
  padding-top: 4px;
  background: repeating-linear-gradient(
    to top,
    transparent,
    transparent calc(25% - 1px),
    rgba(0, 242, 241, 0.05) calc(25% - 1px),
    rgba(0, 242, 241, 0.05) 25%
  );
}
.board-dual-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}
.board-dual-group {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  flex: 1;
  width: 100%;
}
.board-vbar-r {
  background: linear-gradient(180deg, var(--viz-cyan), rgba(0, 242, 241, 0.2));
  box-shadow: 0 0 10px rgba(0, 242, 241, 0.35);
}
.board-vbar-p {
  background: linear-gradient(180deg, var(--viz-orange), rgba(255, 159, 42, 0.2));
  box-shadow: 0 0 10px rgba(255, 159, 42, 0.3);
}
.board-dual-col .board-vbar {
  width: 40%;
  max-width: 14px;
  margin-top: auto;
  border-radius: 1px 1px 0 0;
  transition: height .6s ease;
}
.board-dual-col span {
  margin-top: 4px;
  font-size: 9px;
  color: var(--viz-muted);
  font-family: monospace;
}
.board-mini-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
  font-size: 9px;
  color: var(--viz-muted);
}
.board-mini-legend span { display: inline-flex; align-items: center; gap: 4px; }

/* 排名列表 */
.board-rank-body { padding-top: 6px; }
.board-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board-rank-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
}
.board-rank-no {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 10px;
  font-weight: 700;
  font-family: monospace;
  color: var(--viz-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.board-rank-item.rank-top1 .board-rank-no { color: #ffd54f; border-color: rgba(255, 213, 79, 0.5); }
.board-rank-item.rank-top2 .board-rank-no { color: #cfd8dc; border-color: rgba(207, 216, 220, 0.4); }
.board-rank-item.rank-top3 .board-rank-no { color: #ffab40; border-color: rgba(255, 171, 64, 0.4); }
.board-rank-main { min-width: 0; }
.board-rank-name {
  display: block;
  font-size: 11px;
  color: var(--viz-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.board-rank-name:hover { color: var(--viz-cyan); }
.board-rank-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.board-rank-track span {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width .6s ease;
}
.board-rank-val {
  font-size: 11px;
  font-family: monospace;
  color: var(--viz-gold);
  white-space: nowrap;
}
.board-rank-status {
  grid-column: 3;
  grid-row: 2;
  font-size: 9px;
  font-style: normal;
  text-align: right;
}

/* 趋势摘要 */
.board-trend-summary {
  margin-bottom: 6px;
  padding: 6px 10px;
  font-size: 10px;
  color: var(--viz-muted);
  border: 1px solid rgba(0, 242, 241, 0.1);
  background: rgba(0, 242, 241, 0.04);
  text-align: center;
}
.board-trend-summary strong {
  font-family: monospace;
  color: #fff;
  margin: 0 2px;
}

/* 环形图 */
.board-donut-layout {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 130px;
}
.board-donut-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 0 auto;
}
.board-donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: background .6s ease;
  box-shadow: 0 0 24px rgba(0, 242, 241, 0.2);
}
.board-donut-hole {
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background: var(--viz-bg);
  border: 1px solid rgba(0, 242, 241, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.board-donut-hole strong {
  font-size: 18px;
  color: #fff;
  font-family: monospace;
  line-height: 1;
}
.board-donut-hole span { font-size: 9px; color: var(--viz-muted); }
.board-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.board-donut-legend li {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 10px;
}
.board-donut-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}
.board-donut-legend em {
  font-style: normal;
  color: var(--viz-cyan);
  font-family: monospace;
  font-size: 10px;
}

/* 柱图 */
.board-vbars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 120px;
  padding-top: 6px;
  background: repeating-linear-gradient(
    to top,
    transparent,
    transparent calc(25% - 1px),
    rgba(0, 242, 241, 0.05) calc(25% - 1px),
    rgba(0, 242, 241, 0.05) 25%
  );
}
.board-vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}
.board-vbar {
  width: 65%;
  max-width: 24px;
  margin-top: auto;
  background: linear-gradient(180deg, var(--viz-cyan), rgba(0, 242, 241, 0.2));
  box-shadow: 0 0 14px rgba(0, 242, 241, 0.4);
  border-radius: 1px 1px 0 0;
  transition: height .6s cubic-bezier(.34, 1.2, .64, 1);
  animation: barGrow .8s ease both;
}
@keyframes barGrow {
  from { transform: scaleY(0); transform-origin: bottom; }
  to { transform: scaleY(1); }
}
.board-vbar-col span {
  margin-top: 4px;
  font-size: 9px;
  color: var(--viz-muted);
  font-family: monospace;
}

/* 词云 */
.board-cloud-body { min-height: 110px; padding-bottom: 8px; }
.board-cloud {
  position: relative;
  height: 110px;
}
.board-cloud-item {
  position: absolute;
  padding: 2px 8px;
  color: var(--viz-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s, text-shadow .2s;
  transform-origin: center center;
}
.board-cloud-item:hover {
  color: var(--viz-cyan);
  text-shadow: 0 0 10px var(--viz-glow);
  z-index: 2;
}
.board-cloud-item.size-xl { font-size: 18px; font-weight: 700; color: var(--viz-gold); }
.board-cloud-item.size-lg { font-size: 15px; font-weight: 600; color: var(--viz-orange); }
.board-cloud-item.size-md { font-size: 13px; color: var(--viz-cyan); }
.board-cloud-item.size-sm { font-size: 11px; color: var(--viz-muted); }

/* 面积图 */
.board-area-body { padding-top: 6px; }
.board-area-wrap {
  position: relative;
  height: 150px;
}
.board-area-chart {
  width: 100%;
  height: 100%;
  display: block;
}
.board-area-grid {
  stroke: rgba(0, 242, 241, 0.06);
  stroke-width: 1;
}
.board-area-axis {
  stroke: rgba(0, 242, 241, 0.18);
  stroke-width: 1;
}
.board-area-fill { transition: d .6s ease; }
.board-area-line-r {
  stroke: var(--viz-cyan);
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(0, 242, 241, 0.7));
}
.board-area-line-p {
  stroke: var(--viz-orange);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  opacity: 0.9;
}
.board-area-line-n {
  stroke: var(--viz-green);
  stroke-width: 1.2;
  opacity: 0.75;
}
.board-area-dot {
  fill: #fff;
  stroke: var(--viz-cyan);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 4px rgba(0, 242, 241, 0.8));
}
.board-area-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0 24px;
  font-size: 9px;
  color: var(--viz-muted);
  font-family: monospace;
}
.board-area-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--viz-muted);
}
.board-area-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.dot-cyan { background: var(--viz-cyan); box-shadow: 0 0 6px var(--viz-cyan); }
.dot-orange { background: var(--viz-orange); box-shadow: 0 0 6px var(--viz-orange); }
.dot-purple { background: var(--viz-purple); box-shadow: 0 0 6px var(--viz-purple); }

.dot-green { background: var(--viz-green); box-shadow: 0 0 6px var(--viz-green); }

/* 表格 */
.board-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
.board-data-table thead th {
  padding: 5px 6px;
  text-align: left;
  color: var(--viz-cyan);
  font-weight: 600;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(0, 242, 241, 0.15);
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.board-data-table tbody td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.board-data-table tbody tr:hover { background: rgba(0, 242, 241, 0.04); }
.board-td-clip {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-td-num {
  font-family: monospace;
  color: var(--viz-orange);
  white-space: nowrap;
}
.board-type {
  display: inline-block;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
}
.board-type.type-r { color: var(--viz-green); border: 1px solid rgba(0, 230, 118, 0.3); }
.board-type.type-p { color: var(--viz-orange); border: 1px solid rgba(255, 159, 42, 0.3); }
.board-td-num.type-r { color: var(--viz-green); }
.board-td-num.type-p { color: var(--viz-orange); }
.board-td-date {
  font-family: monospace;
  color: var(--viz-muted);
  white-space: nowrap;
}

/* 半圆径向图 */
.board-radial-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: center;
  min-height: 130px;
}
.board-radial-chart { width: 100%; height: auto; display: block; }
.board-radial-seg {
  transition: opacity .3s;
  filter: drop-shadow(0 0 4px rgba(0, 242, 241, 0.3));
}
.board-radial-seg:hover { opacity: 1 !important; }
.board-radial-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.board-radial-legend li {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 5px;
  align-items: center;
  font-size: 10px;
}
.board-radial-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: block;
}
.board-radial-legend em {
  font-style: normal;
  font-family: monospace;
  color: var(--viz-cyan);
  font-size: 9px;
}

.board-radial-legend span small {
  display: block;
  font-size: 8px;
  color: var(--viz-muted);
  margin-top: 1px;
}

/* 费用构成 */
.board-expense-list { display: flex; flex-direction: column; gap: 10px; }
.board-expense-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
}
.board-expense-rank {
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
  color: var(--viz-cyan);
  padding-top: 2px;
}
.board-expense-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  margin-bottom: 4px;
}
.board-expense-head span { color: var(--viz-text); }
.board-expense-head em {
  font-style: normal;
  font-family: monospace;
  color: var(--viz-orange);
  font-size: 9px;
  white-space: nowrap;
}
.board-expense-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.board-expense-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--viz-purple), rgba(192, 132, 252, 0.3));
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.35);
  border-radius: 3px;
  transition: width .6s ease;
}

/* 堆叠预警条 */
.board-stack-legend {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 9px;
  color: var(--viz-muted);
}
.board-stack-legend span { display: inline-flex; align-items: center; gap: 4px; }
.board-hbars { display: flex; flex-direction: column; gap: 12px; }
.board-hbar-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  gap: 8px;
  align-items: center;
}
.board-hbar-labels { min-width: 0; }
.board-hbar-label { display: block; font-size: 10px; color: var(--viz-text); }
.board-hbar-hint { display: block; font-size: 8px; color: var(--viz-muted); margin-top: 1px; }
.board-hbar-row.level-warn .board-hbar-val { color: #ff6b6b; }
.board-hbar-row.level-mid .board-hbar-val { color: var(--viz-orange); }
.board-hbar-track {
  position: relative;
  height: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  overflow: hidden;
}
.board-hbar-threshold {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(192, 132, 252, 0.5), rgba(192, 132, 252, 0.15));
  border-radius: 2px;
  transition: width .6s ease;
}
.board-hbar-actual {
  position: absolute;
  left: 0;
  top: 2px;
  height: 8px;
  background: linear-gradient(90deg, var(--viz-cyan), rgba(0, 242, 241, 0.35));
  box-shadow: 0 0 8px rgba(0, 242, 241, 0.4);
  border-radius: 2px;
  transition: width .6s ease;
}
.board-hbar-val {
  font-size: 13px;
  font-family: monospace;
  color: var(--viz-orange);
  text-align: right;
}

.board-empty-li {
  color: var(--viz-muted);
  font-size: 11px;
  text-align: center;
  padding: 12px 0;
}
.board-loading { opacity: 0.9; pointer-events: none; }

/* 看板 · 动态效果 */
.page-content-board {
  animation: boardGridDrift 24s linear infinite;
}
@keyframes boardGridDrift {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 36px 36px, 36px 36px, 0 0, 0 0, 0 0; }
}
.board-fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.board-fx-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  animation: boardOrbFloat 12s ease-in-out infinite;
}
.board-fx-orb-1 {
  width: 280px; height: 280px;
  top: 8%; left: 12%;
  background: rgba(0, 100, 200, 0.25);
}
.board-fx-orb-2 {
  width: 220px; height: 220px;
  bottom: 15%; right: 10%;
  background: rgba(0, 242, 241, 0.18);
  animation-delay: -4s;
}
.board-fx-orb-3 {
  width: 160px; height: 160px;
  top: 45%; left: 55%;
  background: rgba(255, 159, 42, 0.12);
  animation-delay: -7s;
}
@keyframes boardOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  33% { transform: translate(24px, -18px) scale(1.08); opacity: 0.45; }
  66% { transform: translate(-16px, 12px) scale(0.95); opacity: 0.35; }
}
.board-fx-beam {
  position: absolute;
  top: 0; left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 241, 0.04), transparent);
  animation: boardBeamSweep 8s ease-in-out infinite;
}
@keyframes boardBeamSweep {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(430%); opacity: 0; }
}
.board-screen.board-ready .board-widget,
.board-screen.board-ready .board-map-panel {
  animation: boardWidgetIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.board-col-left .board-widget:nth-child(1) { animation-delay: 0.08s; }
.board-col-left .board-widget:nth-child(2) { animation-delay: 0.16s; }
.board-col-left .board-widget:nth-child(3) { animation-delay: 0.24s; }
.board-col-center .board-map-panel { animation-delay: 0.12s; }
.board-col-center .board-widget { animation-delay: 0.28s; }
.board-col-right .board-widget:nth-child(1) { animation-delay: 0.14s; }
.board-col-right .board-widget:nth-child(2) { animation-delay: 0.22s; }
.board-col-right .board-widget:nth-child(3) { animation-delay: 0.30s; }
.board-col-right .board-widget:nth-child(4) { animation-delay: 0.38s; }
@keyframes boardWidgetIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.board-fade-in {
  animation: boardFadeIn 0.55s ease both;
}
.board-slide-in {
  animation: boardSlideIn 0.5s ease both;
}
@keyframes boardFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes boardSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.board-screen-title {
  animation: boardTitleGlow 3s ease-in-out infinite;
}
@keyframes boardTitleGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(0, 242, 241, 0.5); }
  50% { text-shadow: 0 0 32px rgba(0, 242, 241, 0.85), 0 0 48px rgba(0, 242, 241, 0.25); }
}
.board-title-wing {
  animation: boardWingPulse 2.5s ease-in-out infinite;
}
.board-title-wing-r { animation-delay: -1.2s; }
@keyframes boardWingPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; filter: brightness(1.3); }
}
.board-brackets i {
  animation: boardBracketGlow 2.8s ease-in-out infinite;
}
.board-brackets i:nth-child(1) { animation-delay: 0s; }
.board-brackets i:nth-child(2) { animation-delay: 0.4s; }
.board-brackets i:nth-child(3) { animation-delay: 0.8s; }
.board-brackets i:nth-child(4) { animation-delay: 1.2s; }
@keyframes boardBracketGlow {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 4px rgba(0, 242, 241, 0.2); }
  50% { opacity: 1; box-shadow: 0 0 12px rgba(0, 242, 241, 0.55); }
}
.board-widget::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(0, 242, 241, 0.06) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: boardWidgetShine 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes boardWidgetShine {
  0% { background-position: 200% 0; opacity: 0; }
  15% { opacity: 1; }
  50% { background-position: -100% 0; opacity: 0.6; }
  100% { background-position: -100% 0; opacity: 0; }
}
.board-kpi-cell {
  position: relative;
  overflow: hidden;
}
.board-kpi-cell::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 241, 0.35), transparent);
  opacity: 0;
  animation: boardKpiScan 4s linear infinite;
}
@keyframes boardKpiScan {
  0% { transform: translateX(-100%); opacity: 0; }
  20% { opacity: 0.8; }
  80% { opacity: 0.8; }
  100% { transform: translateX(100%); opacity: 0; }
}
.board-hero-num {
  animation: boardHeroPulse 2.5s ease-in-out infinite;
}
.board-hero-gold { animation-delay: 0s; }
.board-hero-orange { animation-delay: -1.2s; }
@keyframes boardHeroPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}
.board-donut {
  animation: boardDonutPulse 3s ease-in-out infinite;
}
.board-donut.board-donut-spin {
  animation: boardDonutGlow 2.5s ease;
}
@keyframes boardDonutGlow {
  from { opacity: 0.55; filter: brightness(0.85); }
  to { opacity: 1; filter: brightness(1); }
}
@keyframes boardDonutPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(0, 242, 241, 0.2); }
  50% { box-shadow: 0 0 36px rgba(0, 242, 241, 0.45); }
}
.board-dual-col .board-bar-grow {
  transform-origin: bottom;
  animation: boardBarGrow 0.85s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}
@keyframes boardBarGrow {
  from { transform: scaleY(0); opacity: 0.4; }
  to { transform: scaleY(1); opacity: 1; }
}
@keyframes boardLineDraw {
  to { stroke-dashoffset: 0; }
}
.board-area-dot {
  animation: boardDotPulse 2s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.board-area-dot:nth-child(odd) { animation-delay: -0.5s; }
@keyframes boardDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.25); }
}
.board-flow-row:nth-child(even) { background: rgba(0, 242, 241, 0.02); }
.board-data-table tbody tr.board-flow-row {
  transition: background 0.25s ease;
}
.board-radial-seg {
  animation: boardRadialIn 0.8s ease both;
}
.board-radial-seg:nth-child(1) { animation-delay: 0.05s; }
.board-radial-seg:nth-child(2) { animation-delay: 0.12s; }
.board-radial-seg:nth-child(3) { animation-delay: 0.19s; }
.board-radial-seg:nth-child(4) { animation-delay: 0.26s; }
@keyframes boardRadialIn {
  from { opacity: 0; }
  to { opacity: 0.9; }
}
.board-screen.board-data-pulse .board-kpi-strip,
.board-screen.board-data-pulse .board-map-panel {
  animation: boardDataPulse 0.65s ease;
}
@keyframes boardDataPulse {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.2); }
  100% { filter: brightness(1); }
}
.board-map-stats strong {
  animation: boardStatBlink 3s ease-in-out infinite;
}
.board-map-stats span:nth-child(4) strong { animation-delay: -1s; }
@keyframes boardStatBlink {
  0%, 100% { color: var(--viz-cyan); }
  50% { color: #fff; text-shadow: 0 0 8px var(--viz-cyan); }
}
@media (prefers-reduced-motion: reduce) {
  .page-content-board,
  .board-fx-layer,
  .board-screen-title,
  .board-title-wing,
  .board-brackets i,
  .board-widget::after,
  .board-kpi-cell::before,
  .board-hero-num,
  .board-donut,
  .board-area-dot,
  .board-map-stats strong {
    animation: none !important;
  }
  .board-fade-in,
  .board-slide-in,
  .board-bar-grow,
  .board-radial-seg {
    animation-duration: 0.01ms !important;
  }
}

/* 大屏看板：中等宽度收窄地图，矮屏改为可滚动，避免裁切变形 */
@media (max-width: 1400px) {
  .board-map-scene { height: 320px; min-height: 280px; }
  .board-map-panel { min-height: 340px; }
  .board-screen { padding: 10px 12px 14px; }
}

@media (max-width: 1200px) {
  .page-content-board {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: auto;
  }
  .board-screen { min-height: auto; }
  .board-screen-body { grid-template-columns: 1fr 1fr; }
  .board-col-center { grid-column: 1 / -1; order: -1; }
  .board-radial-body { grid-template-columns: 1fr; }
  .board-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .board-map-scene { height: 280px; min-height: 240px; }
  .board-map-panel { min-height: 300px; }
  .board-widget { flex: 0 0 auto; min-height: 180px; }
}

@media (max-height: 900px) {
  .page-content-board {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
  }
  .board-map-scene {
    height: min(300px, 34vh);
    min-height: 200px;
  }
  .board-map-panel { min-height: 280px; }
}

@media (max-width: 768px) {
  .board-screen-body { grid-template-columns: 1fr; }
  .board-kpi-strip { grid-template-columns: 1fr 1fr; }
  .board-header-tools {
    position: static;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
  }
  .board-exit-btn { position: static; display: inline-block; margin-bottom: 8px; }
  .board-title-wing { display: none; }
  .board-map-kpis { flex-direction: column; gap: 8px; }
  .board-donut-layout { grid-template-columns: 1fr; }
  .board-map-scene { height: 240px; min-height: 200px; }
  .board-hero-num { font-size: 24px; }
}
