:root {
  --brand: #165dff;
  --brand-dark: #044ae9;
  --brand-soft: #f0f5ff;
  --ink: #151515;
  --muted: #6c6f7d;
  --line: #e8ecff;
  --panel: #ffffff;
  --bg: #f8faff;
  --success: #14b8a6;
  --warning: #f59e0b;
  --shadow: 0 12px 34px rgba(22, 93, 255, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(22, 93, 255, 0.1), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 38%, #ffffff 100%);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", Arial, sans-serif;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  display: inline-block;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid #dfe6ff;
  border-radius: 6px;
  color: var(--brand-dark);
  background: #f7f9ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

pre {
  margin: 8px 0 0;
  padding: 14px 16px;
  overflow: auto;
  border-radius: 8px;
  color: #e8ecff;
  background: #111827;
}

pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--success));
  box-shadow: 0 0 18px rgba(22, 93, 255, 0.35);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(232, 236, 255, 0.85);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(22, 93, 255, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.top-actions a,
.menu-button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.top-actions a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.top-actions a:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.top-actions a.top-btn {
  color: #fff;
  font-weight: 800;
  border: 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.top-actions a.top-btn:hover {
  color: #fff;
  transform: translateY(-1px);
}

.top-actions a.top-btn-blue {
  background: #165dff;
}

.top-actions a.top-btn-blue:hover {
  background: #044ae9;
}

.top-actions a.top-btn-yellow {
  color: #3b2500;
  background: #facc15;
}

.top-actions a.top-btn-yellow:hover {
  color: #3b2500;
  background: #f59e0b;
}

.menu-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  padding: 0;
}

.menu-button span {
  width: 18px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--ink);
}

.sidebar-overlay {
  position: fixed;
  inset: 68px 0 0;
  z-index: 25;
  display: none;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(3px);
}

.sidebar-overlay.show {
  display: block;
}

.layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  max-width: 1440px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  overflow: auto;
  background: rgba(255, 255, 255, 0.74);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-head button {
  display: none;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.search-box {
  margin: 18px 0;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

.search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.1);
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.toc-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 999px;
  color: #fff;
  background: #165dff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.28);
}

.empty-search {
  display: none;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px dashed #cbd8ff;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  text-align: center;
}

.empty-search.show {
  display: block;
}

.toc a:hover,
.toc a.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.content {
  min-width: 0;
  padding: 36px 48px 80px;
}

.doc-section {
  scroll-margin-top: 92px;
  margin-bottom: 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 30px;
  align-items: stretch;
  min-height: 430px;
}

.hero-copy,
.hero-board,
.card,
.stack-card,
.feature-card,
.entity-card,
.deploy-card,
.command-panel,
.glossary,
.architecture-map,
.table-wrap,
.timeline,
.steps,
.concept-list,
.page-map,
.deploy-flow,
.server-layout,
.env-table,
.practice-grid,
.note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

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

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.06;
}

.hero-text {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.hero-metrics div {
  padding: 12px;
  border: 1px solid #e6ebff;
  border-radius: 8px;
  background: #fbfcff;
}

.hero-metrics strong,
.hero-metrics span {
  display: block;
}

.hero-metrics strong {
  color: var(--brand);
  font-size: 22px;
}

.hero-metrics span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.primary-link {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 10px 22px rgba(22, 93, 255, 0.25);
}

.secondary-link {
  color: var(--brand);
  border: 1px solid #cbd8ff;
  background: #fff;
}

.hero-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 22px;
}

.flow-card {
  position: relative;
  padding: 18px 18px 18px 66px;
  border: 1px solid #eef2ff;
  border-radius: 8px;
  background: #fff;
}

.flow-card span {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 800;
}

.flow-card.active span {
  color: #fff;
  background: var(--brand);
}

.flow-card strong {
  display: block;
  font-size: 15px;
}

.flow-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 48px 0 18px;
}

.section-index {
  min-width: 42px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 800;
}

.section-title h2 {
  margin: 0;
  font-size: 28px;
}

.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card,
.stack-card,
.feature-card,
.entity-card {
  padding: 22px;
}

