/* 游戏遥测看板。
   图表颜色按数据可视化规范：分类色固定顺序（不循环、不跟排名变）；单一系列用第 1 色；
   发散色蓝 ↔ 红、中间灰；网格实线细线；文字用正文颜色，不用系列色。
   职业色的顺序（精灵、巫师、龙族、主教、皇家护卫、深渊、复仇者）在浅色和深色下都通过了色盲可分辨性校验。 */
:root {
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --s-other: #a3a29c;
  --p-forest: #008300; --p-rune: #2a78d6; --p-dragon: #eb6834; --p-haven: #1baf7a;
  --p-sword: #eda100; --p-abyss: #e87ba4; --p-portal: #6250d6;
  --div-pos: #2a78d6; --div-neg: #e34948; --div-mid: #f0efec;
  --viz-grid: #ebeae5; --viz-base: #c3c2b7; --viz-muted: #898781;
  --up: #006300; --down: #c42b2b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --s-other: #6b6a65;
    --p-forest: #008300; --p-rune: #3987e5; --p-dragon: #d95926; --p-haven: #199e70;
    --p-sword: #c98500; --p-abyss: #d55181; --p-portal: #9085e9;
    --div-pos: #3987e5; --div-neg: #e66767; --div-mid: #26272c;
    --viz-grid: #24262c; --viz-base: #383a40; --viz-muted: #898781;
    --up: #2fbf55; --down: #ff7b7b;
  }
}
:root[data-theme="dark"] {
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --s-other: #6b6a65;
  --p-forest: #008300; --p-rune: #3987e5; --p-dragon: #d95926; --p-haven: #199e70;
  --p-sword: #c98500; --p-abyss: #d55181; --p-portal: #9085e9;
  --div-pos: #3987e5; --div-neg: #e66767; --div-mid: #26272c;
  --viz-grid: #24262c; --viz-base: #383a40; --viz-muted: #898781;
  --up: #2fbf55; --down: #ff7b7b;
}

/* 系列 / 职业 → --c */
.s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); } .s4 { --c: var(--s4); }
.s5 { --c: var(--s5); } .s6 { --c: var(--s6); } .s7 { --c: var(--s7); } .s8 { --c: var(--s8); } .s-other { --c: var(--s-other); }
.p-Forestcraft { --c: var(--p-forest); } .p-Runecraft { --c: var(--p-rune); } .p-Dragoncraft { --c: var(--p-dragon); }
.p-Havencraft { --c: var(--p-haven); } .p-Swordcraft { --c: var(--p-sword); } .p-Abysscraft { --c: var(--p-abyss); }
.p-Portalcraft { --c: var(--p-portal); }
i.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 7px; vertical-align: 1px; flex-shrink: 0; }

/* ---------- 侧栏：三个页面 + 数据统计的标签页 ---------- */
.views { display: flex; flex-direction: column; gap: 2px; padding: 0 0 12px; margin-bottom: 4px; border-bottom: 1px solid var(--sidebar-border); }
.view-item {
  display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--sidebar-text);
  font: inherit; font-size: 13.5px; text-align: left; padding: 7px 10px; border-radius: 8px; cursor: pointer;
}
.view-item .icon { opacity: .8; }
.view-item:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); }
.view-item.active { background: var(--sidebar-active); color: var(--sidebar-strong); font-weight: 600; }
.view-item.active .icon { opacity: 1; color: var(--accent-text); }
.tele-nav { display: none; }
.view-stats .tele-nav { display: flex; padding-top: 8px; }
.view-telemetry #filters, .view-telemetry .label-title, .view-telemetry #label-tree { display: none; }

/* ---------- 页面框架 ---------- */
.tele-view { grid-column: 2; grid-row: 1; overflow-y: auto; min-width: 0; background: var(--bg); position: relative; }
.tele-root.refreshing .tv-body { opacity: .5; transition: opacity .15s; pointer-events: none; }
.tv { max-width: 1280px; margin: 0 auto; padding: 0 28px 56px; }

