:root {
  --brand: #14396a;
  --brand-dark: #0e2a4f;
  --brand-light: #e8eef7;
  --accent: #b8912f;
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --ink-mute: #6b7280;
  --line: #e3e7ee;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --radius: 10px;
  --maxw: 1180px;
  --fs-body: 15.5px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.9;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

/* ---------- 阅读进度条 ---------- */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 100; transition: width .1s linear;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 68px; display: flex; align-items: center; gap: 16px;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: linear-gradient(140deg, var(--brand), #2b5a96);
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.brand-sub { font-size: 12px; color: var(--ink-mute); line-height: 1.3; }
.header-nav { margin-left: auto; display: flex; gap: 4px; }
.header-nav a {
  padding: 8px 14px; border-radius: 8px; font-size: 14px;
  color: var(--ink-soft);
}
.header-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.header-nav a.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }

/* ---------- 页面容器 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.hero {
  background: linear-gradient(180deg, var(--brand-light), #fff);
  border-bottom: 1px solid var(--line);
  padding: 52px 0 40px;
}
.hero h1 {
  margin: 0 0 12px; font-size: 32px; line-height: 1.35;
  color: var(--brand-dark); letter-spacing: -.3px;
}
.hero p { margin: 0; color: var(--ink-soft); max-width: 760px; }

/* ---------- 文档布局 ---------- */
.layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: 52px; padding: 44px 0 72px; align-items: start;
}

.toc { position: sticky; top: 92px; font-size: 13.5px; }
.toc summary {
  cursor: pointer; font-weight: 600; color: var(--ink);
  padding: 8px 0; list-style: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc .toc-label {
  font-size: 12px; font-weight: 600; letter-spacing: .12em;
  color: var(--ink-mute); text-transform: uppercase;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc > ol > li { margin: 0; }
.toc a {
  display: block; padding: 5px 10px; border-left: 2px solid transparent;
  color: var(--ink-soft); line-height: 1.5; border-radius: 0 6px 6px 0;
}
.toc a:hover { background: var(--bg-soft); text-decoration: none; color: var(--brand); }
.toc a.active {
  border-left-color: var(--brand); background: var(--brand-light);
  color: var(--brand); font-weight: 600;
}

.doc-meta {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 30px;
  font-size: 13px; color: var(--ink-mute);
}
.doc-meta b { color: var(--ink-soft); font-weight: 600; }

.doc h2 {
  font-size: 21px; line-height: 1.5; color: var(--brand-dark);
  margin: 2.2em 0 .7em; padding-left: 12px;
  border-left: 4px solid var(--brand);
}
.doc h2:first-of-type { margin-top: .4em; }
.doc h3 {
  font-size: 16.5px; color: var(--ink); margin: 1.5em 0 .5em;
  font-weight: 600;
}
.doc p { margin: 0 0 .85em; text-align: justify; }
.doc ol, .doc ul { margin: 0 0 1em; padding-left: 1.6em; }
.doc li { margin-bottom: .35em; }
.doc li > ul, .doc li > ol { margin-top: .35em; }

.lead {
  font-size: 16px; color: var(--ink-soft); background: var(--bg-soft);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 28px;
  border: 1px solid var(--line);
}

/* 需替换的占位字段 */
.fill {
  background: #fff8e1; border-bottom: 1px dashed #d9b45a;
  color: #8a6516; padding: 0 3px; border-radius: 2px;
  font-style: normal;
}

.note {
  background: #fdfaf2; border: 1px solid #f0e2bd; border-radius: var(--radius);
  padding: 14px 18px; margin: 18px 0; font-size: 14px; color: #7a5c12;
}

table.tbl {
  width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14px;
}
table.tbl th, table.tbl td {
  border: 1px solid var(--line); padding: 10px 12px;
  text-align: left; vertical-align: top; line-height: 1.7;
}
table.tbl th { background: var(--bg-soft); font-weight: 600; color: var(--ink-soft); }

/* ---------- 首页卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; padding: 44px 0 20px; }
.card {
  border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 22px;
  background: #fff; transition: box-shadow .18s, transform .18s, border-color .18s;
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: 0 10px 28px rgba(20, 57, 106, .1); transform: translateY(-2px); border-color: #cdd8e8; }
.card-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--brand-light);
  color: var(--brand); display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.card p { margin: 0 0 18px; color: var(--ink-mute); font-size: 14px; line-height: 1.75; flex: 1; }
.card .go { font-size: 14px; font-weight: 600; color: var(--brand); }

.section-title { font-size: 22px; color: var(--brand-dark); margin: 46px 0 6px; }
.section-desc { color: var(--ink-mute); font-size: 14.5px; margin-bottom: 4px; }

/* 部署说明 */
.deploy {
  border: 1px dashed #c9d4e4; background: var(--bg-soft);
  border-radius: var(--radius); padding: 22px 26px; margin: 40px 0 0;
}
.deploy h4 { margin: 0 0 10px; font-size: 15px; color: var(--brand-dark); }
.deploy ol { margin: 0; padding-left: 1.4em; font-size: 14px; color: var(--ink-soft); }
.deploy li { margin-bottom: 6px; }
.deploy code {
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 6px; font-size: 12.5px; color: #8a6516;
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-soft);
  padding: 30px 0 40px; font-size: 13px; color: var(--ink-mute);
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; }
.footer-links a { color: var(--ink-soft); }

/* ---------- 回到顶部 ---------- */
#toTop {
  position: fixed; right: 26px; bottom: 30px; width: 42px; height: 42px;
  border-radius: 50%; border: 1px solid var(--line); background: #fff;
  color: var(--brand); font-size: 18px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(20, 57, 106, .14);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
#toTop.show { opacity: 1; visibility: visible; }
#toTop:hover { background: var(--brand); color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; }
  .toc { position: static; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 12px; }
  .toc .toc-label { display: none; }
  .toc summary { display: block; }
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 25px; }
  .brand-sub { display: none; }
  .header-nav a { padding: 7px 10px; font-size: 13px; }
}
@media (min-width: 961px) {
  .toc summary { display: none; }
  .toc .toc-label { display: block; }
}

@media print {
  .site-header, .toc, #toTop, #progress, .site-footer, .deploy { display: none !important; }
  body { font-size: 11.5pt; line-height: 1.75; color: #000; }
  .layout { display: block; padding: 0; }
  .hero { background: none; border: 0; padding: 0 0 16px; }
  .doc h2 { page-break-after: avoid; border-left-width: 3px; color: #000; }
  .doc h3 { page-break-after: avoid; }
  table.tbl th, table.tbl td { border-color: #999; }
  a { color: #000; text-decoration: none; }
}
