:root {
  --c-deep: #0A1633;
  --c-cabin: #101E3F;
  --c-cyan: #3EF2D2;
  --c-green: #1FB98C;
  --c-orange: #FF7A3C;
  --c-amber: #F2B441;
  --c-white: #F5F8FF;
  --c-slate: #8896BC;
  --c-line: #33426E;
  --c-paper: #E8EDF9;

  --font-display: "Barlow Condensed", "Roboto Condensed", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Noto Sans SC", monospace;

  --rail-w: 248px;
  --gutter: clamp(20px, 4vw, 56px);
  --maxw: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --progress: 0;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background-color: var(--c-deep);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-left: var(--rail-w);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  color: var(--c-white);
  background-color: transparent;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1100px 560px at 82% -12%, rgba(62, 242, 210, .10), transparent 62%),
    radial-gradient(820px 480px at 6% 104%, rgba(255, 122, 60, .07), transparent 62%),
    repeating-linear-gradient(0deg, rgba(51, 66, 110, .22) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(90deg, rgba(51, 66, 110, .14) 0 1px, transparent 1px 92px);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .6em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--c-white);
}

h1 { font-size: clamp(32px, 5.4vw, 62px); }
h2 { font-size: clamp(26px, 3.6vw, 40px); }
h3 { font-size: clamp(20px, 2.2vw, 26px); }

p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }

a { color: var(--c-cyan); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--c-white); }

ul, ol { margin: 0 0 1.2em; padding-left: 1.25em; }
li { margin-bottom: .4em; }

strong { font-weight: 700; color: var(--c-white); }
code, kbd, samp { font-family: var(--font-mono); font-size: .92em; letter-spacing: .04em; }

hr { height: 0; margin: 2.2em 0; border: 0; border-top: 1px solid var(--c-line); }

img { max-width: 100%; height: auto; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

main { display: block; padding-top: clamp(26px, 4vw, 52px); }

/* ---------- 布局容器 ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow {
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.stack { display: grid; gap: clamp(18px, 2.6vw, 30px); }

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-deep);
  background: var(--c-cyan);
  border-radius: 999px;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform .22s var(--ease);
}

.skip-link:focus { transform: translateY(0); color: var(--c-deep); }

/* ---------- 章节标题组 ---------- */
.sec-head {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.sec-head__code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--c-cyan);
  text-transform: uppercase;
}

.sec-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.sec-head__lead {
  max-width: 62ch;
  margin: 0;
  font-size: 16px;
  color: var(--c-slate);
}

.sec-rule {
  position: relative;
  height: 0;
  margin: 0 0 clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--c-line);
}

.sec-rule::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 68px;
  height: 2px;
  background: var(--c-cyan);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--c-white);
  background: rgba(16, 30, 63, .9);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: color .22s var(--ease), background-color .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease);
}

.btn:hover { color: var(--c-cyan); border-color: var(--c-cyan); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  color: #2B0E02;
  font-weight: 700;
  background: var(--c-orange);
  border-color: var(--c-orange);
}
.btn--primary:hover { color: #2B0E02; background: #ff8d59; border-color: #ff8d59; }

.btn--accent {
  color: #052A22;
  font-weight: 700;
  background: var(--c-cyan);
  border-color: var(--c-cyan);
}
.btn--accent:hover { color: #052A22; background: #66f6dd; border-color: #66f6dd; }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: rgba(62, 242, 210, .08); }

/* ---------- 状态标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  line-height: 1.7;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-paper);
  background: rgba(232, 237, 249, .07);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}

.tag--current {
  color: var(--c-cyan);
  background: rgba(62, 242, 210, .1);
  border-color: rgba(62, 242, 210, .48);
}

.tag--entry {
  color: var(--c-cyan);
  background: rgba(62, 242, 210, .08);
  border-color: rgba(62, 242, 210, .45);
}

.tag--compare {
  color: #7affe0;
  background: rgba(31, 185, 140, .12);
  border-color: rgba(31, 185, 140, .5);
}

.tag--version {
  color: var(--c-amber);
  background: rgba(242, 180, 65, .1);
  border-color: rgba(242, 180, 65, .48);
}

.tag--alert {
  color: #ffb08a;
  background: rgba(255, 122, 60, .1);
  border-color: rgba(255, 122, 60, .52);
}

/* ---------- 编号节点 ---------- */
.node {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  line-height: 1;
  color: var(--c-slate);
  background: rgba(16, 30, 63, .92);
  border: 1px dashed var(--c-line);
  border-radius: 50%;
  transition: color .22s var(--ease), background-color .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease);
}

.node--lg { width: 46px; height: 46px; font-size: 14px; }

.node--cyan {
  color: #052A22;
  background: var(--c-cyan);
  border: 1px solid var(--c-cyan);
}

.node--orange {
  color: #2B0E02;
  background: var(--c-orange);
  border: 1px solid var(--c-orange);
}

/* ---------- 纸张叠层卡片 ---------- */
.paper {
  position: relative;
  padding: clamp(18px, 2.6vw, 30px);
  background: var(--c-cabin);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
}

.paper::before {
  content: "";
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 58%;
  height: 58%;
  border: 1px solid rgba(51, 66, 110, .65);
  border-radius: 0 0 var(--r-md) 0;
  pointer-events: none;
  transition: transform .24s var(--ease);
}

.paper:hover::before { transform: translate(8px, 8px); }

.paper--flat::before { display: none; }

/* ---------- 印刷标记边框 ---------- */
.frame { position: relative; }

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border-style: solid;
  border-color: var(--c-cyan);
}

