/* =========================================================
   B体育中文站 · /assets/site.css
   共享外壳：重置 / 变量 / 排版 / 顶栏 / 导航轨道 / 页脚 / 基础组件
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol { margin: 0; }

ul, ol { list-style: none; padding: 0; }

img, svg, video { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid #FF7A3D;
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- 2. 变量 ---------- */
:root {
  --ink-900: #0B1C15;
  --ink-800: #12291F;
  --ink-700: #2F4F3F;
  --cy: #35E0C0;
  --orange: #FF7A3D;
  --cream: #F4EFE2;
  --brown: #1D1A16;
  --mist: #8FA8A0;
  --ivory: #FBF7EC;
  --red: #E1543A;

  --edge: rgba(53, 224, 192, .16);
  --edge-soft: rgba(143, 168, 160, .24);
  --dim: rgba(143, 168, 160, .62);

  --rail-w: 224px;
  --header-h: 76px;
  --gutter: clamp(1.15rem, 4vw, 3.2rem);
  --maxw: 1180px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur-1: 220ms;
  --dur-2: 320ms;
  --dur-3: 420ms;

  --font-display: "Helvetica Neue", "Arial Narrow", system-ui, -apple-system,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono",
    Menlo, Consolas, "Courier New", monospace;
}

html[data-theme="night"] {
  --cream: #0E1F18;
  --brown: #DCE9E3;
  --ink-800: #0E211A;
  --edge: rgba(53, 224, 192, .26);
}

/* ---------- 3. 中文排版基座 ---------- */
body {
  min-height: 100vh;
  background: var(--ink-900);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

p { max-width: 68ch; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2.4rem, 7vw, 5rem); line-height: 1; letter-spacing: -.03em; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.12rem, 2vw, 1.42rem); }
h4 { font-size: 1rem; }

strong { font-weight: 700; }

.num,
[data-num] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

@media (min-width: 1040px) {
  body {
    font-size: 17px;
    padding-left: var(--rail-w);
  }
}

html.is-nav-locked { overflow: hidden; }

/* ---------- 4. 跳转链接 & 进度条 ---------- */
.skip-link {
  position: absolute;
  top: 0;
  left: clamp(.6rem, 3vw, 1.6rem);
  z-index: 300;
  padding: .7rem 1.15rem;
  background: var(--cy);
  color: var(--ink-900);
  font-weight: 700;
  font-size: .84rem;
  letter-spacing: .06em;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transform: translateY(-140%);
  transition: transform var(--dur-2) var(--ease);
}

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

.scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 5;
  background: linear-gradient(90deg, var(--cy), var(--orange));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- 5. 顶栏 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: clamp(.6rem, 2vw, 1.4rem);
  padding: 0 var(--gutter);
  background: rgba(11, 28, 21, .9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--edge);
  transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.site-header[data-scrolled] {
  background: rgba(8, 21, 16, .97);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .38);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--cy), rgba(53, 224, 192, 0) 52%, var(--orange));
  opacity: .55;
  pointer-events: none;
}

/* ---------- 6. 品牌标记 ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  padding-right: .9rem;
  transition: opacity var(--dur-1) var(--ease);
}

.brand__glyph {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: var(--cy);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -.05em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.brand__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.15;
  letter-spacing: .02em;
  color: var(--ivory);
  white-space: nowrap;
}

.brand__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .24em;
  line-height: 1.5;
  color: var(--dim);
  white-space: nowrap;
}

.brand:hover .brand__glyph { background: var(--ivory); }

/* ---------- 7. 导航轨道 ---------- */
.site-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 110;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.3rem;
  padding: 2rem 1.15rem 2rem 1.5rem;
  background: linear-gradient(180deg, #0B1C15 0%, #0D2419 58%, #0B1C15 100%);
  border-right: 1px solid var(--edge);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    112deg,
    rgba(53, 224, 192, .055) 0 1px,
    rgba(53, 224, 192, 0) 1px 24px
  );
  pointer-events: none;
}

.site-nav > * { position: relative; }

.site-nav__legend,
.site-nav__foot {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .22em;
  color: var(--dim);
  padding-left: .5rem;
  max-width: none;
}

.site-nav__foot { letter-spacing: .18em; }

.rail {
  display: flex;
  flex-direction: column;
  gap: .18rem;
}

.rail__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: .7rem;
  padding: .58rem .7rem;
  color: var(--mist);
  text-decoration: none;
  font-size: .97rem;
  font-weight: 600;
  letter-spacing: .04em;
  transition: color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease),
              padding-left var(--dur-2) var(--ease);
}

.rail__index {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .66rem;
  letter-spacing: .1em;
  color: var(--ink-700);
  transition: color var(--dur-1) var(--ease);
}