.tv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px 0 14px; }
.tv-title h1 { margin: 0; font: 650 22px/1.3 var(--display); letter-spacing: .2px; }
.tv-brand { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--accent-text); letter-spacing: .4px; margin-bottom: 8px; }
.tv-brand img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.tv-actions .btn.icon-only { width: 28px; padding: 0; justify-content: center; }
.tv-actions .btn .icon { width: 14px; height: 14px; }
.range { border-bottom: 1px dotted var(--border-strong); cursor: help; }
.tv-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.tv-actions { display: flex; align-items: center; gap: 8px; }
.sync-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); margin-right: 4px; }
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.sync-state.ok i { background: var(--green); }
.sync-state.bad i { background: var(--red); }
.sync-state.running i { background: var(--amber); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.tv-alert { margin: 0 0 12px; padding: 9px 14px; border-radius: var(--radius); background: var(--red-soft); color: var(--red); font-size: 13px; }

.tv-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tv-tabs button {
  border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text-2); padding: 9px 12px 10px; cursor: pointer;
  position: relative; white-space: nowrap; border-radius: 6px 6px 0 0;
}
.tv-tabs button:hover { color: var(--text); background: var(--surface-3); }
.tv-tabs button.active { color: var(--text); font-weight: 600; }
.tv-tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

/* 吸顶的是外层容器（筛选栏本身只有一行高，粘不住） */
#tv-filters { position: sticky; top: 0; z-index: 4; }
.tv-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 -28px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.tv-filters .input { height: 30px; width: auto; min-width: 0; padding: 0 8px; font-size: 12.5px; }
.tv-filters .check { margin-top: 0; font-size: 12.5px; color: var(--text-2); }
.tv-divider { width: 1px; height: 20px; background: var(--border-strong); margin: 0 2px; }
.date-range { display: inline-flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-3); gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 6px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--raised); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

