/* ============================================================
   南岸区人力资源市场热力图谱 · 深色大屏主题
   配色按"数据职责"分配：chrome 克制单色，色彩只用于编码数据。
   ============================================================ */
:root {
  /* 表面 */
  --bg:        #0a1526;
  --surface:   #0f1d35;
  --surface-2: #0c1830;   /* 内嵌：表格、图表底 */
  --surface-3: #13233f;   /* 悬浮/高亮 */
  --line:        rgba(132,168,224,.14);
  --line-strong: rgba(132,168,224,.30);

  /* 文字 */
  --ink:   #eaf2ff;
  --ink-2: #9fb3d1;
  --ink-3: #61769a;

  /* chrome 主色（仅界面，不用于数据编码） */
  --accent: #46b4f0;

  /* 预警状态（保留色，始终配文字+圆点） */
  --red:    #ff3b5c;
  --orange: #ff8c1a;
  --yellow: #ffd21a;

  /* 热力阶（离散，低→高；连续阶在 app.js 中用同样端点插值） */
  --heat-1: #241a3d;
  --heat-2: #5b2a7a;
  --heat-3: #a52e86;
  --heat-4: #e05a53;
  --heat-5: #f79a3c;
  --heat-6: #ffd24b;

  /* 发散阶（供需比：暖红=缺工 · 灰=平衡 · 冷蓝=过剩） */
  --div-warm: #ff6a4d;
  --div-mid:  #4a5a78;
  --div-cool: #46b4f0;

  --font: "PingFang SC","HarmonyOS Sans SC","Microsoft YaHei",
          "Noto Sans SC","Source Han Sans SC",system-ui,-apple-system,sans-serif;

  --sidebar-w: 248px;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 18% -8%, rgba(70,140,220,.14), transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, rgba(140,70,180,.10), transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;   /* 数字等宽 */
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(70,180,240,.3); }

/* ---------- 布局骨架 ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------- 侧栏 ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, #0c1a31 0%, #0a1526 100%);
  border-right: 1px solid var(--line);
  padding: 22px 14px 28px;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 20px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: conic-gradient(from 210deg, var(--heat-2), var(--heat-4), var(--heat-6), var(--heat-2));
  box-shadow: 0 0 20px rgba(230,110,80,.35);
}
.brand .brand-t { line-height: 1.25; }
.brand .brand-t b { font-size: 15px; letter-spacing: .3px; }
.brand .brand-t span { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.nav-group { margin-top: 16px; }
.nav-group > .g-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; font-size: 12px; color: var(--ink-3); letter-spacing: 1px;
}
.nav-group > .g-head .g-ico { font-size: 13px; }
.nav-item {
  display: flex; align-items: baseline; gap: 9px;
  padding: 8px 11px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--ink-2); line-height: 1.3;
  transition: background .15s, color .15s;
}
.nav-item .idx { font-size: 11px; color: var(--ink-3); min-width: 15px; }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: linear-gradient(90deg, rgba(70,180,240,.18), rgba(70,180,240,.03)); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }

/* ---------- 主区 ---------- */
.main { padding: 26px 34px 56px; max-width: 1480px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 25px; font-weight: 700; margin: 0; letter-spacing: .4px; }
.page-head .lede { margin: 7px 0 0; color: var(--ink-2); font-size: 14px; max-width: 72ch; line-height: 1.55; }
.period-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 12.5px; color: var(--ink-2); background: rgba(255,255,255,.02);
}
.period-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.back-home { font-size: 13px; color: var(--ink-2); padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; transition: .15s; }
.back-home:hover { color: var(--ink); border-color: var(--line-strong); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; font-size: 16px; font-weight: 650; }
.card-sub { margin: 0 0 16px; color: var(--ink-3); font-size: 12.5px; }
.grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3,1fr); }
@media (max-width: 1100px){ .cols-2,.cols-3 { grid-template-columns: 1fr; } }

/* ---------- KPI 指标卡 ---------- */
.kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1100px){ .kpis { grid-template-columns: repeat(2,1fr); } }
.kpi {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.kpi .k-label { font-size: 13px; color: var(--ink-2); }
.kpi .k-val { font-size: 34px; font-weight: 750; letter-spacing: .5px; margin: 8px 0 2px; line-height: 1; }
.kpi .k-note { font-size: 12px; color: var(--ink-3); }
.kpi .k-spark { position: absolute; right: 16px; bottom: 14px; opacity: .9; }
.kpi::after { content:""; position:absolute; inset:0 auto 0 0; width:3px; background: var(--accent); opacity:.5; }
.kpi.warn::after { background: var(--red); }

/* ---------- 图表容器 ---------- */
.chart { width: 100%; }

/* ---------- 热力 / 发散 图例 ---------- */
.legend-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 2px 0 14px; font-size: 12.5px; color: var(--ink-2); }
.legend-scale { display: flex; align-items: center; gap: 9px; }
.legend-scale .bar { width: 160px; height: 10px; border-radius: 5px; }
.legend-scale .bar.heat { background: linear-gradient(90deg,var(--heat-1),var(--heat-2),var(--heat-3),var(--heat-4),var(--heat-5),var(--heat-6)); }
.legend-scale .bar.div { background: linear-gradient(90deg,var(--div-warm),var(--div-mid),var(--div-cool)); }
.legend-scale .ends { display:flex; justify-content:space-between; width:160px; font-size:11px; color:var(--ink-3); }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip .sw { width: 10px; height: 10px; border-radius: 3px; }
.chip.lv .sw { border-radius: 50%; }

