/* =====================================================
   集凯工抵数据看板 —— 龙智精工设计风格适配
   Design System: Indigo Primary + Slate Surface + Lamp Semantics
   参考：龙智精工建占比看板_0614
   ===================================================== */

/* ===== CSS Variables ===== */
:root {
  /* === Primary: Indigo (Professional, Trustworthy) === */
  --color-primary-50: #eef2ff;
  --color-primary-100: #e0e7ff;
  --color-primary-200: #c7d2fe;
  --color-primary-300: #a5b4fc;
  --color-primary-400: #818cf8;
  --color-primary-500: #6366f1;
  --color-primary-600: #4f46e5;
  --color-primary-700: #4338ca;
  --color-primary-800: #3730a3;
  --color-primary-900: #312e81;

  /* === Surface: Slate (Neutral, Clean) === */
  --color-surface-0: #ffffff;
  --color-surface-50: #f8fafc;
  --color-surface-100: #f1f5f9;
  --color-surface-200: #e2e8f0;
  --color-surface-300: #cbd5e1;
  --color-surface-400: #94a3b8;
  --color-surface-500: #64748b;
  --color-surface-600: #475569;
  --color-surface-700: #334155;
  --color-surface-800: #1e293b;
  --color-surface-900: #0f172a;

  /* === Lamp Semantic Colors === */
  --color-lamp-red: #dc2626;
  --color-lamp-red-bg: #fef2f2;
  --color-lamp-red-glow: rgba(220, 38, 38, .45);
  --color-lamp-orange: #f59e0b;
  --color-lamp-orange-bg: #fffbeb;
  --color-lamp-orange-glow: rgba(245, 158, 11, .45);
  --color-lamp-yellow: #eab308;
  --color-lamp-yellow-bg: #fefce8;
  --color-lamp-yellow-glow: rgba(234, 179, 8, .45);
  --color-lamp-green: #16a34a;
  --color-lamp-green-bg: #f0fdf4;
  --color-lamp-green-glow: rgba(22, 163, 74, .45);

  /* === Semantic Tokens === */
  --color-bg-body: #f1f5f9;
  --color-bg-card: #ffffff;
  --color-bg-hover: #f8fafc;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #64748b;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-error: #dc2626;
  --color-warning: #f59e0b;
  --color-success: #16a34a;
  --color-info: #4f46e5;

  /* === Legacy aliases for existing component classes === */
  --bg-primary: var(--color-bg-body);
  --bg-secondary: var(--color-bg-card);
  --bg-card: var(--color-bg-card);
  --bg-header: linear-gradient(135deg, var(--color-primary-900) 0%, var(--color-primary-800) 50%, var(--color-primary-600) 100%);
  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted: var(--color-text-tertiary);
  --border-color: var(--color-border);
  --border-light: var(--color-border-light);
  --border-strong: var(--color-surface-400);
  --accent-color: var(--color-primary-600);
  --accent-hover: var(--color-primary-700);
  --accent-soft: var(--color-primary-100);
  --highlight-color: var(--color-primary-600);
  --highlight-hover: var(--color-primary-700);
  --highlight-soft: var(--color-primary-100);
  --success-color: var(--color-success);
  --warning-color: var(--color-warning);
  --danger-color: var(--color-error);
  --chart-bg: var(--color-bg-card);
  --table-header-bg: var(--color-surface-50);
  --table-row-hover: var(--color-primary-50);
  --rtitle-bg: linear-gradient(90deg, var(--color-surface-50) 0%, var(--color-primary-100) 100%);
  --rtitle-text: var(--color-text-primary);
  --note-bg: var(--color-primary-100);
  --note-border: var(--color-primary-600);

  /* === Shadow Elevation === */
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-2: 0 1px 3px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
  --shadow-3: 0 2px 8px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .04);
  --shadow-4: 0 4px 14px rgba(15, 23, 42, .10), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-5: 0 8px 22px rgba(15, 23, 42, .12), 0 16px 48px rgba(15, 23, 42, .08);
  --shadow-card: var(--shadow-2);
  --shadow-hover: var(--shadow-4);
  --shadow-elevated: var(--shadow-5);
  --focus-ring: 0 0 0 3px var(--color-primary-200);

  /* === Spacing Scale (4px base) === */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* === Typography Scale === */
  --font-display: 26px;
  --font-h1: 22px;
  --font-h2: 16px;
  --font-h3: 14px;
  --font-body: 13px;
  --font-label: 12px;
  --font-caption: 12px;

  /* === Motion === */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --ease-default: cubic-bezier(.4, 0, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, .2, 1);

  /* === Radius === */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  /* === Legacy radii === */
  --transition-fast: var(--duration-fast) var(--ease-default);
  --transition-base: var(--duration-normal) var(--ease-default);
  --transition-slow: var(--duration-slow) var(--ease-default);

  /* === Numeric font: tabular-nums friendly system fonts === */
  --num-font:
    "Microsoft YaHei",
    "PingFang SC",
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Sans GB",
    "Segoe UI",
    "WenQuanYi Micro Hei",
    "Noto Sans SC",
    sans-serif;
}

[data-theme="dark"] {
  /* === Surface: 极暗灰蓝 === */
  --color-surface-0: #0a0e17;
  --color-surface-50: #11151f;
  --color-surface-100: #181c27;
  --color-surface-200: #1e2330;
  --color-surface-300: #2a3040;
  --color-surface-400: #3d4558;
  --color-surface-500: #5c6578;
  --color-surface-600: #7a8398;
  --color-surface-700: #a0aaba;
  --color-surface-800: #c4c9d4;
  --color-surface-900: #e8eaef;

  /* === Semantic: 柔和低对比 === */
  --color-bg-body: #0a0e17;
  --color-bg-card: #11151f;
  --color-bg-hover: #181c27;
  --color-text-primary: #e8eaef;
  --color-text-secondary: #a0aaba;
  --color-text-tertiary: #7a8398;
  --color-text-muted: #5c6578;
  --color-border: #1e2330;
  --color-border-light: #181c27;

  /* === Primary: 柔和低饱和 === */
  --color-primary-50: #1a1d2e;
  --color-primary-100: #252a40;
  --color-primary-200: #363d5c;
  --color-primary-300: #4a5278;
  --color-primary-400: #5e6794;
  --color-primary-500: #757fb0;
  --color-primary-600: #939bc4;
  --color-primary-700: #b5bad8;
  --color-primary-800: #d8dbec;
  --color-primary-900: #f0f1f8;

  /* === Lamp: 深色模式柔和色 === */
  --color-lamp-red: #e06c75;
  --color-lamp-red-bg: rgba(224, 108, 117, .1);
  --color-lamp-red-glow: rgba(224, 108, 117, .15);
  --color-lamp-orange: #d19a66;
  --color-lamp-orange-bg: rgba(209, 154, 102, .1);
  --color-lamp-orange-glow: rgba(209, 154, 102, .15);
  --color-lamp-yellow: #e5c07b;
  --color-lamp-yellow-bg: rgba(229, 192, 123, .1);
  --color-lamp-yellow-glow: rgba(229, 192, 123, .15);
  --color-lamp-green: #98c379;
  --color-lamp-green-bg: rgba(152, 195, 121, .1);
  --color-lamp-green-glow: rgba(152, 195, 121, .15);

  /* === Legacy aliases === */
  --bg-primary: var(--color-bg-body);
  --bg-secondary: var(--color-bg-card);
  --bg-card: var(--color-bg-card);
  --bg-header: linear-gradient(135deg, #151928 0%, #1c2035 100%);
  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted: var(--color-text-tertiary);
  --border-color: var(--color-border);
  --border-light: var(--color-border-light);
  --border-strong: var(--color-surface-500);
  --accent-color: var(--color-primary-600);
  --accent-hover: var(--color-primary-700);
  --accent-soft: var(--color-primary-100);
  --highlight-color: var(--color-primary-600);
  --highlight-hover: var(--color-primary-700);
  --highlight-soft: var(--color-primary-100);
  --success-color: var(--color-lamp-green);
  --warning-color: var(--color-lamp-orange);
  --danger-color: var(--color-lamp-red);
  --chart-bg: var(--color-bg-card);
  --table-header-bg: var(--color-surface-50);
  --table-row-hover: rgba(99, 102, 241, .08);
  --rtitle-bg: linear-gradient(90deg, var(--color-surface-100) 0%, var(--color-primary-100) 100%);
  --rtitle-text: var(--color-text-primary);
  --note-bg: var(--color-primary-100);
  --note-border: var(--color-primary-600);

  /* === Shadows: 深色适配 === */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-2: 0 1px 3px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-3: 0 2px 8px rgba(0, 0, 0, .6), 0 4px 12px rgba(0, 0, 0, .4);
  --shadow-4: 0 4px 14px rgba(0, 0, 0, .65), 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-5: 0 8px 22px rgba(0, 0, 0, .7), 0 16px 48px rgba(0, 0, 0, .5);
  --shadow-card: var(--shadow-2);
  --shadow-hover: var(--shadow-4);
  --shadow-elevated: var(--shadow-5);
  --focus-ring: 0 0 0 3px rgba(147, 155, 196, .35);

  /* === 状态/徽章深色覆盖 === */
  [data-theme="dark"] .hs-exact,
  [data-theme="dark"] .hs-signed { background: var(--color-lamp-green-bg); color: var(--color-lamp-green); }
  [data-theme="dark"] .hs-comp,
  [data-theme="dark"] .hs-company,
  [data-theme="dark"] .hs-unsigned { background: var(--color-lamp-orange-bg); color: var(--color-lamp-orange); }
  [data-theme="dark"] .hs-miss { background: var(--color-lamp-red-bg); color: var(--color-lamp-red); }
  [data-theme="dark"] .hs-custom { background: rgba(147, 155, 196, .12); color: var(--color-primary-600); }
  [data-theme="dark"] .hs-year-2024 { background: var(--color-surface-200); color: var(--color-text-secondary); }
  [data-theme="dark"] .hs-year-2025 { background: var(--color-lamp-red-bg); color: var(--color-lamp-red); }
  [data-theme="dark"] .hs-year-2026 { background: var(--color-primary-100); color: var(--color-primary-600); }
  [data-theme="dark"] .hs-status-info { background: var(--color-lamp-yellow-bg); color: var(--color-lamp-yellow); }
  [data-theme="dark"] .hs-status-yellow { background: var(--color-lamp-orange-bg); color: var(--color-lamp-orange); }
  [data-theme="dark"] .alert-item.warn { background: var(--color-lamp-orange-bg); color: var(--color-lamp-orange); }
  [data-theme="dark"] .alert-item.info { background: var(--color-lamp-yellow-bg); color: var(--color-lamp-yellow); }
  [data-theme="dark"] .hs-status-warn { background: var(--color-lamp-orange-bg); color: var(--color-lamp-orange); }
  [data-theme="dark"] .diff-banner { background: var(--color-lamp-orange-bg); border-left-color: var(--color-lamp-orange); }
  [data-theme="dark"] .upload-hint { background: var(--color-lamp-orange-bg); border-left-color: var(--color-lamp-orange); }
  [data-theme="dark"] .upload-hint b { color: var(--color-lamp-orange); }
}

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

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100vh; }

body {
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Sans GB",
    "Segoe UI",
    "WenQuanYi Micro Hei",
    "Noto Sans SC",
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 124px;
}