.tv-body { padding-top: 4px; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid > .panel { margin: 0; min-width: 0; }
.grid.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.split.wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid.cards3 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.hero-row { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

/* ---------- 面板 ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font: 600 14px/1.4 var(--display); display: flex; align-items: center; }
.panel-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.panel-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.panel-tools .input { height: 30px; width: auto; font-size: 12.5px; }
#card-search { width: 170px; }
.note, .lead-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; line-height: 1.6; }
.lead-note { margin: 0 0 14px; }
.tv-link { border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--accent-text); cursor: pointer; padding: 2px 0; white-space: nowrap; }
.tv-link:hover { text-decoration: underline; }
.strong { font-weight: 600; color: var(--text); }

/* ---------- 指标 ---------- */
.tv-hero { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.hero-value { font: 650 52px/1.1 var(--display); letter-spacing: -1px; margin: 6px 0 4px; }
.hero-sub { font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tv-hero .chart-box { min-height: 150px; margin-top: 6px; }
.tv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tv-stats.three { margin-bottom: 16px; }
.tv-stat {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow-sm); min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; overflow: hidden;
}
.tv-label { font-size: 12.5px; color: var(--text-2); }
.tv-value { font: 650 24px/1.3 var(--display); margin-top: 4px; white-space: nowrap; }
.tv-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.tv-sub { font-size: 12px; color: var(--muted); }
.tv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tv-stat .spark { flex-shrink: 0; }
.delta { font-size: 12px; font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); font-weight: 500; }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.mini-value { font: 650 26px/1.3 var(--display); margin: 2px 0 4px; }

.insights { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.insights li { position: relative; padding-left: 16px; line-height: 1.65; font-size: 13.5px; }
.insights li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); }

.rank { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank li { counter-increment: rank; display: grid; grid-template-columns: 22px minmax(0, 1fr) 80px 52px; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.rank li:first-child { border-top: 0; }
.rank li::before { content: counter(rank); font-size: 12px; color: var(--muted); text-align: center; }
.rank-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- SVG 图表 ---------- */
.chart-box { width: 100%; min-height: 120px; }
.chart { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--viz-grid); stroke-width: 1; }
.chart .base { stroke: var(--viz-base); stroke-width: 1; }
.chart .tick { fill: var(--viz-muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--c); opacity: .1; }
.chart .stack { fill: var(--c); stroke: var(--surface); stroke-width: 2; stroke-linejoin: round; }
.chart .end { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.chart .end-label { fill: var(--text); font-size: 11.5px; font-weight: 600; font-family: var(--font); }
.chart .col rect { fill: transparent; }
.chart .col .guide { stroke: var(--viz-base); stroke-width: 1; opacity: 0; }
.chart .col .dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; opacity: 0; }
.chart .col:hover .guide, .chart .col:hover .dot { opacity: 1; }
.spark .spark-line { fill: none; stroke: var(--s-other); stroke-width: 1.5; stroke-linejoin: round; }
.spark .spark-end { fill: var(--s1); stroke: var(--surface); stroke-width: 1.5; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-2); margin: -4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; flex-shrink: 0; background: var(--c); }
.key.line { width: 12px; height: 2px; border-radius: 1px; }
.key.rect { width: 10px; height: 10px; border-radius: 3px; }
.key.none { width: 12px; height: 2px; background: transparent; }

/* 横向条形：数据端 4px 圆角、基线端方角；区间须线；参考线是实线细线 */
.bars { display: flex; flex-direction: column; gap: 4px; }
.bars-ref-note { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin: -6px 0 6px; }
.ref-key { width: 1px; height: 12px; background: var(--text-2); }
.bar-row { display: grid; grid-template-columns: minmax(96px, 168px) minmax(0, 1fr) 62px; align-items: center; gap: 12px; padding: 5px 6px; margin: 0 -6px; border-radius: 8px; }
.bar-row:hover { background: var(--surface-2); }
.bar-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.bar-label span { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
.bar-label small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-value { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track { position: relative; height: 12px; }
.bar-track::before { content: ""; position: absolute; inset: 0; border-radius: 0 4px 4px 0; background: var(--surface-3); }
.bar-track.thin { height: 8px; min-width: 70px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--c); }
.whisker { position: absolute; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--text); opacity: .6; }
.whisker::before, .whisker::after { content: ""; position: absolute; top: -4px; width: 1.5px; height: 9.5px; background: inherit; }
.whisker::before { left: 0; }
.whisker::after { right: 0; }
.bar-track.thin .whisker::before, .bar-track.thin .whisker::after { top: -3px; height: 7.5px; }
.tv-ref { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--text-2); }

/* 点图：点 = 数值，淡色横条 = 误差范围，竖线 = 参考值。行之间没有空隙，竖线和网格线连成一整条 */
.dots { display: flex; flex-direction: column; }
.dp-row { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) 64px; align-items: center; gap: 14px; padding: 7px 6px; margin: 0 -6px; border-radius: 8px; }
.dp-row:not(.dp-head):not(.dp-axis):hover { background: var(--surface-2); }
.dp-track { position: relative; height: 22px; }
.dp-row:not(.dp-head):not(.dp-axis) .dp-track { margin: -7px 0; height: 36px; }
.dp-grid { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: var(--border); opacity: .7; }
.dp-ref { position: absolute; top: 0; bottom: 0; width: 1.5px; margin-left: -.75px; background: var(--text-2); opacity: .75; }
.dp-ci { position: absolute; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: color-mix(in srgb, var(--c) 32%, transparent); }
.dp-dot { position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2.5px var(--surface); }
.dp-row:hover .dp-dot { transform: scale(1.15); }
.dp-value { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; font-variant-numeric: tabular-nums; }
.dp-value b { font-size: 13.5px; font-weight: 650; }
.dp-value small { font-size: 11px; color: var(--muted); }
.dp-head { padding-block: 0 2px; }
.dp-head .dp-track { height: 18px; }
.dp-ref-label { position: absolute; bottom: 2px; transform: translateX(-50%); white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface-3); border-radius: 5px; padding: 1px 7px; }
.dp-axis { padding-block: 4px 0; }
.dp-axis .dp-track { height: 16px; }
.dp-tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 堆叠柱状图 */
.chart .col .seg { fill: var(--c); }
.chart .col .hit { fill: transparent; }
.chart .col:hover .hit { fill: var(--surface-2); }
.chart .col:hover .seg { filter: brightness(1.1); }
.chart .col-total { fill: var(--text-2); font-size: 11px; font-weight: 600; font-family: var(--font); font-variant-numeric: tabular-nums; }
.takeaway { margin: 0 0 12px; font-size: 13px; color: var(--text); line-height: 1.6; }
.takeaway b { font-weight: 650; }

