/* ==========================================================================
   必搏主站 · /assets/site.css
   共享层：reset / 变量 / 中文排版 / 头部 / 页脚 / 通用组件
   ========================================================================== */

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

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

body,
h1, h2, h3, h4,
p, ul, ol, li, figure, blockquote { margin: 0; }

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

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

a { color: inherit; }

button { font: inherit; color: inherit; background: none; border: 0; }

/* 2. Tokens --------------------------------------------------------------- */
:root {
  --blue: #1A5CFF;
  --blue-deep: #0E3FB0;
  --orange: #FF6B1A;
  --silver: #C8CDD6;
  --bamboo: #2E8B57;
  --ink: #0B1220;
  --paper: #F5F3EE;
  --stone: #E7E3DA;
  --clay: #B45309;
  --graphite: #5B6472;
  --white: #FFFFFF;

  --line: rgba(11, 18, 32, 0.16);
  --line-soft: rgba(11, 18, 32, 0.09);
  --line-invert: rgba(245, 243, 238, 0.22);
  --grid: rgba(11, 18, 32, 0.045);
  --foot-dim: rgba(245, 243, 238, 0.62);

  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "Noto Sans Mono",
    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1280px;
  --gut: clamp(16px, 4vw, 44px);

  --fs-h1: clamp(30px, 6vw, 64px);
  --fs-h2: clamp(23px, 3.4vw, 40px);
  --fs-h3: clamp(19px, 2.2vw, 26px);
  --fs-h4: clamp(16px, 1.6vw, 20px);

  --dur: 220ms;
}

/* 3. Base ---------------------------------------------------------------- */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

strong { font-weight: 700; }

::selection {
  background: var(--blue);
  color: var(--white);
}

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

.site-footer :focus-visible {
  outline-color: var(--orange);
}

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

/* 4. Skip link ------------------------------------------------------------ */
.skip-link {
  position: absolute;
  left: 12px;
  top: -70px;
  z-index: 200;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--white);
  font: 600 13px/1 var(--font-sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 12px;
}