/* Numbers and KPI values use mono */
.value, .num, td.num, th.num, .ns-meta, .card .value,
.ds-value, .hs-num, .hs-progress-text {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ===== Accessibility ===== */
:focus { outline: none; }
:focus-visible {
  outline: 1px solid var(--color-primary-500);
  outline-offset: 1px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

button, select, input, [role="button"], [role="tab"] {
  transition: background var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), box-shadow var(--transition-fast),
              transform var(--transition-fast);
}

button, select, input { font-family: inherit; }

/* ===== Header ===== */
.header {
  background: var(--bg-header);
  color: #fff;
  padding: var(--space-4) var(--space-10);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 51;
  box-shadow: 0 4px 12px rgba(49, 46, 129, .15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, .08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, .15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.header > * { position: relative; z-index: 1; }

.header h1 {
  font-size: var(--font-h2);
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header h1::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 22px;
  background: linear-gradient(180deg, var(--color-lamp-orange), var(--color-lamp-yellow));
  border-radius: 2px;
}

.header p {
  font-size: var(--font-caption);
  opacity: .8;
  padding-left: 18px;
  letter-spacing: .3px;
  margin: 0;
  color: rgba(255, 255, 255, .85);
}

.header-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-shrink: 0;
}

/* ===== Header Icon Buttons (Alert / Log) ===== */
.header-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 200ms ease-out,
              box-shadow 200ms ease-out;
  backdrop-filter: blur(4px);
}
.header-icon-btn:hover { background: rgba(255, 255, 255, .3); transform: scale(1.1); }
.header-icon-btn:active { transform: scale(0.95); }
.header-icon-btn .header-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-error);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
[data-theme="dark"] .header-icon-btn { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .header-icon-btn:hover { background: rgba(255, 255, 255, .2); }

/* ===== Header Dropdown Panels ===== */
.header-dropdown {
  position: absolute;
  top: 64px;
  right: 16px;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* 备份/恢复专用下拉 */
.backup-menu {
  right: 0;
  width: 160px;
  padding: 8px 0;
  top: 52px;
}
.header-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  background: var(--color-surface-50);
}
.header-dropdown-header h4 { margin: 0; font-size: var(--font-body); }
.header-dropdown-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
}
.header-dropdown-close:hover { background: var(--color-surface-100); color: var(--text-primary); }
.header-dropdown-tabs {
  display: flex;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-light);
  background: var(--color-surface-0);
}
.header-dropdown-tab {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-caption);
  font-weight: 500;
}
.header-dropdown-tab:hover { background: var(--color-surface-100); color: var(--text-primary); }
.header-dropdown-tab.active { background: var(--color-primary-100); color: var(--color-primary-700); }
.alert-data-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  background: var(--color-surface-50);
}
.alert-data-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--color-surface-0);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.alert-data-filter:hover { border-color: var(--color-primary-400); color: var(--color-primary-700); }
.alert-data-filter.active { border-color: var(--color-primary-400); background: var(--color-primary-100); color: var(--color-primary-700); }
.alert-data-filter-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(100,116,139,.12);
  font-family: var(--num-font);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.alert-item-source {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,.65);
  font-size: 11px;
  font-weight: 600;
}
.header-dropdown-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
}
.alert-section { margin-bottom: var(--space-4); }
.alert-section-title { font-size: var(--font-label); font-weight: 600; margin-bottom: var(--space-2); color: var(--text-primary); }
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  font-size: var(--font-caption);
  line-height: 1.45;
  white-space: pre-line;
  word-break: break-all;
}
.alert-item.error { background: var(--color-lamp-red-bg); color: var(--color-error); }
.alert-item.warn { background: var(--color-lamp-orange-bg); color: #92400e; }
.alert-item.info { background: var(--color-lamp-yellow-bg); color: #a16207; }
.alert-item.ok { background: var(--color-lamp-green-bg); color: var(--color-success); }
.alert-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.alert-item.error .alert-dot { background: var(--color-error); }
.alert-item.warn .alert-dot { background: var(--color-warning); }
.alert-item.info .alert-dot { background: var(--color-warning); }
.alert-item.ok .alert-dot { background: var(--color-success); }

/* ===== 预警中心卡片 ===== */
#alertCenterPanel.header-dropdown {
  position: fixed;
  top: 74px;
  right: 16px;
  width: min(780px, calc(100vw - 32px));
  max-height: 82vh;
  z-index: 9999;
}
.alert-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.alert-card {
  --alert-accent: #64748b;
  position: relative;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--alert-accent);
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .055);
  color: var(--text-primary);
  line-height: 1.6;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.alert-card:hover {
  box-shadow: 0 6px 18px rgba(15, 23, 42, .09);
  transform: translateY(-1px);
}
.alert-card.error { --alert-accent: #dc2626; }
.alert-card.warn { --alert-accent: #d97706; }
.alert-card.info { --alert-accent: #2563eb; }
.alert-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  margin-bottom: 8px;
}
.alert-card-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.alert-card-severity,
.alert-card-source {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.alert-card-severity { color: var(--alert-accent); background: color-mix(in srgb, var(--alert-accent) 11%, transparent); }
.alert-card-source { color: var(--text-secondary); background: var(--color-surface-100); }
.alert-card-title {
  margin-bottom: 5px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}
.alert-card-location,
.alert-card-period,
.alert-card-note,
.alert-card-change-count {
  color: var(--text-secondary);
  font-size: 13px;
}
.alert-card-project,
.alert-card-house,
.alert-card-key strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alert-card-project { margin-top: 8px; font-size: 14px; font-weight: 600; }
.alert-card-house { color: var(--text-secondary); font-size: 13px; }
.alert-card-period {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}
.alert-card-period span { color: var(--alert-accent); font-weight: 700; }
.alert-card-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--color-surface-50);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.alert-card-value-old { color: var(--text-secondary); word-break: break-word; }
.alert-card-value-new { color: var(--alert-accent); font-weight: 600; word-break: break-word; }
.alert-card-arrow { color: var(--text-muted); }
.alert-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.alert-card-metric {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: var(--color-surface-0);
}
.alert-card-metric span { display: block; color: var(--text-muted); font-size: 12px; }
.alert-card-metric strong { display: block; overflow: hidden; color: var(--text-primary); font-size: 13px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.alert-card-key {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--color-surface-50);
  font-size: 13px;
}
.alert-card-key span { color: var(--text-muted); }
.alert-card-preview { margin-top: 8px; border-top: 1px solid var(--border-light); }
.alert-card-preview > div { display: grid; grid-template-columns: minmax(80px, .7fr) minmax(0, 1.3fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.alert-card-preview span { color: var(--text-muted); }
.alert-card-preview b { color: var(--text-primary); font-weight: 500; word-break: break-word; }
.alert-card-note { margin-top: 9px; padding: 7px 9px; border-radius: 6px; background: color-mix(in srgb, var(--alert-accent) 7%, transparent); }
.alert-card-count { display: flex; align-items: baseline; gap: 7px; margin: 7px 0 10px; }
.alert-card-count strong { color: var(--alert-accent); font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.alert-card-count span { color: var(--text-secondary); font-size: 13px; }
.alert-card-house-list { display: grid; gap: 5px; }
.alert-card-house-list > div,
.alert-card-detail-house { overflow: hidden; padding: 5px 8px; border-radius: 5px; background: var(--color-surface-50); color: var(--text-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.alert-card-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.alert-card-btn {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.alert-card-btn:hover { border-color: var(--color-primary-400); background: var(--color-primary-50); color: var(--color-primary-700); }
.alert-card-btn.primary { border-color: var(--color-primary-600); background: var(--color-primary-600); color: #fff; }
.alert-card-btn.primary:hover { border-color: var(--color-primary-700); background: var(--color-primary-700); color: #fff; }
.alert-card-detail {
  display: none;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  word-break: break-word;
}
.alert-card.expanded .alert-card-detail { display: block; }
.alert-card-detail dl { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 5px 9px; margin: 0; }
.alert-card-detail dt { color: var(--text-muted); }
.alert-card-detail dd { margin: 0; color: var(--text-primary); }
.alert-card-detail p { margin: 0 0 8px; white-space: pre-line; }
[data-theme="dark"] .alert-card { box-shadow: 0 2px 8px rgba(0, 0, 0, .24); }

@media (max-width: 680px) {
  #alertCenterPanel.header-dropdown { right: 8px; width: calc(100vw - 16px); max-width: none; }
  .alert-card-grid { grid-template-columns: 1fr; }
}
@media (min-width: 681px) and (max-width: 900px) {
  .alert-card-grid { grid-template-columns: 1fr; }
}

.log-item {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-light);
  font-size: var(--font-caption);
  line-height: 1.45;
}
.log-item:last-child { border-bottom: none; }
.log-time { color: var(--text-muted); font-size: 11px; }
.log-action { font-weight: 600; color: var(--text-primary); }

/* ===== Table Attachment Cell ===== */
.hs-remark-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 220px;
}
.hs-remark-wrap .hs-remark-input {
  flex: 1;
  min-width: 180px;
}
.hs-attach-mini {
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  transition: all .15s;
}
.hs-attach-mini:hover {
  background: var(--brand-bg, #eef2ff);
  border-color: var(--brand, #4338ca);
  transform: scale(1.1);
}
.hs-attachment-cell {
  text-align: center;
  padding: 4px 8px !important;
}
.hs-attachment-cell button {
  font-size: 14px;
  padding: 4px 8px;
  white-space: nowrap;
}

/* ===== Theme Toggle ===== */
.theme-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 200ms ease-out,
              box-shadow 200ms ease-out;
  backdrop-filter: blur(4px);
}

.theme-btn:hover { background: rgba(255, 255, 255, .3); transform: scale(1.1); }
.theme-btn:active { transform: scale(0.95); }

[data-theme="dark"] .theme-btn { background: rgba(255, 255, 255, .08); color: #fbbf24; }
[data-theme="dark"] .theme-btn:hover { background: rgba(255, 255, 255, .2); }

/* ===== Tabs Bar ===== */
.tabs-bar {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-5);
  background: var(--bg-secondary);
  padding: 0;
  box-shadow: var(--shadow-3);
  overflow-x: auto;
  overflow-y: visible;
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 50;
  scrollbar-width: thin;
  mask-image: linear-gradient(90deg, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, black 92%, transparent 100%);
}

.tabs-bar::-webkit-scrollbar { height: 6px; }
.tabs-bar::-webkit-scrollbar-thumb { background: var(--color-surface-400); border-radius: 3px; }
.tabs-bar::-webkit-scrollbar-thumb:hover { background: var(--color-surface-700); }

.tabs { display: flex; flex: 1; }

.tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: var(--font-body);
  font-weight: 500;
  color: var(--color-text-tertiary);
  transition: color 200ms ease-out, background 200ms ease-out;
  white-space: nowrap;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .3px;
  min-height: 46px;
}

.tab-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface-200);
  color: var(--color-text-tertiary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.tab:hover .tab-no { background: var(--color-primary-200); color: var(--color-primary-800); }
.tab.active .tab-no { background: var(--color-primary-600); color: #fff; }

.tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-800));
  transition: left 250ms cubic-bezier(0.16, 1, 0.3, 1),
              right 250ms cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 2px 2px 0 0;
}

.tab:hover {
  color: var(--color-primary-800);
  background: linear-gradient(180deg, var(--color-surface-50) 0%, var(--color-surface-100) 100%);
}

.tab:hover::after { left: 30%; right: 30%; }

.tab.active {
  color: var(--color-primary-800);
  font-weight: 600;
  background: linear-gradient(180deg, var(--color-primary-50) 0%, var(--color-primary-100) 100%);
}

.tab.active::after { left: 0; right: 0; height: 3px; }

.tab:not(:last-child) { border-right: 1px solid var(--border-color); }

/* ===== Panels ===== */
.panel {
  display: none;
  padding: var(--space-5) var(--space-10);
  animation: fadeIn 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 1400px;
  margin: 0 auto;
}

.panel.active { display: block; }

/* 宽表面板（房源状态/全局看板）铺满全屏，避免右侧留白 */
#p7, #p8 { max-width: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Overview Header ===== */
.overview-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 var(--space-4);
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-primary-200);
  position: relative;
}

.overview-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 1px;
  background: var(--color-primary-500);
}

.overview-header h3 {
  margin: 0;
  font-size: var(--font-h2);
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.overview-source-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--color-surface-50);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}
.overview-source-note.carried {
  border-color: rgba(217, 119, 6, .28);
  background: rgba(245, 158, 11, .10);
  color: #a15c04;
}

.overview-header .ov-month-selector {
  margin-left: 0;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-body);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
  min-height: 38px;
}

.overview-header h3::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: auto;
  align-self: stretch;
  background: linear-gradient(180deg, var(--color-primary-500), var(--color-primary-800));
  border-radius: 2px;
}