.frame::before { top: -5px; left: -5px; border-width: 2px 0 0 2px; }
.frame::after { right: -5px; bottom: -5px; border-width: 0 2px 2px 0; }

/* ---------- 图片容器 ---------- */
.media {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background-color: var(--c-cabin);
  background-image:
    linear-gradient(135deg, rgba(62, 242, 210, .10), transparent 46%),
    repeating-linear-gradient(-45deg, rgba(51, 66, 110, .5) 0 1px, transparent 1px 12px);
}

.media > img,
.media > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }

.media__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--c-slate);
}

/* ---------- 面包屑 ---------- */
.crumbs {
  margin-bottom: clamp(16px, 2vw, 24px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--c-slate);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li { margin: 0; }

.crumbs li::after {
  content: "/";
  margin-left: 8px;
  color: var(--c-line);
}

.crumbs li:last-child::after { content: none; }
.crumbs a { color: var(--c-slate); }
.crumbs a:hover { color: var(--c-cyan); }
.crumbs [aria-current="page"] { color: var(--c-white); }

/* ---------- 左侧品牌路径轨道 ---------- */
.site-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: var(--rail-w);
  padding: 26px 20px 22px;
  background: linear-gradient(180deg, #0C1A3A 0%, #0A1633 58%, #0B1734 100%);
  border-right: 1px solid var(--c-line);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rail__brand { display: grid; gap: 12px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--c-white);
  text-decoration: none;
}

.brand:hover { color: var(--c-white); }

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--c-cyan);
  background: rgba(62, 242, 210, .08);
  border: 1px solid rgba(62, 242, 210, .45);
  border-radius: 9px;
  transition: background-color .22s var(--ease), color .22s var(--ease);
}

.brand:hover .brand__mark { color: #052A22; background: var(--c-cyan); }

.brand__name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .02em;
}

.rail__status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.rail__code {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--c-slate);
}

/* 移动端开关 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-white);
  background: rgba(16, 30, 63, .9);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .22s var(--ease), color .22s var(--ease);
}

.nav-toggle:hover { border-color: var(--c-cyan); color: var(--c-cyan); }

.nav-toggle__bars { display: grid; gap: 4px; width: 18px; }

.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--c-cyan);
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}

.site-rail[data-open] .nav-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-rail[data-open] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.site-rail[data-open] .nav-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 纵向编号导航 */
.rail-nav__list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-nav__item { position: relative; margin: 0; }

.rail-nav__item::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 17px;
  height: 12px;
  border-left: 1px dashed var(--c-line);
  transition: border-color .24s var(--ease);
}

.rail-nav__item:first-child::before { display: none; }

.rail-nav__item:hover::before { border-color: rgba(62, 242, 210, .55); }

.rail-nav__link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 0;
  color: var(--c-slate);
  text-decoration: none;
  border-radius: 10px;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}

.rail-nav__link:hover { color: var(--c-white); background: rgba(62, 242, 210, .06); }
.rail-nav__link:hover .node {
  color: #052A22;
  background: var(--c-cyan);
  border-color: var(--c-cyan);
  border-style: solid;
  transform: scale(1.06);
}

.rail-nav__link[aria-current="page"] { color: var(--c-white); background: rgba(62, 242, 210, .09); }
.rail-nav__link[aria-current="page"] .node {
  color: #052A22;
  background: var(--c-cyan);
  border: 1px solid var(--c-cyan);
}
.rail-nav__link[aria-current="page"] .rail-nav__hint { color: var(--c-cyan); }

