/* ============================================================
   博业赛场 · /assets/site.css
   共享外壳：reset、变量、排版、页头、页脚、通用组件
   ============================================================ */

/* ---------- 1. 变量 ---------- */
:root {
  --ink-900: #050807;
  --pitch: #0B1F1A;
  --char: #111417;
  --chalk: #F4F7F2;
  --turf: #8FA39A;
  --cyan: #2FF3D0;
  --orange: #FF6A2A;
  --amber: #FFB020;
  --ice: #6DC8FF;
  --edge: #2A3531;
  --mint: #D7FFF7;

  --body-text: #D9E4DF;
  --muted: #9FB2AA;
  --faint: #7B8C85;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --grid-gap: clamp(14px, 2vw, 24px);
  --header-h: 66px;
  --ease: cubic-bezier(.22, .7, .28, 1);
}

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

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

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--body-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .015em;
  color: var(--chalk);
  text-wrap: balance;
}

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

/* ---------- 3. 排版工具 ---------- */
.container {
  width: min(calc(100% - var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--cyan);
  flex: none;
}

.serif-note {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: clamp(40px, 7vw, 88px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.03em;
  color: var(--chalk);
  font-variant-numeric: tabular-nums;
}

.u-cyan { color: var(--cyan); }
.u-orange { color: var(--orange); }
.u-amber { color: var(--amber); }
.u-ice { color: var(--ice); }
.u-muted { color: var(--muted); }

.u-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
}

/* ---------- 4. 跳过链接 ---------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 120;
  transform: translate(-50%, -130%);
  padding: 10px 18px;
  border-radius: 0 0 14px 14px;
  background: var(--cyan);
  color: #03231D;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s var(--ease);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
  outline: 2px solid var(--chalk);
  outline-offset: 2px;
}

/* ---------- 5. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--pitch);
  border-bottom: 1px solid var(--edge);
  color: var(--chalk);
}

.header-rail {
  background: var(--ink-900);
  border-bottom: 1px solid var(--edge);
}

.header-rail__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--faint);
}

.rail-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.rail-legend {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
}

.rail-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--turf);
  display: inline-block;
}

.dot--cyan { background: var(--cyan); box-shadow: 0 0 0 3px rgba(47, 243, 208, .15); }
.dot--amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(255, 176, 32, .15); }
.dot--ice { background: var(--ice); box-shadow: 0 0 0 3px rgba(109, 200, 255, .15); }
.dot--orange { background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 42, .15); }

.header-bar {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 26px);
  min-height: var(--header-h);
  padding-block: 10px;
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
  padding: 4px 2px;
  color: var(--chalk);
  text-decoration: none;
  border-radius: 14px;
}

.brand__mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--char);
  border: 1px solid var(--edge);
  overflow: hidden;
}

.brand__mark::before {
  content: "";
  position: absolute;
  left: -8px;
  top: -8px;
  width: 38px;
  height: 38px;
  background: var(--cyan);
  opacity: .92;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.brand__mark::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 106, 42, .18);
}

.brand__text { display: block; }

.brand__name {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.25;
  color: var(--chalk);
}

.brand__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--turf);
}

.brand--footer .brand__mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.brand--footer .brand__mark::before {
  width: 46px;
  height: 46px;
}

/* 主导航 */
.primary-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.primary-nav__list a {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease);
}

.primary-nav__list a:hover {
  color: var(--chalk);
  background: rgba(244, 247, 242, .06);
}

.primary-nav__list a[aria-current="page"] {
  color: var(--chalk);
  background: rgba(47, 243, 208, .1);
  border-color: rgba(47, 243, 208, .55);
}

.nav-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--faint);
}

.primary-nav__list a:hover .nav-idx { color: var(--turf); }
.primary-nav__list a[aria-current="page"] .nav-idx { color: var(--cyan); }

.nav-aside { display: none; }

/* 右侧动作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 15px;
  background: var(--char);
  color: var(--chalk);
  border: 1px solid var(--edge);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}

.nav-toggle:hover { border-color: #45574F; }

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 15px;
  height: 11px;
  flex: none;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--cyan);
  transition: transform .22s var(--ease), opacity .16s linear;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

.nav-toggle__label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
}

/* 滚动进度条 */
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

