:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --paper: #ffffff;
  --panel: #f0f4f7;
  --ink: #151c23;
  --muted: #637181;
  --dim: #8a96a3;
  --line: #dce4ec;
  --amber: #a86812;
  --amber-soft: #fff3dc;
  --teal: #146e65;
  --teal-soft: #e0f2ee;
  --blue: #2e5f9c;
  --rose: #a94f43;
  --code-bg: #111827;
  --code-ink: #e7edf5;
  --shadow: 0 16px 36px rgba(21, 28, 35, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.7;
  letter-spacing: 0;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

code,
pre,
kbd {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

code {
  padding: 0.12rem 0.32rem;
  border-radius: 5px;
  background: #e8eef2;
  color: #1f3d46;
  font-size: 0.92em;
}

pre {
  overflow-x: auto;
  margin: 1.1rem 0;
  padding: 1rem;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
  line-height: 1.55;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.92rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar {
  width: min(1320px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid #f0d7a4;
}

.brand small {
  display: block;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.78rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.topnav a {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: #344250;
  font-weight: 700;
  font-size: 0.92rem;
}

.topnav a:hover,
.topnav a.active {
  background: var(--teal-soft);
  color: var(--teal);
  text-decoration: none;
}

.layout {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 230px;
  gap: 28px;
  padding: 28px 0 72px;
}

.home-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 76px;
}

.sidebar,
.toc {
  position: sticky;
  top: 92px;
  align-self: start;
}

.sidebar-inner,
.toc-inner {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.nav-block {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.nav-block:last-child {
  border-bottom: 0;
}

.nav-title {
  margin: 0 0 8px;
  color: var(--dim);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-link,
.site-link {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #334150;
  font-size: 0.92rem;
  text-decoration: none;
}

.side-link:hover,
.side-link.active,
.site-link:hover {
  background: var(--panel);
  color: var(--teal);
  text-decoration: none;
}

.side-link span,
.site-link span {
  color: var(--muted);
  font-size: 0.78rem;
}

.article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.article-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 34px;
}

.article h1,
.article h2,
.article h3,
.article h4 {
  line-height: 1.25;
  letter-spacing: 0;
}

.article h1 {
  margin: 0 0 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.article h2 {
  margin: 2.3rem 0 1rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--amber);
  font-size: 1.55rem;
}

.article h3 {
  margin: 1.8rem 0 0.8rem;
  color: var(--teal);
  font-size: 1.22rem;
}

.article h4 {
  margin: 1.4rem 0 0.6rem;
  color: var(--blue);
  font-size: 1.06rem;
}

.article p {
  margin: 0.9rem 0;
}

.article table {
  width: 100%;
  margin: 1.2rem 0;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 0.92rem;
}

.article th,
.article td {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article th {
  background: #edf3f6;
  color: #253340;
  font-weight: 800;
}

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

.article blockquote {
  margin: 1.2rem 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: var(--teal-soft);
  color: #31504b;
}

.toc-inner {
  padding: 16px;
}

.toc a {
  display: block;
  padding: 7px 0;
  border-top: 1px solid #edf2f5;
  color: var(--muted);
  font-size: 0.86rem;
}

.toc a:first-of-type {
  border-top: 0;
}

.toc .level-3 {
  padding-left: 12px;
}

.hero {
  min-height: 440px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(330px, 0.96fr);
  gap: 28px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.06rem;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f6;
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.button:hover {
  text-decoration: none;
  filter: brightness(0.96);
}

.section {
  margin-top: 28px;
}

.section h2 {
  margin: 0 0 14px;
  font-size: 1.6rem;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.card {
  display: flex;
  min-width: 0;
  min-height: 170px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
}

.card:hover {
  border-color: #b9c9d6;
  transform: translateY(-1px);
  text-decoration: none;
  transition: 0.16s ease;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card small {
  margin-top: auto;
  padding-top: 14px;
  color: var(--teal);
  font-weight: 800;
}

.tag {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 12px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 900;
}

.tag.teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 30px;
}

.pager a {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
}

.pager a.next {
  text-align: right;
}

.footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 840px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .sidebar-inner {
    display: none;
  }

  .article-inner {
    padding: 24px 18px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
}
