/* ==========================================================================
   球友汇主页 / assets/site.css
   共享外壳：reset、变量、中文排版、头部侧边轨道、页脚、通用组件
   ========================================================================== */

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

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

body { margin: 0; }

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

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

a { color: inherit; text-decoration: none; }

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

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

table { border-collapse: collapse; width: 100%; }

/* ---------- 2. 设计变量 ---------- */
:root {
  /* 色彩 */
  --c-ridge: #0F5C4E;
  --c-moss: #3E8B77;
  --c-ink: #0B1F1C;
  --c-jersey: #E2542C;
  --c-electric: #1F5AE0;
  --c-batch: #F2B134;
  --c-paper: #F6F3EC;
  --c-slate: #4A5450;
  --c-clay: #B4603E;
  --c-mist: #DCE6E1;

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

  /* 尺寸 */
  --rail-w: 244px;
  --shell-max: 1280px;
  --gutter: 20px;

  /* 形状与材质 */
  --line: 2px solid var(--c-ink);
  --shadow: 6px 6px 0 var(--c-ink);
  --shadow-sm: 3px 3px 0 var(--c-ink);
  --radius: 2px;

  /* 动效 */
  --ease: cubic-bezier(.2, .7, .3, 1);
  --reveal-delay: 0ms;
}

/* ---------- 3. 中文正文基础排版 ---------- */
body {
  background-color: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -.01em;
}

h1 { font-size: 34px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; font-family: var(--font-sans); font-weight: 800; letter-spacing: 0; }

strong { font-weight: 800; }

.mono {
  font-family: var(--font-mono);
  font-size: .92em;
  letter-spacing: .04em;
}

#main-content { scroll-margin-top: 76px; }

/* ---------- 4. 聚焦与跳转链接 ---------- */
:focus-visible {
  outline: 2px solid var(--c-electric);
  outline-offset: 2px;
  border-radius: 1px;
}

.site-header :focus-visible,
.site-footer :focus-visible { outline-color: var(--c-batch); }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-220%);
  background: var(--c-ink);
  color: var(--c-paper);
  border: var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  transition: transform .2s var(--ease);
}

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

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--c-paper);
  color: var(--c-ink);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease),
              background-color .18s var(--ease), color .18s var(--ease);
}

.btn:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--c-ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--c-ink); }

.btn--primary { background: var(--c-jersey); color: #fff; }
.btn--electric { background: var(--c-electric); color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--c-paper);
  border-color: rgba(246, 243, 236, .55);
  box-shadow: none;
}

.btn--ghost:hover {
  transform: none;
  background: rgba(246, 243, 236, .12);
  border-color: var(--c-paper);
  box-shadow: none;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--c-electric);
  border-bottom: 2px solid transparent;
  transition: border-color .18s var(--ease);
}

.link-arrow::after { content: "→"; transition: transform .18s var(--ease); }
.link-arrow:hover { border-bottom-color: var(--c-electric); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- 6. 头部 / 侧边轨道 ---------- */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--c-ridge);
  color: var(--c-paper);
  border-bottom: var(--line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 12px var(--gutter);
}

.brand { display: block; min-width: 0; }

.brand__mark {
  display: block;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--c-paper);
}

.brand__line {
  display: none;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: rgba(246, 243, 236, .68);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 2px solid rgba(246, 243, 236, .5);
  border-radius: var(--radius);
  color: var(--c-paper);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}

.nav-toggle:hover { border-color: var(--c-batch); background: rgba(246, 243, 236, .1); }

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

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

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

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

/* 抽屉（移动端默认） */
.rail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 20px 32px;
  background: var(--c-ridge);
  border-left: var(--line);
  transform: translateX(103%);
  visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform .28s var(--ease), visibility .28s var(--ease);
}

.rail[data-open] { transform: translateX(0); visibility: visible; }

body[data-nav-open]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(11, 31, 28, .58);
}

.rail__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(246, 243, 236, .55);
  margin-bottom: 10px;
}

.rail__list { display: flex; flex-direction: column; gap: 2px; }

.rail__item { display: block; }

.rail__link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 10px;
  border-left: 3px solid transparent;
  color: rgba(246, 243, 236, .86);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease);
}

.rail__link:hover {
  background: rgba(246, 243, 236, .1);
  border-left-color: var(--c-batch);
  color: #fff;
}

.rail__link[aria-current="page"] {
  background: var(--c-batch);
  border-left-color: var(--c-ink);
  color: var(--c-ink);
  font-weight: 800;
}

.rail__num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--c-batch);
}

.rail__link[aria-current="page"] .rail__num { color: rgba(11, 31, 28, .62); }

.rail__text { min-width: 0; }

.rail__steps { border-top: 1px dashed rgba(246, 243, 236, .22); padding-top: 18px; }

.steps { display: flex; flex-direction: column; }

.steps__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(246, 243, 236, .16);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(246, 243, 236, .78);
}

.steps__item:last-child { border-bottom: 0; }

.steps__num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--c-batch);
  color: var(--c-batch);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
}

.steps__text { min-width: 0; }

.rail__cta { width: 100%; margin-top: auto; }

