/* ==========================================================================
   贝博平台主站 · 共享样式表 /assets/site.css
   深海控制台：左侧窄导引轨 + 悬浮胶囊导航 + 编号章节体系
   ========================================================================== */

:root {
  --abyss-900: #060C14;
  --teal-850: #0A1E2B;
  --indigo-800: #171E4A;
  --wine-800: #3E1B2C;
  --cyan-400: #35E3C4;
  --amber-400: #F4A83C;
  --ice-050: #E9F3F7;
  --mist-400: #93A7B4;
  --line-700: #1C3341;
  --surface-900: #0B1620;
  --text-body: #C3D4E0;

  --rail-w: 84px;
  --shell-max: 1440px;
  --shell-pad: clamp(20px, 3vw, 56px);

  --font-display: 'Barlow Condensed', 'Oswald', 'HarmonyOS Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-body: 'HarmonyOS Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --r-pill: 999px;
  --r-l: 26px;
  --r-m: 18px;
  --r-s: 12px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--abyss-900);
  background-image:
    radial-gradient(1200px 620px at 88% -8%, rgba(23, 30, 74, .5), transparent 68%),
    radial-gradient(900px 520px at -6% 22%, rgba(10, 30, 43, .8), transparent 64%);
  color: var(--ice-050);
  font-family: var(--font-body);
  font-size: clamp(15px, .28vw + 13.6px, 17px);
  line-height: 1.85;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

::selection { background: var(--cyan-400); color: #04211C; }

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

#main-content { scroll-margin-top: 104px; }

/* ---------- 布局骨架 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
}

.grid { display: grid; gap: clamp(18px, 2vw, 30px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--asym { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

@media (min-width: 1180px) {
  body { padding-left: var(--rail-w); }
}

/* ---------- 左侧常驻导引轨 ---------- */
.rail { display: none; }

@media (min-width: 1180px) {
  .rail {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    z-index: 80;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    background: linear-gradient(180deg, #08131D 0%, #04080E 100%);
    border-right: 1px solid var(--line-700);
    pointer-events: none;
  }
}

.rail__track {
  position: relative;
  display: block;
  width: 2px;
  height: 190px;
  border-radius: 2px;
  background: var(--line-700);
  overflow: hidden;
}

.rail__fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan-400), var(--amber-400));
  transition: height .12s linear;
}

.rail__word {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .34em;
  color: var(--mist-400);
}

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: -120px;
  left: 18px;
  z-index: 200;
  padding: 12px 22px;
  border-radius: 0 0 var(--r-s) var(--r-s);
  background: var(--cyan-400);
  color: #04211C;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  transition: top .22s var(--ease);
}
.skip-link:focus { top: 0; }

/* ==========================================================================
   页头
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px var(--shell-pad) 0;
  pointer-events: none;
}

.header-shell {
  position: relative;
  pointer-events: auto;
  max-width: var(--shell-max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 9px 9px 14px;
  background: rgba(9, 18, 27, .76);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line-700);
  border-radius: var(--r-pill);
  box-shadow: 0 22px 50px -34px rgba(0, 0, 0, .95);
  transition: padding .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease);
}

[data-header][data-scrolled="true"] .header-shell {
  padding: 6px 6px 6px 12px;
  background: rgba(6, 12, 20, .94);
  border-color: rgba(53, 227, 196, .22);
}

/* 品牌浮岛 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--ice-050);
}

.brand__mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: conic-gradient(from 210deg, var(--cyan-400), var(--indigo-800) 46%, var(--amber-400) 78%, var(--cyan-400));
  box-shadow: inset 0 0 0 1px rgba(233, 243, 247, .16);
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 5px;
  background: var(--abyss-900);
  box-shadow: inset 0 0 0 1px rgba(53, 227, 196, .6);
}

.brand__text { display: flex; flex-direction: column; line-height: 1.18; }

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

.brand__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--mist-400);
  white-space: nowrap;
}

/* 移动端开关 */
.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(53, 227, 196, .32);
  background: rgba(53, 227, 196, .09);
  color: var(--ice-050);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  cursor: pointer;
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.nav-toggle:hover { background: rgba(53, 227, 196, .16); }