.rail__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 1px;
  background: var(--cy);
  transform: translateY(-50%);
  transition: width var(--dur-2) var(--ease);
}

.rail__link:hover { color: var(--ivory); padding-left: 1.05rem; }
.rail__link:hover .rail__index { color: var(--cy); }
.rail__link:hover::before { width: .7rem; }

.rail__link[aria-current="page"] {
  color: var(--ink-900);
  background: var(--cy);
  padding-left: 1.05rem;
  clip-path: polygon(0 0, 100% 0, calc(100% - 11px) 100%, 0 100%);
}

.rail__link[aria-current="page"] .rail__index { color: rgba(11, 28, 21, .58); }
.rail__link[aria-current="page"]::before { width: 0; }

/* ---------- 8. 顶栏工具 ---------- */
.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.collect {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .42rem .8rem;
  border: 1px solid var(--edge);
  background: rgba(53, 224, 192, .07);
  color: var(--ivory);
  text-decoration: none;
  font-size: .82rem;
  letter-spacing: .06em;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}

.collect__count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .72rem;
  line-height: 1.5;
  padding: .02rem .42rem;
  background: var(--orange);
  color: #1D1A16;
}

.collect:hover { background: rgba(53, 224, 192, .16); border-color: var(--cy); }

.theme-toggle {
  cursor: pointer;
  padding: .42rem .72rem;
  border: 1px solid var(--edge-soft);
  background: transparent;
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  transition: color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}

.theme-toggle:hover { color: var(--cy); border-color: var(--cy); }

.theme-toggle[aria-pressed="true"] {
  background: var(--cy);
  border-color: var(--cy);
  color: var(--ink-900);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  padding: .42rem .75rem;
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--ivory);
  font-size: .78rem;
  letter-spacing: .1em;
}

.nav-toggle__box {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle__bar { display: block; }

.nav-toggle__box::before,
.nav-toggle__box::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur-2) var(--ease), opacity var(--dur-1) linear;
}

.nav-toggle__box::before { top: -5px; }
.nav-toggle__box::after { top: 5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__box { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__box::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__box::after { transform: translateY(-5px) rotate(-45deg); }

/* ---------- 9. 遮罩 ---------- */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: rgba(5, 14, 10, .68);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease);
}

.nav-scrim[data-visible] { opacity: 1; pointer-events: auto; }

/* ---------- 10. 移动端 / 平板：抽屉 ---------- */
@media (max-width: 1039px) {
  :root { --header-h: 66px; }

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

  .site-nav {
    top: 0;
    bottom: 0;
    left: auto;
    right: 0;
    width: min(85vw, 320px);
    justify-content: flex-start;
    padding: calc(var(--header-h) + 2.4rem) 1.5rem 2.4rem;
    background: var(--ink-800);
    border-right: 0;
    border-left: 1px solid var(--edge);
    box-shadow: -26px 0 64px rgba(0, 0, 0, .48);
    clip-path: polygon(19% 0, 100% 0, 100% 100%, 0 100%);
    transform: translateX(103%);
    transition: transform var(--dur-3) var(--ease);
    z-index: 130;
  }

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

  .site-nav__legend { margin-bottom: .4rem; }
  .site-nav__foot { margin-top: 1rem; }

  .rail { gap: .3rem; }

  .rail__link {
    font-size: 1.02rem;
    padding: .72rem .8rem;
  }

  .brand__tag { display: none; }
  .collect__label { display: none; }
  .theme-toggle__text { display: none; }
  .theme-toggle { padding: .42rem .6rem; }
}

@media (max-width: 420px) {
  .brand__name { font-size: .94rem; }
  .nav-toggle__text { display: none; }
}

