:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef3f4;
  --ink: #172026;
  --muted: #60707a;
  --line: #dce5e8;
  --accent: #2563eb;
  --accent-soft: #e7efff;
  --shadow: 0 18px 50px rgba(23, 32, 38, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(231, 239, 255, 0.9), rgba(245, 247, 248, 0) 310px),
    var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.shell,
.article-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.hero,
.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 28px 0 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

.hero h1,
.article-hero h1 {
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
}

.hero-copy,
.article-hero p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 118px);
  gap: 10px;
}

.hero-stats div,
.hero-summary {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(23, 32, 38, 0.06);
}

.hero-stats span {
  display: block;
  font-size: 22px;
  font-weight: 850;
}

.hero-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar,
.board,
.article-card,
.toc-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  margin-bottom: 18px;
}

.search {
  display: grid;
  gap: 6px;
}

.search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.search input,
.article-nav select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 9px 12px;
  outline: none;
}

.search input:focus,
.article-nav select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

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

.chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  padding: 7px 13px;
  cursor: pointer;
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.board {
  padding: 20px;
}

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

.section-head h2 {
  font-size: 28px;
}

.result-count {
  color: var(--muted);
  font-weight: 700;
}

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

.doc-card {
  min-height: 330px;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 16px;
  padding: 20px;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.doc-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 20px 42px rgba(23, 32, 38, 0.12);
}

.card-top,
.card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.doc-icon {
  min-width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  font-weight: 850;
}

.doc-date,
.badge,
.read-more {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.badge {
  color: var(--accent);
}

.doc-card h3 {
  font-size: 22px;
  line-height: 1.25;
}

.doc-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.outcomes {
  display: grid;
  gap: 8px;
}

.outcomes span,
.hero-summary span,
.stack-row span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, white);
  color: color-mix(in srgb, var(--accent) 72%, #172026);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 750;
}

.empty {
  grid-column: 1 / -1;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
}

.article-hero {
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-summary {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.hero-summary strong {
  font-size: 14px;
}

.article-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.toc-panel {
  position: sticky;
  top: 18px;
  padding: 16px;
}

.toc-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

#toc {
  display: grid;
  gap: 8px;
}

#toc a {
  color: var(--muted);
  text-decoration: none;
  line-height: 1.45;
  font-size: 14px;
}

#toc a.h3 {
  padding-left: 14px;
  font-size: 13px;
}

.article-card {
  padding: clamp(22px, 4vw, 42px);
}

.article-content {
  max-width: 820px;
}

.article-content h1 {
  display: none;
}

.article-content h2 {
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 28px;
}

.article-content h3 {
  margin-top: 26px;
  font-size: 21px;
}

.article-content p,
.article-content li,
.article-content blockquote {
  color: #334149;
  line-height: 1.85;
}

.article-content p {
  margin: 14px 0;
}

.article-content ul,
.article-content ol {
  padding-left: 24px;
}

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

.article-content code {
  border: 1px solid #d6e0e4;
  border-radius: 5px;
  background: #f2f6f7;
  padding: 2px 5px;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.92em;
}

.code-block {
  margin: 18px 0;
  border: 1px solid #cfd9de;
  border-radius: 8px;
  background: #101820;
  overflow: hidden;
}

.code-block figcaption {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #aebbc4;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 12px;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}

.code-block code {
  border: 0;
  background: transparent;
  color: #eef6ff;
  padding: 0;
  font-size: 13px;
  line-height: 1.65;
}

blockquote {
  margin: 18px 0;
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, white);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
}

.table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

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

th {
  background: #f0f5f7;
  font-size: 13px;
  color: #334149;
}

tr:last-child td {
  border-bottom: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 26px 0;
}

@media (max-width: 960px) {
  .hero,
  .article-hero,
  .toolbar,
  .article-layout {
    grid-template-columns: 1fr;
  }

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

  .toc-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .shell,
  .article-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
  }

  .article-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