.nav-toggle__bars { display: inline-flex; flex-direction: column; gap: 4px; width: 16px; }
.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan-400);
  transition: transform .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:first-child { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:last-child { transform: translateY(-3px) rotate(-45deg); }

/* 主导航 */
.primary-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list__item { display: block; }

.nav-link {
  display: inline-block;
  padding: 9px 12px;
  border-radius: var(--r-pill);
  color: var(--mist-400);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  white-space: nowrap;
  text-decoration: none;
  transition: color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.nav-link:hover { color: var(--ice-050); background: rgba(53, 227, 196, .09); }
.nav-link[aria-current="page"] {
  color: var(--cyan-400);
  background: rgba(53, 227, 196, .12);
  box-shadow: inset 0 0 0 1px rgba(53, 227, 196, .42);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: linear-gradient(120deg, var(--cyan-400), #2AA9D6);
  color: #04211C;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  white-space: nowrap;
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.nav-cta::after { content: "\2192"; font-size: 14px; line-height: 1; }
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -16px rgba(53, 227, 196, .8); }

/* 折叠导航 */
@media (max-width: 1140px) {
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 12px);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-left: 0;
    padding: 12px;
    border-radius: var(--r-l);
    border: 1px solid var(--line-700);
    background: rgba(7, 14, 22, .98);
    box-shadow: 0 34px 64px -32px rgba(0, 0, 0, .95);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .28s var(--ease), transform .28s var(--ease), visibility .28s linear;
  }

  .primary-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link { padding: 13px 16px; font-size: 14.5px; border-radius: var(--r-s); }
  .nav-link[aria-current="page"] { box-shadow: none; }
  .nav-cta { margin: 8px 0 0; justify-content: center; padding: 14px 18px; font-size: 14px; }
}

@media (max-width: 520px) {
  .brand__tag { display: none; }
  .nav-toggle__label { display: none; }
  .site-header { padding-top: 12px; }
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 8vw, 140px);
  background: linear-gradient(180deg, var(--teal-850) 0%, #050A11 66%);
  border-top: 1px solid var(--line-700);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -90px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 34%, rgba(53, 227, 196, .17), transparent 68%);
  pointer-events: none;
}

.site-footer::after {
  content: "";
  position: absolute;
  left: -140px;
  bottom: -200px;
  width: 480px;
  height: 480px;
  border-radius: 48% 52% 60% 40% / 55% 45% 55% 45%;
  background: radial-gradient(circle at 42% 42%, rgba(244, 168, 60, .12), transparent 70%);
  pointer-events: none;
}

.footer-shell {
  position: relative;
  z-index: 1;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding: clamp(48px, 6vw, 86px) var(--shell-pad) clamp(30px, 4vw, 50px);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1.9fr);
  gap: clamp(32px, 5vw, 76px);
}

.footer-brand { display: flex; flex-direction: column; gap: 18px; }

.footer-about {
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--mist-400);
}

.footer-cols {
  display: grid;
  grid-template-columns: .9fr 1.1fr .8fr;
  gap: clamp(20px, 3vw, 46px);
}

.footer-col { min-width: 0; }

.footer-col__title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--cyan-400);
}

.footer-col__list { display: flex; flex-direction: column; gap: 10px; }

.footer-link {
  display: inline-block;
  font-size: 14.5px;
  color: var(--ice-050);
  text-decoration: none;
  transition: color .22s var(--ease), transform .22s var(--ease);
}
.footer-link:hover { color: var(--cyan-400); transform: translateX(4px); }

.footer-base {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(28, 51, 65, .8);
}

.footer-base__inner {
  max-width: var(--shell-max);
  margin-inline: auto;
  padding: 26px var(--shell-pad) 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 34px;
}

.footer-contact {
  flex: 1 1 420px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: .02em;
  color: var(--mist-400);
}

.footer-legal,
.footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--mist-400);
  white-space: nowrap;
}

.footer-copy { color: rgba(147, 167, 180, .72); }

@media (max-width: 900px) {
  .footer-shell { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 620px) {
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
  .footer-legal,
  .footer-copy { white-space: normal; }
}

/* ==========================================================================
   通用组件
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), background-color .25s var(--ease);
}

.btn--primary {
  background: linear-gradient(120deg, var(--cyan-400), #2AA9D6);
  color: #04211C;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -20px rgba(53, 227, 196, .85); }

.btn--amber { background: var(--amber-400); color: #2A1602; }
.btn--amber:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -20px rgba(244, 168, 60, .8); }

.btn--ghost { border-color: var(--line-700); color: var(--ice-050); background: transparent; }
.btn--ghost:hover { border-color: rgba(53, 227, 196, .55); color: var(--cyan-400); }

/* 面包屑 */
.crumbs { margin-bottom: 26px; }

.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--mist-400);
}

.crumbs__item { display: inline-flex; align-items: center; gap: 8px; }
.crumbs__item::after { content: "/"; color: var(--line-700); }
.crumbs__item:last-child::after { content: none; }

.crumbs__link { color: var(--mist-400); text-decoration: none; transition: color .2s var(--ease); }
.crumbs__link:hover { color: var(--cyan-400); }
.crumbs__current { color: var(--ice-050); }

