/* ==========================================================================
   穹光 TR-069 ACS 综合管理平台 · 产品文档站
   纯手写 CSS，无任何外部依赖（不引 CDN / 字体），保证内网与公网都能秒开
   ========================================================================== */

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #172033;
  --ink-2: #3d4a63;
  --muted: #6b7891;
  --line: #e4e9f2;
  --line-2: #eef2f8;
  --brand: #1f6feb;
  --brand-ink: #0d4bb8;
  --brand-soft: #e8f0ff;
  --accent: #00b3a4;
  --warn: #d9822b;
  --danger: #d64545;
  --dark: #0a1730;
  --dark-2: #10224a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 8px 24px rgba(16, 32, 64, .06);
  --shadow-lg: 0 12px 40px rgba(10, 23, 48, .14);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); text-decoration: underline; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 22px; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 23, 48, .96);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-in {
  display: flex; align-items: center; gap: 26px;
  height: 62px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .2px;
  white-space: nowrap;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #fff;
}
.brand small { display: block; font-weight: 400; font-size: 11px; color: #8fa3c8; letter-spacing: 0; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  color: #c3d0e6; font-size: 14.5px; padding: 8px 13px; border-radius: 8px;
  white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .09); text-decoration: none; }
.nav-links a.on { color: #fff; background: rgba(31, 111, 235, .32); }

.nav-toggle {
  display: none; margin-left: auto;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; border-radius: 8px; width: 40px; height: 34px; cursor: pointer; font-size: 17px;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 62px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #0a1730; padding: 10px 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 380px at 12% -8%, rgba(31, 111, 235, .55), transparent 62%),
    radial-gradient(900px 340px at 92% 8%, rgba(0, 179, 164, .34), transparent 60%),
    linear-gradient(180deg, #0a1730 0%, #10224a 100%);
  color: #fff;
  padding: 74px 0 82px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), transparent 78%);
}
.hero .wrap { position: relative; z-index: 2; }
.hero h1 {
  margin: 0 0 16px; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.22;
  letter-spacing: -.4px; font-weight: 800;
}
.hero h1 em { font-style: normal; color: #6fd8cd; }
.hero p.lead {
  margin: 0 0 26px; max-width: 760px;
  font-size: clamp(15px, 1.7vw, 17.5px); color: #c8d6ee; line-height: 1.8;
}
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: .16s;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 22px rgba(31, 111, 235, .34); }
.btn-primary:hover { background: #2b7cf7; color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .26); }
.btn-ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; text-decoration: none; }

