/* 「数据瞭望台」页面私有样式：总览数字带 / 卡通地图 / 手绘图表 / 骑行卡 / 接口预告。
   依赖 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; }

/* ── 时间范围切换（属地模块）──────────────────────────── */
.range-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.range-tabs a {
  font: inherit; font-size: 13px; padding: 5px 13px; border: 1px solid var(--line);
  border-radius: var(--r-pill); background: #fff; color: var(--body); text-decoration: none;
}
.range-tabs a:hover { border-color: var(--teal); }
.range-tabs a.on,
.range-tabs a[aria-pressed="true"] { background: var(--teal-d); border-color: var(--teal-d); color: #fff; font-weight: 700; }
/* 分类 + 品牌两组筛选（品牌组紧随分类之后，细线分隔） */
.frame-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.frame-brands { padding-left: 10px; border-left: 1px solid var(--line); }
.frame-brands a { font-size: 12.5px; padding: 4px 11px; }

/* ── 卡通地图 ─────────────────────────────────────────── */
.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; }

/* ── 品牌车型库 ───────────────────────────────────────── */
/* #frames 锚点跳转时避开 sticky 顶栏，保证标题 + 分类 tab 可见 */
.dash-frames { scroll-margin-top: calc(var(--header-h) + 8px); }
.dash-frames > .hint { margin: 0 0 12px; }
.frame-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.frame-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: var(--teal-050); }
.frame-card-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.frame-brand { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; color: var(--teal-d); }
.frame-model { font-size: 16px; font-weight: 800; color: var(--ink); }
.frame-cat {
  margin-left: auto; font-size: 11.5px; padding: 2px 9px; border-radius: var(--r-pill);
  background: #fff; border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.frame-honors { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.honor { font-size: 11.5px; padding: 2px 9px; border-radius: var(--r-pill); border: 1px solid; background: #fff; }
.honor a { color: inherit; text-decoration: none; }
.honor a:hover { text-decoration: underline; }
.honor-award { border-color: var(--teal); color: var(--teal-d); }
.honor-race { border-color: var(--coral); color: var(--coral-d); }
.honor-tag { border-color: #d9a441; color: #96651b; }
.frame-src { margin: 8px 0 10px; font-size: 12.5px; color: var(--muted); }
.frame-src a { color: var(--teal-d); }
.frame-src span { margin-left: 10px; }
.frame-table-wrap { overflow-x: auto; }
.frame-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
.frame-table th, .frame-table td {
  padding: 5px 7px; text-align: right; border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.frame-table thead th { color: var(--muted); font-weight: 700; font-size: 11.5px; border-top: 0; }
.frame-table thead th:first-child, .frame-table tbody th { text-align: left; }
.frame-table tbody th { font-weight: 800; color: var(--ink); }
.frame-empty { margin: 0; padding: 16px 0 4px; color: var(--muted); font-size: 13.5px; }
/* 轮播控制：每版 ≤3 张，‹ › 翻页 + 展开全部/收起 */
.frame-car { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.frame-car[hidden] { display: none; } /* ≤3 卡不轮播：类选择器会盖掉 [hidden] 的 UA 样式 */
.frame-car-btn {
  width: 32px; height: 32px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: #fff; color: var(--teal-d);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.frame-car-btn:hover { border-color: var(--teal); }
.frame-car-pos { min-width: 54px; text-align: center; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.frame-car-all {
  margin-left: 6px; padding: 6px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--teal); background: #fff; color: var(--teal-d);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.frame-car-all:hover { background: var(--teal-d); color: #fff; }
.frame-car.is-open .frame-car-btn, .frame-car.is-open .frame-car-pos { display: none; }
/* 换版淡入：新一版卡片轻微上浮渐显（仅换版瞬间，非持续动效） */
@keyframes frameFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.frame-grid.is-swap .frame-card:not([hidden]) { animation: frameFade .28s ease; }


@media (prefers-reduced-motion: reduce) {
  .map-wrap .bubble { animation: none; }
  .map-wrap svg path { transition: none; }
  .frame-grid.is-swap .frame-card:not([hidden]) { animation: none; }
}
