/* ============================================================
   必搏官网 — 共享站点套件
   文件位置：/assets/site.css
   ============================================================ */

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

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

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; }

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

/* ---------- 2. Tokens ---------- */
:root {
  --ink-900: #0A1424;
  --ink-800: #111F33;
  --ink-700: #1B2B47;
  --paper-100: #F4EBDD;
  --cyan-400: #19E3D1;
  --orange-500: #FF8A3D;
  --mint-300: #7FE3B0;
  --mist-300: #C9D3DF;
  --print-red: #E4572E;
  --deep-cyan: #0E7C7B;

  --text: var(--mist-300);
  --text-strong: var(--paper-100);
  --surface: var(--ink-800);
  --line: var(--ink-700);

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --wrap: 1320px;
  --wrap-narrow: 860px;
  --gutter: clamp(16px, 3.2vw, 44px);
  --radius: 3px;
  --ease: cubic-bezier(.4, .1, .2, 1);
}

/* ---------- 3. Base ---------- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(201, 211, 223, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(201, 211, 223, .05) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(125% 90% at 50% 0%, #000 8%, transparent 76%);
  mask-image: radial-gradient(125% 90% at 50% 0%, #000 8%, transparent 76%);
}

main { display: block; flex: 1 0 auto; }
#main-content { scroll-margin-top: 108px; }

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -.022em;
  color: var(--text-strong);
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 2.9vw, 2.35rem); }
h3 { font-size: clamp(1.12rem, 1.5vw, 1.4rem); letter-spacing: -.012em; }
h4 { font-size: 1rem; letter-spacing: -.005em; }
p { text-wrap: pretty; }
strong { color: var(--text-strong); font-weight: 700; }

/* ---------- 4. Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: clamp(44px, 6.5vw, 92px); }
.section--tight { padding-block: clamp(28px, 4vw, 56px); }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cyan-400);
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 24px;
  height: 2px;
  background: var(--orange-500);
}

.num {
  font-family: var(--font-mono);
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  color: var(--orange-500);
}
.num--cyan { color: var(--cyan-400); }
.num--paper { color: var(--paper-100); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: .62em 1.15em;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .01em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color .16s var(--ease),
    color .16s var(--ease),
    border-color .16s var(--ease),
    transform .16s var(--ease),
    box-shadow .16s var(--ease);
}
.btn--primary {
  background: var(--cyan-400);
  border-color: var(--cyan-400);
  color: #04222b;
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -12px rgba(25, 227, 209, .95);
}
.btn--outline {
  background: transparent;
  border-color: rgba(25, 227, 209, .5);
  color: var(--cyan-400);
}
.btn--outline:hover {
  background: rgba(25, 227, 209, .1);
  border-color: var(--cyan-400);
}
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--mist-300);
}
.btn--ghost:hover {
  background: var(--ink-700);
  border-color: var(--mist-300);
  color: var(--paper-100);
}
.btn--paper {
  background: var(--paper-100);
  border-color: var(--paper-100);
  color: var(--ink-900);
}
.btn--paper:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .95);
}

/* ---------- 6. Header ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 200;
  padding: .7em 1.3em;
  border-radius: 2px;
  background: var(--cyan-400);
  color: #04222b;
  font-size: .9rem;
  font-weight: 700;
  transform: translate(-50%, calc(-100% - 24px));
  transition: transform .18s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--ink-900);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 20px 34px -30px rgba(0, 0, 0, .95);
}

.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, var(--cyan-400) 0%, var(--mint-300) 62%, var(--orange-500) 100%);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.header-frame {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px clamp(16px, 3vw, 40px);
  padding-block: 13px 11px;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 2px;
  background: var(--paper-100);
  color: var(--ink-900);
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--ink-700);
  transition: box-shadow .16s var(--ease);
}
.brand:hover .brand-mark { box-shadow: 3px 3px 0 var(--cyan-400); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--paper-100);
}
.brand-line {
  font-family: var(--font-mono);
  font-size: .66rem;
  line-height: 1.5;
  letter-spacing: .1em;
  color: var(--mist-300);
  opacity: .78;
  white-space: nowrap;
}

.header-status {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  line-height: 1.6;
  color: var(--mist-300);
  white-space: nowrap;
}

.status-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint-300);
  box-shadow: 0 0 0 3px rgba(127, 227, 176, .16);
  animation: statusPulse 2.4s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(127, 227, 176, .16); }
  50% { opacity: .5; box-shadow: 0 0 0 5px rgba(127, 227, 176, 0); }
}

.nav-toggle {
  display: none;
  justify-self: end;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--mist-300);
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.nav-toggle:hover { color: var(--paper-100); border-color: var(--cyan-400); }
.nav-toggle-box { display: grid; gap: 3px; width: 16px; }
.nav-toggle-box span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}
.site-header[data-open] .nav-toggle-box span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle-box span:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle-box span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 7px;
  border-top: 1px solid var(--line);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  counter-reset: navidx;
}
.nav-list > li { display: flex; counter-increment: navidx; }
.nav-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: .94rem;
  font-weight: 600;
  letter-spacing: .005em;
  color: var(--mist-300);
  transition:
    color .16s var(--ease),
    background-color .16s var(--ease),
    border-color .16s var(--ease);
}
.nav-list a::before {
  content: counter(navidx, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: currentColor;
  opacity: .42;
}
.nav-list a:hover {
  color: var(--paper-100);
  background: var(--ink-800);
  border-color: var(--line);
}
.nav-list a[aria-current="page"] {
  color: var(--cyan-400);
  background: var(--ink-800);
  border-color: var(--line);
  box-shadow: inset 0 -2px 0 var(--cyan-400);
}
.nav-list a[aria-current="page"]::before { opacity: .95; color: var(--orange-500); }

.nav-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------- 7. Footer ---------- */
.site-footer {
  position: relative;
  flex-shrink: 0;
  background: var(--ink-800);
  border-top: 1px solid var(--line);
  color: var(--mist-300);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--ink-700) 0 8px, transparent 8px 16px);
}