.card h3,
.stack-card h3,
.feature-card h3,
.entity-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.card p,
.stack-card p,
.feature-card p,
.entity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.concept-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 16px;
  overflow: hidden;
}

.concept-list div {
  padding: 22px;
  border-right: 1px solid var(--line);
}

.concept-list div:last-child {
  border-right: 0;
}

.concept-list strong {
  color: var(--brand);
}

.concept-list p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.stack-grid,
.feature-list,
.entity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 800;
}

.stack-card h3 {
  margin-top: 14px;
}

.stack-card code {
  margin-top: 14px;
}

.architecture-map {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 22px;
}

.arch-layer {
  min-height: 210px;
  padding: 20px;
  border: 1px solid #eef2ff;
  border-radius: 8px;
  background: #fff;
}

.arch-layer h3 {
  margin: 0;
}

.arch-layer p {
  margin: 8px 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

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

.arch-items span {
  padding: 7px 10px;
  border-radius: 8px;
  color: #334155;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
}

.arch-arrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.note {
  margin-top: 16px;
  padding: 18px 20px;
  color: #334155;
  line-height: 1.8;
}

.note strong {
  color: var(--brand-dark);
}

.table-wrap {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-scroll-tip {
  display: none;
  position: sticky;
  left: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--brand);
  background: #f8faff;
  font-size: 12px;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  color: #334155;
  background: #f8faff;
  font-size: 13px;
}

td {
  color: var(--muted);
  line-height: 1.7;
}

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

.steps {
  margin: 0;
  padding: 10px 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 18px 28px 18px 82px;
  border-bottom: 1px solid var(--line);
  counter-increment: step;
}

.steps li:last-child {
  border-bottom: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 28px;
  top: 20px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

.steps span {
  display: block;
  font-weight: 800;
}

.steps p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* AI 能力设计：深色架构面板 */
#ai-design {
  position: relative;
  padding: 30px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 22px;
  overflow: hidden;
  color: #f8fafc;
  background:
    radial-gradient(circle at 18% 12%, rgba(20, 184, 166, 0.18), transparent 30%),
    radial-gradient(circle at 90% 18%, rgba(22, 93, 255, 0.18), transparent 34%),
    #09090f;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}

#ai-design::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

#ai-design > * {
  position: relative;
  z-index: 1;
}

#ai-design .section-title {
  align-items: center;
  margin: 0 0 22px;
  padding: 0 0 22px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.14);
}

#ai-design .section-index {
  color: #67e8f9;
  border: 1px solid rgba(103, 232, 249, 0.28);
  background: rgba(8, 145, 178, 0.18);
}

#ai-design .section-title h2 {
  color: #fff;
}

#ai-design .section-title p {
  max-width: 720px;
  color: rgba(226, 232, 240, 0.78);
}

#ai-design code {
  border-color: rgba(103, 232, 249, 0.22);
  color: #a5f3fc;
  background: rgba(15, 23, 42, 0.7);
}

.ai-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.ai-summary article,
.ai-grid article,
.agent-contract,
.ai-flows article,
.ai-tech-list div {
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.ai-summary article {
  padding: 22px;
}

.ai-summary article:first-child {
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.18), rgba(15, 23, 42, 0.72));
}

.ai-summary article:last-child {
  background: linear-gradient(180deg, rgba(22, 93, 255, 0.18), rgba(15, 23, 42, 0.72));
}

.ai-summary h3,
.ai-grid h3,
.agent-contract h3,
.ai-flows h3,
.ai-tech-list h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 18px;
}

.ai-summary p,
.ai-grid p,
.agent-contract p,
.ai-flows p,
.ai-tech-list p {
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1.82;
}

.agent-diagram {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 72px minmax(130px, 1fr) 92px minmax(130px, 1fr) 72px minmax(130px, 1fr);
  gap: 10px;
  align-items: stretch;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.5);
}

.agent-node {
  position: relative;
  min-height: 168px;
  padding: 20px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.8);
}

.agent-node::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: #38bdf8;
}

.agent-node.input::after {
  background: #14b8a6;
}

.agent-node.output::after {
  background: #f59e0b;
}

