/* ═══════════════════════════════════════════════════════════════
   📊 统一数据看板 — 共享样式表 (美团风格)
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties (美团设计令牌) ─── */
:root {
  /* 主色调 - 美团黄 */
  --brand: #FFD100;
  --brand-hover: #FFE14D;
  --brand-active: #F5C400;
  --brand-bg: #FFF8D6;
  --brand-ink: #222222;

  /* 语义色 */
  --green: #00B85C;
  --green-light: #2bb17a;
  --green-bg: #d4f3e4;
  --green-text: #006845;
  --red: #d54941;
  --red-light: #e66a5e;
  --red-bg: #f9d7d4;
  --red-text: #a1352e;
  --orange: #ed7b2f;
  --orange-bg: #feede5;
  --orange-text: #b35e1f;
  --yellow: #FFD100;
  --yellow-bg: #FFF8D6;
  --yellow-text: #8a6d00;
  --gold: #FFD100;

  /* 中性色 */
  --bg: #f5f5f5;
  --bg-alt: #f0f0f0;
  --card-bg: #fff;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --border-table: #eeeeee;
  --text: #222222;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-dark: #222222;
  --text-light: #666666;

  /* 侧边栏 - 美团浅色 */
  --sidebar-bg: #ffffff;
  --sidebar-text: #666666;
  --sidebar-hover: #fafafa;
  --sidebar-active: #FFF8D6;
  --sidebar-width: 200px;
  --sidebar-border: #f0f0f0;

  /* 圆角 - 更亲和 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);

  /* Header 渐变 — 对齐运营日报黄顶栏 */
  --header-gradient: linear-gradient(180deg, #FFE566 0%, #FFD100 55%, #FFC300 100%);

  /* 字体 */
  --font-stack: "PingFang SC", "Microsoft YaHei", Arial, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-stack);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
/* 当 nav.js 注入侧边栏时，取消 body 自身 padding（由 .app/.main 控制） */

/* ─── 暗黑模式 ─── */
[data-theme="dark"] {
  --brand: #FFD100;
  --brand-hover: #FFE14D;
  --brand-active: #F5C400;
  --brand-bg: #3a3200;
  --brand-ink: #222222;
  --green: #2bb17a;
  --green-bg: #1a3a2a;
  --green-text: #6ee7b7;
  --red: #e66a5e;
  --red-bg: #3a1a1a;
  --red-text: #fca5a5;
  --orange: #f59e0b;
  --orange-bg: #3a2a1a;
  --orange-text: #fdba74;
  --yellow: #FFD100;
  --yellow-bg: #3a3200;
  --yellow-text: #FFE14D;
  --gold: #FFD100;
  --bg: #0f1117;
  --bg-alt: #1a1d27;
  --card-bg: #1e2130;
  --border: #2a2d3a;
  --border-light: #333645;
  --border-table: #2a2d3a;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-dark: #f3f4f6;
  --text-light: #9ca3af;
  --sidebar-bg: #1a1a1a;
  --sidebar-text: #aaaaaa;
  --sidebar-hover: #252525;
  --sidebar-active: rgba(255,209,0,0.12);
  --sidebar-border: #2a2a2a;
  --header-gradient: linear-gradient(135deg, #3a3200 0%, #5a4a00 100%);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}
[data-theme="dark"] .header h1 span { color: var(--gold); }
[data-theme="dark"] .header { background: var(--header-gradient); color: #fff; }
[data-theme="dark"] table thead th { background: #252838; color: #9ca3af; }
[data-theme="dark"] tbody tr:hover { background: #252838; }
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .card,
[data-theme="dark"] .section { background: var(--card-bg); border-color: var(--border); }

/* ─── 多色主题 ─── */

/* 🟡 美团黄 Yellow（默认，与 :root 一致） */
[data-accent="yellow"],
[data-accent="blue"] {
  --brand: #FFD100; --brand-hover: #FFE14D; --brand-active: #FFC300; --brand-bg: #FFF8D6;
  --header-gradient: linear-gradient(180deg, #FFE566 0%, #FFD100 55%, #FFC300 100%);
}
[data-theme="dark"][data-accent="yellow"],
[data-theme="dark"][data-accent="blue"] {
  --brand: #FFD100; --brand-hover: #FFE14D; --brand-active: #F5C400; --brand-bg: #3a3200;
  --header-gradient: linear-gradient(135deg, #3a3200 0%, #5a4a00 100%);
}

/* 🟤 米杏色 Cream */
[data-accent="cream"] {
  --brand: #c8a96e; --brand-hover: #d4b87a; --brand-active: #b8985a; --brand-bg: #f5efe4;
  --bg: #faf7f2; --card-bg: #fffdf9; --bg-alt: #f5f0e8;
  --border: #e8dfd0; --border-light: #f0e9dd; --border-table: #e5ddd0;
  --text: #3d3528; --text-secondary: #6b5f4c; --text-muted: #9a8b72;
  --header-gradient: linear-gradient(135deg, #c8a96e 0%, #d4b87a 100%);
}
[data-theme="dark"][data-accent="cream"] {
  --brand: #d4b87a; --brand-hover: #e0c48a; --brand-active: #c8a96e; --brand-bg: #2a2214;
  --bg: #14120e; --card-bg: #1e1a14; --bg-alt: #2a261e;
  --border: #3d3224; --border-light: #2e261a; --border-table: #3a2e20;
  --text: #e8e0d0; --text-secondary: #a89880; --text-muted: #7a6b55;
  --header-gradient: linear-gradient(135deg, #2a2214 0%, #4a3a22 100%);
}

/* 🟢 绿色 Green */
[data-accent="green"] {
  --brand: #059669; --brand-hover: #10b981; --brand-active: #047857; --brand-bg: #d1fae5;
  --bg: #f0fdf4; --card-bg: #fff; --bg-alt: #dcfce7;
  --border: #bbf7d0; --border-light: #d1fae5; --border-table: #bbf7d0;
  --text: #1a2e1a; --text-secondary: #3a5a3a; --text-muted: #6b8a6b;
  --header-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
}
[data-theme="dark"][data-accent="green"] {
  --brand: #34d399; --brand-hover: #6ee7b7; --brand-active: #10b981; --brand-bg: #064e3b;
  --bg: #0a1a0e; --card-bg: #0f2214; --bg-alt: #1a2e1e;
  --border: #1a3a22; --border-light: #2a4a32; --border-table: #1a3a22;
  --text: #d1fae5; --text-secondary: #86efac; --text-muted: #4a8a5a;
  --header-gradient: linear-gradient(135deg, #064e3b 0%, #0a7a5a 100%);
}

/* 🟣 紫色 Purple */
[data-accent="purple"] {
  --brand: #7c3aed; --brand-hover: #8b5cf6; --brand-active: #6d28d9; --brand-bg: #ede9fe;
  --bg: #f5f3ff; --card-bg: #fff; --bg-alt: #ede9fe;
  --border: #ddd6fe; --border-light: #e9e2ff; --border-table: #ddd6fe;
  --text: #1e1a3a; --text-secondary: #4a427a; --text-muted: #7a72aa;
  --header-gradient: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}
[data-theme="dark"][data-accent="purple"] {
  --brand: #a78bfa; --brand-hover: #c4b5fd; --brand-active: #8b5cf6; --brand-bg: #2e1a5a;
  --bg: #0e0a1a; --card-bg: #1a142e; --bg-alt: #2a2240;
  --border: #3a2a5a; --border-light: #2a1e4a; --border-table: #3a2a5a;
  --text: #e9e2ff; --text-secondary: #c4b5fd; --text-muted: #8a7ab0;
  --header-gradient: linear-gradient(135deg, #2e1a5a 0%, #5a3a9a 100%);
}

/* 深色主色的 header / area-header 用白字；浅色（黄/米杏）保持深色字 */
[data-accent="green"] .header,
[data-accent="purple"] .header,
[data-accent="green"] .area-header,
[data-accent="purple"] .area-header {
  color: #fff;
}
[data-accent="green"] .header h1,
[data-accent="purple"] .header h1,
[data-accent="green"] .header h1 span,
[data-accent="purple"] .header h1 span {
  color: #fff;
}
[data-theme="dark"] .area-header { color: #fff; }

/* ─── 主题切换过渡 ─── */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease !important;
}

/* ─── 滚动渐入动画 ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.scroll-reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.scroll-reveal.revealed { opacity: 1; transform: translateY(0); }

/* ─── 页面过渡 ─── */
@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }
.page-fade { animation: pageFadeIn .35s ease; }

/* ─── 表格排序 ─── */
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after {
  content: ' ↕'; font-size: 10px; opacity: 0.3; display: inline-block; margin-left: 3px;
}
th.sortable.asc::after { content: ' ↑'; opacity: 1; color: var(--brand); }
th.sortable.desc::after { content: ' ↓'; opacity: 1; color: var(--brand); }

/* ─── 微交互动效 ─── */
.card, .kpi-card, .section, .chart-box {
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover, .section:hover { box-shadow: var(--shadow-lg); }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.chart-box:hover { box-shadow: var(--shadow-md); }

/* ─── React Bits 动效移植 ─── */

/* CountUp — 数字滚动 */
.count-up { display: inline-block; font-variant-numeric: tabular-nums; }

/* ShinyText — 光泽扫光文字 */
.shiny-text { position: relative; display: inline-block; overflow: hidden; }
.shiny-text .shiny-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* FadeContent — 淡入效果 */
.fade-in { animation: fadeInContent .6s ease forwards; opacity: 0; }
@keyframes fadeInContent { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* BlurText — 模糊进入 */
.blur-text { animation: blurIn .8s ease forwards; filter: blur(10px); }
@keyframes blurIn { to { filter: blur(0); } }

/* NumberTicker — 数字跳动 */
.number-ticker { display: inline-block; font-variant-numeric: tabular-nums; }
.number-ticker.tick {
  animation: tickPop .15s ease;
}
@keyframes tickPop { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
.app { display: flex; min-height: 100vh; }
.app-container { max-width: 1400px; margin: 0 auto; padding: 20px 24px 60px; }

/* ─── Sidebar / Nav（美团浅侧栏）─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}
.sidebar-logo { padding: 0; border-bottom: none; flex-shrink: 0; }
.sidebar-logo h1 { font-size: 14px; font-weight: 800; color: #222; }
.sidebar-logo h1 span {
  display: inline-block; background: #222; color: var(--brand);
  padding: 0; border-radius: 8px; width: 28px; height: 28px;
  text-align: center; line-height: 28px; margin-right: 8px;
}
.sidebar-logo p { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

.sidebar-search { padding: 10px 14px 6px; flex-shrink: 0; }
.sidebar-search input {
  width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid transparent;
  background: var(--bg); color: var(--text); font-size: 12px;
  outline: none; transition: background .2s, border-color .2s;
}
.sidebar-search input::placeholder { color: #bbb; }
.sidebar-search input:focus { background: #fff; border-color: var(--brand); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 0 8px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }

.nav-section {
  font-size: 10px; letter-spacing: 0.4px;
  color: var(--text-muted); padding: 12px 18px 4px; font-weight: 600; flex-shrink: 0;
}
.nav-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 15px;
  cursor: pointer; font-size: 12px; color: var(--sidebar-text);
  transition: all .12s; border-left: 3px solid transparent; text-decoration: none;
  margin: 1px 8px 1px 0; border-radius: 0 8px 8px 0;
}
.nav-item:hover { color: var(--text); background: var(--sidebar-hover); }
.nav-item.active {
  color: var(--text); background: var(--sidebar-active);
  border-left-color: var(--brand); font-weight: 600;
}
.nav-item .ni-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .ni-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .ni-tag { font-size: 9px; padding: 1px 6px; border-radius: 6px; font-weight: 500; flex-shrink: 0; }
.tag-dashboard { background: rgba(255,209,0,0.25); color: #8a6d00; }
.tag-report { background: rgba(251,146,60,0.2); color: #c2410c; }
.tag-data { background: rgba(0,184,92,0.15); color: #067647; }

.sidebar-footer { padding: 10px 18px; border-top: 1px solid var(--sidebar-border); font-size: 10px; color: var(--text-muted); flex-shrink: 0; }

/* ─── Main Content Area ─── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; max-width: calc(100vw - var(--sidebar-width)); }
.main-content { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
/* ─── Content ─── */
.content { flex: 1; overflow: hidden; background: var(--bg); position: relative; display: flex; flex-direction: column; }
.content iframe { width: 100%; flex: 1; border: none; }
.content iframe.hidden { display: none; }

/* ─── Page-specific content wrappers ─── */
.page-wrap { max-width: 1400px; margin: 0 auto; padding: 16px 28px 40px; }
.page-wrap-compact { max-width: 1400px; margin: 0 auto; padding: 20px 24px 60px; }

/* ─── Header（美团黄底 + 深色字，对齐运营日报）─── */
.header {
  background: var(--header-gradient);
  color: var(--brand-ink);
  padding: 24px 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.header h1 { font-size: 22px; font-weight: 700; color: var(--brand-ink); }
.header h1 span { color: var(--brand-ink); }
.header p { font-size: 13px; opacity: 0.7; margin-top: 3px; }
.header .sub { font-size: 13px; opacity: 0.65; margin-top: 4px; }
.header .meta { display: flex; gap: 20px; margin-top: 8px; font-size: 12px; opacity: 0.6; flex-wrap: wrap; }

/* ─── Section / Card ─── */
.section {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .st-badge, .section-title .badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-lg);
  background: #f3f4f6;
  color: var(--text-secondary);
  font-weight: 500;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
  margin-bottom: 18px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-body { font-size: 13px; line-height: 1.7; color: #374151; }

/* ─── KPI Cards ─── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.kpi-card .kpi-label, .kpi-card .lb {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 3px;
}
.kpi-card .kpi-value, .kpi-card .val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.kpi-card .kpi-sub, .kpi-card .sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}
.kpi-card .kpi-icon, .kpi-card .icon {
  float: right;
  font-size: 20px;
  opacity: 0.15;
}

/* ─── Color utility classes ─── */
.gn, .green { color: #16a34a; }
.bl, .blue { color: #2563eb; }
.or, .orange { color: #ea580c; }
.pu, .purple { color: #7c3aed; }
.re, .red { color: #dc2626; }
.teal { color: #0d9488; }
.rose { color: #e11d48; }

/* ─── Grid layouts ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ─── Responsive grid ─── */
.summary-row, .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.summary-card, .card-stat {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
}
.summary-card .label, .card-stat .l { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.summary-card .value, .card-stat .num { font-size: 24px; font-weight: 700; }
.summary-card .sub { font-size: 12px; color: #9ca3af; margin-top: 2px; }

/* ─── Charts ─── */
.chart-wrap { position: relative; height: 200px; }
.chart-box { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #e5e7eb; }
.chart-box h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.chart-box canvas { width: 100% !important; max-height: 300px; }
.chart-sm { height: 180px; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid #e5e7eb; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  background: #f1f5f9;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
thead th:first-child { border-radius: 8px 0 0 0; }
thead th:last-child { border-radius: 0 8px 0 0; }
tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: #e0f2fe; }
tbody tr:last-child td:first-child { border-radius: 0 0 0 8px; }
tbody tr:last-child td:last-child { border-radius: 0 0 8px 0; }
.ta-right { text-align: right; font-variant-numeric: tabular-nums; }
.text-left { text-align: left !important; }

/* ─── Table alternative style (subtle) ─── */
table.subtle th {
  background: #f8f9fb;
  color: #6b7280;
  font-weight: 600;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
table.subtle td { padding: 7px 10px; border-bottom: 1px solid #f0f2f5; color: #374151; }
table.subtle tr:hover td { background: #f9fafb; }
table.subtle tbody tr:last-child td { border-radius: 0; }

/* ─── Table with dark header ─── */
table.dark-header th {
  background: #1e2638;
  color: #fff;
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Badges ─── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-red, .bg-red { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-orange, .bg-orange { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.badge-yellow, .bg-yellow { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-green, .bg-green { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.bg-blue { background: #dbeafe; color: #1e40af; }
.bg-purple { background: #f3e8ff; color: #6b21a8; }
.bg-gray { background: #f1f5f9; color: #64748b; }

/* ─── Risk cards (colored gradient) ─── */
.risk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.risk-card { border-radius: 8px; padding: 12px 14px; color: #fff; }
.risk-card .rc-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.risk-card .rc-count { font-size: 24px; font-weight: 700; }
.risk-card .rc-desc { font-size: 10px; opacity: 0.8; margin-top: 1px; }
.risk-severe { background: linear-gradient(135deg, #dc2626, #991b1b); }
.risk-danger { background: linear-gradient(135deg, #ea580c, #c2410c); }
.risk-warn { background: linear-gradient(135deg, #eab308, #a16207); }
.risk-safe { background: linear-gradient(135deg, #16a34a, #15803d); }

/* ─── Risk tags ─── */
.risk-tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.risk-safe-tag { background: #dcfce7; color: #166534; }
.risk-warn-tag { background: #fef9c3; color: #854d0e; }
.risk-danger-tag { background: #ffedd5; color: #9a3412; }
.risk-severe-tag { background: #fee2e2; color: #991b1b; }

/* ─── Tag pills (E/F/G class tags) ─── */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.tag-E { background: #dbeafe; color: #1e40af; }
.tag-F { background: #fef3c7; color: #92400e; }
.tag-G { background: #ede9fe; color: #5b21b6; }

/* ─── Tabs ─── */
.tab-bar {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 14px;
  border-radius: 12px 12px 0 0;
  overflow-x: auto;
}
.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all .15s;
}
.tab:hover { color: #1e3a5f; }
.tab.on, .tab.active { color: #1e3a5f; border-bottom-color: #1e3a5f; }
.tab-content { display: none; }
.tab-content.on, .tab-content.active { display: block; }

/* ─── Progress bar ─── */
.progress-bar { height: 6px; border-radius: 3px; background: #e5e7eb; margin-top: 4px; overflow: hidden; }
.progress-bar .fill { height: 100%; border-radius: 3px; }
.fill-green { background: #22c55e; }
.fill-yellow { background: #eab308; }
.fill-orange { background: #f97316; }
.fill-red { background: #ef4444; }

/* ─── Filter bar ─── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: center; }
.filter-bar .fl { font-size: 12px; font-weight: 600; color: #1e3a5f; margin-right: 4px; }
.filter-btn {
  padding: 4px 12px; border-radius: 14px; font-size: 11px; font-weight: 500;
  cursor: pointer; border: 1px solid #e2e8f0; background: #fff; color: #475569;
  transition: all .15s;
}
.filter-btn:hover { border-color: #94a3b8; }
.filter-btn.on { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

/* ─── City list ─── */
.city-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 5px; }
.city-item { display: flex; justify-content: space-between; padding: 4px 8px; border-radius: 5px; font-size: 11px; background: #f9fafb; align-items: center; }
.city-item .ci-name { font-weight: 500; color: #374151; }
.city-item .ci-val { font-weight: 600; }

/* ─── Rule / info boxes ─── */
.rule-box {
  background: #f9fafb; border-radius: 8px; padding: 12px 14px;
  margin-bottom: 10px; font-size: 12px; line-height: 1.7;
}
.rule-box .rb-title { font-weight: 700; color: #1f2937; margin-bottom: 4px; }
.warn-box {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #991b1b;
  line-height: 1.6;
}
.info-box {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.6;
}

/* ─── Notice banners ─── */
.notice {
  background: #eff6ff;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.6;
}

/* ─── Footer ─── */
.footer, .ft {
  text-align: center;
  color: #9ca3af;
  font-size: 11px;
  padding: 20px;
  border-top: 1px solid #e2e8f0;
  margin-top: 16px;
}

/* ─── Number formatting ─── */
.num { font-variant-numeric: tabular-nums; }
.fw { font-weight: 600; }

/* ─── Sidebar toggle (mobile) ─── */
.sidebar-toggle { display: none; }

/* ─── Floating iframe toolbar ─── */
.iframe-toolbar {
  display: none;
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 100;
  gap: 6px;
}
.iframe-toolbar.show { display: flex; }
.iframe-toolbar .btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 6px; font-size: 10px; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none; transition: all .12s;
  background: rgba(255,255,255,0.9); color: #374151;
  border: 1px solid #d1d5db; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.iframe-toolbar .btn:hover { background: #fff; border-color: #9ca3af; }

/* ─── View home (dashboard landing) ─── */
.view-home { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.view-home.hidden { display: none; }

/* ─── KPI module grid ─── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.kpi-module { background: #f9fafb; border-radius: 10px; padding: 16px; border: 1px solid #f3f4f6; }
.kpi-module .km-title { font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.kpi-module .km-ratio { font-size: 12px; color: #6b7280; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed #e5e7eb; }
.kpi-item { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; border-bottom: 1px solid #f3f4f6; }
.kpi-item:last-child { border-bottom: none; }
.kpi-item .ki-label { color: #4b5563; flex: 1; padding-right: 8px; }
.kpi-item .ki-val { font-weight: 600; color: #1f2937; white-space: nowrap; }

/* ─── Area section ─── */
.area-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-hover));
  color: var(--brand-ink);
  border-radius: 10px 10px 0 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.area-header .ah-name { font-size: 15px; font-weight: 700; flex: 1; }
.area-header .ah-name small { font-weight: 400; opacity: 0.6; font-size: 12px; }
.area-body { background: #fff; border: 1px solid #e5e7eb; border-top: none; border-radius: 0 0 10px 10px; padding: 12px 16px 14px; }

/* ─── Rule cards (colored) ─── */
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rule-card { border-radius: 10px; padding: 16px; color: #fff; position: relative; overflow: hidden; }
.rule-card .rc-type { font-size: 11px; opacity: .7; font-weight: 500; }
.rule-card .rc-title { font-size: 16px; font-weight: 700; margin: 4px 0 8px; }
.rule-card .rc-desc { font-size: 12px; opacity: .9; line-height: 1.5; }
.rule-card .rc-formula { font-size: 13px; font-weight: 700; margin-top: 8px; padding: 6px 10px; background: rgba(255,255,255,.12); border-radius: 6px; display: inline-block; }
.rc1 { background: linear-gradient(135deg,#2563eb,#1d4ed8); }
.rc2 { background: linear-gradient(135deg,#7c3aed,#6d28d9); }
.rc3 { background: linear-gradient(135deg,#16a34a,#15803d); }
.rc4 { background: linear-gradient(135deg,#ea580c,#c2410c); }

/* ─── Analysis / suggestion lists ─── */
.analysis-list { list-style: none; padding: 0; margin: 8px 0; }
.analysis-list li { padding: 8px 12px; margin: 4px 0; border-radius: 6px; font-size: 13px; line-height: 1.6; display: flex; align-items: flex-start; gap: 8px; }
.analysis-list .al-green { background: #f0fdf4; border-left: 3px solid #22c55e; }
.analysis-list .al-yellow { background: #fefce8; border-left: 3px solid #eab308; }
.analysis-list .al-red { background: #fef2f2; border-left: 3px solid #ef4444; }
.analysis-list .al-blue { background: #eff6ff; border-left: 3px solid #3b82f6; }

/* ─── Opportunity cards ─── */
.opp-card { background: #fff; border-radius: 10px; padding: 12px 14px; border-left: 4px solid #16a34a; margin-bottom: 8px; font-size: 12px; line-height: 1.5; }
.opp-card.high { border-left-color: #16a34a; }
.opp-card.mid { border-left-color: #eab308; }
.opp-card.low { border-left-color: #ef4444; }

/* ─── Responsive (mobile) ─── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -200px;
    top: 0;
    height: 100vh;
    transition: left .25s;
    z-index: 200;
  }
  .sidebar.open { left: 0; }
  .sidebar-toggle {
    display: flex;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 300;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1e2638;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  }
  .main { max-width: 100vw; }
  .view-home { padding: 12px 10px 60px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .page-wrap { padding: 12px 10px 36px; }
  .page-wrap-compact { padding: 12px 14px 40px; }
  .header { padding: 18px 16px; }
  .header h1 { font-size: 18px; }
  .summary-row, .stats { grid-template-columns: 1fr 1fr; }
  .charts-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   Board shell — 统一看板风格（对齐 TODO 考核看板）
   ═══════════════════════════════════════════════════════════════ */
.board-page {
  padding: 20px 28px 48px;
  max-width: 1400px;
  margin: 0 auto;
  animation: boardFadeIn .35s ease-out;
}
@keyframes boardFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.board-hero {
  position: relative;
  margin-bottom: 18px;
  padding: 18px 20px 16px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,209,0,.18) 0%, rgba(255,209,0,.04) 42%, transparent 70%),
    linear-gradient(180deg, #fff 0%, #fafafa 100%);
  border: 1px solid #ebebeb;
  overflow: hidden;
}
.board-hero::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--brand, #FFD100);
}
.board-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-muted, #6b6b6b);
  margin-bottom: 4px;
}
.board-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text, #1a1a1a);
  line-height: 1.2;
  margin: 0;
}
.board-meta {
  font-size: 12px;
  color: var(--text-muted, #6b6b6b);
  margin-top: 6px;
  line-height: 1.55;
}
.board-meta strong { color: var(--text, #1a1a1a); font-weight: 700; }
.board-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #7a6400;
  background: rgba(255,209,0,.22);
  border: 1px solid rgba(255,209,0,.45);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.5;
  max-width: 860px;
}
.board-page .kpi-card,
.board-page .summary-card {
  position: relative;
  overflow: hidden;
}
.board-page .kpi-card::after,
.board-page .summary-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--brand, #FFD100);
}
.board-page .filter-btn.on,
.board-page .filter-btn.active,
.board-page .pill.on,
.board-page .month-btn.on,
.board-page .risk-tab.active,
.board-page .fb-on,
.board-page .tab.on,
.board-page .refresh-btn.active {
  background: var(--brand, #FFD100) !important;
  color: #222 !important;
  border-color: #e6bc00 !important;
}
.board-page tbody tr:hover td { background: #fffbeb; }
@media (max-width: 640px) {
  .board-page { padding: 14px 14px 36px; }
  .board-title { font-size: 18px; }
}

