/* ===========================================================
   BBIN主页 · /assets/site.css
   共享外壳：侧边轨道导航 / 页脚索引 / 排版与基础组件
   =========================================================== */

:root {
  --paper: #F7FBFC;
  --mist: #DDF7F8;
  --deep: #061B33;
  --bay: #0B3A5A;
  --cyan: #00C8D7;
  --glow: #A9F3F7;
  --orange: #FF7A2A;
  --orange-soft: #FFD9C2;
  --ink: #0E1720;

  --line: rgba(6, 27, 51, 0.14);
  --line-light: rgba(169, 243, 247, 0.26);

  --rail-w: 272px;
  --bar-h: 66px;
  --maxw: 1160px;
  --pad-x: clamp(18px, 4vw, 56px);

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --shadow-hard: 6px 6px 0 rgba(6, 27, 51, 0.92);
  --shadow-soft: 10px 10px 0 rgba(6, 27, 51, 0.10);
  --ease: cubic-bezier(0.22, 0.75, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 18px);
}

body { margin: 0; }
h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, picture, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.01em; }

/* ---------- 中文排版基底 ---------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (max-width: 1023px) {
  body { padding-top: var(--bar-h); }
}

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

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

.site-nav :focus-visible,
.site-footer :focus-visible { outline-color: var(--orange); }

/* ---------- 通用排版工具 ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bay);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 3px;
  background: var(--orange);
  flex: 0 0 auto;
}

.lead {
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.8;
  color: var(--bay);
  max-width: 34em;
}

.prose {
  max-width: 34em;
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.9;
  color: var(--ink);
}

.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3 { font-weight: 800; }
.prose a { color: var(--bay); text-decoration: none; border-bottom: 2px solid var(--cyan); }
.prose a:hover { border-color: var(--orange); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: clamp(56px, 8vw, 118px); }
.section--mist { background: var(--mist); }

/* ---------- 面包屑 ---------- */
.crumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bay);
}

.crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; }

.crumbs li { display: flex; align-items: center; gap: 8px; }

.crumbs li + li::before { content: "/"; color: var(--cyan); }

.crumbs a {
  text-decoration: none;
  border-bottom: 1px solid rgba(6, 27, 51, 0.25);
}

.crumbs a:hover { color: var(--orange); border-color: var(--orange); }

.crumbs [aria-current="page"] { color: var(--deep); font-weight: 700; }

/* ---------- 悬挂编号 ---------- */
.index-num {
  font-family: var(--font-mono);
  font-size: clamp(42px, 7vw, 96px);
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.03em;
  color: transparent;
  -webkit-text-stroke: 2px var(--bay);
}

@supports not (-webkit-text-stroke: 1px #000) {
  .index-num { color: var(--bay); }
}

/* ---------- 卡片与标签 ---------- */
.card {
  background: var(--paper);
  border: 3px solid var(--deep);
  padding: clamp(18px, 2.4vw, 30px);
  box-shadow: var(--shadow-hard);
}

.card--mist { background: var(--mist); }

.card--dark {
  background: var(--deep);
  color: #E3F6F9;
  border-color: var(--deep);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--mist);
  border: 2px solid var(--deep);
  color: var(--deep);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tag--cyan { background: var(--cyan); }
.tag--orange { background: var(--orange-soft); border-color: var(--orange); color: var(--ink); }

/* ---------- 网格 ---------- */
.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

