/* 「数据瞭望台」页面私有样式：总览数字带 / 卡通地图 / 手绘图表 / 骑行卡 / 接口预告。
   依赖 site.css 的设计令牌。 */

.dash { max-width: 1240px; margin: 0 auto; padding: clamp(14px, 3vw, 30px) clamp(14px, 4vw, 40px) 0; }
.dash h2 { font-size: 19px; margin: 0; }
.dash h3 { font-size: 14px; margin: 0 0 8px; }

/* ── 头部 ─────────────────────────────────────────────── */
.dash-hero { margin: 4px 0 clamp(14px, 2.4vw, 22px); }
.dash-hero h1 { font-size: clamp(23px, 3.4vw, 32px); margin: 0 0 .28em; letter-spacing: -.01em; }
.dash-hero p { margin: 0; color: var(--muted); max-width: 62ch; }

/* ── 总览数字带 ───────────────────────────────────────── */
.dash-stats {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.stat .v { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; color: var(--teal-d); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat.accent .v { color: var(--coral); }

/* ── 卡片通用 ─────────────────────────────────────────── */
.dash .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(16px, 2.4vw, 24px); }
.dash section { margin-top: clamp(18px, 3vw, 30px); }
.dash-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

/* ── 卡通地图 ─────────────────────────────────────────── */
.dash-map-grid { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: clamp(14px, 2vw, 22px); align-items: start; }
@media (max-width: 860px) { .dash-map-grid { grid-template-columns: 1fr; } }

.map-wrap {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background:
    radial-gradient(120% 90% at 18% 8%, #eaf7fb 0%, #d3ecf4 45%, #bfe3ec 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}
/* 细微波纹，给海洋一点生气 */
.map-wrap::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,.5) 0 1px, transparent 1px 9px);
}
.map-wrap svg { display: block; width: 100%; height: auto; position: relative; z-index: 1; }
/* 圆角描边 + 外描边（paint-order）→ 贴纸般的卡通大陆 */
.map-wrap svg path {
  fill: #f0e7d5; stroke: #9c8a6a; stroke-width: 1.1; stroke-linejoin: round; stroke-linecap: round;
  paint-order: stroke fill; vector-effect: non-scaling-stroke;
  transition: filter .16s ease;
}
.map-wrap svg path.is-hit { cursor: pointer; }
.map-wrap svg path.is-hit:hover { filter: brightness(1.06) drop-shadow(0 2px 4px rgba(30,90,90,.35)); }
.map-wrap svg path[aria-pressed="true"] { stroke: var(--ink); stroke-width: 2; }
/* 呼吸气泡标记 */
.map-wrap .bubble { fill: var(--coral); fill-opacity: .55; stroke: #fff; stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: bubblePulse 2.6s ease-in-out infinite; }
@keyframes bubblePulse { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.28); } }

.map-side { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: var(--teal-050); }
.map-side .fp-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; padding: 5px 0; border-top: 1px dashed var(--line); }
.map-side .fp-row:first-of-type { border-top: 0; }
.map-side .fp-row .lbl { color: var(--muted); }
.map-side .fp-row .num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.map-side .fp-row .delta.up { color: var(--coral-d); }
.map-side .fp-row .delta.down { color: var(--teal-d); }
.map-side .fp-name { font-weight: 800; color: var(--ink); font-size: 15px; }
.map-side .fp-sub { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }

.map-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.map-legend i { display: inline-block; width: 26px; height: 12px; border-radius: 3px; }
.map-legend .lo { background: #efe7d6; }
.map-legend .mid { background: #8fd6cd; }
.map-legend .hi { background: var(--coral); }
.map-legend-note { margin-left: auto; }
.map-total { margin-top: 6px; font-size: 13px; color: var(--body); }

.map-actions button {
  font: inherit; font-size: 13px; padding: 6px 14px; border: 1px solid var(--line);
  border-radius: var(--r-pill); background: #fff; color: var(--body); cursor: pointer;
}
.map-actions button[aria-pressed="true"] { background: var(--teal-d); border-color: var(--teal-d); color: #fff; font-weight: 700; }

/* ── 图表 ─────────────────────────────────────────────── */
.dash-charts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.chart { margin: 0; }
.chart figcaption { font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.chart-svg svg { display: block; width: 100%; height: auto; }
.chart-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.chart .bar { fill: var(--teal); }
.chart .bar.alt { fill: var(--teal-l); }
.chart .bar.inseam { fill: var(--coral); }
.chart .bar.arm { fill: var(--teal); }
.chart .curve { fill: none; stroke: var(--coral-d); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 4 4; }
.chart .base.arm { stroke: var(--teal-d); }
.chart .rule { stroke: var(--coral); stroke-width: 1.4; stroke-dasharray: 3 3; }
.chart text { font-size: 11px; fill: var(--muted); }
.chart .mark { fill: var(--ink); font-weight: 700; }
.chart .dot { fill: var(--coral); stroke: #fff; stroke-width: 1.5; }
.chart .track { fill: var(--teal-050); }
.chart .range { fill: var(--teal-050); stroke: var(--teal); stroke-width: 1; }
.dash-laws > h2 { margin-bottom: 12px; }

/* ── 开放接口 ─────────────────────────────────────────── */
.api-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.api-list li { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: var(--teal-050); border-radius: var(--r-md); }
.api-list code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--teal-d); font-weight: 700; }
.api-list span { font-size: 12.5px; color: var(--muted); }
.api-sample summary { cursor: pointer; font-size: 13px; color: var(--teal-d); }
.api-sample pre { margin: 8px 0 0; padding: 14px; background: #2b3636; color: #d9e6e6; border-radius: var(--r-md); overflow: auto; font-size: 12px; line-height: 1.55; }
.dash-api > .hint { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .map-wrap .bubble { animation: none; }
  .map-wrap svg path { transition: none; }
}
