/* ==========================================================================
   BBIN服务 · /assets/site.css
   共享外壳：命令栏头部 / 印刷色带页脚 / 基础组件与图片容器
   ========================================================================== */

/* ---------- 0. 变量 ---------- */
:root {
  --ink: #071B2E;
  --deep: #0B2A4A;
  --teal-dark: #0E6F6B;
  --teal: #1FA7A0;
  --teal-soft: #8FD8D2;
  --teal-wash: #D9EEEB;
  --coral: #FF6B4A;
  --coral-dark: #D94A2E;
  --paper: #F3EEE4;
  --mist: #E8F0F7;
  --line: #B8CBDD;
  --white: #FFFFFF;

  --font-display: "Archivo Black", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --bw: 3px;
  --shadow-hard: 8px 8px 0 var(--ink);
  --shadow-soft: 4px 4px 0 var(--ink);
  --shell: 1200px;
  --pad: clamp(16px, 4vw, 40px);
  --ease: 160ms cubic-bezier(.2, .7, .3, 1);
}

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--mist);
  background-image: linear-gradient(180deg, rgba(184, 203, 221, .38), rgba(232, 240, 247, 0) 340px);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-nav-open { overflow: hidden; }

h1, h2, h3, h4, h5, h6, 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%; height: auto; }
a { color: var(--teal-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
[id] { scroll-margin-top: 118px; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* ---------- 2. 头部：状态条 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--paper);
  border-bottom: var(--bw) solid var(--ink);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  transform: translateY(-180%);
  padding: 10px 16px;
  background: var(--coral);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  transition: transform var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.util-strip {
  background: var(--ink);
  color: var(--teal-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
}
.util-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
  min-height: 38px;
  padding-block: 6px;
}
.util-pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-soft);
}
.util-pulse__dot {
  width: 8px; height: 8px;
  background: var(--teal);
  border: 1px solid var(--teal-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(31, 167, 160, .25);
}
.util-strip__brand { color: #C9DCEB; }
.util-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.util-links a {
  color: var(--paper);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.util-links a:hover { color: var(--coral); border-bottom-color: var(--coral); }

/* ---------- 3. 头部：命令栏 ---------- */
.cmdbar {
  position: relative;
  background: var(--paper);
}
.cmdbar__inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: 74px;
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  background: var(--deep);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--coral);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .02em;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -.01em;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--teal-dark);
}

.nav { min-width: 0; margin-inline: auto; }
.nav__title { display: none; }
.nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
}
.nav__item { list-style: none; }
.nav__link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 11px;
  border: 2px solid transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
}
.nav__idx {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--teal-dark);
  transition: color var(--ease);
}
.nav__link:hover {
  background: var(--deep);
  color: var(--paper);
  border-color: var(--ink);
}
.nav__link:hover .nav__idx { color: var(--teal-soft); }
.nav__link[aria-current="page"] {
  background: var(--teal-wash);
  border-color: var(--ink);
  box-shadow: inset 0 3px 0 var(--coral);
}

.cmdbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), color var(--ease);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn--cta { background: var(--coral); color: var(--ink); }
.btn--cta:hover { background: var(--coral-dark); color: var(--white); }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--ghost:hover { background: var(--deep); color: var(--paper); box-shadow: none; transform: none; }

/* ---------- 5. 菜单按钮与遮罩 ---------- */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
}
.nav-toggle__bars {
  display: grid;
  gap: 3px;
  width: 18px;
}
.nav-toggle__bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform var(--ease), opacity var(--ease);
}
.site-header[data-open] .nav-toggle {
  background: var(--coral);
  box-shadow: 2px 2px 0 var(--ink);
}
.site-header[data-open] .nav-toggle__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(7, 27, 46, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}
.nav-scrim[hidden] { display: none; }
.site-header[data-open] .nav-scrim { opacity: 1; pointer-events: auto; }

/* ---------- 6. 阅读进度轨 ---------- */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  z-index: 2;
  height: 3px;
  background: rgba(7, 27, 46, .12);
}
.progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 90ms linear;
}