.overview-header select,
.ov-upload-sel {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-body);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
  min-height: 38px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

/* 上传区选择框：更紧凑 */
.overview-header .ov-upload-sel {
  padding: 6px 10px;
  font-size: var(--font-caption);
  min-height: 32px;
  min-width: auto;
}

.ov-upload-divider {
  width: 1px;
  height: 22px;
  background: var(--border-color);
  margin: 0 4px;
}

.ov-upload-label { margin-left: auto; }

.overview-header select:hover {
  border-color: var(--color-primary-500);
  box-shadow: var(--focus-ring);
}

/* ===== Dashboard Grid ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.chart-container {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-4) 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 250ms ease-out,
              border-color 250ms ease-out;
  position: relative;
  overflow: hidden;
}

.chart-container:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.chart-container h3 {
  font-size: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.chart-container h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 14px;
  background: linear-gradient(180deg, var(--color-primary-500), var(--color-primary-800));
  border-radius: 2px;
}

.chart-box { width: 100%; height: 320px; }
.chart-box.tall { height: 400px; }
.chart-full { grid-column: 1 / -1; }

/* ===== Cards / KPI ===== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
/* 卡片每行最多 3 张；大屏可放 4 张 */
@media (min-width: 760px) {
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1600px) {
  .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
  background: linear-gradient(135deg, var(--color-surface-0) 0%, var(--color-surface-50) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px var(--space-4) 16px 18px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70px;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 250ms ease-out,
              border-color 250ms ease-out;
  cursor: default;
}

/* KPI 卡片右下角装饰 */
.card::after {
  content: '';
  position: absolute;
  right: -16px;
  bottom: -16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.10) 0%, rgba(99,102,241,0) 70%);
  pointer-events: none;
}

.card.value-success::after { background: radial-gradient(circle, rgba(22,163,74,0.10) 0%, rgba(22,163,74,0) 70%); }
.card.value-warning::after { background: radial-gradient(circle, rgba(245,158,11,0.10) 0%, rgba(245,158,11,0) 70%); }
.card.value-danger::after { background: radial-gradient(circle, rgba(220,38,38,0.10) 0%, rgba(220,38,38,0) 70%); }
.card.value-teal::after { background: radial-gradient(circle, rgba(13,148,136,0.10) 0%, rgba(13,148,136,0) 70%); }
.card.card-highlight::after { background: radial-gradient(circle, rgba(249,115,22,0.10) 0%, rgba(249,115,22,0) 70%); }

/* 卡片左侧彩色竖线（默认靛蓝，按 tone 变色），与卡片同高 */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: linear-gradient(180deg, var(--color-primary-500) 0%, var(--color-primary-700) 100%);
  box-shadow: 2px 0 6px rgba(79, 70, 229, 0.25);
}

.card .label {
  font-size: var(--font-caption);
  color: var(--color-text-tertiary);
  margin-bottom: 4px;
  font-weight: 500;
  line-height: 1.3;
}

.card .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary-800);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

.card .value .unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  margin-left: 4px;
}

/* 左侧竖线按 tone 变色 */
.card.value-success::before { background: var(--color-success); }
.card.value-warning::before { background: var(--color-warning); }
.card.value-danger::before { background: var(--color-error); }
.card.value-teal::before { background: #0d9488; }
.card.value-info::before { background: var(--color-primary-500); }

.card.value-success .value,
.card.value-success .value .unit { color: var(--color-success); }
.card.value-warning .value,
.card.value-warning .value .unit { color: var(--color-warning); }
.card.value-danger .value,
.card.value-danger .value .unit { color: var(--color-error); }
.card.value-teal .value,
.card.value-teal .value .unit { color: #0d9488; }
.card.value-info .value,
.card.value-info .value .unit { color: var(--color-primary-700); }

/* ===== Filters ===== */
.filters {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--border-strong);
}

.filters.filters-second {
  margin-top: calc(-1 * var(--space-2));
  margin-bottom: var(--space-4);
}

.filters.filters-second input[type="text"] {
  flex: 1 1 240px;
  min-width: 240px;
}

.filters.filters-second #hsQuickFilter {
  display: inline-flex;
  gap: 4px;
}

.filters.filters-second .hs-mind-btn {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 30px;
}

.filters.filters-second .export-btn {
  margin-left: auto;
}

.filters label {
  font-size: var(--font-label);
  font-weight: 500;
  color: var(--color-text-tertiary);
}

.filters select, .filters input[type="text"] {
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--font-body);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  min-height: 36px;
  min-width: 110px;
  font-weight: 500;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* 房源状态筛选区：选择框更紧凑，避免换行 */
.hs-filters {
  background: var(--color-surface-50);
  border-bottom: 1px solid var(--border-color);
  padding: 10px var(--space-4);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-top: 0;
  flex-wrap: nowrap;
}

/* 房源状态筛选区：选择框更紧凑，避免换行 */
.hs-filters select { min-width: 80px; padding: 6px 10px; font-size: var(--font-caption); min-height: 32px; flex: 0 1 auto; }
.hs-filters label { font-size: var(--font-caption); white-space: nowrap; }
.filters select#hsStatusFilter { min-width: 90px; }

/* 房源状态第二排筛选区搜索框：缩短，便于一行排开 */
.hs-filters input[type="text"].hs-search-input {
  min-width: 140px;
  max-width: 190px;
  flex: 0 1 170px;
}

.filters select:hover, .filters input[type="text"]:hover,
.filters select:focus, .filters input[type="text"]:focus {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .10), 0 2px 8px rgba(79, 70, 229, .16);
}

/* 全局流水/付款看板搜索框：聚焦时蓝色细边框 + 阴影 */
.hs-search-input {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  font-size: var(--font-body);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.hs-search-input:hover { border-color: var(--color-primary-400); }
.hs-search-input:focus {
  border: 1px solid var(--color-primary-500);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .22), 0 4px 14px rgba(79, 70, 229, .18);
}

/* 地区分析表：5 个地区行加高 + 地区名左侧蓝色边线 */
.region-table { border-collapse: collapse; }
.region-table thead th { background: var(--table-header-bg); border-bottom: 2px solid var(--border-color); padding: 11px 16px; }
.region-table tbody tr.region-row { background: var(--bg-card); transition: background 150ms ease; }
.region-table tbody tr.region-row:hover { background: var(--table-row-hover); }
.region-table tbody tr.region-row td { padding: 16px 16px; border-bottom: 1px solid var(--border-light); }
.region-table tbody tr.region-row td:first-child {
  border-left: 4px solid var(--color-primary-500);
  font-weight: 600;
  padding-left: 14px;
  color: var(--color-primary-700);
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: var(--font-label);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

th {
  background: var(--table-header-bg);
  padding: var(--space-3) 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  color: var(--color-text-secondary);
  font-size: var(--font-label);
  position: sticky;
  top: 0;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

tr { transition: background var(--transition-fast); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--table-row-hover); }

.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; font-family: var(--num-font); font-weight: 500; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-md);
  font-size: var(--font-caption);
  font-weight: 600;
  line-height: 1.4;
}

.badge-yes { background: var(--color-lamp-green-bg); color: var(--color-success); border: 1px solid rgba(22, 163, 74, .3); }
.badge-no { background: var(--color-lamp-red-bg); color: var(--color-error); border: 1px solid rgba(220, 38, 38, .3); }
.badge-new { background: var(--color-lamp-orange-bg); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, .3); }

/* ===== Expandable Sections ===== */
.rtitle {
  font-size: var(--font-body);
  font-weight: 600;
  color: var(--rtitle-text);
  padding: var(--space-3) var(--space-6);
  background: var(--rtitle-bg);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--highlight-color);
  margin: var(--space-3) 0;
  cursor: pointer;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1),
              background 200ms ease-out,
              box-shadow 200ms ease-out;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}

.rtitle:hover {
  background: linear-gradient(90deg, var(--color-surface-100) 0%, var(--color-lamp-orange-bg) 100%);
  transform: translateX(4px);
}

.rtitle .arrow { transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1); font-size: var(--font-caption); }
.rtitle.open .arrow { transform: rotate(180deg); }

/* 工抵单位查询-合计表：蓝色表头、单行不换行、卡片化 */
.owner-grand-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 13px;
  margin: 10px 0 14px;
  white-space: nowrap;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border: 1px solid var(--border-color);
}
.owner-grand-table th,
.owner-grand-table td {
  padding: 11px 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.4;
  border: none;
}
.owner-grand-table th {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .02em;
  text-align: center;
  border-bottom: 2px solid #3730a3;
}
.owner-grand-table td {
  background: var(--card-bg);
  color: var(--text-primary);
  font-weight: 500;
  border-top: 1px solid var(--border-light);
}
.owner-grand-table td:first-child,
.owner-grand-table th:first-child {
  text-align: left;
  font-weight: 700;
}
.owner-grand-table .num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.owner-grand-table .grand-row td {
  text-align: center;
  font-weight: 700;
  background: var(--color-surface-50);
}
.owner-grand-table .grand-row td:first-child {
  text-align: center;
}
body.dark-mode .owner-grand-table th {
  background: linear-gradient(180deg, #3730a3 0%, #312e81 100%);
}

/* 月度回款对比表 */
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.cmp-table th {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.cmp-table th.num, .cmp-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cmp-table td {
  padding: 7px 10px;
  border-top: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}
.cmp-table tbody tr:hover { background: var(--hover-bg); }
body.dark-mode .cmp-table th { background: linear-gradient(180deg, #3730a3 0%, #312e81 100%); }



.rcontent {
  display: none;
  padding: var(--space-2) 0;
  animation: fadeIn 200ms cubic-bezier(0.16, 1, 0.3, 1) ease-out;
}

.rcontent.open { display: block; }

/* ===== Diff row highlight & delete button ===== */
.diff-banner {
  background: var(--color-lamp-orange-bg);
  border-left: 4px solid var(--color-warning);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-body);
  line-height: 1.6;
  color: var(--text-primary);
}

.diff-banner b { color: var(--color-warning); font-family: var(--num-font); }

tr.diff-row { background: var(--color-lamp-orange-bg) !important; }
tr.diff-row:hover { background: var(--color-lamp-orange-bg) !important; }

.diff-tag {
  display: inline-block;
  background: var(--color-lamp-orange-bg);
  color: var(--color-warning);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-caption);
  font-weight: 600;
  border: 1px solid rgba(245, 158, 11, .3);
  white-space: nowrap;
}

.del-btn {
  background: var(--color-error);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-caption);
  font-weight: 600;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 150ms ease-out,
              box-shadow 200ms ease-out,
              background-color var(--transition-fast);
  min-height: 28px;
}

.del-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(220, 38, 38, .4);
}

.del-btn:active { transform: scale(0.97); filter: brightness(0.95); }

/* ===== Notes ===== */
.note {
  background: var(--note-bg);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--font-body);
  margin-bottom: var(--space-4);
  border-left: 4px solid var(--note-border);
  color: var(--text-secondary);
  line-height: 1.7;
  position: relative;
}

.note::before {
  content: '说明';
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--bg-card);
  padding: 0 6px;
  font-size: var(--font-caption);
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--highlight-color);
}

