:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #dbe3ef;
  --text: #152033;
  --muted: #5e6d82;
  --accent: #1263d6;
  --accent-soft: #e9f1ff;
  --code-bg: #f1f4f8;
  --shadow: 0 12px 36px rgba(21, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
  color: var(--text);
  font: 16px/1.7 "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(219, 227, 239, 0.8);
  background: rgba(247, 249, 252, 0.92);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.brand small {
  margin-left: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.topbar-left,
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-link {
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.menu-toggle:hover {
  background: #f8fbff;
}

.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.sidebar-backdrop {
  display: none;
}

.sidebar-title {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin: 4px 0;
}

.nav-link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: #f0f5ff;
  color: var(--accent);
  text-decoration: none;
}

.nav-link.current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.nav-children {
  list-style: none;
  margin: 4px 0 6px;
  padding: 0 0 0 14px;
  border-left: 1px solid #e4ebf5;
}

.nav-depth-1 > .nav-link {
  font-weight: 700;
  color: var(--text);
}

.nav-depth-2 > .nav-link {
  font-size: 15px;
}

.sidebar-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-bottom: 16px;
  border: 1px solid #d7e4f7;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  color: var(--text);
  font-weight: 700;
}

.sidebar-home:hover {
  text-decoration: none;
  border-color: #bfd4fa;
  background: #f8fbff;
}

.nav-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e8eef7;
}

.nav-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.nav-section.active .nav-section-title {
  color: var(--accent);
}