.footer-frame {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(40px, 5.5vw, 72px) var(--gutter) 22px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr .85fr .85fr 1.5fr;
  gap: clamp(26px, 4vw, 56px);
  padding-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.footer-brand-link {
  display: inline-block;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.03em;
  color: var(--paper-100);
  transition: color .16s var(--ease);
}
.footer-brand-link:hover { color: var(--cyan-400); }
.footer-brand-sub {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--cyan-400);
}
.footer-summary {
  margin-top: 14px;
  max-width: 30ch;
  font-size: .95rem;
  line-height: 1.75;
  color: var(--mist-300);
}
.footer-cta { margin-top: 22px; }

.footer-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--paper-100);
}
.footer-col-title::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--orange-500);
}

.footer-links { display: grid; gap: 9px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  color: var(--mist-300);
  transition: color .16s var(--ease);
}
.footer-links a::before {
  content: "";
  flex: none;
  width: 12px;
  height: 1px;
  background: var(--line);
  transition: width .16s var(--ease), background-color .16s var(--ease);
}
.footer-links a:hover { color: var(--paper-100); }
.footer-links a:hover::before { width: 20px; background: var(--cyan-400); }
.footer-links a[aria-current="page"] { color: var(--cyan-400); }
.footer-links a[aria-current="page"]::before { width: 20px; background: var(--cyan-400); }

.footer-contact-list { display: grid; gap: 14px; }
.fc-item {
  display: grid;
  grid-template-columns: 4.6em minmax(0, 1fr);
  gap: 2px 10px;
  align-items: start;
}
.fc-item--action {
  grid-template-columns: 4.6em minmax(0, 1fr) auto;
  align-items: center;
}
.fc-key {
  padding-top: .28em;
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .1em;
  line-height: 1.5;
  color: var(--orange-500);
}
.fc-val {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--mist-300);
  overflow-wrap: anywhere;
}

