:root {
  --ink: #16324a;
  --ink-strong: #0c2b43;
  --muted: #6d8495;
  --line: #dce8f1;
  --line-strong: #c8dce9;
  --blue: #0c71b7;
  --blue-deep: #075a96;
  --cyan: #10b7c8;
  --sky: #72c6e8;
  --wash: #edf7fc;
  --paper: #ffffff;
  --page: #edf3f7;
  --shadow: 0 14px 36px rgba(24, 71, 103, 0.08);
  --radius: 18px;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--page); }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(circle at 15% 0%, rgba(38, 159, 217, 0.11), transparent 28rem),
    radial-gradient(circle at 90% 12%, rgba(16, 183, 200, 0.08), transparent 32rem),
    linear-gradient(180deg, #f6fafc 0%, var(--page) 38%, #eaf1f5 100%);
  min-height: 100vh;
}

button, input { font: inherit; }
button { color: inherit; }

.page-shell {
  width: min(1680px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(315px, 0.9fr) minmax(520px, 2.2fr) minmax(190px, 0.7fr);
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(205, 224, 235, 0.9);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(24, 71, 103, 0.06);
  backdrop-filter: blur(14px);
}

.date-control {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.date-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-right: 3px;
}

.icon-button {
  width: 30px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--blue-deep);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: 160ms ease;
}

.icon-button:hover { background: var(--wash); border-color: #9bc8e1; }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }

.date-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}

.date-picker svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  flex: none;
}

.date-picker input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-strong);
  font-weight: 700;
  font-size: 14px;
}

.title-block { min-width: 0; text-align: center; }

.eyebrow,
.section-kicker {
  display: block;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

h1 {
  margin: 5px 0 5px;
  color: var(--ink-strong);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.2;
  letter-spacing: .02em;
}

.title-block p {
  margin: 0;
  color: #8a5a4c;
  font-size: 12px;
  line-height: 1.5;
}

.update-chip {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  padding: 10px 13px;
  border: 1px solid #d9e8f0;
  border-radius: 12px;
  background: linear-gradient(135deg, #f7fbfd, #eef7fb);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22b57d;
  box-shadow: 0 0 0 5px rgba(34, 181, 125, 0.12);
  flex: none;
}

.update-chip div { display: flex; flex-direction: column; gap: 2px; }
.update-chip span:not(.status-dot) { color: var(--muted); font-size: 10px; }
.update-chip strong { font-size: 13px; color: var(--ink-strong); }

main { margin-top: 18px; }

.hero-grid,
.lower-grid {
  display: grid;
  grid-template-columns: minmax(350px, .88fr) minmax(800px, 2.12fr);
  gap: 18px;
  align-items: stretch;
}

.lower-grid { margin-top: 18px; align-items: start; }

.hero-right, .left-stack, .right-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), transparent 65%);
  opacity: .75;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 10px;
}

.card-heading.compact { padding-top: 18px; padding-bottom: 12px; }
.card-heading h2 { margin: 5px 0 0; font-size: 17px; color: var(--ink-strong); line-height: 1.35; }

.period-badge {
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e5f4fb, #eef9fb);
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.period-badge.muted { background: #f1f6f9; color: var(--muted); }
.date-note { color: var(--muted); font-size: 11px; white-space: nowrap; padding-top: 3px; }

.donut-card { min-height: 100%; display: flex; flex-direction: column; }

.donut-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 10px 22px 4px;
}

.donut-wrap {
  position: relative;
  width: min(255px, 74%);
  aspect-ratio: 1;
  filter: drop-shadow(0 12px 20px rgba(10, 109, 173, 0.12));
}

.donut {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#e5edf3 0 100%);
  display: grid;
  place-items: center;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0%, #f9fcfe 70%, #f4f9fc 100%);
  box-shadow: inset 0 0 0 1px rgba(217, 232, 240, .8);
}

.donut-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.donut-center span { color: var(--muted); font-size: 11px; }
.donut-center strong { color: var(--ink-strong); font-size: clamp(30px, 3vw, 42px); line-height: 1.05; letter-spacing: -.03em; }
.donut-center small { color: var(--muted); font-size: 10px; }

.donut-legend {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  margin-top: 22px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 10px;
  background: #f7fbfd;
  border: 1px solid #e8f1f6;
}

.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; min-width: 0; width: 100%; }
.legend-copy span { color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.legend-copy strong { color: var(--ink-strong); font-size: 13px; }
.legend-copy small { color: var(--muted); font-size: 10px; margin-left: 2px; }

.donut-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 15px 22px 20px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef8fc, #f8fcfd);
  color: var(--muted);
  font-size: 11px;
}
.donut-footnote strong { color: var(--blue-deep); }

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

.kpi {
  min-width: 0;
  padding: 14px 13px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 22px rgba(24, 71, 103, 0.04);
}