.agent-node span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(103, 232, 249, 0.24);
  border-radius: 999px;
  color: #67e8f9;
  background: rgba(8, 145, 178, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.agent-node strong {
  display: block;
  margin: 14px 0 8px;
  color: #fff;
  font-size: 17px;
  line-height: 1.35;
}

.agent-node p {
  margin: 0;
  color: rgba(226, 232, 240, 0.72);
  font-size: 13px;
  line-height: 1.7;
}

.agent-link {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px;
  border: 1px solid rgba(103, 232, 249, 0.16);
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(8, 47, 73, 0.55);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  line-height: 1.35;
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.ai-grid article {
  padding: 22px;
}

.agent-contract {
  margin-top: 18px;
  padding: 22px;
}

.agent-contract pre {
  margin-top: 16px;
  border: 1px solid rgba(103, 232, 249, 0.14);
  border-radius: 14px;
  color: #dbeafe;
  background: rgba(2, 6, 23, 0.78);
}

.ai-flows {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ai-flows article {
  padding: 18px;
}

.ai-flows span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(8, 145, 178, 0.18);
  font-size: 12px;
  font-weight: 800;
}

.ai-flows h3 {
  margin-top: 12px;
  font-size: 16px;
}

.ai-tech-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ai-tech-list div {
  position: relative;
  padding: 20px 18px 20px 44px;
}

.ai-tech-list div::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 25px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #14b8a6;
  box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.12);
}

#ai-design .note {
  border-color: rgba(245, 158, 11, 0.22);
  color: rgba(254, 243, 199, 0.92);
  background: rgba(120, 53, 15, 0.26);
  box-shadow: none;
}

#ai-design .note strong {
  color: #fde68a;
}

@media (max-width: 1120px) {
  .agent-diagram,
  .ai-flows,
  .ai-tech-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-link {
    display: none;
  }
}

@media (max-width: 820px) {
  #ai-design {
    padding: 20px;
    border-radius: 18px;
  }

  .ai-summary,
  .ai-grid,
  .agent-diagram,
  .ai-flows,
  .ai-tech-list {
    grid-template-columns: 1fr;
  }

  .agent-node {
    min-height: 0;
  }
}

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

.entity-card {
  min-height: 170px;
}

.command-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
}

.command-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #334155;
  background: #fff;
  box-shadow: 0 8px 22px rgba(22, 93, 255, 0.05);
  font-size: 14px;
}

.checklist input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.page-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.page-map article,
.deploy-card,
.server-layout article,
.practice-grid article {
  padding: 20px;
  border: 1px solid #eef2ff;
  border-radius: 8px;
  background: #fff;
}

.page-map article:first-child {
  grid-column: span 2;
}

.page-map span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 800;
}

.page-map h3,
.deploy-card h3,
.server-layout h3,
.practice-grid h3,
.env-table h3 {
  margin: 12px 0 10px;
  font-size: 18px;
}

.page-map p,
.deploy-card p,
.server-layout p,
.practice-grid p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.8;
}

.page-map code {
  margin: 4px 4px 0 0;
}

.deploy-grid,
.server-layout,
.practice-grid {
  display: grid;
  gap: 16px;
}

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

.deploy-card ul,
.server-layout ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.deploy-card li,
.server-layout li {
  margin: 6px 0;
}

.env-table {
  margin-top: 16px;
  padding: 20px;
}

.env-table h3 {
  margin-top: 0;
}

.deploy-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.deploy-flow div {
  position: relative;
  padding: 22px 18px 20px;
  border-right: 1px solid var(--line);
}

.deploy-flow div:last-child {
  border-right: 0;
}

.deploy-flow span {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

.deploy-flow h3 {
  margin: 14px 0 8px;
  font-size: 16px;
}

.deploy-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.server-layout {
  grid-template-columns: 1.1fr 0.9fr;
  margin-top: 16px;
  padding: 18px;
}

.server-layout pre {
  white-space: pre;
}

.practice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px;
}

.practice-grid article {
  min-height: 170px;
}

.timeline {
  padding: 8px 0;
}

.timeline div {
  position: relative;
  padding: 22px 28px 22px 112px;
  border-bottom: 1px solid var(--line);
}

.timeline div:last-child {
  border-bottom: 0;
}