.copy-btn {
  flex: none;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .08em;
  line-height: 1.6;
  color: var(--mist-300);
  transition:
    color .16s var(--ease),
    background-color .16s var(--ease),
    border-color .16s var(--ease);
}
.copy-btn:hover {
  background: var(--cyan-400);
  border-color: var(--cyan-400);
  color: var(--ink-900);
}
.copy-btn.is-copied {
  background: var(--mint-300);
  border-color: var(--mint-300);
  color: var(--ink-900);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .06em;
  line-height: 1.7;
  color: var(--mist-300);
}
.footer-note, .footer-icp { margin: 0; opacity: .82; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-legal a {
  border-bottom: 1px solid transparent;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.footer-legal a:hover { color: var(--cyan-400); border-bottom-color: var(--cyan-400); }

/* ---------- 8. Panels & bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 20px);
}
.bento > * { min-width: 0; }

.panel {
  position: relative;
  padding: clamp(18px, 2.2vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-800);
}
.panel--paper {
  background: var(--paper-100);
  border-color: var(--paper-100);
  color: var(--ink-800);
}
.panel--paper h2,
.panel--paper h3,
.panel--paper h4 { color: var(--ink-900); }
.panel--paper p { color: var(--ink-800); }
.panel--paper .eyebrow { color: var(--deep-cyan); }
.panel--paper .num { color: var(--print-red); }
.panel--paper .tag { border-color: rgba(17, 31, 51, .28); background: rgba(255, 255, 255, .4); color: var(--ink-800); }

.paper-stack { position: relative; }
.paper-stack::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: translate(9px, 9px);
  border: 1px solid rgba(201, 211, 223, .22);
  border-radius: var(--radius);
  pointer-events: none;
}

/* ---------- 9. Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(27, 43, 71, .55);
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .08em;
  line-height: 1.7;
  color: var(--mist-300);
  white-space: nowrap;
}
.tag--cyan { color: var(--cyan-400); border-color: rgba(25, 227, 209, .42); }
.tag--mint { color: var(--mint-300); border-color: rgba(127, 227, 176, .42); }
.tag--orange { color: var(--orange-500); border-color: rgba(255, 138, 61, .42); }
.tag--paper {
  background: var(--paper-100);
  border-color: var(--paper-100);
  color: var(--ink-900);
}

/* ---------- 10. Media frames ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-900);
}
.media-frame > img,
.media-frame > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(10, 20, 36, .2) 0,
    rgba(10, 20, 36, .2) 1px,
    transparent 1px,
    transparent 3px
  );
}
.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--screen {
  aspect-ratio: 16 / 9;
  border-color: var(--ink-700);
  box-shadow: inset 0 0 0 7px var(--ink-900), inset 0 0 0 8px var(--ink-700);
}

/* ---------- 11. Breadcrumb ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  line-height: 1.8;
  color: var(--mist-300);
}
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.breadcrumb a { color: var(--mist-300); transition: color .16s var(--ease); }
.breadcrumb a:hover { color: var(--cyan-400); }
.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--ink-700);
}
.breadcrumb [aria-current="page"] { color: var(--paper-100); }

/* ---------- 12. Prose ---------- */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.05em; }
.prose p { color: var(--mist-300); }
.prose h2 { margin-top: 2.1em; }
.prose h3 { margin-top: 1.7em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose li { color: var(--mist-300); }
.prose li::marker { color: var(--cyan-400); }
.prose a {
  color: var(--cyan-400);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover { color: var(--mint-300); }
.prose blockquote {
  padding-left: 16px;
  border-left: 2px solid var(--orange-500);
  color: var(--paper-100);
}
.prose code {
  padding: .1em .4em;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--ink-800);
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--cyan-400);
}

/* ---------- 13. Reveal protocol ---------- */
html.has-motion [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
html.has-motion [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 14. Responsive ---------- */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .header-top {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-block: 11px 10px;
  }
  .header-status { display: none; }
  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding-block: 14px 18px;
  }
  .site-header[data-open] .site-nav { display: flex; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list > li { display: block; }
  .nav-list a { width: 100%; padding: 12px 14px; }
  .nav-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .nav-actions .btn { width: 100%; }
}

@media (max-width: 720px) {
  body { font-size: 1rem; }
  .brand-mark { width: 38px; height: 38px; font-size: .82rem; }
  .brand-name { font-size: .98rem; }
  .brand-line { font-size: .6rem; letter-spacing: .08em; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-brand { grid-column: auto; }
  .footer-summary { max-width: none; }
  .footer-meta { flex-direction: column; align-items: flex-start; gap: 8px; }
}

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