:root {
  --ink: #18212f;
  --muted: #657186;
  --line: #dbe2ea;
  --panel: #ffffff;
  --page: #f4f7f8;
  --blue: #2f6df6;
  --green: #148f6a;
  --red: #cc4b37;
  --gold: #a86f12;
  --violet: #7457c7;
  --shadow: 0 18px 48px rgba(31, 45, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(18px, 4vw, 48px);
  background: rgba(244, 247, 248, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

h3 {
  font-size: 15px;
}

.status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status span,
.pipeline span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 42px) 48px;
}

.definition-band {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: #18212f;
  color: #fff;
  border-radius: 8px;
}

.definition-band p {
  max-width: 920px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.8;
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pipeline span {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric,
.stat-card,
.panel,
.own-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 14px;
  box-shadow: none;
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.stat-card strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 22px;
  line-height: 1.1;
}

.metric span,
.metric small,
.section-head p {
  color: var(--muted);
}

.metric span,
.metric small {
  display: block;
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 26px;
}

.metric-delta {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 8px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.metric-delta.up {
  background: rgba(20, 143, 106, 0.11);
  color: var(--green);
}

.metric-delta.down {
  background: rgba(204, 75, 55, 0.11);
  color: var(--red);
}

.metric-delta.flat {
  background: #edf1f4;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.panel,
.own-section {
  padding: 20px;
  margin-bottom: 18px;
}

.chart-panel {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head p {
  margin-bottom: 0;
  font-size: 13px;
}

.with-controls {
  align-items: center;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

select {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.bar-chart {
  display: grid;
  gap: 14px;
}

.bar-chart.compact {
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.bar-label b {
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f4;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.svg-chart {
  width: 100%;
  min-height: 260px;
  overflow: hidden;
}

.svg-chart.tall {
  min-height: 310px;
}

.svg-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.hot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hot-item {
  display: grid;
  grid-template-rows: 156px 1fr;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hot-item img {
  width: 100%;
  height: 156px;
  object-fit: cover;
  background: #e8edf2;
}

.hot-item div {
  padding: 14px;
}

.hot-item span {
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
}

.hot-item h3 {
  display: -webkit-box;
  min-height: 40px;
  margin: 8px 0;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

.hot-item p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.hot-item ul,
.own-copy ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 13px;
}

.analysis-table {
  min-width: 680px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td a {
  color: #164ea8;
  font-weight: 700;
}

.video-title {
  max-width: 420px;
}

.video-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.growth-list {
  display: grid;
  gap: 10px;
}

.growth-list h3 {
  margin: 10px 0 0;
}

.growth-list p {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.growth-list b {
  color: var(--red);
}

.growth-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 18px;
  border: 1px dashed #b9c4cf;
  border-radius: 8px;
  background: #f9fbfc;
}

.empty-state p,
.insights p {
  color: var(--muted);
  line-height: 1.8;
}

.own-section {
  background: #fbfbf8;
}

.own-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.own-copy p {
  line-height: 1.8;
}

.score-grid {
  display: grid;
  gap: 12px;
}

.score {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.score span {
  color: var(--muted);
  font-size: 13px;
}

.score strong {
  float: right;
  font-size: 20px;
}

.score-track {
  clear: both;
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f4;
}

.score-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--green));
}

footer {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 42px) 32px;
  color: var(--muted);
  font-size: 12px;
}

.error {
  max-width: 720px;
  padding-top: 80px;
}

@media (max-width: 1100px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .section-head,
  .with-controls {
    display: block;
  }

  .status,
  .filters {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .definition-band,
  .split,
  .own-grid {
    grid-template-columns: 1fr;
  }

  .pipeline {
    justify-content: flex-start;
  }

  .hot-grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}