/* 柱状图：柱宽 ≤ 24px，顶部 4px 圆角，柱间 2px 间隙 */
.columns { display: flex; align-items: flex-end; gap: 2px; height: 170px; }
.column { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; border-radius: 4px; }
.column-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--viz-base); }
.column-bar i { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--c); }
.column:hover .column-bar i { filter: brightness(1.12); }
.column span { font-size: 10.5px; color: var(--viz-muted); height: 14px; line-height: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 热力图 */
.heat-wrap { overflow: auto; max-height: min(520px, 70vh); isolation: isolate; }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 12.5px; }
.heat th { font-weight: 500; color: var(--text-2); padding: 4px 8px; white-space: nowrap; }
.heat thead th { color: var(--muted); font-size: 11.5px; font-weight: 500; position: sticky; top: 0; z-index: 2; background: var(--surface); }
.heat tbody th { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 3px 0 0 var(--surface); }
.heat thead th:first-child { left: 0; z-index: 3; }
.heat td { text-align: center; padding: 7px 4px; border-radius: 4px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 54px; color: var(--text); }
.heat td.strong { color: #fff; }
.heat td small { display: block; font-size: 10.5px; font-weight: 400; opacity: .7; }
.heat td.none { background: var(--surface-2); }
.heat-scale { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.heat-scale .scale { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--div-neg), var(--div-mid), var(--div-pos)); }

/* 表格 */
.table-scroll { overflow-x: auto; }
.tv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tv-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tv-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; font-variant-numeric: tabular-nums; }
.tv-table tbody tr:last-child td { border-bottom: 0; }
.tv-table tbody tr:hover { background: var(--surface-2); }
.tv-table .r { text-align: right; }
.tv-table .bar-col { width: 20%; min-width: 100px; }
.tv-table th.sortable { cursor: pointer; user-select: none; }
.tv-table th.sortable:hover { color: var(--text); }
.tv-table th.active { color: var(--text); font-weight: 600; }
.tv-table th.active::after { content: " ↓"; }
.tv-table .ns { display: block; font-size: 11px; color: var(--muted); }
.tv-table .spark { display: block; }
.tv-table .tag { display: inline-flex; gap: 4px; font-size: 11.5px; color: var(--text-2); background: var(--surface-3); border-radius: 5px; padding: 1px 7px; margin: 1px 4px 1px 0; white-space: nowrap; }
.tv-table .tag b { font-weight: 600; color: var(--text); }
.data-view { margin-top: 10px; }
.data-view summary { font-size: 12px; color: var(--muted); cursor: pointer; width: max-content; }
.data-view summary:hover { color: var(--text); }
.data-view[open] .table-scroll { max-height: 280px; overflow-y: auto; margin-top: 8px; }

/* 选牌 */
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pchip {
  display: inline-flex; align-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  font: inherit; font-size: 13px; padding: 5px 14px; cursor: pointer; color: var(--text-2); box-shadow: var(--shadow-sm);
}
.pchip small { margin-left: 8px; color: var(--muted); font-size: 11.5px; }
.pchip:hover { color: var(--text); border-color: var(--border-strong); }
.pchip.active { color: var(--text); font-weight: 600; border-color: var(--text-2); }
.tv-more { margin-top: 10px; }