/* 可关闭说明：点击空白处或 ✕ 隐藏 */
.note.dismissible { cursor: pointer; padding-right: 40px; }
.note.dismissible:hover { filter: brightness(0.99); }
.note.dismissible .hint-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  min-width: 28px;
  min-height: 28px;
  border-radius: var(--radius-sm);
}
.note.dismissible .hint-close:hover { color: var(--color-warning); background: var(--color-lamp-orange-bg); }

/* ===== Diff colors ===== */
.diff-pos { color: var(--color-success); font-weight: 600; }
.diff-neg { color: var(--color-error); font-weight: 600; }

/* ===== Loading / Empty States ===== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--text-muted);
  font-size: var(--font-body);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-lg);
  font-size: var(--font-body);
  gap: var(--space-3);
}

.empty-state .icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-100);
  border: 2px solid var(--color-primary-500);
  border-radius: 50%;
  color: var(--color-primary-600);
  font-size: 20px;
  font-weight: 800;
  font-family: var(--num-font);
}

/* ===== Scrollbar ===== */
html { scrollbar-width: thin; scrollbar-color: var(--color-surface-400) var(--color-surface-100); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface-100); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: var(--color-surface-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-surface-600); }

/* ===== Section Titles ===== */
h3 {
  font-size: var(--font-h2);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-6) 0 var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  line-height: 1.4;
}

h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, var(--color-primary-500), var(--color-primary-800));
  border-radius: 2px;
}

h3:first-child { margin-top: 0; }

/* 灰色调标题：灰色竖杆 + 圆点 + 灰字 */
h3.title-muted {
  color: var(--color-text-secondary);
  font-weight: 600;
}
h3.title-muted::before {
  content: '│';
  color: var(--color-text-tertiary);
  font-size: 18px;
  line-height: 1;
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
}
h3.title-muted::after {
  content: '●';
  color: var(--color-text-tertiary);
  font-size: 8px;
  margin-left: -2px;
  align-self: center;
}

h4 {
  font-size: var(--font-h3);
  font-weight: 600;
  color: var(--text-secondary);
  margin: var(--space-4) 0 var(--space-3);
  line-height: 1.4;
}

/* ===== New Signed Block ===== */
.ns-block { margin: var(--space-4) 0; }

.ns-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--font-body);
  font-weight: 600;
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-6);
  background: var(--rtitle-bg);
  border-left: 4px solid var(--highlight-color);
  border-radius: var(--radius-md);
  color: var(--rtitle-text);
  cursor: pointer;
  user-select: none;
  min-height: 48px;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1),
              background 200ms ease-out,
              box-shadow 200ms ease-out;
}

.ns-title:hover {
  background: linear-gradient(90deg, var(--color-surface-100) 0%, var(--color-lamp-orange-bg) 100%);
  transform: translateX(4px);
}

.ns-title-text { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); }
.ns-title-main { font-size: var(--font-body); font-weight: 600; letter-spacing: .02em; }
.ns-meta {
  font-size: var(--font-label);
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-family: var(--num-font);
}

.ns-arrow {
  font-size: var(--font-caption);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  color: var(--highlight-color);
}

.ns-title.open .ns-arrow { transform: rotate(180deg); }

.ns-content {
  display: none;
  animation: fadeIn 200ms cubic-bezier(0.16, 1, 0.3, 1) ease-out;
  padding-left: var(--space-3);
  border-left: 1px dashed var(--border-color);
  margin-left: 9px;
}

.ns-content.open { display: block; }
.ns-region th, .ns-region td { font-size: var(--font-label); }

/* ===== 新增房源与新增网签 ===== */
.new-change-summary {
  margin: var(--space-5) 0 var(--space-8);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.new-change-summary-toggle {
  width: 100%; min-height: 78px; padding: var(--space-4) var(--space-5); border: 0;
  display: grid; grid-template-columns: minmax(260px, 1fr) auto 24px; align-items: center; gap: var(--space-5);
  color: var(--text-primary); background: linear-gradient(90deg, var(--color-primary-100), var(--color-lamp-green-bg));
  text-align: left; cursor: pointer; font-family: inherit;
}
.new-change-summary-toggle:hover { filter: brightness(.99); }
.new-change-summary-title strong { display: block; font-size: var(--font-h2); font-weight: 600; line-height: 1.4; }
.new-change-summary-title small { display: block; margin-top: 3px; color: var(--text-secondary); font-size: var(--font-label); }
.new-change-summary-quick { display: flex; align-items: center; gap: var(--space-5); white-space: nowrap; font-size: var(--font-body); font-variant-numeric: tabular-nums; }
.new-change-summary-quick b { color: var(--highlight-color); font-weight: 600; }
.new-change-summary-quick b.signed { color: var(--success-color); }
.new-change-summary-arrow { color: var(--highlight-color); transition: transform 200ms ease; }
.new-change-summary-toggle.open .new-change-summary-arrow { transform: rotate(180deg); }
.new-change-summary-content { display: none; padding: var(--space-5); border-top: 1px solid var(--border-light); }
.new-change-summary-content.open { display: block; animation: fadeIn 180ms ease-out; }
.new-change-heading p { margin: 0 0 var(--space-4); color: var(--text-secondary); font-size: var(--font-label); }
.new-change-summary-content h4 { margin: var(--space-2) 0 var(--space-3); color: var(--text-primary); }
.new-change-region-title { margin-top: var(--space-6) !important; }
.new-change-table-wrap { overflow-x: auto; }
.new-change-table { min-width: 900px; margin: 0; }
.new-change-region-table { min-width: 720px; margin: 0; }
.new-change-table th, .new-change-table td { height: 40px; font-size: var(--font-body); }
.new-change-region-table th, .new-change-region-table td { height: 40px; font-size: var(--font-body); }
.new-change-table .group-house { color: var(--color-primary-700); background: var(--color-primary-100); }
.new-change-table .group-signed { color: var(--success-color); background: var(--color-lamp-green-bg); }
.new-change-table .signed-value { color: var(--success-color); font-weight: 600; }
.new-change-total td { background: var(--table-header-bg); font-weight: 600; border-top: 2px solid var(--highlight-color); }
.new-change-month { margin: 0 0 36px; }
.new-change-month > h3 { margin-top: 28px; }
.new-change-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-4) 0; }
.new-change-kpi { padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--border-light); background: var(--bg-card); box-shadow: var(--shadow-sm); }
.new-change-kpi.house { border-left: 5px solid var(--highlight-color); }
.new-change-kpi.signed { border-left: 5px solid var(--success-color); }
.new-change-kpi span { display: block; color: var(--text-secondary); font-size: var(--font-label); }
.new-change-kpi strong { display: block; margin: 4px 0; color: var(--text-primary); font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.new-change-kpi.signed strong { color: var(--success-color); }
.new-change-kpi small { font-size: var(--font-label); font-weight: 500; }
.new-change-kpi em { display: block; color: var(--text-secondary); font-size: var(--font-label); font-style: normal; }
.new-change-block { margin-top: var(--space-5); padding: var(--space-4); border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg-card); }
.new-change-block.signed-block { border-color: color-mix(in srgb, var(--success-color) 24%, var(--border-light)); }
.new-change-block-title { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); font-size: var(--font-h3); font-weight: 600; color: var(--text-primary); }
.change-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.change-dot.house { background: var(--highlight-color); }
.change-dot.signed { background: var(--success-color); }
.new-change-empty { padding: var(--space-5); text-align: center; color: var(--text-muted); background: var(--bg-secondary); border-radius: var(--radius-md); }
.new-change-subtotal td { background: var(--table-header-bg); font-weight: 600; }
.new-signed-chart-section { margin: 0 0 36px; }
.new-signed-chart-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-3); }
.new-signed-chart-heading h3 { margin: 0 0 3px; }
.new-signed-chart-heading p { margin: 0; color: var(--text-secondary); font-size: var(--font-label); }
.new-signed-chart-wide { display: grid; grid-template-columns: 1fr; margin-bottom: var(--space-4); }
.new-signed-chart-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: var(--space-4); }
.new-signed-chart-section .chart-container { margin: 0; padding: var(--space-4); }
.new-signed-chart-section .chart-container h4 { margin: 0 0 var(--space-2); color: var(--text-primary); font-size: var(--font-h3); }
.new-signed-chart-box { width: 100%; height: 360px; }
@media (max-width: 1000px) {
  .new-change-summary-toggle { grid-template-columns: 1fr 24px; }
  .new-change-summary-quick { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .new-change-kpis { grid-template-columns: 1fr; }
  .new-signed-chart-grid { grid-template-columns: 1fr; }
}

/* ===== Chart skeleton (loading) ===== */
.chart-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    var(--border-light) 0%,
    var(--bg-card) 50%,
    var(--border-light) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.segmented-control {
  display: inline-flex;
  background: var(--color-surface-100);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-caption);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out, transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.seg-btn:hover { color: var(--color-text-primary); }
.seg-btn.active { background: var(--color-bg-card); color: var(--color-primary-700); box-shadow: var(--shadow-1); }
.seg-btn:active { transform: scale(0.96); }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  body { padding-top: 124px; }
}

@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-full { grid-column: 1; }
  .header { padding: var(--space-3) var(--space-4); height: auto; min-height: 64px; }
  .header h1 { font-size: var(--font-h3); }
  .tabs-bar { top: 64px; }
  body { padding-top: 116px; }
  .panel { padding: var(--space-4); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  table { font-size: 12px; }
  th, td { padding: var(--space-2) 10px; }
  .tab { padding: 14px 10px; font-size: var(--font-label); }
}

/* ===== Buttons (unified) ===== */
button {
  font-family: inherit;
}

.upload-btn, .export-btn, .hint-btn, .hs-mind-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: var(--font-body);
  font-weight: 500;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 150ms ease-out,
              box-shadow 200ms ease-out,
              background-color var(--transition-fast);
  white-space: nowrap;
  min-height: 36px;
}

.upload-btn, .export-btn, .hs-mind-btn {
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.upload-btn:active,
.export-btn:active,
.hint-btn:active,
.hs-mind-btn:active {
  transform: scale(0.97);
  filter: brightness(0.95);
  box-shadow: none;
}

.upload-btn {
  background: var(--color-primary-600);
  color: #fff;
}

.upload-btn:hover { background: var(--color-primary-700); transform: translateY(-1px); }
.upload-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.export-btn {
  background: var(--color-success);
  color: #fff;
}

.export-btn:hover { background: #15803d; transform: translateY(-1px); }

.hint-btn {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
}

.hint-btn:hover { background: rgba(255, 255, 255, .3); }

.hs-mind-btn {
  background: var(--color-primary-600);
  color: #fff;
}

.hs-mind-btn:hover { background: var(--color-primary-700); transform: translateY(-1px); }
.hs-mind-btn.secondary {
  background: var(--color-surface-100);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.hs-mind-btn.secondary:hover { background: var(--color-surface-200); }
.hs-mind-btn.secondary.active {
  background: var(--color-primary-600);
  color: #fff;
  border-color: var(--color-primary-600);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .18);
}

.hs-mind-btn.tiny {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 10px;
}
.hs-mind-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.4;
  border-radius: 8px;
  background: var(--color-lamp-yellow-bg, #fef3c7);
  color: var(--color-lamp-orange, #d97706);
  border: 1px solid var(--color-lamp-yellow, #f59e0b);
  cursor: pointer;
  white-space: nowrap;
}
.hs-mind-tag:hover {
  background: var(--color-lamp-yellow, #f59e0b);
  color: #fff;
}

/* ===== Upload Form ===== */
.upload-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius-md);
  position: relative;
}

.upload-form select {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius-sm);
  font-size: var(--font-caption);
  background: rgba(0, 0, 0, .2);
  color: #fff;
  cursor: pointer;
  min-height: 32px;
}

.upload-form select option { background: var(--bg-card); color: var(--text-primary); }

.upload-status {
  font-size: var(--font-caption);
  color: var(--text-secondary);
  max-width: 120px;
  min-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--num-font);
  padding: 2px 8px;
  background: var(--color-surface-100);
  border-radius: var(--radius-sm);
  display: inline-block;
  vertical-align: middle;
  text-align: center;
}

/* 数据总览上传状态：紧跟按钮，固定宽度避免布局抖动 */
.overview-header #uploadStatus {
  position: static;
  margin-left: 4px;
}