.kpi.market {
  border-color: #bdddec;
  background: linear-gradient(145deg, #eff9fd, #ffffff 70%);
}

.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.kpi-value { margin: 3px 0 1px; color: var(--ink-strong); font-size: clamp(21px, 2vw, 29px); line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.kpi-value small { margin-left: 2px; font-size: 10px; color: var(--muted); font-weight: 600; }
.kpi-sub { color: var(--blue-deep); font-size: 10px; white-space: nowrap; }
.kpi-sub.negative { color: #c65b4d; }
.kpi-sub.neutral { color: var(--muted); }

.matrix-card { flex: 1; }
.table-scroll { overflow-x: auto; padding: 0 18px 18px; }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid #d5e6ef;
  border-radius: 11px;
  background: #fff;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 9px 10px;
  border-right: 1px solid #e1edf3;
  border-bottom: 1px solid #e1edf3;
  text-align: right;
  white-space: nowrap;
}

.data-table tr:last-child td { border-bottom: 0; }
.data-table th:last-child, .data-table td:last-child { border-right: 0; }
.data-table th { background: linear-gradient(180deg, #eaf6fb, #e3f1f8); color: var(--ink-strong); font-size: 11px; font-weight: 800; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th:first-child { border-top-left-radius: 10px; }
.data-table th:last-child { border-top-right-radius: 10px; }
.data-table tbody tr:nth-child(even) td { background: #fbfdfe; }
.data-table tbody tr:hover td { background: #f2f9fd; }
.data-table td { color: var(--ink-strong); }
.data-table .carrier-name { font-weight: 800; color: var(--ink-strong); }
.data-table td.cell-total, .data-table th.cell-total { background: #f5fbfe; }
.data-table tr.total-row td { background: #e8f4fa !important; font-weight: 800; border-top: 1px solid #c9e1ed; }

.cell-value { display: block; font-size: 12px; line-height: 1.1; }
.cell-share { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1; }
.cell-empty { color: #9fb1bd; }

.th-main { display: block; }
.th-sub { display: block; margin-top: 2px; color: #7892a3; font-size: 9px; font-weight: 600; }

.carrier-card .data-table th:nth-child(2),
.carrier-card .data-table th:nth-child(3),
.carrier-card .data-table td:nth-child(2),
.carrier-card .data-table td:nth-child(3) { text-align: right; }

.trend-stats { display: flex; gap: 14px; color: var(--muted); font-size: 10px; padding-top: 3px; }
.trend-stats b { display: block; color: var(--ink-strong); font-size: 13px; text-align: right; }
.trend-chart { padding: 0 16px 14px; min-height: 235px; }
.trend-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.trend-grid { stroke: #e1ecf2; stroke-width: 1; }
.trend-axis { fill: #8aa0af; font-size: 9px; font-family: var(--font); }
.trend-line { fill: none; stroke: #0b83c7; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.trend-area { fill: url(#trendGradient); }
.trend-point { fill: #fff; stroke: #0b83c7; stroke-width: 2; cursor: pointer; transition: 140ms ease; }
.trend-point:hover, .trend-point.latest { fill: #0b83c7; stroke: #fff; stroke-width: 2.5; }
.trend-value { fill: var(--ink-strong); font-size: 9px; font-weight: 800; font-family: var(--font); }

.insight-card { min-height: 190px; }
.annual-layout { display: grid; grid-template-columns: minmax(170px, .8fr) 1.6fr; gap: 26px; align-items: center; padding: 8px 22px 22px; }
.annual-total { padding: 20px; border-radius: 14px; background: linear-gradient(145deg, #0c71b7, #0a9ab8); color: #fff; box-shadow: 0 12px 22px rgba(12, 113, 183, .18); }
.annual-total span { display: block; font-size: 11px; opacity: .8; }
.annual-total strong { display: inline-block; margin-top: 8px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.03em; }
.annual-total small { font-size: 10px; opacity: .78; margin-left: 4px; }
.annual-bars { display: flex; flex-direction: column; gap: 10px; }
.annual-row { display: grid; grid-template-columns: 88px 1fr 62px; align-items: center; gap: 10px; font-size: 11px; }
.annual-row span { color: var(--muted); }
.annual-row strong { color: var(--ink-strong); text-align: right; }
.annual-track { height: 7px; border-radius: 999px; background: #edf3f6; overflow: hidden; }
.annual-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 4px 0;
  color: #7f94a2;
  font-size: 10px;
}

.chart-tooltip {
  position: fixed;
  z-index: 99;
  display: none;
  pointer-events: none;
  padding: 8px 10px;
  border: 1px solid rgba(12, 113, 183, .18);
  border-radius: 9px;
  background: rgba(10, 37, 57, .93);
  color: #fff;
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 8px 22px rgba(5, 30, 48, .2);
}

.chart-tooltip.visible { display: block; }

@media (max-width: 1250px) {
  .page-shell { width: min(100% - 30px, 1200px); }
  .topbar { grid-template-columns: 300px 1fr 175px; gap: 14px; }
  .hero-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr; text-align: center; }
  .date-control, .update-chip { justify-self: center; }
  .title-block { order: -1; }
  .hero-grid, .lower-grid { grid-template-columns: 1fr; }
  .hero-grid { display: flex; flex-direction: column; }
  .donut-card { min-height: auto; }
  .donut-layout { flex-direction: row; gap: 18px; padding-bottom: 22px; }
  .donut-wrap { width: 230px; flex: none; }
  .donut-legend { margin-top: 0; }
  .donut-footnote { margin-top: 0; }
  .annual-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .page-shell { width: calc(100% - 20px); padding-top: 10px; }
  .topbar { padding: 16px 14px; border-radius: 16px; }
  .date-control { flex-wrap: wrap; justify-content: center; }
  .title-block p { font-size: 10px; }
  .card-heading { padding-left: 15px; padding-right: 15px; }
  .table-scroll { padding-left: 10px; padding-right: 10px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .donut-layout { flex-direction: column; }
  .donut-wrap { width: min(260px, 80vw); }
  .donut-legend { grid-template-columns: 1fr 1fr; }
  .trend-stats { display: none; }
  .annual-row { grid-template-columns: 72px 1fr 52px; }
  footer { flex-direction: column; gap: 5px; }
}