/* ---------- 7. 页脚 ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  border-top: var(--bw) solid var(--ink);
}
.footer__rail {
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    var(--coral) 0 26px,
    var(--teal) 26px 52px,
    var(--deep) 52px 78px
  );
}
.footer__top { padding-block: clamp(34px, 5.5vw, 62px); }

.footer__grid {
  display: grid;
  gap: clamp(22px, 3vw, 38px);
  grid-template-columns: 1fr;
}

.footer__brand { min-width: 0; }
.footer__mark {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 14px;
  background: var(--deep);
  color: var(--paper);
  border: 2px solid var(--teal-soft);
  box-shadow: 4px 4px 0 var(--coral);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
}
.footer__brandname {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -.01em;
  margin-bottom: 8px;
}
.footer__line {
  font-size: 14px;
  line-height: 1.65;
  color: #C9DCEB;
  margin-bottom: 6px;
}
.footer__line--mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--teal-soft);
}

.footer__col { min-width: 0; }
.footer__col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal-soft);
}
.footer__col-title::before {
  content: "";
  flex: 0 0 auto;
  width: 10px; height: 10px;
  background: var(--coral);
}
.footer__links { display: grid; gap: 8px; }
.footer__links a {
  display: inline-block;
  color: var(--paper);
  font-size: 14.5px;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.footer__links a:hover { color: var(--coral); border-bottom-color: var(--coral); }

.footer__contact { min-width: 0; }
.contact-row {
  display: grid;
  gap: 10px;
}
.contact-row__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(184, 203, 221, .28);
}
.contact-row__item:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-row__key {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--teal-soft);
}
.contact-row__val {
  color: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.chip {
  margin-left: auto;
  padding: 4px 9px;
  background: transparent;
  color: var(--teal-soft);
  border: 1px solid var(--teal-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.chip:hover { background: var(--teal-soft); color: var(--ink); }
.chip[data-copied="true"] { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.chip[data-copied="false"] { background: var(--coral); border-color: var(--coral); color: var(--ink); }

.footer__bottom {
  border-top: 2px solid rgba(184, 203, 221, .3);
  padding-block: 20px 26px;
}
.footer__bottom-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #9FB6CB;
}
.footer__note { color: #9FB6CB; max-width: 62ch; }
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.footer__legal a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 203, 221, .5);
  transition: color var(--ease), border-color var(--ease);
}
.footer__legal a:hover { color: var(--coral); border-bottom-color: var(--coral); }
.footer__mono { color: var(--teal-soft); letter-spacing: .04em; }

/* ---------- 8. 回顶 ---------- */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 55;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  background: var(--coral);
  color: var(--ink);
  border: var(--bw) solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--ease), transform var(--ease), visibility var(--ease), background var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--teal-soft); }

/* ---------- 9. 通用页面组件 ---------- */
.section { padding-block: clamp(30px, 5vw, 62px); }
.section--paper {
  background: var(--paper);
  border-block: var(--bw) solid var(--ink);
}
.section--deep {
  background: var(--deep);
  color: var(--paper);
  border-block: var(--bw) solid var(--ink);
}
.section--deep a { color: var(--teal-soft); }

.eyebrow {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal-dark);
}
.section--deep .eyebrow { color: var(--teal-soft); }