.monthly-upload-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--color-surface-100);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.monthly-upload-badge.uploaded {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.monthly-upload-badge.missing {
  color: #b45309;
  border-color: #fed7aa;
  background: #fff7ed;
}

.monthly-upload-badge.locked {
  color: #64748b;
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.monthly-upload-reminder {
  flex-basis: 100%;
  display: none;
  margin-left: auto;
  padding: 7px 11px;
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius-sm);
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.monthly-upload-reminder.show { display: block; }

.upload-status.success { color: var(--color-lamp-green); background: var(--color-lamp-green-bg); }
.upload-status.error { color: var(--color-lamp-red); background: var(--color-lamp-red-bg); }
.upload-status.warn { color: #92400e; background: var(--color-lamp-orange-bg); white-space: normal; text-align: left; }
.upload-status.loading { color: var(--text-secondary); background: var(--color-surface-100); }
.upload-status.loading::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border: 2px solid rgba(79, 70, 229, .25);
  border-top-color: var(--color-primary-500);
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.upload-hint {
  font-size: var(--font-body);
  line-height: 1.5;
  padding: var(--space-3) var(--space-6);
  background: var(--color-lamp-orange-bg);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  max-width: 720px;
  margin-bottom: var(--space-4);
  position: relative;
}

.upload-hint b { color: var(--color-warning); }

.upload-hint .hint-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  min-width: 32px;
  min-height: 32px;
}

.upload-hint .hint-close:hover { color: var(--color-warning); }

/* ===== Downstream Management (Panel 6) ===== */
.ds-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.ds-card-sm {
  background: linear-gradient(135deg, var(--color-surface-0) 0%, var(--color-surface-50) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px var(--space-4) 10px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 250ms ease-out,
              border-color 250ms ease-out;
}

.ds-card-sm:active { transform: scale(0.98); }

.ds-card-sm:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* 左侧彩色竖线（默认靛蓝），与卡片同高 */
.ds-card-sm::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--color-primary-500);
}

.ds-label {
  font-size: var(--font-label);
  color: var(--color-text-tertiary);
  margin-bottom: 3px;
  font-weight: 500;
}

.ds-value {
  font-family: var(--num-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary-800);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

.ds-sublabel {
  font-size: var(--font-caption);
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.ds-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 250ms ease-out,
              border-color 250ms ease-out;
}

.ds-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.ds-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.ds-title {
  font-size: var(--font-h3);
  font-weight: 600;
  color: var(--text-primary);
}

.ds-meta {
  font-size: var(--font-body);
  color: var(--color-text-tertiary);
}

.ds-badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.ds-badge-signed {
  background: var(--color-lamp-green-bg);
  color: var(--color-success);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--font-caption);
  font-weight: 600;
  border: 1px solid rgba(22, 163, 74, .3);
}

.ds-badge-pending {
  background: var(--color-lamp-orange-bg);
  color: var(--color-warning);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--font-caption);
  font-weight: 600;
  border: 1px solid rgba(245, 158, 11, .3);
}

.ds-badge-overdue {
  background: var(--color-lamp-red-bg);
  color: var(--color-error);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--font-caption);
  font-weight: 600;
  border: 1px solid rgba(220, 38, 38, .3);
}

.ds-progress-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.ds-progress-label {
  font-size: var(--font-label);
  color: var(--color-text-tertiary);
  width: 36px;
  flex-shrink: 0;
  font-weight: 500;
}

.ds-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--color-surface-200);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.ds-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-800));
  border-radius: 4px;
  transition: width .4s var(--ease-default);
}

.ds-progress-text {
  font-size: var(--font-caption);
  color: var(--color-text-tertiary);
  width: 80px;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--num-font);
}

@media (max-width: 768px) {
  .ds-summary-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Panel 7: 房源状态 ===== */
.hs-summary-cards { margin: var(--space-3) 0; }

.hs-table-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 全局看板表格：表头固定 + 表体滚动 */
#p8 .hs-table-wrap { display: flex; flex-direction: column; max-height: 55vh; }
#p8 .hs-body-table { flex: 1; overflow: auto; max-height: none; }
#p8 .hs-header-table .hs-table th,
#p8 .hs-body-table .hs-table th {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  color: #fff;
}
#p8 .hs-table { border-collapse: separate; border-spacing: 0; }
#p8 .hs-body-table .hs-table thead { visibility: collapse; }
#p8 .hs-body-table .hs-table thead th { height: 0; padding: 0; border: none; }

/* 房源状态表格：减小单元格内边距，压缩行高 */
#p7 .hs-table td { padding: 4px 8px; line-height: 1; }
#p7 .hs-table .hs-fang { line-height: 1.2; }

/* 筛选栏淡灰背景 + 底部分隔线 */
.hs-upload-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.hs-upload-row .hs-search-input {
  min-width: 300px;
  flex: 1 1 auto;
}

.hs-filters select { min-width: 120px; padding: 6px 10px; font-size: var(--font-caption); min-height: 32px; }
.hs-filters label { font-size: var(--font-caption); }
.filters select#hsStatusFilter { min-width: 140px; }

.hs-upload-row .upload-label,
.hs-upload-row label {
  flex-shrink: 0;
  font-size: var(--font-caption);
}

.hs-upload-row select {
  min-width: 70px;
  padding: 5px 6px;
  font-size: var(--font-caption);
}

.hs-upload-row .upload-btn,
.hs-upload-row .export-btn-sm {
  padding: 5px 10px;
  font-size: var(--font-caption);
  min-height: 30px;
  flex-shrink: 0;
  white-space: nowrap;
}

.hs-upload-row .upload-status {
  flex-shrink: 0;
  max-width: 120px;
}

.relation-upload-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.relation-upload-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.relation-upload-badge.success {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.relation-upload-badge.pending {
  color: #64748b;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.relation-upload-badge.loading {
  color: #4338ca;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.relation-upload-badge.error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

/* 房源状态上传行也变浅灰 */
#p7 > .filters:first-of-type {
  background: var(--color-surface-50);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 8px var(--space-4);
  margin-bottom: 0;
  flex-wrap: wrap;
  row-gap: 6px;
}

/* 房源状态第一行：上传按钮/选择框压紧，保证一排 */
#p7 > .filters:first-of-type .upload-btn,
#p7 > .filters:first-of-type .export-btn { padding: 5px 10px; font-size: var(--font-caption); min-height: 30px; }
#p7 > .filters:first-of-type select { padding: 5px 8px; font-size: var(--font-caption); min-height: 30px; min-width: 64px; }
#p7 > .filters:first-of-type .upload-label { font-size: var(--font-caption); }

/* 导出按钮缩小版（导出异常房源：黄色警示） */
.export-btn-sm {
  padding: 4px 10px;
  font-size: var(--font-caption);
  min-height: 30px;
  margin-left: 8px;
  background: var(--color-warning);
}
.export-btn-sm:hover { background: #d97706; }

.hs-header-table {
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-card);
  padding-right: 8px;
  box-sizing: border-box;
}

.hs-body-table {
  overflow: auto;
  max-height: 55vh;
}

.hs-body-table::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.hs-body-table::-webkit-scrollbar-track {
  background: var(--color-surface-100);
  border-radius: 3px;
}

.hs-body-table::-webkit-scrollbar-thumb {
  background: var(--color-surface-400);
  border-radius: 3px;
  min-height: 80px;
}

.hs-body-table::-webkit-scrollbar-thumb:hover {
  background: var(--color-surface-600);
}

.hs-table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--font-label);
  white-space: normal;
  word-break: break-all;
  table-layout: fixed;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
}

.hs-table th {
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
  font-weight: 600;
  color: #fff;
  font-size: var(--font-label);
  border-bottom: 1px solid rgba(255,255,255,.25);
  background-clip: padding-box;
  box-sizing: border-box;
}

.hs-header-table .hs-table th,
.hs-body-table .hs-table th,
#p8 .hs-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.hs-table td {
  padding: 6px 8px;
  border: none;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  font-weight: 500;
  font-size: var(--font-label);
  color: var(--text-primary);
}

/* 统一表头：蓝色底白字 */
.hs-table thead th,
.region-table thead th,
.ns-region thead th {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  color: #fff;
}

