/* ============================================================
   salary.css - /salary/ 系列页面样式（全国统计 / 城市统计 / 占比图 / 记录详情）
   各页面原 <style> 块合并迁移至此；
   动态数据值（如条形宽度百分比）仍由模板输出内联。
   页面加载 redesign-theme.css（变量与本文件配套），--primary 在此补充定义。
   ============================================================ */
:root { --primary: #1677ff; }
[data-theme="dark"] { --primary: #4096ff; }

/* ---------- 页面骨架（共享） ---------- */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head h1 { font-size: 26px; font-weight: 800; margin: 6px 0 8px; }
.page-head .desc { color: var(--muted); font-size: 14.5px; line-height: 1.7; max-width: 760px; }
.page-head .desc a { color: var(--primary); font-weight: 600; }
.page-head .meta { color: var(--muted); font-size: 14px; }
.crumb { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--primary); font-weight: 600; }
.section-gap { margin-top: 22px; }
.sec-title { font-size: 18px; font-weight: 700; margin: 0; }
.sec-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); line-height: 1.9; }
.table-scroll { overflow-x: auto; }

/* ---------- 操作按钮（共享） ---------- */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn-line {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--primary); color: var(--primary);
  font-weight: 700; font-size: 14px; padding: 8px 16px;
  border-radius: 999px; transition: .18s; text-decoration: none;
}
.btn-line:hover { background: var(--primary); color: #fff; }
.btn-line.ghost { border-color: var(--border); color: var(--muted); }
.btn-line.ghost:hover { background: var(--bg); color: var(--text); }
/* ---------- 统计卡片（共享） ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat-card .v { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat-card .v.hl { color: #10b981; }
.stat-card .v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat-card .k { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- 数据表格（共享） ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
table.data td { border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: none; }
table.data a { color: var(--primary); font-weight: 600; }
table.data td.note { color: var(--muted); font-size: 12.5px; }

/* ---------- 工资水平占比条（全国/城市统计页） ---------- */
.level-bars { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.level-bar-row { display: grid; grid-template-columns: 92px 1fr 130px; align-items: center; gap: 12px; font-size: 14px; }
.level-bar-row .lb-track { height: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.level-bar-row .lb-fill { height: 100%; border-radius: 999px; min-width: 2px; transition: width .5s ease; }
.level-bar-row .lb-num { color: var(--muted); text-align: right; white-space: nowrap; }
.level-bar-row .lb-num b { color: var(--text); }

/* 六档区间填充色（与 includes/salary-levels.php 的 color 一致） */
.fill-lv1 { background: #94a3b8; }
.fill-lv2 { background: #69b1ff; }
.fill-lv3 { background: #4096ff; }
.fill-lv4 { background: #1677ff; }
.fill-lv5 { background: #0958d9; }
.fill-lv6 { background: #0a2e63; }

/* ---------- 全国统计页专属 ---------- */
.history-scroll { max-height: 440px; overflow-y: auto; }
.history-scroll table.data th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.tag-split { font-size: 11px; border: 1px solid var(--border); color: var(--muted); border-radius: 4px; padding: 1px 5px; margin-left: 6px; white-space: nowrap; }
.chg-up { color: #e11d48; font-weight: 600; }
.chg-down { color: #10b981; font-weight: 600; }

/* ---------- 城市统计页专属：历史数据表 ---------- */
.kv-note { color: var(--muted); font-size: 12px; }
.kv-year { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; margin-right: 6px; }

/* ---------- 占比图页（全国/单城） ---------- */
.chart-card { margin-top: 22px; }
.chart-card .chart { width: 100%; height: 420px; }
.chart-card.tall .chart { height: 520px; }
.chart-card.cc .chart { height: 400px; }
.city-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.city-chips a { border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 13px; padding: 6px 13px; border-radius: 999px; transition: .18s; }
.city-chips a:hover { border-color: var(--primary); color: var(--primary); }
.city-chips .chip-static { cursor: default; }
.city-chips-flush { margin-top: 0; }

/* ---------- 记录详情页专属：同城对比 ---------- */
.cmp-rows { display: flex; flex-direction: column; gap: 14px; }
.cmp-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; font-size: 14px; }
.cmp-row .lb { color: var(--muted); }
.cmp-track { height: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cmp-fill { height: 100%; border-radius: 999px; min-width: 2px; }
.cmp-legend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.cmp-legend b { color: var(--text); }
.cmp-note { margin: 16px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.cmp-pct { color: var(--primary); }
.fill-blue { background: #1677ff; }
.fill-green { background: #10b981; }

/* ---------- 页脚与正文链接（共享） ---------- */
.salary-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.salary-footer .meta-line { margin: 0 0 6px; }
.salary-footer .copy-line { margin: 0; }
.salary-footer a, .tlink {
  color: var(--primary);
  font-weight: 600;
}
.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .page-wrap { padding: 20px 14px 48px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .level-bar-row { grid-template-columns: 78px 1fr 104px; }
  .table-scroll { overflow-x: auto; }
  .chart-card .chart { height: 340px; }
  .chart-card.tall .chart { height: 460px; }
  .chart-card.cc .chart { height: 320px; }
}