/* 流派 */
.arche { display: flex; flex-direction: column; }
.arche-head, .arche-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(70px, 1.3fr) 44px 44px; align-items: center; gap: 10px; }
.arche-head { font-size: 11.5px; color: var(--muted); padding-bottom: 6px; }
.arche-row { padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.arche-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arche .r { text-align: right; font-variant-numeric: tabular-nums; }

/* 数据质量 */
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: 13px; line-height: 1.6; }
.facts.terms dt { color: var(--text); font-weight: 600; }
.facts.terms dd { color: var(--text-2); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* 空状态 / 加载 */
.tv-empty { max-width: 560px; margin: 48px auto; text-align: center; padding: 36px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.tv-empty-icon { width: 48px; height: 48px; margin: 0 auto; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.tv-empty-icon .icon { width: 22px; height: 22px; }
.tv-empty h2 { margin: 16px 0 6px; font: 600 17px/1.4 var(--display); }
.tv-empty p { color: var(--text-2); margin: 0 0 12px; }
.tv-empty ol { text-align: left; margin: 12px auto 20px; padding-left: 20px; max-width: 420px; line-height: 1.9; color: var(--text-2); font-size: 13px; }
.tv-loading { text-align: center; padding: 80px 0; color: var(--muted); }
.spinner { width: 30px; height: 30px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 提示框：数值在前、名称在后，序列用短线标识 */
.tele-tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 300px; min-width: 120px;
  background: var(--raised); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: var(--shadow); padding: 8px 10px; font-size: 12px; line-height: 1.5; white-space: pre-line;
}
.tt-title { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; overflow-wrap: anywhere; }
.tt-row { display: flex; align-items: center; gap: 7px; }
.tt-row b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tt-row span { color: var(--text-2); }
.tt-row span:empty { display: none; }

/* 分享页：没有侧栏，整页滚动 */
.share-page { height: auto; min-height: 100%; background: var(--bg); }
.share-view { min-height: 100vh; }
.share-view .tv { padding-top: 8px; }
.tv.shared .tv-head { padding-top: 32px; }

/* 分享对话框 */
.share-intro { margin: 0 0 14px; line-height: 1.7; }
.share-form { display: flex; gap: 8px; margin-bottom: 16px; }
.share-form .input { flex: 1; }
.share-list { display: flex; flex-direction: column; gap: 10px; }
.share-item { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.share-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.share-main .share-url { flex-basis: 100%; height: 30px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.share-actions { display: flex; gap: 6px; justify-content: flex-end; }
.share-note { margin: 14px 0 0; line-height: 1.7; }

/* 设置里的测试连接 */
.tele-test { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ok-text { color: var(--green); }
.bad-text { color: var(--red); }

@media (max-width: 1180px) {
  .grid.hero-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1040px) {
  .view-item { justify-content: center; padding: 8px; }
  .view-item span { display: none; }
  .tele-nav .nav-item { display: none; }
  .grid.split, .grid.split.wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  /* 手机上侧栏只留视图切换，放在最上面 */
  .app { grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { display: flex !important; flex-direction: row; padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--sidebar-border); overflow: visible; }
  .sidebar > :not(.views) { display: none !important; }
  .views { flex: 1; flex-direction: row; padding: 0; margin: 0; border: 0; }
  .view-item { flex: 1; justify-content: center; padding: 6px 4px; font-size: 12.5px; }
  .view-item span { display: inline !important; }
  .main, .tele-view { grid-column: 1; grid-row: 2; }
  .tv { padding: 0 16px 40px; }
  .tv-head { padding-top: 18px; }
  #tv-filters { position: static; }
  .tv-filters { margin: 0 -16px; padding: 10px 16px; }
  .tv-divider { display: none; }
  .tv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tv-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tv-stat .spark { display: none; }
  .tv-value { font-size: 20px; }
  .hero-value { font-size: 44px; }
  .panel { padding: 14px 14px; }
  .panel-head { flex-wrap: wrap; }
  .bar-row { grid-template-columns: minmax(72px, 110px) minmax(0, 1fr) 54px; gap: 8px; }
  .dp-row { grid-template-columns: minmax(64px, 96px) minmax(0, 1fr) 52px; gap: 10px; }
  .minis { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 0; }
  .rank li { grid-template-columns: 22px minmax(0, 1fr) 52px; }
  .rank li .spark { display: none; }
}
.public-nav { max-width: 1240px; margin: 16px auto 0; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