/* 房源状态分组表头：对上/对下紫色，集凯保持青色 */
.hs-grouprow th.hs-g-up { background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%) !important; }
.hs-grouprow th.hs-g-jk { background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%) !important; }
.hs-grouprow th.hs-g-dn { background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%) !important; }
.hs-subrow th.hs-g-up { background: #4338ca !important; }
.hs-subrow th.hs-g-jk { background: #0284c7 !important; }
.hs-subrow th.hs-g-dn { background: #4338ca !important; }

.hs-header-table .hs-table thead tr:first-child th:not(.hs-g-up):not(.hs-g-jk):not(.hs-g-dn),
.hs-body-table .hs-table thead tr:first-child th:not(.hs-g-up):not(.hs-g-jk):not(.hs-g-dn) {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
}

.hs-header-table .hs-table thead tr:last-child th:not(.hs-g-up):not(.hs-g-jk):not(.hs-g-dn),
.hs-body-table .hs-table thead tr:last-child th:not(.hs-g-up):not(.hs-g-jk):not(.hs-g-dn) {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
}

/* 房源状态分组表头：两行统一分组色 */
.hs-grouprow th.hs-g-up,
.hs-subrow th.hs-g-up { background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%) !important; }
.hs-grouprow th.hs-g-jk,
.hs-subrow th.hs-g-jk { background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%) !important; }
.hs-grouprow th.hs-g-dn,
.hs-subrow th.hs-g-dn { background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%) !important; }
.hs-table td.hs-col-up { color: #2563eb; font-weight: 600; }
.hs-table td.hs-col-jk { color: #0284c7; font-weight: 600; }
.hs-table td.hs-col-dn { color: #d97706; font-weight: 600; }
.hs-table td.hs-num { color: #1e293b; font-weight: 600; }

.hs-table tbody tr { transition: background .15s ease; background: var(--color-surface-0); }
.hs-table tbody tr:nth-child(even) { background: var(--color-surface-50); }
.hs-table tbody tr:hover { background: var(--color-primary-50) !important; }

/* 批量选中行：仅用颜色标记，去掉网格/边框干扰 */
.hs-table tbody tr.row-selected { background: var(--color-lamp-yellow-bg) !important; }
.hs-table tbody tr.row-selected td { border-bottom-color: transparent; }
.hs-table tbody tr.row-selected td::after { content: none; }

.hs-num {
  text-align: center !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-family: var(--num-font);
  font-size: var(--font-label);
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}

.hs-num.hi-up { color: var(--color-error); font-weight: 600; }
.hs-num.hi-down { color: var(--color-success); font-weight: 600; }

.hs-fang {
  white-space: normal;
  word-break: break-all;
  font-weight: 600;
  font-size: var(--font-label);
  line-height: 1.35;
}

.hs-fang .hs-badge {
  margin-top: 2px;
  margin-right: 3px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 1.4;
}

.hs-idx {
  text-align: center;
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.hs-ht {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  font-size: var(--font-label);
  color: var(--color-text-tertiary);
}

.hs-table td.hs-col-up { color: #d97706; font-weight: 600; background: rgba(245, 158, 11, 0.10) !important; }
.hs-table td.hs-col-jk { color: #0284c7; font-weight: 600; background: rgba(14, 165, 233, 0.10) !important; }
.hs-table td.hs-col-dn { color: #c2410c; font-weight: 600; background: rgba(234, 88, 12, 0.10) !important; }
.hs-table td.hs-num { color: #1e293b; font-weight: 600; }

/* 分组背景覆盖斑马纹 */
.hs-table tbody tr:nth-child(even) td.hs-col-up,
.hs-table tbody tr:nth-child(even) td.hs-col-jk,
.hs-table tbody tr:nth-child(even) td.hs-col-dn { background: inherit !important; }

.hs-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  font-size: var(--font-label);
  color: var(--text-primary);
  max-width: 100%;
}

.hs-ht {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  font-size: var(--font-label);
  color: var(--text-primary);
}

.hs-id {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--num-font);
  font-size: var(--font-label);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.hs-region-row {
  background: var(--color-surface-0) !important;
  cursor: pointer;
  user-select: none;
  border-left: 4px solid #2563eb;
  border-radius: var(--radius-md);
}

/* 区域之间的 2px 间隔行 */
.hs-region-gap { height: 2px; }
.hs-region-gap td {
  height: 2px;
  padding: 0 !important;
  border: none !important;
  line-height: 2px;
  font-size: 0;
}

.hs-region-row td {
  color: var(--text-primary) !important;
  font-weight: 600;
  font-size: var(--font-body);
  padding: 15px 14px !important;
  height: 53px;
  border-bottom: 1px solid var(--border-light) !important;
}

[data-theme="dark"] .hs-region-row {
  background: var(--color-surface-0) !important;
  border-left-color: #60a5fa;
}

.hs-region-icon { display: inline-block; width: 16px; font-weight: 700; }
.hs-region-count { font-weight: 400; opacity: .75; }

.hs-sign-row {
  background: var(--color-surface-0) !important;
  font-style: normal !important;
  font-weight: 500;
  font-size: var(--font-body);
}
.hs-sign-row td {
  color: var(--text-primary) !important;
  font-style: normal !important;
  font-weight: 500;
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--border-light) !important;
}
.hs-sign-unsigned td { color: #92400e !important; background: #fffbeb !important; }
.hs-sign-count { font-weight: 400; opacity: .75; margin-left: 6px; }

.hs-dim { opacity: .55; font-style: normal; font-family: inherit; }

.card.gb-card {
  cursor: pointer;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 200ms ease-out,
              border-color 200ms ease-out,
              background-color 200ms ease-out;
}
.card.gb-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-primary-400);
}
.card.gb-card:active {
  transform: translateY(-1px) scale(0.98);
}
.card.gb-card.active {
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-500);
  box-shadow: 0 4px 12px rgba(79, 70, 229, .22);
  transform: translateY(-2px);
  animation: none;
}

[data-theme="dark"] .card.gb-card.active {
  background: rgba(99, 102, 241, .14);
  border-color: var(--color-primary-400);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .28);
}
}

.card.gb-card .gb-value {
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.gb-filter-tip {
  font-size: var(--font-label);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  padding: 0 var(--space-2);
}

.gb-filter-tip .gb-filter-name {
  font-weight: 600;
  color: var(--color-primary-800);
}

.hs-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

/* 状态/匹配精度标签：红橙黄绿语义 */
.hs-exact { background: #dcfce7; color: #16a34a; }
.hs-comp { background: #fed7aa; color: #c2410c; }
.hs-miss { background: #fecaca; color: #dc2626; }
.hs-custom { background: #dbeafe; color: #1d4ed8; }
.hs-signed { background: #dcfce7; color: #16a34a; }
.hs-unsigned { background: #fef9c3; color: #a16207; }

/* 公司级 / 跨公司统一用橙色 */
.hs-company { background: #fed7aa; color: #c2410c; }

/* 年份标签 */
.hs-year-2024 { background: #f3f4f6; color: #4b5563; }
.hs-year-2025 { background: #fce7f3; color: #be185d; }
.hs-year-2026 { background: #e0e7ff; color: #4338ca; }
.hs-year-other { background: var(--color-surface-200); color: var(--color-text-secondary); }

/* 时间标签 */
.hs-time-tag {
  background: #f0fdf4;
  color: #15803d;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  margin-left: 4px;
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
}

.hs-time-tag-signed {
  background: #ecfeff;
  color: #0e7490;
}

body.dark-mode .hs-time-tag {
  background: #14532d;
  color: #86efac;
}

body.dark-mode .hs-time-tag-signed {
  background: #164e63;
  color: #67e8f9;
}

/* 手动标记下拉菜单 */
.manual-flag-menu {
  background: #ffffff !important; /* 强制不透明白底，避免叠在表格上看不清 */
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0,0,0,0.05);
  min-width: 220px;
  overflow: hidden;
  z-index: 99999;
}
[data-theme="dark"] .manual-flag-menu,
body.dark-mode .manual-flag-menu {
  background: #1e293b !important; /* 深色模式强制不透明深色底 */
  border-color: #475569;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .manual-flag-menu .menu-title,
body.dark-mode .manual-flag-menu .menu-title {
  background: #0f172a;
  color: #94a3b8;
  border-bottom-color: #334155;
}
[data-theme="dark"] .manual-flag-menu .menu-item,
body.dark-mode .manual-flag-menu .menu-item {
  color: #e2e8f0;
}
[data-theme="dark"] .manual-flag-menu .menu-item:hover,
body.dark-mode .manual-flag-menu .menu-item:hover {
  background: #334155;
  color: #fff;
}
[data-theme="dark"] .manual-flag-menu .menu-item.active,
body.dark-mode .manual-flag-menu .menu-item.active {
  background: #3730a3;
  color: #fff;
}
[data-theme="dark"] .manual-flag-menu .menu-divider,
body.dark-mode .manual-flag-menu .menu-divider {
  background: #334155;
}

.manual-flag-menu .menu-title {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.manual-flag-menu .menu-item {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.manual-flag-menu .menu-item:hover {
  background: var(--hover-bg);
  color: var(--highlight-color);
}

.manual-flag-menu .menu-item.active {
  background: var(--highlight-bg);
  color: var(--highlight-color);
  font-weight: 600;
}

.manual-flag-menu .menu-item.active::after {
  content: ' ✓';
  float: right;
}

.manual-flag-menu .menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.manual-flag-menu .menu-item-clear {
  color: var(--danger-color);
}

.manual-flag-menu .menu-item-clear:hover {
  background: var(--danger-bg);
  color: var(--danger-color);
}

body.dark-mode .manual-flag-menu {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* C类房源管理 */
.ch-section { background: var(--color-surface-50); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.ch-section h4 { margin: 0 0 8px 0; color: var(--highlight-color); }
.ch-tip { color: var(--text-muted); font-size: 12px; margin-bottom: 12px; }
.ch-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ch-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 160px;
  min-width: 160px;
}

.ch-form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-tertiary);
}

.ch-form-group input,
.ch-form-group select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
}

.ch-form-group input::placeholder {
  color: var(--color-text-muted);
}
.ch-form button { flex: 0 0 auto; }

.hs-status-cell { white-space: normal; min-width: 200px; font-size: 11px; }

.hs-status-badge {
  display: inline-block;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin: 1px 2px 1px 0;
  line-height: 1.35;
}

.hs-status-ok { background: var(--color-lamp-green-bg); color: var(--color-success); }
.hs-status-error { background: var(--color-lamp-red-bg); color: var(--color-error); }
.hs-status-warn { background: var(--color-lamp-orange-bg); color: #92400e; }
/* 提示类（无流水/无付款/未分配）改为黄色并更小 */
.hs-status-info { background: #e0f2fe; color: #075985; font-size: 11px; padding: 0 4px; }
.hs-status-yellow { background: var(--color-lamp-orange-bg); color: #92400e; font-size: 11px; padding: 0 4px; }

.hs-status-manual-wrap { margin-top: 3px; }
.hs-status-manual-btn {
  font-size: 12px;
  padding: 0 5px;
  border: 1px dashed var(--color-lamp-orange, #f59e0b);
  border-radius: 4px;
  background: transparent;
  color: #a16207;
  cursor: pointer;
  line-height: 1.4;
}
.hs-status-manual-btn:hover { background: #fef9c3; }
.hs-status-manual-btn.on {
  border-style: solid;
  background: #fef9c3;
  color: #92400e;
  font-weight: 600;
}

/* ===== 进度条（用于全局看板） ===== */
.hs-progress {
  display: inline-block;
  width: 100px;
  height: 6px;
  background: var(--color-surface-200);
  border-radius: 3px;
  vertical-align: middle;
  overflow: hidden;
  margin-right: 6px;
}

.hs-progress-bar {
  height: 100%;
  transition: width .3s var(--ease-default);
  background: linear-gradient(90deg, var(--color-primary-400), var(--color-primary-600));
}

/* 进度色与状态色解耦：进度恒中性蓝表达使用比例；
   状态语义交给 hs-status-badge 文字徽章，仅 error 叠加红斜纹强调超用。 */
.hs-progress-bar.ok,
.hs-progress-bar.warn { background: linear-gradient(90deg, var(--color-primary-400), var(--color-primary-600)); }
.hs-progress-bar.error {
  background:
    repeating-linear-gradient(45deg,
      var(--color-error) 0 6px,
      rgba(239, 68, 68, .35) 6px 12px);
}

.hs-progress-text {
  font-size: var(--font-caption);
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

[data-theme="dark"] .hs-grouprow th.hs-g-up,
[data-theme="dark"] .hs-grouprow th.hs-g-dn { background: #1d4ed8 !important; color: #bfdbfe; }
[data-theme="dark"] .hs-grouprow th.hs-g-jk { background: #075985 !important; color: #bae6fd; }
[data-theme="dark"] .hs-subrow th.hs-g-up,
[data-theme="dark"] .hs-subrow th.hs-g-dn { background: #1e40af; color: #bfdbfe; }
[data-theme="dark"] .hs-subrow th.hs-g-jk { background: #0369a1; color: #bae6fd; }
[data-theme="dark"] .hs-table thead th { background: var(--color-surface-50); }

/* ===== Panel 7 脑图视图 ===== */
.hs-tree { display: flex; flex-direction: column; gap: var(--space-3); }

.hs-tree-house {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.hs-tree-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface-50);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.hs-tree-fang { font-weight: 600; color: var(--text-primary); max-width: 320px; }
.hs-tree-kx { color: var(--color-text-tertiary); font-size: var(--font-label); }
.hs-tree-amt { margin-left: auto; font-size: var(--font-label); color: var(--color-text-tertiary); }
.hs-tree-empty { padding: var(--space-3); color: var(--color-text-tertiary); font-size: var(--font-label); }
.hs-tree-pays { padding: var(--space-2) var(--space-3) var(--space-3); }

.hs-tree-pay {
  margin: var(--space-2) 0;
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--color-primary-50);
}

.hs-tree-pay-main { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

.hs-tree-del {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--color-lamp-red-bg);
  color: var(--color-error);
  cursor: pointer;
  font-size: var(--font-label);
  line-height: 28px;
  text-align: center;
  min-width: 28px;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 150ms ease-out,
              color 150ms ease-out;
}

.hs-tree-del:hover { background: var(--color-error); color: #fff; }
.hs-tree-del:active { transform: scale(0.92); }

.hs-tree-payno { font-family: var(--num-font); font-size: var(--font-label); font-weight: 600; color: var(--text-primary); }
.hs-tree-payinfo { font-size: var(--font-label); color: var(--color-text-tertiary); }
.hs-tree-flow { font-size: var(--font-caption); color: var(--color-text-tertiary); margin-top: 4px; padding-left: var(--space-8); }
.hs-tree-contract { font-size: var(--font-caption); color: var(--color-text-tertiary); margin-top: 2px; padding-left: var(--space-8); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

[data-theme="dark"] .hs-tree-pay { background: rgba(99, 102, 241, .08); }

/* ===== Panel 7 脑图视图（新） ===== */
.hs-mind { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-2); }

.hs-mind-house {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  padding: var(--space-4);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 200ms ease-out,
              border-color 200ms ease-out;
}

.hs-mind-house:hover {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px var(--color-primary-100);
  transform: translateY(-2px);
}

.hs-mind-house:active { transform: translateY(-1px) scale(0.99); }

.hs-mind-h { display: flex; align-items: stretch; gap: 0; min-height: 140px; }
.hs-mind-h.editor { align-items: center; }

.hs-mind-root-h {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: var(--space-4);
  min-width: 240px;
  max-width: 320px;
  background: var(--color-surface-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.hs-mind-root-h .hs-mind-badge.root { align-self: flex-start; }
.hs-mind-root-h .hs-mind-title { font-weight: 700; font-size: var(--font-body); color: var(--text-primary); }
.hs-mind-root-h .hs-mind-meta { font-size: var(--font-caption); color: var(--color-text-tertiary); }

.hs-mind-trunk {
  width: 40px;
  min-width: 40px;
  position: relative;
}

.hs-mind-trunk::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
  transform: translateX(-50%);
}

.hs-mind-trunk::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 20px;
  height: 2px;
  background: var(--border-color);
  transform: translateY(-50%);
}

.hs-mind-branches-h { display: flex; flex-direction: column; justify-content: center; flex: 1; gap: var(--space-3); }
.hs-mind-branch-h { display: flex; align-items: center; }

.hs-mind-line-h {
  width: 24px;
  min-width: 24px;
  height: 2px;
  background: var(--border-color);
  position: relative;
}

.hs-mind-line-h::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  transform: translateY(-50%);
}

.hs-mind-node-h {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface-50);
  max-width: 760px;
}

.hs-mind-node-h.up { border-left: 4px solid var(--color-primary-500); }
.hs-mind-node-h.jk { border-left: 4px solid var(--color-warning); }
.hs-mind-node-h.dn { border-left: 4px solid var(--color-success); }
.hs-mind-node-h.empty { border-left: 4px solid var(--color-surface-400); color: var(--color-text-tertiary); font-size: var(--font-label); }

.hs-mind-node-title { font-weight: 600; font-size: var(--font-body); margin-bottom: 6px; color: var(--text-primary); }
.hs-mind-amt { font-size: var(--font-caption); color: var(--color-text-tertiary); font-weight: 400; margin-left: 8px; }
.hs-mind-node-body { font-size: var(--font-label); color: var(--text-secondary); line-height: 1.7; }

.hs-mind-leaf {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2) 0;
  border-top: 1px dashed var(--border-color);
}

.hs-mind-leaf:first-child { border-top: none; }

.hs-mind-del {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--color-lamp-red-bg);
  color: var(--color-error);
  cursor: pointer;
  font-size: var(--font-caption);
  line-height: 28px;
  text-align: center;
  flex-shrink: 0;
  min-width: 28px;
}

.hs-mind-del:hover { background: var(--color-error); color: #fff; }

.hs-mind-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }

.hs-mind-payno {
  font-family: var(--num-font);
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-body);
}

.hs-mind-payno.clickable {
  color: var(--color-primary-600);
  cursor: pointer;
  text-decoration: underline;
}

.hs-mind-payno.clickable:hover { opacity: .8; }

.hs-mind-payinfo { color: var(--text-secondary); font-size: var(--font-label); line-height: 1.5; }
.hs-mind-contract { width: 100%; padding-left: var(--space-8); color: var(--color-text-tertiary); font-size: var(--font-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hs-mind-status {
  font-size: var(--font-caption);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
}

.hs-mind-status.ok { background: var(--color-lamp-green-bg); color: var(--color-success); }
.hs-mind-status.warn { background: var(--color-lamp-red-bg); color: var(--color-error); }

[data-theme="dark"] .hs-mind-badge.root { background: var(--color-primary-800); color: #93c5fd; }

/* 编辑器额外 */
.hs-mind-editor { padding: var(--space-2); }
.hs-mind-editor .hs-mind-node-h { background: var(--bg-card); }

.hs-mind-addrow {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) 0;
  border-top: 1px dashed var(--border-color);
  margin-top: 6px;
  flex-wrap: wrap;
}

.hs-mind-input {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-width: 200px;
  font-size: var(--font-label);
  background: var(--bg-card);
  color: var(--text-primary);
}

.hs-mind-input:focus {
  border-color: var(--color-primary-500);
  box-shadow: var(--focus-ring);
}

.hs-mind-numinput {
  width: 120px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-label);
  text-align: right;
  background: var(--bg-card);
  color: var(--text-primary);
}

.hs-mind-numinput:focus { border-color: var(--color-primary-500); box-shadow: var(--focus-ring); }

.hs-mind-usedrow { display: flex; gap: var(--space-4); align-items: center; padding: 4px 0 2px; }
.hs-mind-remain { font-size: var(--font-label); color: var(--color-text-tertiary); font-weight: 600; }

.hs-mind-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  animation: modalBackdropIn 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hs-mind-modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  width: 600px;
  max-height: 70vh;
  overflow: auto;
  box-shadow: var(--shadow-elevated);
  border: 1px solid var(--border-color);
  transform: scale(0.96) translateY(12px);
  opacity: 0;
  animation: modalBoxIn 280ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalBoxIn {
  from { transform: scale(0.96) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.hs-mind-modal-box h4 { margin: 0 0 var(--space-3); font-size: var(--font-h3); color: var(--text-primary); }
.hs-mind-modal-sub { font-size: var(--font-caption); color: var(--color-text-tertiary); font-weight: 400; }
.hs-mind-modal-query { font-size: var(--font-caption); color: var(--color-text-tertiary); margin-bottom: var(--space-3); }

.hs-mind-candidates { max-height: 360px; overflow-y: auto; }

.hs-mind-canditem {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  cursor: pointer;
  font-size: var(--font-label);
  background: var(--bg-card);
  transition: transform 150ms cubic-bezier(0.16, 1, 0.3, 1),
              background-color 150ms ease-out,
              border-color 150ms ease-out,
              box-shadow 150ms ease-out;
}

.hs-mind-canditem:hover {
  background: var(--color-surface-50);
  border-color: var(--color-primary-500);
  transform: translateY(-1px);
}

.hs-mind-canditem:active { transform: scale(0.99); }

.hs-mind-canditem.warn { border-color: var(--color-warning); background: var(--color-lamp-orange-bg); }

[data-theme="dark"] .hs-mind-canditem.warn { background: rgba(245, 158, 11, .10); border-color: var(--color-warning); }

/* 候选卡片标题旁备注：与标题同行，限制宽度左对齐 */
.hs-mind-canditem > div:first-child .hs-mind-cand-warns {
  margin-top: 0;
  text-align: left;
  max-width: 260px;
}

.hs-mind-cand-title { font-size: var(--font-body); color: var(--text-primary); margin-bottom: 8px; font-weight: 500; }
.hs-mind-cand-title b { font-weight: 700; }

.hs-mind-cand-section {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.hs-mind-cand-section:first-of-type { margin-top: 0; }
.hs-mind-cand-section.empty { background: var(--color-lamp-yellow-bg); border-color: var(--color-warning); }

[data-theme="dark"] .hs-mind-cand-section.empty { background: rgba(234, 179, 8, .10); border-color: var(--color-warning); }

.hs-mind-cand-section-title { font-size: var(--font-caption); font-weight: 700; color: var(--color-primary-600); margin-bottom: 6px; letter-spacing: .04em; }
.hs-mind-cand-empty { font-size: var(--font-label); color: #a16207; padding: 6px 0; }

[data-theme="dark"] .hs-mind-cand-empty { color: #fde047; }

.hs-mind-cand-warns { margin-top: var(--space-2); display: flex; flex-direction: column; gap: 4px; }

.hs-mind-cand-warn {
  font-size: var(--font-label);
  color: #854d0e;
  background: var(--color-lamp-yellow-bg);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
}

[data-theme="dark"] .hs-mind-cand-warn { color: #fde047; background: rgba(234, 179, 8, .12); border-color: var(--color-warning); }

.hs-mind-cand-sep { height: 1px; background: var(--border-color); margin: var(--space-2) 0; }

.hs-mind-cand-detail { font-size: var(--font-caption); color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }
.hs-mind-cand-detail b { color: var(--text-primary); }
.hs-mind-cand-section .hs-mind-cand-detail { font-size: var(--font-label); margin-top: 2px; line-height: 1.6; }
.hs-mind-cand-warn { color: var(--color-warning); margin-top: 4px; }
.hs-mind-cand-warn.info { color: var(--color-text-tertiary); }
.hs-mind-cand-error { color: var(--color-error); margin-top: 4px; font-weight: 600; }
.hs-mind-cand-yellow { color: #ca8a04; margin-top: 4px; }
.hs-mind-canditem.disabled { opacity: .6; cursor: not-allowed; background: var(--color-surface-50); }
.hs-mind-canditem.selected { border-color: var(--color-primary-500); background: rgba(37, 99, 235, .06); }

.hs-mind-detail-body { font-size: var(--font-body); line-height: 1.8; margin: var(--space-3) 0; }
.hs-mind-detail-row { display: flex; border-bottom: 1px dashed var(--border-color); padding: 6px 0; }
.hs-mind-detail-label { color: var(--text-secondary); width: 120px; flex-shrink: 0; }
.hs-mind-detail-value { color: var(--text-primary); flex: 1; }

/* ===== 对下工抵合同分组 ===== */
.hs-mind-contract-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-success);
  border-radius: var(--radius-md);
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-card);
}

.hs-mind-contract-block:first-child { margin-top: 4px; }
.hs-mind-contract-block:last-child { margin-bottom: 4px; }

.hs-mind-contract-header {
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed var(--border-color);
  margin-bottom: var(--space-2);
}

.hs-mind-contract-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 6px;
}

.hs-mind-contract-name {
  font-weight: 700;
  font-size: var(--font-body);
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hs-mind-settled-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.hs-mind-contract-no {
  font-size: var(--font-caption);
  color: var(--color-text-tertiary);
  font-family: var(--num-font);
  background: var(--color-surface-50);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.hs-mind-contract-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--font-label);
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.hs-mind-contract-amt-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--font-label);
  color: var(--text-secondary);
}

.hs-mind-gongdi-total {
  font-size: var(--font-caption);
  color: var(--color-lamp-green);
  font-weight: 500;
  margin-left: auto;
}

.hs-mind-contract-pays {
  padding-left: var(--space-3);
  border-left: 2px solid var(--border-color);
  margin-left: 6px;
}

.hs-mind-contract-pays .hs-mind-leaf.pay-item {
  position: relative;
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
}

.hs-mind-contract-pays .hs-mind-leaf.pay-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 18px;
  width: 8px;
  height: 2px;
  background: var(--border-color);
}

.hs-mind-contract-pays .hs-mind-leaf.pay-item::after {
  content: '';
  position: absolute;
  left: -12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.hs-mind-contract-pays .hs-mind-leaf.pay-item:first-child::after { top: 18px; }
.hs-mind-contract-pays .hs-mind-leaf.pay-item:last-child::after { bottom: auto; height: 18px; }

/* 合同附件 + 备注 */
.hs-mind-contract-attachments {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--border-color);
  margin-left: 6px;
  background: var(--color-surface-0);
  border-radius: var(--radius-md);
}
.hs-mind-attach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.hs-mind-attach-title { font-size: var(--font-caption); color: var(--color-text-secondary); font-weight: 500; }
.hs-mind-attach-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--space-2); }
.hs-mind-attach-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.hs-mind-attach-name {
  font-size: var(--font-caption);
  color: var(--color-primary-600);
  cursor: pointer;
  text-decoration: underline;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hs-mind-attach-name:hover { color: var(--color-primary-800); }
.hs-mind-attach-empty { font-size: var(--font-caption); color: var(--color-text-tertiary); padding: 4px 0; }
.hs-mind-remark-row { display: flex; align-items: center; gap: var(--space-2); }
.hs-mind-remark-row label { font-size: var(--font-caption); color: var(--color-text-secondary); display: flex; align-items: center; gap: var(--space-2); flex: 1; }
.hs-mind-remark-input { flex: 1; min-width: 120px; }

.hs-mind-payno-label {
  font-size: var(--font-label);
  color: var(--color-text-tertiary);
  font-weight: 400;
  margin-right: 4px;
}

.hs-mind-contract-group {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--color-lamp-green-bg);
  margin: var(--space-2) 0;
  padding: var(--space-3);
}

.hs-mind-contract-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--border-color);
  margin-bottom: 6px;
}

.hs-mind-contract-unit {
  font-size: var(--font-caption);
  color: var(--color-text-tertiary);
  background: var(--color-surface-50);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.hs-mind-contract-amt {
  font-size: var(--font-caption);
  color: var(--text-secondary);
  margin-left: auto;
  font-family: var(--num-font);
}

[data-theme="dark"] .hs-mind-contract-block { background: var(--bg-card); }
[data-theme="dark"] .hs-mind-contract-group { background: rgba(22, 163, 74, .08); }

.hs-mind-alerts { margin-top: var(--space-2); display: flex; flex-direction: column; gap: 4px; }

.hs-mind-alert {
  padding: 4px 8px;
  border-radius: var(--radius-md);
  font-size: 10px;
  line-height: 1.35;
  border-left: 3px solid;
}

.hs-mind-alert .hs-alert-tag { font-weight: 600; margin-right: 4px; font-size: 10px; }

.hs-alert-warn { background: var(--color-lamp-orange-bg); color: #92400e; border-color: var(--color-warning); }
.hs-alert-yellow { background: var(--color-lamp-yellow-bg); color: #854d0e; border-color: var(--color-warning); }
.hs-alert-error { background: var(--color-lamp-red-bg); color: var(--color-error); border-color: var(--color-error); }

[data-theme="dark"] .hs-alert-warn { background: rgba(245, 115, 22, .12); color: #fdba74; }
[data-theme="dark"] .hs-alert-yellow { background: rgba(234, 179, 8, .12); color: #fde047; }
[data-theme="dark"] .hs-alert-error { background: rgba(239, 68, 68, .12); color: #fca5a5; }

/* ===== Batch Bar ===== */
#hsBatchBar {
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-200);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  gap: var(--space-3);
}

#hsBatchCount {
  font-weight: 600;
  color: var(--color-primary-800);
}

/* ===== Global Board ===== */
#gbContent { padding: var(--space-3) 0; }

#gbTabFlow, #gbTabPay, #gbTabFlowDetail, #gbTabPayDetail {
  margin-right: var(--space-2);
}

/* ===== Pagination ===== */
.gb-pagination {
  padding: var(--space-3);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.gb-pagination button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

/* 房源状态表格：退出脑图后高亮当前行 */
.hs-row-highlight {
  background: rgba(99, 102, 241, 0.1) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3) inset;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.hs-change-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  margin: 2px 2px 0 0;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: help;
  vertical-align: middle;
}

.hs-change-new {
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
}

.hs-change-updated {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fbbf24;
}

.hs-change-signed {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}
/* ===== B类网签任务管理 ===== */
.signing-task-panel { padding: 18px 22px 42px; background: var(--color-surface-50, #f6f8fb); }
.signing-task-head { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:18px; }
.signing-task-head h2 { margin:0 0 6px; font-size:24px; color:var(--color-text-primary, #172033); }
.signing-task-head p { margin:0; font-size:13px; color:var(--color-text-tertiary, #64748b); }
.signing-task-month-picker { display:flex; align-items:center; gap:10px; background:var(--color-surface-0, #fff); padding:10px 12px; border-radius:10px; box-shadow:0 2px 8px rgba(15,23,42,.06); }
.signing-task-month-picker label { font-size:13px; color:var(--color-text-secondary, #475569); font-weight:600; }
.signing-task-month-picker select { min-width:130px; height:34px; border:1px solid var(--color-border, #dbe2ea); border-radius:7px; padding:0 10px; background:var(--color-surface-0, #fff); color:var(--color-text-primary, #172033); }
.signing-task-save-status { min-width:100px; font-size:12px; color:#64748b; }
.signing-task-save-status.success { color:#059669; }
.signing-task-save-status.error { color:#dc2626; }
.signing-task-save-status.saving { color:#2563eb; }
.signing-task-section-title { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; margin:22px 0 10px; }
.signing-task-section-title h3 { margin:0; font-size:17px; color:var(--color-text-primary, #172033); }
.signing-task-section-title p { margin:4px 0 0; font-size:12px; color:var(--color-text-tertiary, #64748b); }
.st-kpi-grid { display:grid; gap:12px; }
.st-kpi-grid-six { grid-template-columns:repeat(6,minmax(0,1fr)); }
.st-kpi-grid-five { grid-template-columns:repeat(5,minmax(0,1fr)); }
.st-kpi { position:relative; min-height:118px; padding:16px; border-radius:12px; background:var(--color-surface-0, #fff); border:1px solid var(--color-border-light, #edf1f5); box-shadow:0 2px 8px rgba(15,23,42,.05); overflow:hidden; }
.st-kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:#94a3b8; }
.st-kpi.primary::before { background:#2563eb; }
.st-kpi.success::before { background:#10b981; }
.st-kpi.warning::before { background:#f59e0b; }
.st-kpi-label { font-size:12px; color:var(--color-text-tertiary, #64748b); margin-bottom:9px; }
.st-kpi-value { font-size:27px; line-height:1.15; font-weight:750; color:var(--color-text-primary, #172033); white-space:nowrap; }
.st-kpi-value span { margin-left:4px; font-size:12px; font-weight:500; color:var(--color-text-tertiary, #64748b); }
.st-kpi-note { margin-top:11px; min-height:28px; font-size:11px; line-height:1.45; color:var(--color-text-tertiary, #64748b); }
.signing-task-chart-grid { display:grid; grid-template-columns:1.15fr .85fr; gap:14px; margin-top:20px; }
.signing-task-card { background:var(--color-surface-0, #fff); border:1px solid var(--color-border-light, #edf1f5); border-radius:12px; box-shadow:0 2px 8px rgba(15,23,42,.05); }
.signing-task-card-title { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 16px; border-bottom:1px solid var(--color-border-light, #edf1f5); font-size:14px; font-weight:650; color:var(--color-text-primary, #172033); }
.signing-task-chart { height:310px; }
.st-region-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.st-region-card { text-align:left; padding:14px; border:1px solid var(--color-border, #dbe2ea); border-radius:11px; background:var(--color-surface-0, #fff); color:var(--color-text-primary, #172033); cursor:pointer; transition:.18s ease; box-shadow:0 1px 3px rgba(15,23,42,.04); }
.st-region-card:hover { transform:translateY(-1px); box-shadow:0 5px 16px rgba(15,23,42,.09); border-color:#93b4f5; }
.st-region-card.active { border-color:#2563eb; box-shadow:0 0 0 2px rgba(37,99,235,.12); }
.st-region-card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.st-region-card-head strong { font-size:16px; }
.st-region-card-head span { padding:3px 8px; border-radius:999px; background:#eff6ff; color:#2563eb; font-size:12px; font-weight:700; }
.st-region-metrics { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.st-region-metrics span { font-size:11px; color:var(--color-text-tertiary, #64748b); }
.st-region-metrics b { display:block; margin-top:2px; font-size:13px; color:var(--color-text-primary, #172033); }
.st-region-pending { margin-top:11px; padding-top:9px; border-top:1px dashed var(--color-border, #dbe2ea); font-size:11px; color:#b45309; }
.st-workspace-card,.st-review-card { margin-top:14px; overflow:hidden; }
.st-workspace-title small { display:block; margin-top:3px; font-weight:400; color:var(--color-text-tertiary, #64748b); }
.st-plan-toolbar { display:grid; grid-template-columns:150px 150px 170px minmax(220px,1fr) auto; gap:10px; align-items:end; padding:14px 16px; background:var(--color-surface-50, #f8fafc); border-bottom:1px solid var(--color-border-light, #edf1f5); }
.st-plan-toolbar label { display:flex; flex-direction:column; gap:5px; font-size:11px; color:var(--color-text-secondary, #475569); }
.st-plan-toolbar input { height:34px; box-sizing:border-box; border:1px solid var(--color-border, #dbe2ea); border-radius:7px; padding:0 9px; background:var(--color-surface-0, #fff); color:var(--color-text-primary, #172033); }
.st-plan-toolbar button,.st-review-card button { height:34px; padding:0 14px; border:0; border-radius:7px; color:#fff; background:#2563eb; cursor:pointer; font-weight:600; }
.st-review-card button.secondary { background:#eff6ff; color:#2563eb; border:1px solid #bfdbfe; }
.st-review-card button.mini { height:27px; padding:0 9px; margin-right:5px; font-size:11px; }
.st-review-card button.success { background:#059669; }
.st-review-card button.danger { background:#dc2626; }
.st-table-wrap { overflow:auto; max-height:520px; }
.st-table { width:100%; border-collapse:separate; border-spacing:0; font-size:12px; }
.st-table th { position:sticky; top:0; z-index:1; padding:10px 9px; background:#eaf2ff; color:#1e3a5f; border-bottom:1px solid #cfe0f7; text-align:left; white-space:nowrap; }
.st-table td { padding:9px; border-bottom:1px solid var(--color-border-light, #edf1f5); color:var(--color-text-secondary, #475569); vertical-align:middle; }
.st-table tbody tr:hover td { background:var(--color-surface-50, #f8fafc); }
.st-table td.house { min-width:330px; color:var(--color-text-primary, #172033); }
.st-table td.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.st-table th.check,.st-table td.check { width:34px; text-align:center; }
.st-table td.empty { padding:32px; text-align:center; color:var(--color-text-tertiary, #64748b); }
.st-tag { display:inline-flex; align-items:center; white-space:nowrap; padding:3px 7px; border-radius:999px; font-size:10px; font-weight:650; }
.st-tag.new { background:#eef2ff; color:#4f46e5; }
.st-tag.carry { background:#fff7ed; color:#c2410c; }
.st-tag.neutral { background:#f1f5f9; color:#64748b; }
.st-tag.pending { background:#fef3c7; color:#a16207; }
.st-tag.done { background:#dcfce7; color:#047857; }
.st-tag.outside { background:#ede9fe; color:#6d28d9; }
.st-completion-chips { display:flex; gap:8px; }
.st-completion-chips span { padding:6px 10px; border-radius:999px; background:#ecfdf5; color:#047857; font-size:11px; font-weight:650; }
@media (max-width:1400px) {
  .st-kpi-grid-six { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .st-kpi-grid-five { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .st-region-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:900px) {
  .signing-task-head,.signing-task-section-title { align-items:stretch; flex-direction:column; }
  .st-kpi-grid-six,.st-kpi-grid-five,.st-region-grid,.signing-task-chart-grid { grid-template-columns:1fr; }
  .st-plan-toolbar { grid-template-columns:1fr 1fr; }
  .st-plan-toolbar .wide { grid-column:1/-1; }
}
