/* ============ Paris Vivant · styles.css ============
   Style: Newsprint（报纸印刷风）
   纸感底色 #EAF0F4 微蓝冷白新闻纸 / 报头 serif / 3px double 线 / 0 圆角 / 严格栅格 / 栏线
   多色报刊板块：墨黑 ink-black 主识别 + 暗红 seal 印章点缀 + 深蓝 navy + 橄榄绿
   ============ Paris Vivant · styles.css ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #EAF0F4; --surface: #FBFCFD; --surface2: #DDE3EA;
  --ink: #26211A; --ink2: #5C6470; --line: #B8BCC4;
  --accent: #1C1917; --accent-soft: rgba(28, 25, 23, .08);
  --seal: #7F1D1D;
  --blue: #1F3A5F; --olive: #4A5D3A;
  --good: #3E6B3A; --bad: #7F1D1D;
  --radius: 0px;
  --shadow: none;
  --tip-bg: #26211A; --tip-fg: #EAF0F4;
  --serif: 'Playfair Display', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --sans: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #1C1915; --surface: #26221C; --surface2: #322D24;
  --ink: #E8ECF1; --ink2: #A8B0BA; --line: #3E382C;
  --accent: #E8ECF1; --accent-soft: rgba(232, 236, 241, .14);
  --seal: #E0705F;
  --blue: #7FA3C8; --olive: #A3B86B;
  --good: #8AB87E; --bad: #E0705F;
  --shadow: none;
  --tip-bg: #E8ECF1; --tip-fg: #1C1915;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  font-variant-numeric: tabular-nums;
  background-image: repeating-linear-gradient(0deg, transparent 0 26px, rgba(38,33,26,.05) 26px 27px);
  transition: background .25s ease, color .25s ease;
}
.app { max-width: 1440px; margin: 0 auto; padding: 8px 28px 24px; }
::selection { background: var(--accent); color: var(--bg); }

/* ---------- top bar（报头：3px double 报头线） ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0 14px; border-bottom: 3px double var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name {
  font-family: var(--serif); font-weight: 700; font-size: 20px;
  letter-spacing: .02em; text-transform: uppercase;
}
.brand-tag {
  font-size: 10.5px; color: var(--ink2); border: 1px solid var(--ink);
  border-radius: 0; padding: 2px 8px; letter-spacing: .18em; text-transform: uppercase;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.period-chip {
  font-size: 11px; color: var(--ink2); letter-spacing: .08em; text-transform: uppercase;
  border-left: 1px solid var(--line); padding-left: 12px;
}
.icon-btn {
  background: var(--surface); border: 1px solid var(--ink); color: var(--ink2);
  width: 34px; height: 34px; border-radius: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s, transform .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: none; }
.ic-moon { display: none; }
[data-theme="dark"] .ic-sun { display: none; }
[data-theme="dark"] .ic-moon { display: block; }

/* ---------- hero（大标题：serif + 报头 double 线） ---------- */
.hero {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; margin: 22px 0 18px; flex-wrap: wrap;
  border-bottom: 3px double var(--ink); padding-bottom: 16px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(30px, 3.8vw, 48px); line-height: 1.08; letter-spacing: -.01em;
}
.hero-sub { color: var(--ink2); margin-top: 8px; font-size: 13px; font-style: italic; }
.hero-meta { display: flex; align-items: baseline; gap: 8px; padding-bottom: 4px; }
.hm-num { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--accent); }
.hm-lab { font-size: 11px; color: var(--ink2); text-transform: uppercase; letter-spacing: .12em; }
.hm-dot { width: 4px; height: 4px; border-radius: 0; background: var(--ink2); align-self: center; margin: 0 4px; }