/* ---------- 11. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 9vw, 7rem);
  padding: clamp(2.6rem, 6vw, 4.6rem) var(--gutter) 1.8rem;
  background: var(--ink-900);
  border-top: 1px solid var(--edge);
  color: var(--mist);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(130px, 24vw, 340px);
  height: 2px;
  background: linear-gradient(90deg, var(--cy), var(--orange));
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.8rem, 4vw, 2.8rem);
  max-width: var(--maxw);
}

.footer__mark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.16rem;
  letter-spacing: -.01em;
  color: var(--ivory);
  text-decoration: none;
}

.footer__mark:hover { color: var(--cy); }

.footer__line {
  margin-top: .85rem;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--mist);
  max-width: 34ch;
}

.footer__stamp {
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .16em;
  color: var(--dim);
}

.foot-rail__title {
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--cy);
  margin-bottom: 1rem;
}

.foot-rail__list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.foot-rail__list a {
  display: inline-block;
  font-size: .88rem;
  letter-spacing: .03em;
  color: var(--ivory);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease), transform var(--dur-2) var(--ease);
}

.foot-rail__list a:hover { color: var(--cy); transform: translateX(5px); }

.foot-rail__meta {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  font-size: .82rem;
  line-height: 1.62;
  color: var(--mist);
}

.foot-rail__meta strong {
  display: block;
  font-family: var(--font-mono);
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--dim);
  margin-bottom: .1rem;
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1.6rem;
  margin-top: clamp(2rem, 5vw, 3.4rem);
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(143, 168, 160, .28);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--dim);
}

.footer__base p { max-width: none; }

@media (min-width: 640px) {
  .footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}

@media (min-width: 1040px) {
  .footer__inner {
    grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr));
    column-gap: clamp(1.4rem, 3vw, 2.4rem);
  }
  .footer__brand { grid-column: auto; }
}

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

.zone { padding-block: clamp(2.6rem, 7vw, 5.4rem); }
.zone--cream { background: var(--cream); color: var(--brown); }
.zone--panel { background: var(--ink-800); }
.zone--tight { padding-block: clamp(1.6rem, 4vw, 2.8rem); }

.rule-slant {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--cy), rgba(53, 224, 192, .05) 60%, var(--orange));
  transform: rotate(-1.4deg);
  transform-origin: left center;
  opacity: .7;
}

/* ---------- 13. 切角与面板 ---------- */
.cut { clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%); }
.cut--bl { clip-path: polygon(0 0, 100% 0, 100% 100%, 26px 100%, 0 calc(100% - 26px)); }

.panel {
  position: relative;
  padding: clamp(1.1rem, 3vw, 1.8rem);
  background: var(--ink-800);
  border: 1px solid var(--edge);
}

.panel--cut {
  border: 0;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px var(--edge);
}

.zone--cream .panel {
  background: rgba(11, 28, 21, .05);
  border-color: rgba(29, 26, 22, .2);
}

.zone--cream .panel--cut { box-shadow: inset 0 0 0 1px rgba(29, 26, 22, .22); }

/* ---------- 14. 索引标签 / 数据块 ---------- */
.tag {
  display: inline-block;
  padding-left: .55rem;
  border-left: 2px solid var(--cy);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .18em;
  color: var(--cy);
}

.zone--cream .tag { color: var(--brown); border-left-color: var(--orange); }

.metric { display: block; }

.metric__value {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 2.9rem);
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--ivory);
}

.metric__value--hot { color: var(--orange); }
.zone--cream .metric__value { color: var(--brown); }

.metric__label {
  display: block;
  margin-top: .5rem;
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .2em;
  color: var(--mist);
}

.zone--cream .metric__label { color: rgba(29, 26, 22, .62); }

/* ---------- 15. 按钮 / 筛选 chip ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1.4rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: background var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
}

.btn--solid { background: var(--cy); color: #0B1C15; }
.btn--solid:hover { background: var(--ivory); }

.btn--mark { background: var(--orange); color: #1D1A16; }
.btn--mark:hover { background: #FF9A66; }

.btn--ghost { border-color: var(--edge-soft); color: var(--ivory); }
.btn--ghost:hover { border-color: var(--cy); color: var(--cy); }

.zone--cream .btn--ghost { color: var(--brown); border-color: rgba(29, 26, 22, .28); }
.zone--cream .btn--ghost:hover { border-color: var(--brown); color: var(--brown); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .42rem .9rem;
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .1em;
  color: var(--mist);
  background: transparent;
  border: 1px solid var(--edge-soft);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
}

.chip:hover { color: var(--ivory); border-color: var(--cy); }

.chip[aria-pressed="true"],
.chip[data-active] {
  background: var(--cy);
  border-color: var(--cy);
  color: #0B1C15;
}

.zone--cream .chip { color: rgba(29, 26, 22, .72); border-color: rgba(29, 26, 22, .24); }
.zone--cream .chip:hover { color: var(--brown); border-color: var(--brown); }

/* ---------- 16. 面包屑 ---------- */
.crumbs {
  padding-block: 1rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .14em;
  color: var(--mist);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.crumbs li { display: inline-flex; align-items: center; gap: .55rem; }
.crumbs li + li::before { content: "/"; color: var(--ink-700); }
.crumbs a { text-decoration: none; color: var(--mist); }
.crumbs a:hover { color: var(--cy); }
.crumbs [aria-current="page"] { color: var(--ivory); }

/* ---------- 17. 响应式图片容器 ---------- */
.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: linear-gradient(140deg, var(--ink-800), var(--ink-700));
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%);
}

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

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.92) contrast(1.05);
}

.media__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: .5rem .85rem;
  background: rgba(11, 28, 21, .84);
  color: var(--ivory);
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .14em;
}

/* ---------- 18. 显现协议 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
}

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

/* ---------- 19. reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .site-nav { transition: none !important; }
  .scroll-progress { transition: none !important; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