/* ---------- 6. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-pill);
  background: var(--char);
  color: var(--chalk);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}

.btn:hover { border-color: #45574F; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #03231D;
}

.btn--primary:hover {
  background: #63F7DF;
  border-color: #63F7DF;
}

.btn--ghost {
  background: transparent;
  color: var(--chalk);
  border-color: #3C4C46;
}

.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(47, 243, 208, .07);
}

.btn--sm {
  min-height: 38px;
  padding: 0 15px;
  font-size: 13px;
}

/* ---------- 7. 通用标签 / 面包屑 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-pill);
  background: rgba(244, 247, 242, .04);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.tag--plain { color: var(--muted); }
.tag--cyan { color: var(--cyan); border-color: rgba(47, 243, 208, .4); background: rgba(47, 243, 208, .1); }
.tag--amber { color: var(--amber); border-color: rgba(255, 176, 32, .4); background: rgba(255, 176, 32, .1); }
.tag--ice { color: var(--ice); border-color: rgba(109, 200, 255, .4); background: rgba(109, 200, 255, .1); }
.tag--orange { color: var(--orange); border-color: rgba(255, 106, 42, .4); background: rgba(255, 106, 42, .1); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--faint);
}

.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }

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

.breadcrumb a {
  color: var(--turf);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}

.breadcrumb a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.breadcrumb [aria-current="page"] { color: var(--chalk); }

/* ---------- 8. 正文容器 / 网格 / 卡片 ---------- */
.section {
  padding-block: clamp(38px, 6vw, 78px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(18px, 3vw, 30px);
}

.prose {
  max-width: 68ch;
  color: var(--body-text);
  font-size: 16px;
  line-height: 1.85;
}

.prose > * + * { margin-top: 1.05em; }

.prose h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin-top: 1.9em;
}

.prose h3 {
  font-size: 19px;
  margin-top: 1.6em;
}

.prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose strong { color: var(--chalk); }

.prose ul,
.prose ol {
  padding-left: 1.2em;
  list-style: disc;
}

.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }

.prose code {
  font-family: var(--font-mono);
  font-size: .92em;
  color: var(--mint);
}

.grid {
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: 1fr;
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  position: relative;
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid var(--edge);
  border-radius: var(--radius-md);
  background: var(--char);
}

/* ---------- 9. 图片容器基础规则 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  background-color: var(--char);
  background-image:
    linear-gradient(rgba(143, 163, 154, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 163, 154, .09) 1px, transparent 1px);
  background-size: 28px 28px;
}

.media-frame > img,
.media-frame > picture,
.media-frame > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

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

.media-frame img {
  filter: saturate(.78) contrast(1.06) brightness(.94);
}

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

.media-frame--cut {
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 6px 6px;
}

.media-frame__caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  right: 12px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: rgba(5, 8, 7, .78);
  color: var(--chalk);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  line-height: 1.5;
}

/* ---------- 10. 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--ink-900);
  color: var(--muted);
  border-top: 1px solid var(--edge);
}

.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg,
    var(--cyan) 0 25%,
    var(--orange) 25% 50%,
    var(--amber) 50% 75%,
    var(--ice) 75% 100%);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 60px);
  padding-block: clamp(40px, 6vw, 76px) clamp(30px, 4vw, 52px);
}

.footer-summary {
  margin-top: 16px;
  max-width: 34ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

.legend-list {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-pill);
  background: var(--pitch);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--turf);
  white-space: nowrap;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.footer-col__title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--edge);
  color: var(--chalk);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.footer-links li + li { margin-top: 2px; }

.footer-links a {
  display: inline-block;
  padding: 5px 0;
  color: var(--muted);
  font-size: 14.5px;
  text-decoration: none;
  transition: color .18s var(--ease);
}

.footer-links a:hover { color: var(--cyan); }

.contact-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(42, 53, 49, .85);
}

.contact-row:last-of-type { border-bottom: 0; }

.contact-row__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.contact-row span:last-child {
  color: var(--chalk);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.contact-note {
  margin-top: 14px;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.7;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px 26px;
  border-top: 1px solid var(--edge);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--faint);
}

.footer-copy { color: var(--turf); }
.footer-meta { color: var(--faint); }

/* ---------- 11. 显现动效 ---------- */
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}

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

/* ---------- 12. 移动端页头 ---------- */
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: block;
    margin-left: 0;
    padding: 10px var(--gutter) 22px;
    background: var(--pitch);
    border-block: 1px solid var(--edge);
    box-shadow: 0 26px 44px rgba(0, 0, 0, .55);
    max-height: calc(100vh - 104px);
    max-height: calc(100dvh - 104px);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }

  .primary-nav[data-open] {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 6px;
  }

  .primary-nav__list a {
    justify-content: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(244, 247, 242, .03);
    border-color: transparent;
    font-size: 16px;
  }

  .primary-nav__list a[aria-current="page"] {
    border-color: rgba(47, 243, 208, .55);
    background: rgba(47, 243, 208, .1);
  }

  .nav-idx { font-size: 11px; min-width: 20px; }

  .nav-aside {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--edge);
  }

  .nav-aside .btn { flex: 1 1 0; }

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

@media (max-width: 860px) {
  .grid--2,
  .grid--3 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .header-rail__inner { min-height: 32px; }
  .rail-item { display: none; }
  .rail-legend {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
    letter-spacing: .04em;
  }

  .footer-top { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-summary { max-width: none; }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 1040px) and (min-width: 721px) {
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .nav-toggle__label { display: none; }
  .nav-toggle { padding: 0 13px; }
  .brand__sub { display: none; }
  .footer-nav { grid-template-columns: 1fr; }
  .legend-list li { font-size: 10px; padding: 4px 9px; }
}

/* ---------- 13. 降低动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

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

  .skip-link { transition: none; }
}
