:root {
  --paper: #ffffff;
  --page: #f5f6f7;
  --ink: #172026;
  --muted: #61707b;
  --line: #d9e0e5;
  --teal: #006d77;
  --red: #b23a2f;
  --gold: #a46f00;
  --blue: #26547c;
  --shadow: 0 18px 48px rgba(21, 32, 38, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0, 109, 119, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0, var(--page) 460px);
  font-family: "Iowan Old Style", "Noto Serif SC", "Songti SC", Georgia, serif;
  line-height: 1.72;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--red);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(217, 224, 229, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
  min-width: 184px;
}

.brand strong {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

.brand span {
  color: var(--muted);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.top-nav a,
.format-link,
.doc-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 13px;
  line-height: 1;
  padding: 9px 11px;
  text-decoration: none;
}

.top-nav a:hover,
.format-link:hover,
.doc-chip:hover {
  border-color: rgba(0, 109, 119, 0.5);
  color: var(--teal);
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 22px 28px;
}

.eyebrow {
  color: var(--teal);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  line-height: 1.28;
}

h1 {
  max-width: 920px;
  font-size: clamp(30px, 5vw, 58px);
  margin: 0 0 16px;
}

.hero p {
  max-width: 780px;
  color: #40505a;
  font-size: 18px;
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 22px 72px;
}

.doc-card {
  position: relative;
  display: block;
  min-height: 275px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.doc-card:hover {
  border-color: rgba(0, 109, 119, 0.45);
  box-shadow: 0 22px 54px rgba(21, 32, 38, 0.14);
  color: var(--ink);
  transform: translateY(-2px);
}

.doc-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  border-radius: 8px 8px 0 0;
  background: var(--teal);
}

.doc-card.red::before {
  background: var(--red);
}

.doc-card.gold::before {
  background: var(--gold);
}

.doc-card .kicker {
  color: var(--muted);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 700;
  margin: 10px 0 18px;
  text-transform: uppercase;
}

.doc-card h2 {
  font-size: 22px;
  margin: 0 0 12px;
}

.doc-card p {
  color: #4c5d67;
  margin: 0 0 20px;
}

.doc-cta {
  color: var(--teal);
  display: inline-block;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
}

.card-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reading-layout {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: 34px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 26px 22px 72px;
}

.side-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 16px;
}

.side-panel h2 {
  font-size: 15px;
  margin: 0 0 10px;
}

.side-panel ol {
  margin: 0 0 16px;
  padding-left: 20px;
}

.side-panel li {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0;
}

#TOC {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

#TOC ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#TOC li {
  margin: 7px 0;
}

#TOC ul ul {
  border-left: 1px solid var(--line);
  margin: 7px 0 8px 8px;
  padding-left: 12px;
}

#TOC a {
  color: #40505a;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 13px;
  text-decoration: none;
}

#TOC a:hover {
  color: var(--teal);
}

.article-shell {
  min-width: 0;
}

.article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 54px);
}

.article > #TOC {
  display: none;
}

.article h1 {
  font-size: clamp(26px, 4vw, 44px);
  margin-top: 0;
}

.article h2 {
  border-top: 1px solid var(--line);
  font-size: 26px;
  margin: 42px 0 14px;
  padding-top: 24px;
}

.article h3 {
  color: #25333b;
  font-size: 20px;
  margin: 28px 0 10px;
}

.article p,
.article li {
  font-size: 16px;
}

.article blockquote {
  border-left: 4px solid var(--teal);
  color: #40505a;
  margin: 22px 0;
  padding: 2px 0 2px 18px;
}

.article table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 22px 0;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 14px;
}

.article th,
.article td {
  border: 1px solid var(--line);
  min-width: 120px;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.article th {
  background: #eef3f5;
  color: #1d2c34;
}

.article code {
  border-radius: 6px;
  background: #eef3f5;
  color: #24323a;
  padding: 2px 5px;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.article-footer a {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  text-decoration: none;
}

.article-footer a:last-child {
  text-align: right;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 13px;
  padding: 24px 22px 42px;
  text-align: center;
}

@media (max-width: 940px) {
  .doc-grid,
  .reading-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 34px;
  }

  .article-footer {
    flex-direction: column;
  }

  .article-footer a:last-child {
    text-align: left;
  }
}