/* 5. Shell & layout primitives ------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line);
}

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

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* 6. Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 14px 0 14px;
  background: linear-gradient(
    180deg,
    rgba(245, 243, 238, 0.97) 0%,
    rgba(245, 243, 238, 0.9) 58%,
    rgba(245, 243, 238, 0) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: padding var(--dur) ease, box-shadow var(--dur) ease;
}

.site-header[data-scrolled] {
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.07);
}

.site-header[data-condensed] {
  padding-top: 6px;
  padding-bottom: 6px;
}

.header-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--orange), var(--bamboo));
  transition: width 0.12s linear;
}

.header-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-island {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 10px;
  background: var(--ink);
  border: 1px solid var(--ink);
  text-decoration: none;
  transition: background-color var(--dur) ease, border-color var(--dur) ease;
}

.brand-island:hover {
  background: #101a2e;
}

.site-header[data-condensed] .brand-island {
  padding-top: 6px;
  padding-bottom: 6px;
}

.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--blue);
  color: var(--white);
  font: 900 15px/1 var(--font-sans);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  display: block;
  font: 900 15px/1.2 var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--white);
  white-space: nowrap;
}

.brand-sub {
  display: block;
  font: 400 10px/1.35 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--silver);
  white-space: nowrap;
}

.site-header[data-condensed] .brand-sub {
  display: none;
}

.nav-capsule {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-link {
  display: block;
  padding: 9px 14px;
  font: 500 14px/1 var(--font-sans);
  color: var(--graphite);
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--stone);
  border-color: var(--line-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -12px rgba(11, 18, 32, 0.6);
}

.nav-link[aria-current="page"] {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  font-weight: 700;
}

.site-header[data-condensed] .nav-link {
  padding-top: 7px;
  padding-bottom: 7px;
}

.header-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-link {
  padding: 8px 0;
  font: 500 13px/1 var(--font-sans);
  color: var(--graphite);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.tool-link:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.site-header[data-condensed] .tool-link {
  display: none;
}

.q-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.q-badge:hover {
  border-color: var(--bamboo);
  color: var(--bamboo);
}

.q-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bamboo);
  animation: q-pulse 2.6s ease-out infinite;
}

@keyframes q-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 139, 87, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(46, 139, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 139, 87, 0); }
}

.nav-toggle {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 42px;
  background: var(--ink);
  border: 1px solid var(--ink);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--white);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* 7. Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  background: var(--silver);
  border: 1px solid transparent;
  font: 700 14px/1 var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  box-shadow: 0 10px 22px -14px rgba(26, 92, 255, 0.95);
}

.btn--quote {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

.btn--quote:hover {
  box-shadow: 0 10px 22px -14px rgba(255, 107, 26, 0.95);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink);
}

.btn--sm {
  padding: 10px 15px;
  font-size: 13px;
}

/* 8. Footer -------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: var(--silver);
  margin-top: clamp(48px, 7vw, 96px);
}

.foot-band {
  display: flex;
  height: 6px;
}

.foot-band span {
  flex: 1;
}

.foot-band span:nth-child(1) { background: var(--blue); }
.foot-band span:nth-child(2) { background: var(--orange); }
.foot-band span:nth-child(3) { background: var(--silver); }
.foot-band span:nth-child(4) { background: var(--bamboo); }

.foot-inner {
  padding-top: clamp(36px, 5vw, 60px);
  padding-bottom: 28px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.3fr 1fr;
  gap: 0;
}

.foot-col {
  padding: 0 26px;
  border-left: 1px solid var(--line-invert);
}

.foot-col:first-child {
  padding-left: 0;
  border-left: 0;
}

.foot-col:last-child {
  padding-right: 0;
}

.foot-brand {
  font: 900 17px/1.3 var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 12px;
}

.foot-note {
  font-size: 13px;
  line-height: 1.8;
  color: var(--foot-dim);
  max-width: 34ch;
}

.foot-note + .foot-note {
  margin-top: 10px;
}

.foot-note--mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--silver);
}

.foot-h {
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0.16em;
  color: var(--orange);
  margin-bottom: 16px;
}

.foot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.foot-list a {
  font-size: 13.5px;
  color: var(--silver);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.foot-list a:hover {
  color: var(--white);
  border-color: var(--orange);
}

.foot-list--data {
  gap: 12px;
}

.foot-list--data li {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.foot-key {
  font: 600 11px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--foot-dim);
}

.foot-val {
  font: 400 13px/1.6 var(--font-mono);
  color: var(--silver);
  word-break: break-word;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(32px, 4vw, 52px);
  padding-top: 20px;
  border-top: 1px solid var(--line-invert);
}

.foot-copy {
  font: 400 12px/1.7 var(--font-mono);
  letter-spacing: 0.03em;
  color: var(--foot-dim);
}

/* 9. Shared content components ------------------------------------------ */
.crumb {
  padding: 20px 0 0;
}

.crumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font: 400 12px/1.6 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--graphite);
}

.crumb-list li {
  display: flex;
  align-items: center;
}

.crumb-list li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--silver);
}

.crumb-list a {
  color: var(--graphite);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.crumb-list a:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.crumb-current {
  color: var(--ink);
}

.sec {
  position: relative;
  padding: clamp(44px, 6vw, 80px) 0;
}

.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  align-items: baseline;
  padding-bottom: 14px;
  margin-bottom: clamp(22px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}

.sec-num {
  grid-column: 1;
  grid-row: 1;
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--clay);
}

.sec-title {
  grid-column: 2;
  grid-row: 1;
}

.sec-desc {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  max-width: 62ch;
  font-size: 15px;
  color: var(--graphite);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--clay);
}

.v-note {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.2em;
  color: var(--clay);
}

.prose {
  max-width: 68ch;
  font-size: 16px;
  color: var(--ink);
}