/* ---------- 图像容器（页面阶段放占位图） ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 3px solid var(--deep);
  background: linear-gradient(135deg, var(--mist) 0%, #FFFFFF 100%);
  box-shadow: var(--shadow-soft);
  aspect-ratio: 16 / 10;
}

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

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

.media__caption {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 11px;
  background: var(--deep);
  color: var(--glow);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.78em 1.35em;
  background: var(--paper);
  color: var(--deep);
  border: 3px solid var(--deep);
  box-shadow: 5px 5px 0 rgba(6, 27, 51, 0.92);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 rgba(6, 27, 51, 0.92);
}

.btn:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 rgba(6, 27, 51, 0.92); }

.btn--primary { background: var(--orange); color: var(--ink); }

.btn--ghost {
  background: transparent;
  box-shadow: none;
  border-color: currentColor;
}

.btn--ghost:hover { box-shadow: none; transform: none; background: rgba(0, 200, 215, 0.12); }

.btn--sm { padding: 0.5em 0.85em; font-size: 13px; box-shadow: 3px 3px 0 rgba(6, 27, 51, 0.92); }

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 0.7em 1.1em;
  background: var(--orange);
  color: var(--ink);
  border: 3px solid var(--deep);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.22s var(--ease);
}

.skip-link:focus { transform: translateY(0); }

/* ===========================================================
   头部外壳
   =========================================================== */
.site-header { position: relative; z-index: 60; }

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 140;
  pointer-events: none;
}

.read-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--orange) 100%);
}

/* ----- 移动顶栏 ----- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar-h);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--paper);
  border-bottom: 3px solid var(--deep);
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--deep);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.topbar__brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--deep);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.topbar__brand-text { white-space: nowrap; }

.topbar__cta { margin-left: auto; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding: 8px 11px;
  background: var(--orange);
  color: var(--ink);
  border: 3px solid var(--deep);
  box-shadow: 3px 3px 0 rgba(6, 27, 51, 0.92);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.nav-toggle:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(6, 27, 51, 0.92); }

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

.nav-toggle__bars span {
  display: block;
  width: 16px;
  height: 3px;
  background: var(--deep);
}

/* ----- 轨道导航（移动端为抽屉） ----- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 120;
  width: min(86vw, 342px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 20px 28px;
  background-color: var(--deep);
  background-image: radial-gradient(rgba(0, 200, 215, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
  color: #E6F7FA;
  border-right: 3px solid var(--cyan);
  transform: translateX(-102%);
  transition: transform 0.34s var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-nav[data-open="true"] { transform: translateX(0); }

.site-nav__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.site-nav__head .brand { flex: 1 1 auto; }

.site-nav__close {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  background: transparent;
  border: 2px solid rgba(169, 243, 247, 0.5);
  color: var(--glow);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.site-nav__close:hover { border-color: var(--orange); color: var(--orange); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-light);
  text-decoration: none;
  color: #EAFBFD;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  background: var(--cyan);
  color: var(--deep);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 4px 4px 0 rgba(0, 200, 215, 0.24);
}

.brand__text { display: flex; flex-direction: column; line-height: 1.3; }
.brand__name { font-size: 18px; font-weight: 800; letter-spacing: 0.02em; }

.brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--glow);
  opacity: 0.85;
}

.nav-list { display: flex; flex-direction: column; gap: 2px; }

.nav-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 10px;
  color: #D9F1F5;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}

.nav-link__idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--cyan);
  opacity: 0.85;
}

.nav-link__label { font-size: 16px; font-weight: 600; letter-spacing: 0.04em; }

.nav-link:hover {
  background: rgba(0, 200, 215, 0.12);
  border-left-color: var(--cyan);
  color: #FFFFFF;
  transform: translateX(3px);
}

.nav-link[aria-current="page"] {
  background: var(--cyan);
  border-left-color: var(--orange);
  color: var(--deep);
}

.nav-link[aria-current="page"] .nav-link__idx { color: var(--deep); opacity: 1; }

.site-nav__aside {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px dashed rgba(169, 243, 247, 0.3);
}

.site-nav__aside-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--glow);
  opacity: 0.82;
}

.nav-quick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(169, 243, 247, 0.24);
  color: #C9EDF2;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-quick::after {
  content: "→";
  font-family: var(--font-mono);
  color: var(--orange);
}

.nav-quick:hover {
  background: rgba(0, 200, 215, 0.16);
  border-color: var(--cyan);
  color: #FFFFFF;
}

.site-nav__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: rgba(214, 240, 245, 0.62);
}

.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(6, 27, 51, 0.62);
}

.nav-scrim[data-open="true"] { display: block; }

/* ----- 移动端滚动锁 ----- */
@media (max-width: 1023px) {
  body.nav-open { overflow: hidden; }
}

