:root {
  color-scheme: dark;
  --bg: #080d13;
  --panel: #131b24;
  --panel-2: #0e151d;
  --line: #2a3542;
  --line-strong: #465466;
  --text: #f4f7fb;
  --muted: #8e9bac;
  --blue: #3b8bff;
  --cyan: #00d8e5;
  --yellow: #ffd400;
  --purple: #b784f7;
  --green: #3ccb6f;
  --red: #ff7b72;
  --warn-bg: #301d22;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 1120px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.topbar {
  min-height: 78px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #080d13;
}
.brand, .top-actions, .hero-meta, .panel-heading, .table-tools, .footer { display: flex; align-items: center; }
.brand { gap: 14px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #5b9dff;
  border-radius: 10px;
  background: #145bc1;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.brand h1 { margin: 0; font-size: 22px; letter-spacing: 0; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { gap: 18px; }
.data-status { color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); }
.download-button, .select-like {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel-2);
  font-size: 12px;
}
.download-button:hover { border-color: var(--blue); background: #112845; }

.page-shell { width: min(1720px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 44px; }
.hero-band {
  min-height: 128px;
  padding: 26px 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.eyebrow, .section-kicker { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; }
.hero-band h2, .panel h2 { margin: 0; font-size: 22px; letter-spacing: 0; }
.hero-subtitle { margin: 8px 0 0; color: var(--muted); }
.hero-meta { max-width: 520px; flex-wrap: wrap; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 12px; text-align: right; }
.hero-meta span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-2); }
.hero-meta span:nth-child(3), .hero-meta span:nth-child(4) { color: var(--purple); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.kpi-card { min-height: 94px; padding: 15px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-value { margin-top: 10px; font-size: 22px; font-weight: 750; letter-spacing: 0; }
.kpi-note { margin-top: 5px; color: var(--muted); font-size: 11px; }
.kpi-card:nth-child(1) .kpi-value { color: var(--blue); }
.kpi-card:nth-child(2) .kpi-value { color: var(--yellow); }
.kpi-card:nth-child(3) .kpi-value { color: var(--cyan); }
.kpi-card:nth-child(4) .kpi-value { color: var(--purple); }

.panel { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.panel-heading { min-height: 78px; padding: 20px 22px 16px; justify-content: space-between; gap: 18px; }
.compact-heading { min-height: 66px; }
.panel-heading h2 { font-size: 18px; }
.table-tools { gap: 8px; }
.search-field { width: 190px; height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--panel-2); color: var(--muted); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
select { height: 32px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--panel-2); color: var(--text); font: inherit; }
.table-scroll { width: 100%; overflow-x: auto; scrollbar-gutter: stable; }
table { width: 100%; border-collapse: collapse; }
th, td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
th:last-child, td:last-child { border-right: 0; }
.metric-table { width: 2630px; min-width: 2630px; table-layout: fixed; }
.metric-table th { height: 40px; padding: 8px 10px; background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 700; text-align: right; white-space: normal; }
.metric-table thead tr:first-child th { height: 46px; color: var(--text); font-size: 13px; text-align: center; border-bottom: 2px solid var(--line-strong); }
.metric-table thead tr:first-child th:nth-child(2) { border-bottom-color: var(--blue); }
.metric-table thead tr:first-child th:nth-child(3) { border-bottom-color: var(--cyan); }
.metric-table thead tr:first-child th:nth-child(4) { border-bottom-color: var(--yellow); }
.metric-table thead tr:first-child th:last-child { border-bottom-color: var(--purple); }
.metric-table th:first-child, .metric-table td:first-child:not([colspan]) {
  position: sticky;
  left: 0;
  width: 190px;
  min-width: 190px;
  max-width: 190px;
  text-align: left;
  box-shadow: 8px 0 14px -12px #000;
}
.metric-table th:first-child { z-index: 3; background: var(--panel-2); }
.metric-table td:first-child:not([colspan]) { z-index: 2; background: var(--panel); }
.metric-table th:not(:first-child):not(:last-child), .metric-table td:not(:first-child):not(:last-child) { width: 180px; }
.metric-table th:last-child, .metric-table td:last-child { width: 280px; text-align: left; }
.metric-table thead tr:nth-child(2) th:nth-child(4n + 1) { color: var(--text); }
.metric-table thead tr:nth-child(2) th:nth-child(4n + 2) { color: var(--yellow); }
.metric-table thead tr:nth-child(2) th:nth-child(4n + 3) { color: var(--cyan); }
.metric-table thead tr:nth-child(2) th:nth-child(4n) { color: var(--purple); background: #21172c; }
.metric-table td { height: 48px; padding: 9px 10px; text-align: right; white-space: nowrap; }
.metric-table tbody tr:hover { background: #1b2632; }
.metric-table td:first-child:not([colspan]) { color: var(--text); font-weight: 700; white-space: normal; line-height: 1.35; }
.metric-table tbody tr:hover td:first-child:not([colspan]) { background: #1b2632; }
.metric-table td:nth-child(4n + 2) { color: var(--text); font-weight: 700; }
.metric-table td:nth-child(4n + 3) { color: var(--yellow); }
.metric-table td:nth-child(4n + 4) { color: var(--cyan); }
.metric-table td:nth-child(4n + 5) { color: var(--purple); }
.metric-table th:nth-child(5), .metric-table td:nth-child(5), .metric-table th:nth-child(9), .metric-table td:nth-child(9), .metric-table th:nth-child(13), .metric-table td:nth-child(13) { border-right: 2px dashed var(--line-strong); }
.metric-table td.status-cell { color: var(--red); background: var(--warn-bg); font-size: 11px; white-space: normal; line-height: 1.4; }
.metric-table td.status-ok { color: var(--green); }
.metric-value { font-weight: 700; }
.metric-delta { margin-left: 6px; font-size: 11px; }
.up { color: var(--green) !important; }
.down { color: var(--red) !important; }
.empty { color: #697687 !important; }
.table-note { padding: 11px 16px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }

.structure-grid { display: grid; gap: 9px; padding: 0 22px 20px; }
.structure-card { display: grid; grid-template-columns: 230px 1fr 118px; gap: 16px; align-items: center; min-height: 74px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); }
.structure-name { font-weight: 700; }
.structure-total { margin-top: 4px; color: var(--muted); font-size: 11px; }
.bar-track { display: flex; height: 12px; overflow: hidden; border-radius: 2px; background: #27313e; }
.bar-self { background: var(--yellow); }
.bar-non { background: var(--cyan); }
.bar-direct { background: var(--purple); }
.structure-legend { display: flex; flex-wrap: wrap; gap: 8px 13px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.legend-item::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 1px; background: var(--muted); }
.legend-self::before { background: var(--yellow); }
.legend-non::before { background: var(--cyan); }
.legend-direct::before { background: var(--purple); }
.structure-check { text-align: right; }
.structure-check strong { display: block; color: var(--green); font-size: 16px; }
.structure-check span { color: var(--muted); font-size: 10px; }

.chart-wrap { min-height: 330px; padding: 0 20px 22px; }
.chart-wrap svg { width: 100%; height: 310px; display: block; }
.chart-grid { stroke: #2d3845; stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; }
.chart-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 13px; padding: 0 8px; color: var(--muted); font-size: 11px; }
.chart-legend span::before { content: ""; display: inline-block; width: 16px; height: 3px; margin: 0 5px 3px 0; background: var(--legend-color); }

.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 22px 22px; border: 1px solid var(--line); background: var(--line); }
.definition-item { min-height: 47px; padding: 9px 12px; background: var(--panel-2); }
.definition-item .label { color: var(--muted); font-size: 11px; }
.definition-item .value { margin-top: 4px; color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
.definition-item.wide { grid-column: 1 / -1; }

.pace-panel { border-top-color: var(--green); }
.pace-heading { align-items: flex-end; }
.pace-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.pace-scope { padding: 6px 9px; border: 1px solid #326a45; border-radius: 4px; color: #72df94; background: #10251a; font-size: 11px; }
.pace-overall {
  display: grid;
  grid-template-columns: repeat(7, minmax(170px, 1fr));
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.pace-overall-stat { min-height: 106px; padding: 17px 18px; border-right: 1px solid var(--line); }
.pace-overall-stat:last-child { border-right: 0; }
.pace-overall-label { color: var(--muted); font-size: 11px; }
.pace-overall-value { margin-top: 10px; color: var(--text); font-size: 21px; font-weight: 750; white-space: nowrap; }
.pace-overall-note { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.pace-block { padding: 18px 22px 22px; }
.pace-block + .pace-block { border-top: 1px solid var(--line); }
.pace-block-heading { min-height: 42px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.pace-block-heading h3 { margin: 0; font-size: 15px; letter-spacing: 0; }
.pace-block-heading > span { color: var(--muted); font-size: 10px; text-align: right; }
.pace-block-kicker { margin: 0 0 5px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.pace-table { table-layout: fixed; }
.pace-summary-table { width: 2115px; min-width: 2115px; }
.pace-fluctuation-table { width: 1610px; min-width: 1610px; }
.pace-table th { height: 42px; padding: 9px 11px; background: var(--panel-2); color: var(--muted); font-size: 11px; text-align: right; white-space: normal; }
.pace-table td { min-height: 48px; padding: 11px; text-align: right; vertical-align: top; line-height: 1.45; white-space: nowrap; }
.pace-table tbody tr:hover { background: #1b2632; }
.pace-table .sticky-group {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 190px;
  min-width: 190px;
  max-width: 190px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  text-align: left;
  white-space: normal;
}
.pace-table .sticky-advertiser {
  position: sticky;
  left: 190px;
  z-index: 2;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  white-space: normal;
  box-shadow: 10px 0 16px -14px #000;
}
.pace-table th.sticky-group, .pace-table th.sticky-advertiser { z-index: 4; background: var(--panel-2); }
.pace-table tbody tr:hover td.sticky-group, .pace-table tbody tr:hover td.sticky-advertiser { background: #1b2632; }
.pace-summary-table .pace-emphasis { color: var(--yellow); font-weight: 700; }
.pace-fluctuation-table th:nth-child(3), .pace-fluctuation-table td:nth-child(3) { text-align: center; }
.pace-fluctuation-table th:nth-child(4), .pace-fluctuation-table th:nth-child(5), .pace-fluctuation-table td:nth-child(4), .pace-fluctuation-table td:nth-child(5) { text-align: left; white-space: normal; }
.pace-rank { color: var(--cyan); font-weight: 800; }
.pace-new { display: inline-block; padding: 2px 6px; border: 1px solid #326a45; border-radius: 4px; color: #72df94; background: #10251a; font-size: 10px; }
.pace-note { padding: 11px 22px; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 10px; line-height: 1.5; }

.framework-panel { border-top-color: #4e79aa; }
.framework-heading { align-items: flex-end; }
.framework-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.framework-filter-label { color: var(--muted); font-size: 11px; }
#framework-group-filter { min-width: 230px; }
.framework-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.framework-stat { min-height: 96px; padding: 17px 22px; border-right: 1px solid var(--line); }
.framework-stat:last-child { border-right: 0; }
.framework-stat-label { color: var(--muted); font-size: 11px; }
.framework-stat-value { margin-top: 9px; font-size: 24px; font-weight: 750; }
.framework-stat-note { margin-top: 4px; color: var(--muted); font-size: 10px; }
.framework-stat:nth-child(1) .framework-stat-value { color: var(--blue); }
.framework-stat:nth-child(2) .framework-stat-value { color: var(--yellow); }
.framework-stat:nth-child(3) .framework-stat-value { color: var(--cyan); }
.framework-stat:nth-child(4) .framework-stat-value { color: var(--green); }
.framework-block { padding: 18px 22px 22px; }
.framework-block + .framework-block, .framework-split + .framework-block { border-top: 1px solid var(--line); }
.framework-block-heading { min-height: 42px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.framework-block-heading h3 { margin: 0; font-size: 15px; letter-spacing: 0; }
.framework-block-heading > span { color: var(--muted); font-size: 10px; text-align: right; }
.framework-block-kicker { margin: 0 0 5px; color: var(--cyan); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.framework-split { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.framework-split .framework-block { min-width: 0; }
.framework-split .framework-block + .framework-block { border-top: 1px solid var(--line); border-left: 0; }
.framework-table { min-width: 760px; }
.framework-table th { padding: 10px 12px; background: var(--panel-2); color: var(--muted); text-align: left; font-size: 11px; white-space: nowrap; }
.framework-table td { padding: 11px 12px; color: var(--text); vertical-align: top; line-height: 1.45; }
.framework-table tbody tr:hover { background: #1b2632; }
.framework-table td:nth-last-child(1), .framework-table td:nth-last-child(3) { white-space: nowrap; }
.framework-summary-table { min-width: 920px; }
.framework-summary-table th:not(:first-child), .framework-summary-table td:not(:first-child) { text-align: right; }
.framework-summary-table td:first-child { font-weight: 700; }
.framework-summary-table tr.is-selected td { background: #142845; }
.framework-top-table { width: 1180px; min-width: 1180px; table-layout: fixed; }
.framework-top-table th:nth-child(3) { width: 90px; }
.framework-top-table th:nth-child(4), .framework-top-table th:nth-child(5) { width: 225px; }
.framework-top-table th:nth-child(6) { width: 170px; text-align: right; }
.framework-top-table td:last-child { color: var(--yellow); font-weight: 700; text-align: right; }
.framework-cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.framework-rank { width: 48px; color: var(--cyan) !important; font-weight: 800; }
.framework-table .sticky-group {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  text-align: left;
  white-space: normal;
}
.framework-table .sticky-advertiser {
  position: sticky;
  left: 170px;
  z-index: 2;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  background: var(--panel);
  color: var(--text);
  white-space: normal;
  box-shadow: 10px 0 16px -14px #000;
}
.framework-table th.sticky-group, .framework-table th.sticky-advertiser { z-index: 4; background: var(--panel-2); }
.framework-table tbody tr:hover td.sticky-group, .framework-table tbody tr:hover td.sticky-advertiser { background: #1b2632; }
.framework-summary-table tr.is-selected td.sticky-group { background: #142845; }
.framework-empty-inline { color: #697687 !important; font-weight: 500 !important; }
.industry-list { display: block; }
.industry-group { padding: 16px 0; border-top: 1px solid var(--line); }
.industry-group:first-child { padding-top: 0; border-top: 0; }
.industry-group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.industry-group-heading h4 { margin: 0; font-size: 13px; }
.industry-group-heading span { color: var(--muted); font-size: 10px; }
.industry-group-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; }
.industry-row { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.industry-order { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); font-size: 10px; }
.industry-title { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.industry-title strong { color: var(--text); white-space: nowrap; }
.industry-track { height: 7px; margin-top: 7px; overflow: hidden; border-radius: 2px; background: #27313e; }
.industry-track span { display: block; height: 100%; background: var(--cyan); }
.industry-meta { margin-top: 4px; color: var(--muted); font-size: 10px; }
.industry-empty { grid-column: 1 / -1; }
.framework-focus-table { table-layout: fixed; }
.framework-medical-table { width: 1100px; min-width: 1100px; }
.framework-medical-table th:nth-child(3) { width: 150px; }
.framework-medical-table th:nth-child(4) { width: 300px; }
.framework-medical-table th:nth-child(5) { width: 180px; }
.framework-city-table { width: 1190px; min-width: 1190px; }
.framework-city-table th:nth-child(3) { width: 90px; }
.framework-city-table th:nth-child(4) { width: 150px; }
.framework-city-table th:nth-child(5) { width: 300px; }
.framework-city-table th:nth-child(6) { width: 180px; }
.framework-period { display: block; white-space: nowrap; }
.framework-period + small { display: block; margin-top: 3px; color: var(--muted); }
.city-tag { display: inline-block; min-width: 34px; padding: 2px 6px; border: 1px solid #5b9dff; border-radius: 4px; color: #8dbbff; text-align: center; font-size: 10px; }
.framework-empty { padding: 22px !important; color: #697687 !important; text-align: center !important; }
.framework-note { padding: 11px 22px; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 10px; line-height: 1.5; }
.footer { justify-content: space-between; width: min(1720px, calc(100% - 40px)); margin: 0 auto; padding: 16px 0 26px; color: var(--muted); font-size: 11px; }

@media (max-width: 900px) {
  body { min-width: 0; }
  .topbar { padding: 12px 16px; }
  .brand p, .data-status { display: none; }
  .download-button { padding: 0 9px; }
  .page-shell, .footer { width: calc(100% - 24px); }
  .hero-band { display: block; padding: 21px; }
  .hero-meta { margin-top: 18px; justify-content: flex-start; text-align: left; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-heading { display: block; }
  .table-tools { margin-top: 13px; }
  .structure-card { grid-template-columns: 1fr; gap: 9px; }
  .structure-check { text-align: left; }
  .definition-grid { grid-template-columns: 1fr; }
  .definition-item.wide { grid-column: auto; }
  .framework-heading { display: block; }
  .pace-heading { display: block; }
  .pace-scope { display: inline-block; margin-top: 12px; }
  .pace-block { padding: 17px 16px 20px; }
  .pace-block-heading { display: block; }
  .pace-block-heading > span { display: block; margin-top: 6px; text-align: left; }
  .framework-heading .table-tools { display: grid; }
  #framework-group-filter { width: 100%; min-width: 0; }
  .framework-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .framework-stat:nth-child(2) { border-right: 0; }
  .framework-stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .framework-split { grid-template-columns: 1fr; }
  .framework-split .framework-block + .framework-block { border-left: 0; border-top: 1px solid var(--line); }
  .industry-group-rows { grid-template-columns: 1fr; }
  .industry-group-heading { display: block; }
  .industry-group-heading span { display: block; margin-top: 5px; }
  .framework-block { padding: 17px 16px 20px; }
  .framework-block-heading { display: block; }
  .framework-block-heading > span { display: block; margin-top: 6px; text-align: left; }
}