.nav-section-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.nav-section-copy {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.content-shell {
  min-width: 0;
}

.search-shell {
  position: relative;
  width: min(440px, 56vw);
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font: inherit;
  outline: none;
}

.search-input:focus {
  border-color: #a6c4f5;
  box-shadow: 0 0 0 4px rgba(18, 99, 214, 0.08);
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 400;
  overflow: auto;
  max-height: min(68vh, 560px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.search-results[hidden] {
  display: none;
}

.search-result-link {
  display: block;
  padding: 12px 13px;
  border-radius: 12px;
  color: inherit;
}

.search-result-link:hover {
  background: #f5f9ff;
  text-decoration: none;
}

.search-result-title {
  display: block;
  font-weight: 700;
  color: var(--text);
}

.search-result-meta,
.search-result-snippet,
.search-empty,
.search-loading {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.article-card {
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.breadcrumbs {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs span {
  color: var(--muted);
}

.breadcrumbs b {
  color: var(--text);
}

.article-guide {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid #dfe8f5;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(18, 99, 214, 0.08), transparent 34%),
    linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.guide-kicker,
.flow-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 99, 214, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.guide-title {
  margin: 12px 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.guide-summary {
  margin: 0;
  color: #3d4d62;
}

.guide-card-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-link {
  display: block;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.guide-link:hover {
  text-decoration: none;
  border-color: #bfd4fa;
  background: #f8fbff;
}

.guide-link-label {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.guide-link strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

.guide-link span:last-child {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.article-title {
  margin: 0 0 20px;
  font-size: 34px;
  line-height: 1.2;
}

.article-content {
  min-width: 0;
}

.article-content :first-child {
  margin-top: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 1.5em 0 0.7em;
  line-height: 1.3;
  color: var(--text);
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content table,
.article-content pre {
  margin: 0 0 1em;
}

.article-content ul,
.article-content ol {
  padding-left: 1.35em;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.article-content td,
.article-content th {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.article-content th {
  background: #f2f6fb;
  text-align: left;
}

.article-content blockquote {
  margin-left: 0;
  padding: 14px 16px;
  border-left: 4px solid #c5d6f7;
  background: #f7faff;
  border-radius: 10px;
  color: #304259;
}

.article-content code {
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: var(--code-bg);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.92em;
}

.article-content pre {
  overflow: auto;
  padding: 14px 16px;
  border-radius: 14px;
  background: #0e1525;
  color: #edf3ff;
}

.article-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.tech-lede {
  padding: 20px 22px;
  border: 1px solid #bfd4fa;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(18, 99, 214, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  color: #21324a;
  font-size: 18px;
  line-height: 1.7;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}

.tech-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.tech-card strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.tech-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.tech-warning {
  padding: 18px 20px;
  border: 1px solid #ffd7a8;
  border-radius: 18px;
  background: #fff8ee;
  color: #5e3b12;
}

.friendly-lede {
  margin-bottom: 22px;
  padding: 20px 22px;
  border: 1px solid #cfe0f7;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(18, 99, 214, 0.09), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.friendly-lede-label {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 99, 214, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.friendly-lede p {
  margin: 0;
  color: #263852;
  font-size: 18px;
  line-height: 1.75;
}

.friendly-section {
  margin: 22px 0;
}

.friendly-section h2 {
  margin-bottom: 10px;
}

.friendly-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.friendly-list li {
  position: relative;
  padding: 12px 14px 12px 40px;
  border: 1px solid #e3ebf6;
  border-radius: 14px;
  background: #fff;
}

.friendly-list li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 20px;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
}

.friendly-warning {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid #ffd7a8;
  border-radius: 18px;
  background: #fff8ee;
  color: #5e3b12;
}

.source-details {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.source-details summary {
  cursor: pointer;
  padding: 16px 18px;
  color: var(--text);
  font-weight: 700;
}

.source-details-content {
  padding: 0 18px 18px;
  border-top: 1px solid #edf2f8;
}

.pager {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pager-link {
  display: block;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
}

.pager-link:hover {
  border-color: #bfd4fa;
  background: #f8fbff;
  text-decoration: none;
}

.pager-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.pager-title {
  display: block;
  font-weight: 700;
}

.footer-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.home-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.hero-card,
.home-section {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: visible;
  padding: 34px 34px 28px;
  background:
    radial-gradient(circle at top right, rgba(18, 99, 214, 0.13), transparent 34%),
    radial-gradient(circle at left bottom, rgba(24, 160, 120, 0.09), transparent 28%),
    rgba(255, 255, 255, 0.97);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -40px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: rgba(18, 99, 214, 0.06);
  filter: blur(4px);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(18, 99, 214, 0.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.hero-title {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 16px 0 10px;
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-summary {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  color: #37475e;
  font-size: 17px;
}

.hero-search {
  position: relative;
  z-index: 80;
  width: min(760px, 100%);
  margin-top: 22px;
}

.hero-search .search-shell {
  width: 100%;
}

.hero-search .search-input {
  height: 52px;
  padding: 0 18px;
  font-size: 16px;
}

.hero-actions {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-button,
.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.hero-button.primary {
  border-color: #0e58c3;
  background: #1263d6;
  color: #fff;
}

.hero-button:hover,
.hero-link:hover {
  text-decoration: none;
}

.hero-stats {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-stat {
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: rgba(247, 250, 255, 0.96);
  border: 1px solid #dde7f6;
}

.hero-stat strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.hero-stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.home-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 20px;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.flow-card {
  display: block;
  min-height: 214px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,251,255,1) 100%);
}

.flow-card:hover {
  text-decoration: none;
  border-color: #bfd4fa;
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(241,247,255,1) 100%);
}

.flow-card strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 18px;
}

.flow-card p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.flow-links,
.topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-links span,
.topic-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2558a6;
  font-size: 12px;
  font-weight: 700;
}

.topic-links {
  margin-top: 10px;
}

.topic-links a:hover {
  text-decoration: none;
  background: #e4efff;
}

.home-section {
  padding: 24px;
}

.section-title {
  margin: 0 0 6px;
  font-size: 22px;
}

.section-subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.quick-card:hover {
  background: #f8fbff;
  border-color: #bfd4fa;
  text-decoration: none;
}

.quick-card strong,
.category-card strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.quick-card span,
.category-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.category-card {
  display: block;
  min-height: 146px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,251,255,1) 100%);
}

.category-card:hover {
  text-decoration: none;
  border-color: #bfd4fa;
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(241,247,255,1) 100%);
}

.category-tag {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.topic-list {
  display: grid;
  gap: 12px;
}

.topic-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid #ebf0f7;
}

.topic-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.topic-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.topic-body a {
  font-weight: 700;
  color: var(--text);
}

.topic-body p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.home-note {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid var(--line);
  color: #3b4b61;
}

.search-hit {
  padding: 0 0.16em;
  border-radius: 4px;
  background: #fff1a8;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .flow-grid,
  .guide-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .search-shell {
    width: min(380px, 48vw);
  }

  .js-ready .menu-toggle {
    display: inline-flex;
  }

  .js-ready .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(15, 23, 42, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .js-ready .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: min(86vw, 320px);
    height: 100vh;
    max-height: none;
    border-radius: 0 20px 20px 0;
    transform: translateX(-104%);
    transition: transform 0.18s ease;
  }

  .js-ready body.sidebar-open {
    overflow: hidden;
  }

  .js-ready body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .js-ready body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 640px) {
  .topbar-inner,
  .layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .article-card {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .home-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-card,
  .home-section {
    padding: 20px 18px;
    border-radius: 20px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-stats,
  .quick-grid,
  .category-grid,
  .flow-grid,
  .guide-card-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner,
  .topbar-tools {
    flex-wrap: wrap;
  }

  .topbar-tools {
    width: 100%;
  }

  .search-shell {
    width: 100%;
  }

  .article-title {
    font-size: 28px;
  }

  .pager {
    grid-template-columns: 1fr;
  }
}