/* ---------- 预警徽标（始终文字+圆点，不靠颜色单独表意） ---------- */
.badge { display:inline-flex; align-items:center; gap:6px; padding:3px 9px 3px 7px; border-radius:999px; font-size:12px; font-weight:600; border:1px solid transparent; }
.badge .d { width:8px; height:8px; border-radius:50%; }
.badge.red    { color:#ffd9e0; background:rgba(255,59,92,.14);  border-color:rgba(255,59,92,.4);  }
.badge.red .d    { background:var(--red); }
.badge.orange { color:#ffe6c7; background:rgba(255,140,26,.13); border-color:rgba(255,140,26,.4); }
.badge.orange .d { background:var(--orange); }
.badge.yellow { color:#fff3c2; background:rgba(255,210,26,.12); border-color:rgba(255,210,26,.38);}
.badge.yellow .d { background:var(--yellow); }

/* 优先级标签 */
.tag { display:inline-block; padding:2px 8px; border-radius:6px; font-size:11.5px; border:1px solid var(--line-strong); color:var(--ink-2); }
.tag.hi { color:#ffd9e0; border-color:rgba(255,59,92,.45); background:rgba(255,59,92,.1); }
.tag.mh { color:#ffe6c7; border-color:rgba(255,140,26,.4); background:rgba(255,140,26,.08); }
.tag.mid{ color:var(--ink-2); }

/* ---------- 数据表 ---------- */
.table-wrap { overflow-x: auto; }
table.dt { width:100%; border-collapse: collapse; font-size: 13px; }
table.dt th, table.dt td { padding: 10px 14px; text-align: left; white-space: nowrap; }
table.dt thead th {
  position: sticky; top: 0; background: var(--surface-2);
  color: var(--ink-2); font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid var(--line-strong);
}
table.dt td { border-bottom: 1px solid var(--line); color: var(--ink); }
table.dt td.num, table.dt th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dt tbody tr:hover { background: rgba(70,180,240,.05); }
table.dt .heatcell { border-radius:6px; padding:3px 9px; font-variant-numeric:tabular-nums; font-weight:600; }
.detail { color: var(--ink-2); white-space: normal; max-width: 42ch; line-height: 1.5; }

/* 行内迷你条（表格里的量级） */
.minibar { position:relative; height:7px; border-radius:4px; background:rgba(255,255,255,.06); min-width:70px; }
.minibar > i { position:absolute; left:0; top:0; bottom:0; border-radius:4px; }

/* ---------- 首页主题入口 ---------- */
.theme-cards { display:grid; grid-template-columns: repeat(2,1fr); gap:20px; }
@media (max-width: 1100px){ .theme-cards { grid-template-columns:1fr; } }
.theme-card {
  display:block; background: var(--surface); border:1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; transition: border-color .18s, transform .18s, background .18s;
}
.theme-card:hover { border-color: var(--line-strong); background: var(--surface-3); transform: translateY(-2px); }
.theme-card .tc-top { display:flex; align-items:center; gap:13px; margin-bottom:12px; }
.theme-card .tc-ico { font-size:22px; width:44px; height:44px; display:grid; place-items:center; border-radius:11px; background:var(--surface-2); border:1px solid var(--line); }
.theme-card h3 { margin:0; font-size:18px; }
.theme-card .tc-count { margin-left:auto; font-size:12px; color:var(--ink-3); }
.theme-card .tc-desc { color:var(--ink-2); font-size:13px; line-height:1.55; margin:0 0 14px; }
.theme-card .tc-links { display:flex; flex-wrap:wrap; gap:8px; }
.theme-card .tc-links span { font-size:12px; color:var(--ink-2); padding:4px 10px; border-radius:999px; background:var(--surface-2); border:1px solid var(--line); }

.footnote { color: var(--ink-3); font-size: 12px; line-height: 1.7; margin-top: 10px; }
.hl { color: var(--ink); font-weight: 600; }

/* 一句话解读条 */
.readout { display:flex; gap:12px; align-items:flex-start; padding:13px 16px; border-radius:var(--radius-sm);
  background: rgba(70,180,240,.06); border:1px solid rgba(70,180,240,.18); color:var(--ink-2); font-size:13px; line-height:1.6; margin-bottom:20px; }
.readout .ri { color: var(--accent); flex:none; }

@media (prefers-reduced-motion: reduce){ * { animation: none !important; transition: none !important; } }