.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.55rem, 3.2vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 12px;
}
.lede {
  max-width: 58ch;
  font-size: clamp(16px, 1.9vw, 19px);
  line-height: 1.68;
  color: var(--deep);
}
.section--deep .lede { color: #D3E4F2; }

.prose { max-width: 68ch; }
.prose p { margin-bottom: 1em; }
.prose ul { margin-bottom: 1em; }
.prose li {
  position: relative;
  padding-left: 22px;
  margin-bottom: .42em;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 9px; height: 9px;
  background: var(--teal);
  border: 2px solid var(--ink);
}
.prose h2, .prose h3 { margin: 1.4em 0 .5em; font-family: var(--font-display); line-height: 1.2; }

.card {
  padding: clamp(16px, 2.4vw, 24px);
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow-soft);
}
.card--mist { background: var(--mist); }
.card--deep { background: var(--deep); color: var(--paper); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--teal-soft);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tag--coral { background: var(--coral); }
.tag--paper { background: var(--paper); }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--teal-dark);
}
.crumbs__item { display: inline-flex; align-items: center; gap: 6px; }
.crumbs__item + .crumbs__item::before { content: "/"; color: var(--line); }
.crumbs__link {
  color: var(--teal-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease), color var(--ease);
}
.crumbs__link:hover { border-bottom-color: var(--coral); color: var(--coral-dark); }
.crumbs__current { color: var(--ink); }

.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }

/* ---------- 10. 图片容器（页面阶段放置占位） ---------- */
.media {
  position: relative;
  overflow: hidden;
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow-soft);
  background: var(--paper);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media--wide { aspect-ratio: 16 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--tall { aspect-ratio: 3 / 4; }
.media--placeholder {
  background-image:
    repeating-linear-gradient(135deg, rgba(11, 42, 74, .10) 0 10px, rgba(11, 42, 74, 0) 10px 20px),
    linear-gradient(155deg, var(--teal-wash), var(--mist) 60%, var(--paper));
}
.media__caption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--teal-dark);
}

/* ---------- 11. 响应式 ---------- */
@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__bottom-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
  }
  .footer__note { flex: 1 1 100%; }
}

@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: 1.4fr .85fr .9fr .8fr 1.35fr; }
  .footer__note { flex: 0 1 52ch; }
}

@media (max-width: 1099px) {
  .util-strip__brand { display: none; }
  .nav__idx { display: none; }
  .nav__link { padding: 8px 9px; font-size: 14px; }
  .brand__sub { font-size: 10px; }
}

/* --- 移动端：命令栏折叠为底部吸附索引 --- */
@media (max-width: 899px) {
  .util-strip { display: none; }

  .cmdbar__inner {
    min-height: 64px;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 10px;
    padding-block: 9px;
  }
  .brand__mark { width: 38px; height: 38px; font-size: 14px; box-shadow: 3px 3px 0 var(--coral); }
  .brand__name { font-size: 17px; }
  .brand__sub { font-size: 9.5px; letter-spacing: .06em; }

  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 90;
    margin: 0;
    max-height: 84vh;
    overflow-y: auto;
    padding: 18px var(--pad) calc(20px + env(safe-area-inset-bottom));
    background: var(--deep);
    border-top: var(--bw) solid var(--ink);
    transform: translateY(104%);
    visibility: hidden;
    transition: transform 200ms cubic-bezier(.2, .7, .3, 1), visibility 200ms;
  }
  .site-header[data-open] .nav { transform: translateY(0); visibility: visible; }

  .nav__title {
    display: block;
    margin-bottom: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--teal-soft);
  }
  .nav__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 12px;
    background: var(--paper);
    border: 2px solid var(--ink);
    box-shadow: 4px 4px 0 rgba(7, 27, 46, .55);
    font-size: 15px;
    font-weight: 600;
  }
  .nav__idx { display: inline; font-size: 11px; }
  .nav__link:hover { background: var(--teal-soft); color: var(--ink); }
  .nav__link[aria-current="page"] {
    background: var(--teal-wash);
    box-shadow: inset 0 3px 0 var(--coral);
  }

  .nav-toggle { display: inline-flex; }
  .cmdbar__actions { margin-left: 0; }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-scrim { display: none; }
}

@media (max-width: 560px) {
  .brand__sub { display: none; }
  .cmdbar__actions .btn--cta { display: none; }
  .nav__list { grid-template-columns: 1fr; }
  .to-top { right: 12px; bottom: 12px; width: 42px; height: 42px; }
}

/* ---------- 12. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .btn:hover { transform: none; }
}