.timeline span {
  position: absolute;
  left: 28px;
  top: 24px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.timeline h3 {
  margin: 0 0 8px;
}

.timeline p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.glossary {
  padding: 8px 20px;
}

details {
  border-bottom: 1px solid var(--line);
}

details:last-child {
  border-bottom: 0;
}

summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.8;
}

.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(22, 93, 255, 0.28);
  cursor: pointer;
}

.back-top.show {
  display: inline-flex;
}

.hidden-by-search {
  display: none;
}

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

  .content {
    padding: 30px;
  }

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

  .architecture-map,
  .stack-grid,
  .entity-grid,
  .practice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arch-arrow {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    background: var(--bg);
  }

  .top-actions {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 68px 0 0 auto;
    z-index: 30;
    width: min(320px, 88vw);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.12);
    background: #fff;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-head button {
    display: inline-flex;
  }

  .content {
    padding: 22px 16px 70px;
  }

  .doc-section {
    margin-bottom: 26px;
    scroll-margin-top: 84px;
  }

  .hero {
    gap: 16px;
    min-height: 0;
  }

  .hero-copy {
    padding: 28px;
  }

  .hero-text {
    font-size: 15px;
    line-height: 1.75;
  }

  .hero-actions a {
    flex: 1 1 150px;
  }

  .grid.two,
  .concept-list,
  .stack-grid,
  .feature-list,
  .entity-grid,
  .command-panel,
  .deploy-grid,
  .server-layout,
  .practice-grid,
  .architecture-map {
    grid-template-columns: 1fr;
  }

  .page-map {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .page-map article:first-child {
    grid-column: auto;
  }

  .deploy-flow {
    grid-template-columns: 1fr;
  }

  .deploy-flow div {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .deploy-flow div:last-child {
    border-bottom: 0;
  }

  .deploy-flow span {
    grid-row: span 2;
  }

  .deploy-flow h3 {
    margin-top: 0;
  }

  .deploy-flow p {
    grid-column: 2;
  }

  .env-table,
  .server-layout,
  .practice-grid {
    padding: 14px;
  }

  .architecture-map {
    gap: 10px;
    padding: 14px;
  }

  .arch-layer {
    min-height: 0;
  }

  .concept-list div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .concept-list div:last-child {
    border-bottom: 0;
  }

  .timeline div {
    padding-left: 28px;
  }

  .timeline span {
    position: static;
    display: block;
    margin-bottom: 8px;
  }

  .mobile-scroll-tip {
    display: block;
  }

  .steps li {
    padding: 18px 18px 18px 64px;
  }

  .steps li::before {
    left: 18px;
  }

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

@media (max-width: 520px) {
  .topbar {
    padding: 0 16px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .brand strong {
    max-width: 160px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand small {
    display: none;
  }

  .hero-copy,
  .hero-board,
  .card,
  .stack-card,
  .feature-card,
  .entity-card,
  .deploy-card,
  .page-map article,
  .server-layout article,
  .practice-grid article {
    padding: 18px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

  h1 {
    font-size: 32px;
    line-height: 1.12;
  }

  .section-title h2 {
    font-size: 24px;
  }

  .section-title {
    gap: 10px;
    margin-top: 34px;
  }

  .section-index {
    min-width: 36px;
    height: 30px;
    font-size: 13px;
  }

  .flow-card {
    padding-left: 58px;
  }

  .flow-card span {
    left: 14px;
  }

  th,
  td {
    padding: 13px 12px;
  }

  .back-top {
    right: 16px;
    bottom: 16px;
  }
}

/* ── Plus 专享章节蒙层 ── */
.plus-gated {
  overflow: hidden;
}
.plus-gated > *:not(.plus-gate-overlay) {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}
.plus-gate-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  border-radius: 12px;
}
.plus-gate-card {
  text-align: center;
  padding: 36px 28px;
  max-width: 360px;
}
.plus-gate-card svg {
  margin-bottom: 14px;
}
.plus-gate-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.plus-gate-desc {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  line-height: 1.6;
  margin-bottom: 18px;
}
.plus-gate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.plus-gate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(129,140,248,.35);
}
.toc-plus-badge {
  font-size: 9px;
  font-weight: 700;
  background: rgba(167,139,250,.18);
  color: #a78bfa;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