/* ---------- 7. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 72px;
  background: var(--c-ink);
  color: rgba(246, 243, 236, .86);
  border-top: var(--line);
}

.site-footer::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(90deg,
    var(--c-jersey) 0 38%,
    var(--c-batch) 38% 66%,
    var(--c-moss) 66% 84%,
    var(--c-electric) 84% 100%);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 48px var(--gutter) 36px;
}

.footer__brand {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--c-paper);
}

.footer__summary {
  margin-top: 12px;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(246, 243, 236, .72);
}

.footer__cta { margin-top: 20px; }

.footer__title {
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(246, 243, 236, .22);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--c-batch);
}

.footer__list { display: flex; flex-direction: column; gap: 9px; }

.footer__link {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(246, 243, 236, .8);
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}

.footer__link:hover { color: var(--c-paper); border-bottom-color: var(--c-batch); }

.footer__line {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(246, 243, 236, .72);
  word-break: break-word;
}

.footer__line + .footer__line { margin-top: 8px; }

.footer__legal {
  border-top: 1px solid rgba(246, 243, 236, .18);
  padding: 18px var(--gutter) 24px;
}

.footer__legal-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: var(--shell-max);
  margin: 0 auto;
}

.footer__legal-line {
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(246, 243, 236, .58);
}

/* ---------- 8. 布局容器与网格 ---------- */
.wrap {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap--narrow { max-width: 880px; }

.section { padding: 52px 0; }
.section--tight { padding: 30px 0; }

.section__head { margin-bottom: 26px; }

.section__title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--c-ridge);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--c-jersey);
}

.grid { display: grid; gap: 24px; grid-template-columns: 1fr; }

.grid--2,
.grid--3,
.grid--sidebar { grid-template-columns: 1fr; }

.rule {
  position: relative;
  height: 8px;
  margin: 36px 0;
  border-bottom: 1px solid var(--c-ink);
}

.rule::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg,
    rgba(11, 31, 28, .32) 0 1px, transparent 1px 14px);
}

/* ---------- 9. 通用组件 ---------- */
.card {
  background: #fff;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card__title {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.card__body { font-size: 15px; line-height: 1.75; color: var(--c-slate); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--c-ink);
  border-radius: 999px;
  background: var(--c-paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  line-height: 1.5;
  color: var(--c-ink);
}

.tag--batch { background: var(--c-batch); }
.tag--electric { background: var(--c-electric); color: #fff; }
.tag--moss { background: var(--c-moss); color: #fff; }

.annotation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--c-slate);
}

.annotation::before {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border: 2px solid var(--c-clay);
  border-radius: 50%;
}

.prose {
  max-width: 44rem;
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-ink);
}

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

.prose h2 {
  font-size: 26px;
  line-height: 1.25;
  margin-top: 2em;
}

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

.prose ul { padding-left: 0; }

.prose ul li {
  position: relative;
  padding-left: 20px;
  margin-top: .5em;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .78em;
  width: 9px;
  height: 2px;
  background: var(--c-jersey);
}

.prose a {
  color: var(--c-electric);
  border-bottom: 1px solid rgba(31, 90, 224, .35);
}

.prose a:hover { border-bottom-color: var(--c-electric); }

.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--c-slate);
}

.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }

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

.breadcrumbs li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--c-clay);
}

.breadcrumbs a { border-bottom: 1px solid var(--c-mist); }
.breadcrumbs a:hover { color: var(--c-electric); border-bottom-color: var(--c-electric); }

/* ---------- 10. 图片容器基础规则 ---------- */
.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--c-mist);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }

.media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background-image: repeating-linear-gradient(135deg,
    var(--c-mist) 0 12px, #fff 12px 24px);
  color: var(--c-slate);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-align: center;
  padding: 20px;
}

.media__caption {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--c-slate);
}

/* ---------- 11. 滚动进度尺 ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 130;
  background: transparent;
  pointer-events: none;
}

.progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--c-jersey), var(--c-batch), var(--c-moss));
  transition: width .1s linear;
}

/* ---------- 12. 滚动显现 ---------- */
html.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .32s ease-out, transform .32s ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}

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

/* ---------- 13. 平板与桌面 ---------- */
@media (min-width: 700px) {
  :root { --gutter: 28px; }

  h1 { font-size: 44px; }
  .section { padding: 64px 0; }
  .section__title { font-size: 38px; }

  .footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 38px 32px; }
  .footer__lead { grid-column: 1 / -1; }

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

@media (min-width: 1024px) {
  :root { --gutter: 32px; }

  body { padding-left: var(--rail-w); }

  #main-content { scroll-margin-top: 24px; }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 0;
    border-right: var(--line);
  }

  .site-header__bar {
    display: block;
    max-width: none;
    margin: 0;
    padding: 26px 22px 20px;
    border-bottom: 1px solid rgba(246, 243, 236, .24);
  }

  .brand__mark { font-size: 24px; }
  .brand__line { display: block; margin-top: 7px; }

  .nav-toggle { display: none; }

  .rail {
    position: static;
    transform: none;
    visibility: visible;
    width: auto;
    flex: 1 1 auto;
    z-index: auto;
    gap: 24px;
    padding: 22px 22px 28px;
    background: transparent;
    border-left: 0;
    overflow: visible;
  }

  .rail[data-open] { transform: none; }

  body[data-nav-open]::after { display: none; }

  .footer__inner {
    grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.15fr);
    gap: 40px 30px;
  }

  .footer__lead { grid-column: auto; }

  .grid--sidebar { grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: 34px; }

  .progress { left: var(--rail-w); background: rgba(11, 31, 28, .1); }
}

@media (min-width: 1180px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- 14. 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 120ms !important;
    transition-property: opacity !important;
    transition-delay: 0ms !important;
  }

  html.js-ready [data-reveal] {
    opacity: 1;
    transform: none;
    transition-delay: 0ms !important;
  }
}