@media (max-width: 419px) {
  .topbar__cta { display: none; }
  .nav-toggle { margin-left: auto; }
}

/* ----- 桌面：轨道常驻 ----- */
@media (min-width: 1024px) {
  .topbar { display: none; }

  .site-nav {
    width: var(--rail-w);
    transform: none;
    transition: none;
    padding: 30px 24px 26px;
    gap: 26px;
    border-right: 3px solid var(--cyan);
  }

  .site-nav[data-open="true"] { transform: none; }

  .site-nav__close { display: none; }

  .nav-scrim { display: none !important; }

  html { scroll-padding-top: 26px; }
}

@media (min-width: 720px) and (max-width: 1023px) {
  .site-nav { width: min(60vw, 360px); }
  .nav-link__label { font-size: 17px; }
}

/* ===========================================================
   页脚
   =========================================================== */
.site-footer {
  position: relative;
  background: var(--deep);
  color: #DCEFF3;
  padding-top: clamp(48px, 7vw, 96px);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--cyan) 0 42%, var(--orange) 42% 56%, var(--glow) 56% 100%);
}

.footer__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  display: grid;
  gap: clamp(28px, 4vw, 56px);
}

@media (min-width: 900px) {
  .footer__inner { grid-template-columns: minmax(260px, 1.1fr) minmax(0, 2fr); align-items: start; }
}

.footer__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}

.footer__brandline {
  max-width: 15em;
  color: #F2FEFF;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  line-height: 1.38;
  letter-spacing: 0.01em;
}

.footer__lead .btn { margin-top: 22px; }

.footer__cols {
  display: grid;
  gap: clamp(20px, 3vw, 36px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}

.footer__col-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--glow);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-light);
}

.footer__list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.footer__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #CFE9EE;
  font-size: 15px;
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

.footer__link::before {
  content: "";
  width: 10px;
  height: 2px;
  flex: 0 0 auto;
  background: var(--cyan);
  transition: width 0.2s var(--ease), background 0.2s var(--ease);
}

.footer__link:hover { color: #FFFFFF; }
.footer__link:hover::before { width: 20px; background: var(--orange); }

.footer__contact {
  width: 100%;
  max-width: var(--maxw);
  margin: clamp(32px, 5vw, 60px) auto 0;
  padding: 26px var(--pad-x) 0;
  border-top: 1px solid var(--line-light);
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.footer__contact-row { display: flex; flex-direction: column; gap: 6px; }

.footer__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.footer__value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #E6F7FA;
  font-size: 15px;
  word-break: break-word;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: transparent;
  border: 1px solid rgba(169, 243, 247, 0.4);
  color: var(--glow);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.copy-btn:hover {
  background: rgba(0, 200, 215, 0.16);
  border-color: var(--cyan);
  color: #FFFFFF;
}

.copy-btn.is-copied {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

.copy-btn__label { pointer-events: none; }

.footer__legal {
  width: 100%;
  max-width: var(--maxw);
  margin: clamp(26px, 4vw, 46px) auto 0;
  padding: 18px var(--pad-x) 28px;
  border-top: 1px solid var(--line-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(214, 240, 245, 0.72);
}

.footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-left: auto;
}

.footer__legal-links a {
  color: #CFE9EE;
  text-decoration: none;
  border-bottom: 1px solid rgba(169, 243, 247, 0.35);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.footer__legal-links a:hover { color: var(--orange); border-color: var(--orange); }

/* ===========================================================
   显现动效
   =========================================================== */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.66s var(--ease), transform 0.66s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.js-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

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

  .nav-link:hover,
  .btn:hover,
  .nav-toggle:hover { transform: none; }
}