/* ---------- KPI strip（栏线分隔的指标栏） ---------- */
.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin-bottom: 20px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.kpi {
  background: var(--surface); border-right: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 18px 12px;
  animation: rise .5s both;
}
.kpi:last-child { border-right: 0; }
.kpi:nth-child(2) { animation-delay: .05s; } .kpi:nth-child(3) { animation-delay: .1s; } .kpi:nth-child(4) { animation-delay: .15s; }
.kpi-top { display: flex; justify-content: space-between; align-items: baseline; }
.kpi-label {
  font-size: 10.5px; color: var(--ink2); letter-spacing: .14em; text-transform: uppercase;
}
.kpi-unit { font-size: 11px; color: var(--ink2); }
.kpi-value {
  font-family: var(--serif); font-size: 32px; font-weight: 700;
  margin: 4px 0 6px; letter-spacing: -.01em;
}
.kpi-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.delta {
  font-size: 11px; padding: 2px 7px; border-radius: 0; white-space: nowrap;
  border: 1px solid currentColor;
}
.delta.up { color: var(--good); background: transparent; }
.delta.down { color: var(--bad); background: transparent; }
.delta.flat { color: var(--ink2); background: transparent; border-color: var(--ink2); }
.delta-note { font-size: 10.5px; color: var(--ink2); margin-top: 3px; }

/* ---------- layout grid（严格栅格 + 栏线分隔） ---------- */
.grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0;
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
}
.panel {
  background: var(--surface); border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 22px;
  animation: rise .5s .1s both;
}
.map-panel { grid-column: span 7; }
.detail-panel { grid-column: span 5; }
.volume-panel { grid-column: span 5; }
.table-panel { grid-column: span 7; }
@media (max-width: 1120px) {
  .grid > .panel { grid-column: span 12; border-right: 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } .app { padding: 8px 14px 18px; } }

.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--ink); padding-bottom: 10px;
}
.panel-head h2 {
  font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .01em;
}
.panel-note { font-size: 11.5px; color: var(--ink2); font-style: italic; }
.sub-h {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink2); margin-bottom: 10px; border-bottom: 1px solid var(--line); padding-bottom: 5px;
}
.hint { font-size: 11.5px; color: var(--ink2); margin-top: 10px; font-style: italic; }

/* ---------- segmented control & buttons（方形、报刊式） ---------- */
.seg {
  display: inline-flex; background: var(--surface2); border-radius: var(--radius);
  padding: 0; gap: 0; border: 1px solid var(--ink);
}
.seg button {
  border: 0; border-right: 1px solid var(--line); background: transparent;
  padding: 6px 13px; border-radius: 0;
  font: inherit; font-size: 12px; color: var(--ink2); cursor: pointer;
  text-transform: uppercase; letter-spacing: .06em;
  transition: background .15s, color .15s;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); background: var(--surface); }
.seg button.on {
  background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: none;
}
.ghost-btn {
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 0; padding: 7px 14px; font: inherit; font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  transition: all .18s; white-space: nowrap;
}
.ghost-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ghost-btn.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.ghost-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- map ---------- */
.map-wrap { display: flex; justify-content: center; }
#mapSvg { width: 100%; max-width: 520px; height: auto; }
.arr-poly { stroke: var(--surface); stroke-width: 2.5; cursor: pointer; transition: filter .15s, stroke-width .15s; outline: none; }
.arr-poly:hover, .arr-poly:focus-visible { filter: brightness(1.06) saturate(1.1); stroke: var(--ink); }
.arr-poly.sel { stroke: var(--accent); stroke-width: 3.5; filter: brightness(1.05); }
.map-label {
  font-size: 12.5px; font-weight: 700; fill: var(--ink); text-anchor: middle;
  font-family: var(--serif);
  paint-order: stroke; stroke: var(--surface); stroke-width: 3.5px; pointer-events: none;
}
.legend { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.legend-bar { flex: 1; height: 8px; border-radius: 0; border: 1px solid var(--ink); }
.legend-lab { font-size: 11px; color: var(--ink2); white-space: nowrap; letter-spacing: .04em; }

/* ---------- detail panel ---------- */
.detail-head { margin-bottom: 6px; }
.detail-sub { font-size: 12px; color: var(--ink2); margin-top: 3px; font-style: italic; }
.range-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 8px; flex-wrap: wrap; }
.compare-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--ink); border-radius: 0;
  padding: 3px 5px 3px 9px; font-size: 12px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 0; border: 1px solid var(--ink); }
