*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
p,
ul,
pre {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: #f8fafc;
  color: #0f172a;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-header nav a {
  color: #64748b;
  font-size: 13px;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: #2563eb;
}

.page {
  width: min(100% - 40px, 920px);
  margin: 0 auto;
  padding: 36px 0 60px;
}

.eyebrow {
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.18em;
}

h1 {
  margin: 6px 0 10px;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
}

.lead {
  color: #334155;
  font-size: 16px;
}

.panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
}

h2 {
  font-size: 18px;
}

.panel > p {
  margin-top: 6px;
  color: #334155;
  font-size: 13px;
}

/* 1. Flex vs Grid 对照 */
.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.pane {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  min-width: 0;
}

.pane h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.flex-dot { background: #7c3aed; }
.grid-dot { background: #2563eb; }

.cards {
  gap: 8px;
  margin-top: 10px;
}

.flex-cards {
  display: flex;
  flex-wrap: wrap;
}

.flex-cards .card {
  flex: 1 1 96px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.card {
  display: grid;
  place-items: center;
  min-height: 56px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 12px;
  font-family: ui-monospace, Menlo, monospace;
}

.pane pre {
  margin-top: 10px;
  padding: 10px;
  overflow-x: auto;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 10.5px;
  line-height: 1.55;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* 2. 仪表盘 */
.dash {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.stat,
.chart,
.list,
.table-wrap {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  min-width: 0;
}

.stat { grid-column: span 3; }
.chart { grid-column: span 8; }
.list { grid-column: span 4; }
.table-wrap { grid-column: span 12; }

.stat-label,
.chart-note {
  color: #64748b;
  font-size: 11px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-trend {
  color: #047857;
  font-size: 11px;
}

.stat-trend.down {
  color: #be123c;
}

.chart h3,
.list h3,
.table-wrap h3 {
  font-size: 13px;
  margin-bottom: 8px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 8px;
}

.bars span {
  flex: 1 1 0;
  height: var(--h);
  border-radius: 4px 4px 0 0;
  background: #2563eb;
}

.chart-note {
  margin-top: 8px;
}

.list ul {
  list-style: none;
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
}

.list li:first-child {
  border-top: 0;
}

.list b {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #64748b;
  font-weight: 600;
}

.decide-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.decide td:first-child {
  white-space: normal;
  min-width: 220px;
}

.site-footer {
  padding: 20px 24px 36px;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 860px) {
  .dash {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .stat { grid-column: span 3; }
  .chart { grid-column: span 6; }
  .list { grid-column: span 6; }
  .table-wrap { grid-column: span 6; }
}

@media (max-width: 620px) {
  .site-header {
    padding: 12px 18px;
  }

  .page {
    width: min(100% - 28px, 920px);
    padding: 24px 0 44px;
  }

  .panel {
    padding: 16px;
  }

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

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

  .dash > * {
    grid-column: 1 / -1;
  }
}