.prose p + p,
.prose ul + p,
.prose p + ul {
  margin-top: 14px;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: var(--white);
  border: 1px solid var(--line);
  font: 600 11px/1.6 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--graphite);
}

.tag--blue {
  background: rgba(26, 92, 255, 0.08);
  border-color: rgba(26, 92, 255, 0.36);
  color: var(--blue);
}

.tag--orange {
  background: rgba(255, 107, 26, 0.12);
  border-color: rgba(255, 107, 26, 0.42);
  color: #97400A;
}

.tag--silver {
  background: var(--silver);
  border-color: var(--silver);
  color: var(--ink);
}

.tag--bamboo {
  background: rgba(46, 139, 87, 0.12);
  border-color: rgba(46, 139, 87, 0.42);
  color: #1F6B41;
}

.tag--clay {
  background: rgba(180, 83, 9, 0.09);
  border-color: rgba(180, 83, 9, 0.36);
  color: var(--clay);
}

.kpi {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.kpi-num {
  display: block;
  font: 700 clamp(26px, 4vw, 34px) / 1 var(--font-mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.kpi-label {
  display: block;
  margin-top: 7px;
  font: 500 12px/1.5 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--graphite);
}

.tier-bar {
  display: flex;
  align-items: stretch;
  height: 14px;
  background: var(--stone);
  border: 1px solid var(--line);
  overflow: hidden;
}

.tier-seg {
  flex: 1;
}

.tier-seg--blue   { background: var(--blue); }
.tier-seg--orange { background: var(--orange); }
.tier-seg--silver { background: var(--silver); }
.tier-seg--bamboo { background: var(--bamboo); }
.tier-seg--clay   { background: var(--clay); }

.frame {
  position: relative;
  display: block;
  background: var(--stone);
  border: 1px solid var(--line);
  overflow: hidden;
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

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

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

.frame__cap {
  display: block;
  margin-top: 8px;
  font: 400 12px/1.6 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--graphite);
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.panel-body {
  padding: 18px;
}

/* 10. Reveal ------------------------------------------------------------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}

html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur) ease-out, transform var(--dur) ease-out;
}

/* 11. Responsive --------------------------------------------------------- */
@media (max-width: 1180px) {
  .tool-link { display: none; }
}

@media (max-width: 1000px) {
  .nav-toggle { display: flex; }

  .brand-island { flex: 1 1 auto; min-width: 0; }
  .header-tools { margin-left: auto; }

  .nav-capsule {
    position: absolute;
    left: var(--gut);
    right: var(--gut);
    top: calc(100% + 10px);
    display: none;
    justify-content: stretch;
    padding: 8px;
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: 0 22px 44px -30px rgba(11, 18, 32, 0.6);
  }

  .nav-capsule[data-open] {
    display: block;
    animation: nav-drop 0.2s ease-out both;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
  }

  .nav-link {
    padding: 14px 12px;
    font-size: 15px;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-item:last-child .nav-link { border-bottom: 0; }

  .nav-link:hover {
    transform: none;
    background: var(--stone);
  }

  .foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px;
  }

  .foot-col {
    padding: 0;
    border-left: 0;
  }

  .foot-note { max-width: none; }
}

@keyframes nav-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  body { background-size: 36px 36px; }

  .g-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .span-3,
  .span-4 { grid-column: span 3; }
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 { grid-column: span 6; }

  .sec-head {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .sec-num,
  .sec-title,
  .sec-desc {
    grid-column: 1;
    grid-row: auto;
  }

  .v-note {
    writing-mode: horizontal-tb;
    letter-spacing: 0.14em;
  }
}

@media (max-width: 640px) {
  body { background-size: 28px 28px; }

  .q-badge { display: none; }

  .brand-sub { display: none; }

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

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 { grid-column: span 6; }
}

/* 12. Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .btn:hover,
  .nav-link:hover { transform: none; }
}
