:root {
  --paper: #f4f0e7;
  --paper-light: #fbf9f4;
  --ink: #16233b;
  --muted: #6c7480;
  --blue: #184a86;
  --blue-deep: #0e315d;
  --gold: #b58a45;
  --line: rgba(22, 35, 59, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(22, 35, 59, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 35, 59, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 14% 10%, rgba(181, 138, 69, 0.15), transparent 30rem),
    var(--paper);
  background-size: 28px 28px, 28px 28px, auto, auto;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: inherit; }
.page-shell { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; text-decoration: none; letter-spacing: 0.03em; }
.wordmark-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--paper-light);
  background: var(--blue-deep);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 13px;
}
.hero {
  min-height: 630px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  align-items: center;
  gap: 72px;
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 22px; color: var(--gold); font-family: Georgia, serif; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow span { margin-right: 12px; color: var(--blue); font-weight: 700; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  max-width: 700px;
  margin: 0;
  color: var(--blue-deep);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(48px, 6.4vw, 88px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.08;
  overflow-wrap: normal;
  white-space: nowrap;
}
.hero-lead { max-width: 600px; margin: 30px 0 0; color: var(--muted); font-size: 18px; line-height: 1.9; }
.text-link { display: inline-flex; gap: 12px; margin-top: 36px; color: var(--blue); font-size: 14px; font-weight: 700; text-decoration: none; }
.text-link:hover { color: var(--blue-deep); }
.code-card {
  overflow: hidden;
  background: #11203a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(22, 35, 59, 0.18);
}
.code-card-top { height: 48px; padding: 0 17px; display: flex; align-items: center; gap: 7px; background: #0b172b; }
.code-card-top span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.23); }
.code-card-top small { margin-left: auto; color: rgba(255, 255, 255, 0.45); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { margin: 0; padding: 36px 32px 42px; color: #dfe8f6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 2.45; white-space: pre-wrap; }
.line-number { margin-right: 18px; color: #60718e; }

.topics, .about { padding: 110px 0; border-bottom: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 180px 1fr; align-items: end; margin-bottom: 48px; }
.section-heading p { margin: 0; color: var(--gold); font-family: Georgia, serif; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; }
.section-heading h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 36px; font-weight: 600; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.topic-grid article { min-height: 245px; padding: 28px; background: rgba(251, 249, 244, 0.72); border: 1px solid var(--line); }
.topic-index { color: var(--gold); font-family: Georgia, serif; font-size: 13px; }
.topic-grid h3 { margin: 52px 0 14px; font-family: "Songti SC", "STSong", serif; font-size: 23px; font-weight: 600; }
.topic-grid p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.9; }

.about-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
.about-copy > p { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 28px; line-height: 1.75; }
dl { margin: 0; border-top: 1px solid var(--line); }
dl div { padding: 18px 0; display: grid; grid-template-columns: 100px 1fr; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; font-size: 14px; }

footer { min-height: 94px; margin-top: 72px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--blue); }

@media (max-width: 860px) {
  .hero { min-height: auto; padding: 80px 0; grid-template-columns: 1fr; gap: 52px; }
  .code-card { max-width: 560px; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic-grid article { min-height: 190px; }
  .topic-grid h3 { margin-top: 32px; }
  .about-copy { grid-template-columns: 1fr; gap: 42px; }
}

@media (max-width: 560px) {
  .page-shell { width: min(100% - 28px, 1160px); }
  .site-header { min-height: 74px; }
  .wordmark > span:last-child { display: none; }
  .hero { padding: 66px 0; }
  h1 { font-size: clamp(36px, 11vw, 48px); }
  .hero-lead { font-size: 16px; }
  pre { padding: 28px 22px 32px; font-size: 12px; }
  .topics, .about { padding: 78px 0; }
  .section-heading { grid-template-columns: 1fr; gap: 10px; margin-bottom: 34px; }
  .section-heading h2 { font-size: 31px; }
  .about-copy > p { font-size: 23px; }
  footer { padding: 24px 0; align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
