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

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

body {
  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: 0.75rem;
  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: 0.8125rem;
  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: 32px 0 64px;
}

.hero {
  padding: 16px 0 8px;
}

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

/* 核心：流体字号 */
h1 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 1.4rem + 3vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 46ch;
  color: #334155;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
}

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

h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.5rem);
}

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

/* 1. 字号阶梯 */
.scale {
  margin-top: 12px;
}

.scale-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
}

.scale-row:first-child {
  border-top: 0;
}

.scale-tag {
  color: #2563eb;
  font-size: 0.6875rem;
  font-family: ui-monospace, Menlo, monospace;
}

.t-display { font-size: clamp(2rem, 1.4rem + 3vw, 4rem); line-height: 1.1; }
.t-h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem); line-height: 1.2; }
.t-h3 { font-size: clamp(1.125rem, 1rem + 0.8vw, 1.5rem); line-height: 1.3; }
.t-body { font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem); }
.t-small { font-size: 0.875rem; color: #64748b; }

/* 2. 容器字号 */
.hosts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.host {
  container-type: inline-size;
  max-width: 100%;
}

.w-240 { flex: 0 0 240px; }
.w-520 { flex: 0 0 520px; }

.mini-card {
  padding: clamp(0.75rem, 4cqi, 1.25rem);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.mini-tag {
  color: #2563eb;
  font-size: 0.6875rem;
  font-family: ui-monospace, Menlo, monospace;
}

.mini-card h3 {
  margin-top: 2px;
  font-size: clamp(1rem, 7cqi, 1.75rem);
  line-height: 1.2;
}

.mini-card p:not(.mini-tag) {
  margin-top: 4px;
  color: #64748b;
  font-size: clamp(0.8125rem, 3cqi, 0.9375rem);
}

/* 3. 行宽 */
.measure {
  max-width: 65ch;
  margin-top: 12px;
  padding: 14px;
  border-left: 3px solid #2563eb;
  background: #f8fafc;
}

.measure h3 {
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
}

.measure p {
  margin-top: 6px;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
}

/* 4. 固定与流体 */
.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.compare-card {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.compare-tag {
  color: #2563eb;
  font-size: 0.6875rem;
  font-family: ui-monospace, Menlo, monospace;
}

.compare-card h3 {
  margin-top: 4px;
  line-height: 1.2;
}

.compare-card p {
  margin-top: 6px;
  color: #64748b;
  font-size: 0.8125rem;
}

.fixed-title {
  font-size: 2rem;
}

.fluid-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

/* 5. 表格 */
.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

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

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

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 24px 36px;
  color: #64748b;
  font-size: 0.75rem;
}

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

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

  .panel {
    padding: 16px;
  }

  .scale-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

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