/* ============================================================
   /assets/site.css — BOGO博狗 短路径索引站 共享样式
   01 重置与变量 / 02 中文排版 / 03 头部 / 04 页脚 / 05 通用组件
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 132px;
}
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

:root {
  --ink: #0A0E0D;
  --panel: #151C1A;
  --moss: #1E2B25;
  --line: #2C3833;
  --mint: #39F2B0;
  --mint-soft: #B7FFE4;
  --amber: #FFB24A;
  --clay: #C96F45;
  --paper: #F4F0E6;
  --alert: #E05A47;

  --text: #E4E2D8;
  --text-dim: #8FA097;
  --text-faint: #5E6E67;

  --font-display: "Helvetica Neue", "Arial Narrow", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Consolas", "Liberation Mono", monospace;

  --shell-w: 1240px;
  --cut: 14px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 02 中文排版与基础 ---------- */
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--ink);
  background-image:
    radial-gradient(900px 520px at 86% -8%, rgba(57, 242, 176, .10), transparent 62%),
    radial-gradient(760px 460px at 2% 2%, rgba(30, 43, 37, .95), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.022em;
  line-height: 1.14;
  color: var(--paper);
}
h1 { font-size: clamp(32px, 5.2vw, 60px); }
h2 { font-size: clamp(24px, 3.2vw, 38px); }
h3 { font-size: clamp(18px, 2vw, 22px); }
p { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

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

.shell {
  width: min(var(--shell-w), calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- 03 页头 ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--mint);
  color: #08110D;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(10, 14, 13, .94);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.header-strip {
  background: var(--moss);
  border-bottom: 1px solid var(--line);
}
.strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 18px;
  padding-block: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.strip__note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mint);
}
.strip__dot {
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(57, 242, 176, .16);
}
.strip__meta { color: var(--text-faint); }

.header__bar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px 28px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--paper);
  text-decoration: none;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  background: var(--mint);
  color: #08110D;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: background-color .2s var(--ease);
}
.brand:hover .brand__mark { background: var(--mint-soft); }
.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand__sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.site-nav {
  grid-column: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-list {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.nav-item { display: flex; }
.nav-link {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  gap: 1px;
  padding: 6px 12px 10px;
  border-left: 1px solid var(--line);
  color: var(--text-dim);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.nav-item:first-child .nav-link { border-left: 0; }
.nav-link__idx {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--mint);
  transition: color .2s var(--ease);
}
.nav-link__label {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  background: var(--mint);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s var(--ease);
}
.nav-link:hover { color: var(--paper); }
.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--paper); }
.nav-link[aria-current="page"] .nav-link__idx { color: var(--amber); }
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--amber);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--mint);
  color: #08110D;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.nav-cta:hover { background: var(--mint-soft); transform: translateX(2px); }
.nav-cta__idx { font-family: var(--font-mono); font-size: 13px; }

.nav-toggle {
  display: none;
  grid-column: 2;
  justify-self: end;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mint);
  cursor: pointer;
}
.nav-toggle__bars { display: grid; gap: 4px; }
.nav-toggle__bars i {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
.nav-toggle__text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
}
.site-header[data-nav-open="true"] .nav-toggle__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-header[data-nav-open="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.site-header[data-nav-open="true"] .nav-toggle__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.scroll-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}
.scroll-rail__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--amber));
  transition: width .1s linear;
}

/* ---------- 04 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 8vw, 120px);
  background: var(--moss);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 130px;
  pointer-events: none;
  background-image: repeating-linear-gradient(115deg, rgba(57, 242, 176, .09) 0 1px, transparent 1px 14px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}

.footer__top {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 32px;
  padding-block: clamp(30px, 4.5vw, 54px) 22px;
  border-bottom: 1px solid var(--line);
}
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__brandline {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vw, 30px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  color: var(--paper);
}
.footer__brandsub {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.footer__line {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .3em;
  color: rgba(57, 242, 176, .55);
}

.footer__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1.15fr .9fr;
  gap: clamp(22px, 4vw, 56px);
  padding-block: clamp(26px, 3.6vw, 44px);
}
.footer__col { min-width: 0; }
.footer__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--mint);
}
.footer__title::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--mint);
}
.footer__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding-block: 7px;
  border-top: 1px solid rgba(44, 56, 51, .7);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
}
.footer__list li:first-child { border-top: 0; }
.footer__list a {
  color: var(--text);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.footer__list a:hover { color: var(--mint); }
.footer__k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--amber);
}
.footer__v { color: var(--text); word-break: break-word; }
.footer__note {
  margin-top: 14px;
  max-width: 32ch;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-faint);
}

.copy-btn {
  padding: 2px 7px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}
.copy-btn:hover { color: var(--mint); border-color: var(--mint); }
.copy-btn[data-copied="true"] { color: var(--amber); border-color: var(--amber); }

.footer__bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 16px 26px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text-faint);
}
.footer__legal { color: var(--text-dim); }
.footer__copy { color: var(--text-faint); }

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--panel);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(57, 242, 176, .7);
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s, background-color .2s var(--ease);
}
.to-top[data-visible="true"] { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: rgba(57, 242, 176, .12); }

/* ---------- 05 通用组件 ---------- */
.section { padding-block: clamp(40px, 6vw, 88px); }
.section--rule { border-top: 1px solid var(--line); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--mint);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  flex: none;
  background: currentColor;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(20px, 3vw, 36px);
}
.section-sub {
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
}

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

