/* ══════════════════════════════════════════════════════════════════════
   MRRC Cloud Hub 文档站 — 本站专属样式
   ──────────────────────────────────────────────────────────────────────
   upstream 设计系统在 css/octen.css（原样复制，永不 fork —— 上游改版时
   只需重拷一份）。除 octen.css 已有类之外，本站需要的一切都写在这里，
   这样"上游 vs 本站"的差异永远是单一文件、一眼可见。
   设计令牌沿用上游：--accent #22d3ee / --bg-primary #000 / --font-mono。
   ══════════════════════════════════════════════════════════════════════ */

/* ── 跳过导航（a11y） ── */
.hub-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  background: var(--accent);
  color: #000;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  font-size: 0.875rem;
}
.hub-skip:focus {
  left: 0;
}

/* ── 文档页 hero（比首页 .hero 矮，抬高是为了让开 fixed navbar） ── */
.hub-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: calc(var(--nav-h) + 3.5rem) 2rem 3rem;
}
.hub-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 50%);
}
.hub-hero > * {
  position: relative;
  z-index: 1;
}
.hub-hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hub-hero p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.75;
}
@media (max-width: 768px) {
  .hub-hero {
    padding: calc(var(--nav-h) + 2.5rem) 1.25rem 2rem;
  }
  .hub-hero h1 {
    font-size: 1.9rem;
  }
}

/* ── 文档外壳：正文列 + 粘性目录 ── */
.hub-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 3.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}
.hub-toc {
  position: sticky;
  top: calc(var(--gn-h) + var(--nav-h) + 2rem);
  align-self: start;
  grid-column: 2;
  grid-row: 1;
  max-height: calc(100vh - var(--gn-h) - var(--nav-h) - 4rem);
  overflow-y: auto;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
  font-size: 0.8125rem;
}
.hub-toc h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.9rem;
}
.hub-toc ul {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.hub-toc a {
  display: block;
  color: var(--text-secondary);
  padding: 0.3rem 0;
  line-height: 1.5;
  transition: color 0.2s var(--ease);
}
.hub-toc a:hover {
  color: var(--text-primary);
}
.hub-toc a.active {
  color: var(--accent);
  font-weight: 600;
}
@media (max-width: 1100px) {
  .hub-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .hub-toc {
    grid-column: 1;
    grid-row: 1;
    position: static;
    max-height: none;
    overflow: visible;
    border-left: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 0 1.25rem;
    margin-bottom: 2.5rem;
  }
  .hub-prose {
    grid-column: 1;
    grid-row: 2;
  }
}

/* ── 正文排版（octen.css 把 ul 的 list-style 清空了，这里恢复） ── */
.hub-prose {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}
.hub-prose > section {
  margin-bottom: 4rem;
}
.hub-prose h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.hub-prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.25rem 0 0.9rem;
}
.hub-prose h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
}
.hub-prose p {
  color: var(--text-secondary);
  line-height: 1.85;
  margin: 0.9rem 0;
}
.hub-prose ul {
  list-style: disc;
  padding-left: 1.4rem;
  margin: 0.9rem 0;
}
.hub-prose ol {
  list-style: decimal;
  padding-left: 1.4rem;
  margin: 0.9rem 0;
}
.hub-prose li {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0.3rem 0;
}
.hub-prose li > ul,
.hub-prose li > ol {
  margin: 0.3rem 0;
}
.hub-prose strong {
  color: var(--text-primary);
}

/* 行内代码：注意顺序 —— .hub-code 内的一律还原 */
.hub-prose code,
.hub-shell code,
.footer code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(34, 211, 238, 0.09);
  color: #7dd3fc;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

/* ── 代码块 ── */
.hub-code {
  position: relative;
  margin: 1.1rem 0;
}
.hub-code pre {
  background: #080d12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  color: #c9d6e2;
}
.hub-code pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
  overflow-wrap: normal;
}
.hub-code .hub-copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: var(--font-sans);
}
.hub-code .hub-copy:hover {
  color: var(--accent);
  border-color: var(--border-hover);
}
.hub-code .hub-copy.done {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}