/* 正文容器 */
.prose { max-width: 68ch; color: var(--text-body); }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: clamp(24px, 2.2vw, 32px); color: var(--ice-050); }
.prose h3 { font-size: clamp(19px, 1.6vw, 23px); color: var(--ice-050); }
.prose strong { color: var(--ice-050); }
.prose a { color: var(--cyan-400); text-decoration-color: rgba(53, 227, 196, .4); }
.prose ul, .prose ol { padding-left: 1.3em; list-style: disc; }
.prose li + li { margin-top: .5em; }

/* 编号章节 */
.section { position: relative; padding-block: clamp(52px, 6.5vw, 108px); }

.section__head {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: clamp(16px, 2vw, 36px);
  align-items: start;
  margin-bottom: clamp(28px, 3.2vw, 54px);
}

.section__num {
  font-family: var(--font-display);
  font-size: clamp(48px, 5.4vw, 96px);
  font-weight: 700;
  line-height: .82;
  letter-spacing: -.02em;
  color: rgba(53, 227, 196, .26);
}

.section__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--amber-400);
}

.section__title {
  margin-top: 8px;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -.01em;
}

.section__lead {
  margin-top: 14px;
  max-width: 62ch;
  color: var(--text-body);
}

.section__rule { height: 1px; background: var(--line-700); }

@media (max-width: 720px) {
  .section__head { grid-template-columns: 1fr; gap: 10px; }
  .section__num { font-size: 44px; }
}

/* 卡片 */
.card {
  position: relative;
  padding: clamp(20px, 2.2vw, 32px);
  border: 1px solid var(--line-700);
  border-radius: var(--r-m);
  background: var(--surface-900);
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: rgba(53, 227, 196, .42); }

.card--teal { background: linear-gradient(158deg, var(--teal-850), var(--surface-900) 76%); }
.card--accent { background: linear-gradient(158deg, var(--indigo-800), var(--surface-900) 78%); }
.card--warm { background: linear-gradient(158deg, var(--wine-800), var(--surface-900) 78%); }

.card__label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mist-400);
}

.card__title { margin-top: 10px; font-size: clamp(19px, 1.5vw, 23px); }
.card__text { margin-top: 10px; font-size: 15px; color: var(--text-body); }
.card__meta {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--mist-400);
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line-700);
  border-radius: var(--r-pill);
  background: rgba(11, 22, 32, .72);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mist-400);
}
.tag--cyan { color: var(--cyan-400); border-color: rgba(53, 227, 196, .42); }
.tag--amber { color: var(--amber-400); border-color: rgba(244, 168, 60, .42); }

/* 图片容器 */
.media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-700);
  border-radius: var(--r-m);
  background: linear-gradient(140deg, var(--teal-850), var(--abyss-900));
}

.media__frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(140deg, var(--teal-850), var(--abyss-900));
}
.media__frame--tall { aspect-ratio: 4 / 5; }
.media__frame--square { aspect-ratio: 1 / 1; }

.media__placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .24em;
  color: var(--mist-400);
  background-color: var(--teal-850);
  background-image:
    linear-gradient(rgba(53, 227, 196, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 227, 196, .09) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px;
}

.media__caption {
  padding: 12px 16px;
  border-top: 1px solid var(--line-700);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--mist-400);
}

/* 时间轴 */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--line-700);
}

.timeline__item { position: relative; padding: 0 0 34px 8px; }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--abyss-900);
  border: 2px solid var(--cyan-400);
}

.timeline__version {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--amber-400);
}

/* 可展开内容组 */
.accordion { border-top: 1px solid var(--line-700); }
.accordion__item { border-bottom: 1px solid var(--line-700); }

.accordion__trigger {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 4px;
  border: 0;
  background: none;
  text-align: left;
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 600;
  color: var(--ice-050);
  cursor: pointer;
  transition: color .25s var(--ease);
}
.accordion__trigger::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1;
  color: var(--cyan-400);
  transition: transform .3s var(--ease);
}
.accordion__trigger[aria-expanded="true"] { color: var(--cyan-400); }
.accordion__trigger[aria-expanded="true"]::after { transform: rotate(45deg); }

.accordion__panel[hidden] { display: none; }
.accordion__body {
  max-width: 72ch;
  padding: 0 4px 24px;
  color: var(--text-body);
}

/* ---------- 渐入 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready [data-reveal] { opacity: 0; transform: translateY(22px); }
  .reveal-ready [data-reveal].is-visible {
    opacity: 1;
    transform: none;
    transition: opacity .7s var(--ease), transform .7s var(--ease);
  }
}

/* ---------- 平板 / 手机 ---------- */
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--asym { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .grid--asym { grid-template-columns: minmax(0, 1fr); }
  .section { padding-block: 48px; }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