.cut {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.panel {
  position: relative;
  padding: clamp(18px, 2.4vw, 28px);
  background: var(--panel);
  border: 1px solid var(--line);
}
.panel--cut {
  border: 0;
  background: linear-gradient(150deg, var(--panel), var(--moss));
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.idx {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.02em;
  color: var(--mint);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { border-color: var(--mint); color: var(--mint-soft); }
.btn--primary {
  background: var(--mint);
  border-color: var(--mint);
  color: #08110D;
  font-weight: 800;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.btn--primary:hover { background: var(--mint-soft); border-color: var(--mint-soft); color: #08110D; }
.btn--ghost { background: rgba(57, 242, 176, .06); }
.btn__idx {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  opacity: .72;
}

.breadcrumbs { padding-block: 18px; }
.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.breadcrumbs__list li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs__list li + li::before { content: "/"; color: var(--line); }
.breadcrumbs__list a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.breadcrumbs__list a:hover { color: var(--mint); border-color: var(--mint); }
.breadcrumbs__list [aria-current="page"] { color: var(--amber); }

.prose {
  max-width: 68ch;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
}
.prose p + p { margin-top: 1em; }
.prose a { color: var(--mint-soft); text-decoration-color: var(--line); text-underline-offset: 3px; }
.prose a:hover { color: var(--mint); text-decoration-color: var(--mint); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 178, 74, .32);
  background: rgba(255, 178, 74, .1);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
}

.toc {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.toc__link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 7px 0;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  transition: color .2s var(--ease), padding-left .2s var(--ease);
}
.toc__link::before {
  content: attr(data-idx);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text-faint);
  transition: color .2s var(--ease);
}
.toc__link:hover,
.toc__link:focus-visible { color: var(--mint-soft); padding-left: 3px; }
.toc__link[data-active="true"] { color: var(--amber); }
.toc__link[data-active="true"]::before { color: var(--amber); }

.media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--panel);
  border: 1px solid var(--line);
}
.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 4 / 5; }
.media__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media__caption {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 8px 12px;
  background: rgba(10, 14, 13, .72);
  color: var(--mint-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
}
.media__placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .2em;
  background-image: repeating-linear-gradient(135deg, rgba(57, 242, 176, .05) 0 2px, transparent 2px 12px);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .nav-link { padding-inline: 10px; }
  .nav-link::after { left: 10px; right: 10px; }
}

@media (max-width: 960px) {
  html { scroll-padding-top: 118px; }
  .header__bar { grid-template-columns: 1fr auto; }
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    grid-column: 1 / -1;
    justify-self: stretch;
    display: block;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 8px clamp(16px, 4vw, 24px) 22px;
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  }
  .site-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-item { display: block; }
  .nav-link {
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    gap: 10px;
    padding: 13px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .nav-item:first-child .nav-link { border-top: 0; }
  .nav-link__idx { font-size: 15px; }
  .nav-link__label { font-size: 17px; white-space: normal; }
  .nav-link::after { left: 0; right: auto; width: 56px; bottom: 8px; }
  .nav-cta {
    margin-top: 18px;
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
    font-size: 14px;
  }

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__col:first-child { grid-column: 1 / -1; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .shell { width: calc(100% - 32px); }
  .strip__meta { display: none; }
  .brand__sub { display: none; }
  .footer__top { align-items: flex-start; }
  .footer__line { display: none; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .to-top { right: 14px; bottom: 14px; padding: 9px 12px; }
}

@media (max-width: 620px) {
  .footer__grid { grid-template-columns: 1fr; gap: 26px; }
  .footer__bottom { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .nav-link::after { transition: none; }
  .to-top { transform: none; }
}