/* ── 调用框 ── */
.hub-callout {
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.hub-callout > :first-child {
  margin-top: 0;
}
.hub-callout > :last-child {
  margin-bottom: 0;
}
.hub-callout .hub-callout-title {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
}
.hub-callout p,
.hub-callout li {
  font-size: 0.9375rem;
}
.hub-callout.warn {
  border-left-color: #f59e0b;
}
.hub-callout.warn .hub-callout-title {
  color: #fbbf24;
}
.hub-callout.danger {
  border-left-color: #ef4444;
}
.hub-callout.danger .hub-callout-title {
  color: #f87171;
}
.hub-callout.ok {
  border-left-color: #10b981;
}
.hub-callout.ok .hub-callout-title {
  color: #34d399;
}

/* ── 状态徽标 ── */
.hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
  vertical-align: 0.08em;
}
.hub-badge.live {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.hub-badge.todo {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}
.hub-badge.gap {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}

/* ── 纵向编号步骤（详细版，与上游 .steps 网格版并存） ── */
.hub-steps {
  counter-reset: hubstep;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}
.hub-steps > li {
  counter-increment: hubstep;
  position: relative;
  padding: 0 0 2.75rem 3.5rem;
}
.hub-steps > li:last-child {
  padding-bottom: 0;
}
.hub-steps > li::before {
  content: counter(hubstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-weight: 800;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hub-steps > li::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 42px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.hub-steps > li:last-child::after {
  display: none;
}
.hub-steps h3 {
  margin: 0.35rem 0 0.75rem;
  font-size: 1.1rem;
}
@media (max-width: 768px) {
  .hub-steps > li {
    padding-left: 3rem;
  }
  .hub-steps > li::before {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
  .hub-steps > li::after {
    left: 14px;
    top: 36px;
  }
}

/* ── 层叠图（设计与层层实现） ── */
.hub-stack {
  display: grid;
  gap: 0.6rem;
  margin: 2rem 0;
}
.hub-layer {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 1.05rem 1.25rem;
}
.hub-layer .hub-layer-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.15rem;
}
.hub-layer .hub-layer-body strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.9375rem;
  margin-bottom: 0.3rem;
}
.hub-layer .hub-layer-body span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}
.hub-layer.cross {
  border-left-style: dashed;
  border-left-color: var(--text-muted);
}
.hub-layer.cross .hub-layer-id {
  color: var(--text-muted);
}
@media (max-width: 768px) {
  .hub-layer {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .hub-layer .hub-layer-id {
    padding-top: 0;
  }
}

/* ── 首页系统地图（拓扑图） ── */
.hub-figure {
  margin: 2rem 0;
}
.hub-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.hub-figure figcaption {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ── 首页双轨入口（我要接入 / 我在用） ── */
.hub-tracks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.hub-track {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}
.hub-track.pri {
  border-color: rgba(34, 211, 238, 0.35);
}
.hub-track h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}
.hub-track p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}
.hub-track ul {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}
.hub-track ul li {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
  padding: 0.2rem 0;
}
.hub-track ul li::before {
  content: "▸ ";
  color: var(--accent);
  font-size: 0.7rem;
}
.hub-track ul a {
  color: var(--accent);
}
@media (max-width: 768px) {
  .hub-tracks {
    grid-template-columns: 1fr;
  }
}

/* ── 表格：窄屏横向滚动 ── */
.hub-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.hub-table-wrap table {
  margin: 0;
  min-width: 540px;
}
@media (max-width: 768px) {
  .hub-table-wrap {
    margin: 1.25rem -1.25rem;
    padding: 0 1.25rem;
  }
}

/* ── 权限矩阵 ── */
.hub-perm th:not(:first-child),
.hub-perm td:not(:first-child) {
  text-align: center;
}
.hub-perm .yes {
  color: #34d399;
  font-weight: 700;
}
.hub-perm .no {
  color: #f87171;
  font-weight: 700;
}

/* ── 事实表（两列，左列不折行） ── */
.hub-facts td:first-child {
  color: var(--text-secondary);
  white-space: nowrap;
  width: 32%;
}

/* ── 页脚小注 ── */
.hub-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 2.5rem;
  line-height: 1.75;
}

/* ── 锚点让开 fixed navbar（含全局顶 nav） ── */
[id] {
  scroll-margin-top: calc(var(--gn-h) + var(--nav-h) + 1rem);
}

/* ── 首页能力卡 2×2（对齐门户 .features-grid 的观感；
   子站版 octen.css 的 auto-fill 在 4 张卡时会排出 3+1 孤儿卡） ── */
@media (min-width: 769px) {
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── hero 数字不许折行（"118–168 ms" 折成两行会显得排坏了） ── */
.hero-stats .stat-value {
  white-space: nowrap;
}
