:root {
  color-scheme: light;
  --bg: #f5f2e9;
  --paper: rgba(255, 253, 247, 0.86);
  --paper-strong: #fffdf7;
  --ink: #1a1712;
  --muted: #5d5548;
  --line: rgba(26, 23, 18, 0.12);
  --accent: #0c7c59;
  --accent-2: #d9572b;
  --accent-3: #123b5d;
  --shadow: 0 18px 60px rgba(18, 16, 12, 0.12);
  --radius: 28px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(217, 87, 43, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(12, 124, 89, 0.16), transparent 30%),
    linear-gradient(180deg, #f8f3e8 0%, #efe7d7 100%);
  color: var(--ink);
  font-family: var(--font-body);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero,
.panel {
  background: var(--paper);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 36px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.02;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  max-width: 12ch;
}

.lede,
.panel-header p,
.hint,
.microcopy,
.prose,
.status {
  color: var(--muted);
}

.lede {
  max-width: 64ch;
  margin: 18px 0 0;
  font-size: 1.06rem;
  line-height: 1.7;
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.hero-proof-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  padding: 16px 18px;
}

.hero-proof-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-proof-value {
  margin: 10px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.75rem);
}

.hero-actions,
.toolbar {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.toolbar-wrap {
  flex-wrap: wrap;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--ink);
  color: #fffdf7;
  box-shadow: 0 12px 24px rgba(26, 23, 18, 0.16);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(26, 23, 18, 0.2);
}

.microcopy {
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.panel {
  padding: 24px;
  margin-top: 20px;
}

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

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

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

.label {
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  border-radius: 24px;
  border: 1px solid rgba(18, 59, 93, 0.16);
  background: rgba(252, 250, 245, 0.9);
  color: var(--ink);
  padding: 18px 20px;
  font: 0.96rem/1.65 "SFMono-Regular", "Menlo", "Monaco", monospace;
}

.hint {
  margin: 14px 0 0;
  font-size: 0.9rem;
}

.status {
  min-height: 64px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  padding: 16px 18px;
  line-height: 1.6;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.metric-card {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  padding: 18px;
}

.metric-card-accent {
  background: linear-gradient(135deg, rgba(12, 124, 89, 0.18), rgba(18, 59, 93, 0.08));
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-value {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.comparison {
  margin-top: 16px;
  border-radius: 24px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  background: rgba(255, 255, 255, 0.7);
}

.comparison-row + .comparison-row {
  border-top: 1px solid var(--line);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.panel-header p {
  margin: 0;
  max-width: 46ch;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 24px;
  border: 1px solid rgba(18, 59, 93, 0.14);
  background: #fcfaf5;
}

.prose h2 {
  font-size: 1.6rem;
  margin-bottom: 14px;
}

.prose ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.prose li + li {
  margin-top: 10px;
}

code {
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 0.92em;
}

.article-shell {
  width: min(1040px, calc(100% - 32px));
}

.article-nav {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin: 0 4px 16px;
}

.article-nav a,
.article-body a {
  color: var(--accent-3);
  font-weight: 700;
  text-underline-offset: 0.18em;
}

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

.article-hero {
  padding: clamp(30px, 7vw, 74px);
  background:
    linear-gradient(115deg, rgba(217, 87, 43, 0.11), transparent 42%),
    linear-gradient(225deg, rgba(12, 124, 89, 0.12), transparent 45%);
  border-bottom: 1px solid var(--line);
}

.article-hero h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 8vw, 6.4rem);
}

html[lang="zh-CN"] .article-hero h1 {
  max-width: 10ch;
  line-height: 1.05;
}

.article-deck {
  max-width: 68ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.65;
}

.article-meta {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.article-proof > div {
  min-width: 0;
  padding: 22px clamp(20px, 5vw, 44px);
  background: rgba(255, 253, 247, 0.98);
}

.article-proof span,
.article-proof strong {
  display: block;
}

.article-proof span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-proof strong {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.15;
}

.article-body {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(36px, 7vw, 72px) clamp(22px, 6vw, 54px);
  font-size: 1.02rem;
  line-height: 1.8;
}

.article-body h2 {
  margin: 64px 0 18px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  scroll-margin-top: 24px;
}

.article-body h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin: 0 0 20px;
}

.article-body li + li {
  margin-top: 8px;
}

.article-lead {
  color: var(--accent-3);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.72rem);
  line-height: 1.55;
}

.article-callout {
  margin: 30px 0;
  padding: 22px 24px;
  border-left: 5px solid var(--accent);
  border-radius: 0 18px 18px 0;
  background: rgba(12, 124, 89, 0.09);
  color: #164837;
}

.article-table-wrap {
  width: calc(100% + 80px);
  margin: 32px -40px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.article-table-wrap table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.5;
}

.article-table-wrap th,
.article-table-wrap td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.article-table-wrap th {
  background: rgba(18, 59, 93, 0.08);
  color: var(--accent-3);
}

.article-table-wrap tr:last-child td {
  border-bottom: 0;
}

.article-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.article-decision-grid section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.article-decision-grid ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.article-body pre {
  margin: 26px 0;
  overflow-x: auto;
  padding: 20px 22px;
  border-radius: 20px;
  background: #171a18;
  color: #f7f4e9;
  line-height: 1.6;
}

.article-body pre code {
  font-size: 0.82rem;
}

.article-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 28px clamp(22px, 6vw, 54px) 36px;
  border-top: 1px solid var(--line);
  background: rgba(12, 124, 89, 0.07);
}

.article a:focus-visible,
.button:focus-visible,
button:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(12, 124, 89, 0.55);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .panel-grid,
  .panel-grid-tight,
  .panel-header,
  .hero-proof {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .hero-actions,
  .toolbar {
    flex-wrap: wrap;
  }

  textarea {
    min-height: 320px;
  }

  .article-proof,
  .article-decision-grid {
    grid-template-columns: 1fr;
  }

  .article-table-wrap {
    width: 100%;
    margin: 28px 0;
  }
}

@media (max-width: 560px) {
  .page,
  .article-shell {
    width: min(1040px, calc(100% - 20px));
    padding-top: 20px;
  }

  .article-nav {
    justify-content: space-between;
    gap: 10px;
    font-size: 0.9rem;
  }

  .article-hero h1 {
    font-size: clamp(2.65rem, 15vw, 4rem);
  }

  html[lang="zh-CN"] .article-hero h1 {
    max-width: none;
    font-size: 2.45rem;
    word-break: keep-all;
  }

  .article-proof > div {
    padding: 18px 20px;
  }

  .article-body h2 {
    margin-top: 48px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero,
  .panel,
  .metric-card,
  .comparison,
  canvas,
  .article,
  .article-proof > div {
    animation: rise-in 500ms ease both;
  }

  .metric-card:nth-child(2) { animation-delay: 60ms; }
  .metric-card:nth-child(3) { animation-delay: 110ms; }
  .metric-card:nth-child(4) { animation-delay: 160ms; }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