.rail-nav__body { display: grid; gap: 2px; min-width: 0; }

.rail-nav__label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .01em;
}

.rail-nav__hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--c-slate);
  transition: color .2s var(--ease);
}

/* 轨道底部 */
.rail__foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--c-line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: var(--c-slate);
}

.rail__foot-line { margin: 0; }

.rail__foot-val {
  color: var(--c-amber);
  letter-spacing: .06em;
}

.rail__progress {
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: calc(var(--progress) * 100%);
  min-height: 0;
  background: linear-gradient(180deg, var(--c-cyan), var(--c-green));
  pointer-events: none;
  transition: height .12s linear;
}

/* ---------- 页脚 ---------- */
.site-foot {
  position: relative;
  margin-top: clamp(56px, 8vw, 110px);
  border-top: 1px solid var(--c-line);
  background: linear-gradient(180deg, rgba(16, 30, 63, .55), rgba(10, 22, 51, .96));
}

.site-foot::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 120px;
  height: 2px;
  background: var(--c-orange);
}

.foot__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
  gap: clamp(26px, 3.4vw, 46px);
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(34px, 5vw, 62px) var(--gutter) clamp(22px, 3vw, 34px);
}

.foot__col { min-width: 0; }

.foot__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 15px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-white);
}

.foot__title-code {
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--c-deep);
  background: var(--c-cyan);
  border-radius: 4px;
}

.foot__col:nth-child(2) .foot__title-code { background: var(--c-amber); }
.foot__col:nth-child(3) .foot__title-code { background: var(--c-orange); color: #2B0E02; }
.foot__col:nth-child(4) .foot__title-code { background: var(--c-green); color: #04231A; }

.foot__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot__list li { margin: 0; }

.foot__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-slate);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.foot__link::before {
  content: "";
  width: 12px;
  height: 0;
  border-top: 1px dashed var(--c-line);
  transition: border-color .2s var(--ease);
}

.foot__link:hover { color: var(--c-cyan); border-bottom-color: rgba(62, 242, 210, .5); }
.foot__link:hover::before { border-color: var(--c-cyan); }

.foot__link--static { color: var(--c-slate); cursor: default; }
.foot__link--static:hover { color: var(--c-slate); border-bottom-color: transparent; }
.foot__link--static:hover::before { border-color: var(--c-line); }

.foot__ver { display: grid; gap: 8px; margin-bottom: 14px; }

.foot__ver-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  font-size: 14px;
  border-bottom: 1px dashed var(--c-line);
}

.foot__ver-key { color: var(--c-slate); }

.foot__ver-val {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .05em;
  color: var(--c-amber);
  white-space: nowrap;
}

.foot__meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-slate);
}

.foot__contact {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.foot__contact li { margin: 0; }

.foot__contact-key {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--c-slate);
}

.foot__contact-val {
  display: block;
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-white);
  overflow-wrap: anywhere;
}

.foot__contact-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-slate);
}

.foot__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 16px var(--gutter) 28px;
  border-top: 1px dashed var(--c-line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .03em;
  color: var(--c-slate);
}

.foot__copy, .foot__icp { margin: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  :root { --rail-w: 220px; }
  .site-rail { padding: 22px 16px 20px; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 24px; }

  body { padding-left: 0; padding-top: 64px; }

  .site-rail {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 100vh;
    max-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand toggle"
      "nav nav"
      "foot foot";
    align-items: center;
    gap: 0 12px;
    padding: 10px clamp(14px, 4vw, 22px) 12px;
    border-right: 0;
    border-bottom: 1px solid var(--c-line);
    overflow-y: auto;
  }

  .rail__brand { grid-area: brand; gap: 0; }
  .rail__status { display: none; }

  .nav-toggle {
    grid-area: toggle;
    display: inline-flex;
  }

  .rail-nav {
    grid-area: nav;
    display: block;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .3s var(--ease), opacity .22s var(--ease), margin-top .3s var(--ease);
  }

  .site-rail[data-open] .rail-nav {
    max-height: min(64vh, 480px);
    margin-top: 10px;
    overflow-y: auto;
    opacity: 1;
  }

  .rail__foot {
    grid-area: foot;
    display: none;
    margin-top: 10px;
    padding-top: 12px;
  }

  .site-rail[data-open] .rail__foot { display: block; }

  .rail__progress { display: none; }
}

@media (max-width: 480px) {
  body { padding-top: 62px; }

  .brand__name { font-size: 18px; }

  .foot__base { flex-direction: column; align-items: flex-start; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .paper:hover::before { transform: none; }
  .btn:hover { transform: none; }
}