.hero-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px;
  margin-top: 6px;
}
.fact {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 12px; padding: 14px 16px;
}
.fact b { display: block; font-size: 21px; font-weight: 800; color: #fff; letter-spacing: -.3px; }
.fact span { font-size: 12.5px; color: #9fb2d4; }

/* ---------- 通用区块 ---------- */
.section { padding: 62px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { margin-bottom: 30px; }
.sec-head .kicker {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--brand); text-transform: uppercase; margin-bottom: 8px;
}
.sec-head h2 { margin: 0 0 10px; font-size: clamp(21px, 2.6vw, 28px); letter-spacing: -.3px; }
.sec-head p { margin: 0; color: var(--muted); max-width: 820px; }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 16.5px; display: flex; align-items: center; gap: 9px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.card ul { margin: 10px 0 0; padding-left: 19px; color: var(--ink-2); font-size: 14.5px; }
.card ul li { margin: 4px 0; }
.icon {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
}

/* ---------- 徽标 / 标签 ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag {
  display: inline-block; padding: 3.5px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #d3e2ff;
}
.tag.g { background: #e5f7f4; color: #0d7a6f; border-color: #c6ece6; }
.tag.o { background: #fdf1e2; color: #9c5b13; border-color: #f6e0c4; }
.tag.r { background: #fdeaea; color: #a72e2e; border-color: #f6d0d0; }
.tag.n { background: #eef1f7; color: #4a5670; border-color: #e0e5ef; }

/* ---------- 永久免费额度 ---------- */
.free-card .tag { margin-bottom: 10px; }
.free-num {
  margin: 6px 0 4px; font-size: 32px; font-weight: 800;
  letter-spacing: -.6px; color: var(--brand); line-height: 1.15;
}
.free-num small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }

/* ---------- 架构图 ---------- */
.arch {
  background: var(--dark); border-radius: var(--radius); padding: 26px 22px;
  color: #d7e2f5; font-family: var(--mono); font-size: 13px; line-height: 1.85;
  overflow-x: auto; border: 1px solid #1d3160;
}
.arch .layer { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.arch .box {
  border: 1px solid #2b4a86; background: #12244c; border-radius: 9px;
  padding: 8px 14px; white-space: nowrap; color: #cfe0ff;
}
.arch .box.hi { border-color: #2b7cf7; background: #16305f; color: #fff; box-shadow: 0 0 0 3px rgba(31, 111, 235, .16); }
.arch .box.acc { border-color: #0d7a6f; background: #0f3733; color: #a7efe6; }
.arch .arrow { color: #5d7db4; }
.arch .note { color: #8ea6cd; font-size: 12px; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
thead th {
  background: #f7f9fd; text-align: left; font-weight: 700; color: var(--ink-2);
  padding: 12px 15px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 11px 15px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcff; }
td code, p code, li code, th code {
  font-family: var(--mono); font-size: 12.8px;
  background: #f1f4f9; border: 1px solid #e2e8f2; border-radius: 5px;
  padding: 1px 5px; color: #234; white-space: nowrap;
}

/* ---------- 步骤 ---------- */
.steps { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps > li {
  position: relative; padding: 0 0 20px 46px; counter-increment: s;
  border-left: 2px solid var(--line); margin-left: 13px;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(s); position: absolute; left: -14px; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 4px #fff;
}
.steps > li > b { display: block; margin-bottom: 3px; font-size: 15.5px; }
.steps > li > p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- 代码块 ---------- */
pre {
  margin: 12px 0; padding: 15px 17px; overflow-x: auto;
  background: #0f1b34; color: #d6e3f8; border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  border: 1px solid #1e3057;
}
pre code { background: none; border: 0; padding: 0; color: inherit; white-space: pre; }

/* ---------- 提示条 ---------- */
.note {
  border-left: 4px solid var(--brand); background: var(--brand-soft);
  padding: 13px 17px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0; font-size: 14.5px; color: #17335f;
}
.note.warn { border-color: var(--warn); background: #fdf6ec; color: #7a4a11; }
.note.danger { border-color: var(--danger); background: #fdeeee; color: #7d2626; }
.note b { font-weight: 700; }

/* ---------- 手册布局（侧边目录） ---------- */
.doc { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 34px; align-items: start; }
.toc {
  position: sticky; top: 84px; align-self: start;
  max-height: calc(100vh - 108px); overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 10px 16px; box-shadow: var(--shadow); font-size: 14px;
}
.toc h4 { margin: 4px 10px 10px; font-size: 12.5px; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc ol > li { counter-increment: t; }
.toc a {
  display: block; padding: 7px 10px 7px 12px; border-radius: 8px; color: var(--ink-2);
  font-size: 14px; border-left: 3px solid transparent;
}
.toc a::before { content: counter(t) ". "; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a:hover { background: #f4f7fc; text-decoration: none; }
.toc a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; border-left-color: var(--brand); }
.toc a.sub { padding-left: 30px; font-size: 13.4px; }
.toc a.sub::before { content: ""; }

@media (max-width: 980px) {
  /* 必须写 minmax(0, 1fr)：裸 1fr 的最小尺寸是 auto，宽图会把栅格列顶宽导致整页横向溢出 */
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; }
}

/* ---------- 文档正文 ---------- */
.doc-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 30px 34px; }
.doc-body section { padding-top: 26px; border-top: 1px solid var(--line-2); margin-top: 8px; }
.doc-body section:first-child { border-top: 0; }
.doc-body h2 { font-size: 22px; margin: 20px 0 12px; scroll-margin-top: 84px; }
.doc-body h3 { font-size: 17px; margin: 24px 0 8px; color: var(--ink); scroll-margin-top: 84px; }
.doc-body h4 { font-size: 15px; margin: 18px 0 6px; color: var(--ink-2); }
.doc-body p { margin: 10px 0; }
.doc-body ul, .doc-body ol { padding-left: 22px; }
.doc-body li { margin: 5px 0; }
.kv { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 6px 14px; font-size: 14.5px; margin: 12px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- 页脚 ---------- */
.foot { background: var(--dark); color: #94a8c8; padding: 34px 0 30px; font-size: 13.6px; }
.foot a { color: #b9cae6; }
.foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 22px; }
.foot h5 { color: #fff; font-size: 13.5px; margin: 0 0 9px; letter-spacing: .4px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 5px 0; }
.foot .visit { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12.6px; color: #7f94b6; }
.foot .visit b { color: #b9cae6; font-weight: 600; }
.foot .visit .dot { margin: 0 6px; opacity: .55; }
[hidden] { display: none !important; }

/* ---------- 回到顶部 ---------- */
.totop {
  position: fixed; right: 22px; bottom: 24px; z-index: 40;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--dark-2); color: #fff; border: 1px solid #2b4a86;
  cursor: pointer; font-size: 17px; display: none; place-items: center;
  box-shadow: var(--shadow-lg);
}
.totop.show { display: grid; }

/* ---------- 界面截图 ---------- */
/* 兜底：正文里任何图片都不得超出栏宽（即使 .shot 规则缺失或浏览器用的是旧版样式表） */
.doc-body img { max-width: 100%; height: auto; }
.shot { margin: 16px 0 22px; max-width: 100%; }
.shot img {
  display: block; width: 100%; max-width: 100%; height: auto; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); background: #fff;
}
.shot figcaption {
  margin-top: 8px; font-size: 13.4px; color: var(--muted); text-align: center; line-height: 1.6;
}
.shot.loading img { opacity: .4; }
.shot.bad figcaption::after { content: "（图片加载失败）"; color: var(--danger); }

.lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(8, 16, 32, .9); padding: 24px; overflow: auto; text-align: center;
}
.lightbox.on { display: block; }
.lightbox img {
  max-width: 100%; height: auto; border-radius: 8px; cursor: zoom-out;
  box-shadow: var(--shadow-lg); background: #fff;
}
.lightbox .cap { color: #c8d6ee; font-size: 13.5px; margin-top: 12px; }
.lightbox .hint { color: #7f94b6; font-size: 12.4px; margin-top: 6px; }
body.lb-open { overflow: hidden; }

/* ---------- 打印 ---------- */
@media print {
  .nav, .toc, .totop, .foot { display: none !important; }
  .doc { grid-template-columns: 1fr; }
  body { background: #fff; }
  .doc-body { border: 0; box-shadow: none; padding: 0; }
  .lightbox { display: none !important; }
  .shot { break-inside: avoid; page-break-inside: avoid; }
  .shot img { box-shadow: none; border-color: #ccd4e2; cursor: default; }
}