.chip button {
  border: 0; background: none; cursor: pointer; color: var(--ink2);
  font-size: 14px; line-height: 1; padding: 0 3px; border-radius: 0;
}
.chip button:hover { color: var(--bad); }
.chart-lg { min-height: 240px; }
.chart-md { min-height: 190px; }
.chart-svg { width: 100%; height: auto; display: block; }
.axis-tick { fill: var(--ink2); font-size: 10.5px; font-family: var(--sans); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 480px) { .detail-grid { grid-template-columns: 1fr; } }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-legend { list-style: none; flex: 1; }
.donut-legend li {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 5px 6px; border-bottom: 1px solid var(--line);
  border-radius: 0; cursor: default; transition: background .12s;
}
.donut-legend li:hover { background: var(--surface2); }
.donut-legend .dot { width: 9px; height: 9px; border-radius: 0; flex: none; border: 1px solid var(--ink); }
.donut-legend .dl { flex: 1; }
.donut-legend .dv { color: var(--ink2); font-family: var(--serif); font-weight: 700; }
.stat-list { list-style: none; }
.stat-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 7.5px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.stat-list li:last-child { border-bottom: 0; }
.stat-list .sl { color: var(--ink2); }
.stat-list .sv { font-weight: 700; text-align: right; font-family: var(--serif); }

/* ---------- table（报刊明细表：双线表头） ---------- */
.search {
  border: 1px solid var(--ink); background: var(--surface); color: var(--ink);
  border-radius: 0; padding: 7px 14px; font: inherit; font-size: 12.5px; width: 180px;
  transition: border-color .15s, width .2s;
}
.search:focus { outline: none; border-color: var(--accent); width: 210px; }
.table-wrap { overflow-x: auto; }
#arrTable { width: 100%; border-collapse: collapse; }
#arrTable th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink);
  text-align: left; padding: 8px 10px; border-bottom: 3px double var(--ink);
  cursor: pointer; user-select: none; white-space: nowrap; font-weight: 700;
  font-family: var(--serif);
}
#arrTable th:hover { color: var(--accent); }
#arrTable th.on-sort::after { content: ' ▾'; color: var(--accent); }
#arrTable th.on-sort.asc::after { content: ' ▴'; }
#arrTable td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
#arrTable th.num, #arrTable td.num { text-align: right; }
#arrTable tbody tr { cursor: pointer; transition: background .12s; }
#arrTable tbody tr:hover { background: var(--surface2); }
#arrTable tbody tr.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
#arrTable tbody tr.paris-row td { font-weight: 700; border-top: 1px solid var(--ink); }
.num-badge {
  display: inline-flex; width: 26px; height: 26px; border-radius: 0;
  background: var(--surface2); color: var(--ink2); font-size: 11.5px; font-weight: 700;
  align-items: center; justify-content: center; border: 1px solid var(--line);
  font-family: var(--serif);
}
tr.sel .num-badge { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.arr-name { font-weight: 600; }
.arr-name small { display: block; color: var(--ink2); font-weight: 400; font-size: 11px; }
.spark { display: block; margin-left: auto; }
.empty { padding: 28px; text-align: center; color: var(--ink2); font-size: 13px; font-style: italic; }

/* ---------- tooltip（墨色底 + 纸色字，方形） ---------- */
.tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--tip-bg); color: var(--tip-fg);
  border-radius: 0; padding: 9px 12px; font-size: 12px; line-height: 1.55;
  box-shadow: none; max-width: 250px; border: 1px solid var(--tip-fg);
}
.tooltip .tt-title { font-weight: 700; margin-bottom: 3px; font-size: 12.5px; font-family: var(--serif); }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; }
.tooltip .tt-row .k { opacity: .65; }
.tooltip .tt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 0; margin-right: 6px; }

/* ---------- skeleton ---------- */
.sk { position: relative; overflow: hidden; background: var(--surface2); border-radius: 0; min-height: 110px; }
.sk-lg { min-height: 240px; } .sk-md { min-height: 90px; }
.sk::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(38,33,26,.12), transparent);
  animation: shim 1.3s infinite;
}
[data-theme="dark"] .sk::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shim { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- footer（报尾 double 线） ---------- */
.foot { margin-top: 26px; padding-top: 14px; border-top: 3px double var(--ink); }
.foot p { font-size: 11.5px; color: var(--ink2); font-style: italic; }
a { color: var(--accent); text-decoration: underline; }
