/* ==========================================================================
   悟空体育 · sports-wk.com.cn
   共享站点样式 / assets/site.css
   骨架：细线网格 + 锐利直角 + 六格色带导航 + 左轨章节索引
   ========================================================================== */

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

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

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

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

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

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

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

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

[id] { scroll-margin-top: 24px; }

/* ---------- 2. Tokens ---------- */
:root {
  /* 品牌色 */
  --ink: #0E0E10;
  --charcoal: #1B1C20;
  --rock: #3A3D44;
  --mid: #6B7078;
  --cloud: #F6F5F2;
  --white: #FFFFFF;
  --orange: #FF7A1A;
  --orange-soft: #FFB067;
  --orange-deep: #B8460A;
  --teal: #0E6E7A;
  --teal-soft: #A8DFE4;
  --line: #D8D6D0;

  /* 度量 */
  --wrap-max: 1360px;
  --gutter: clamp(20px, 5vw, 72px);
  --rail: 96px;

  /* 间距（8px 基准） */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 72px;
  --s7: 104px;

  /* 字体 */
  --font-sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "DIN Condensed", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- 3. 中文排版与基础元素 ---------- */
body {
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--orange);
  color: var(--ink);
}

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

/* 排版工具 */
.h-display {
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.h-light { font-weight: 300; }

.h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.index-label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--mid);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--orange-deep);
}

.prose {
  max-width: 42em;
  font-size: 17px;
  line-height: 1.75;
}

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

.prose h2,
.prose h3 {
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.prose h3 { font-size: 1.15rem; }

.prose ul,
.prose ol {
  margin: 1em 0;
  padding-left: 1.2em;
  list-style: none;
}

.prose li {
  position: relative;
  padding-left: 1em;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 6px;
  height: 1px;
  background: var(--orange);
}

.prose a {
  color: var(--orange-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

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

.grid {
  display: grid;
  gap: var(--s3);
}

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

/* ---------- 5. 按钮与行动链接 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: background-color .18s var(--ease),
              color .18s var(--ease),
              border-color .18s var(--ease),
              transform .18s var(--ease);
}

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

.btn--primary {
  background: var(--orange);
  color: var(--ink);
  border-color: var(--orange);
}
.btn--primary:hover { background: var(--orange-soft); border-color: var(--orange-soft); }

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

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

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--orange-deep);
  border-bottom: 1px solid currentColor;
}

.link-arrow::after {
  content: "→";
  transition: transform .18s var(--ease);
}

.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- 6. 章节三件套 ---------- */
.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0 var(--s3);
  padding-top: 14px;
  margin-bottom: var(--s4);
  border-top: 1px solid var(--ink);
}

.sec-head__num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--orange-deep);
}

.sec-head__title {
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* ---------- 7. 面包屑 ---------- */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  padding-block: var(--s2);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--mid);
}

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

.crumb__sep { color: var(--line); }

.crumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- 8. 左轨章节索引 ---------- */
.rail {
  position: sticky;
  top: var(--s4);
  align-self: start;
  font-size: 11px;
  letter-spacing: 0.18em;
}

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

.rail__link {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: baseline;
  gap: var(--s1);
  padding: 8px 10px;
  color: var(--mid);
  border-left: 2px solid transparent;
  transition: color .18s var(--ease),
              border-color .18s var(--ease),
              background-color .18s var(--ease);
}

.rail__num {
  font-family: var(--font-mono);
  color: var(--orange-deep);
}

.rail__link:hover { color: var(--ink); }

.rail__link[aria-current] {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--orange);
  background: var(--white);
}

/* ---------- 9. 图片容器基础规则 ---------- */
.media {
  position: relative;
  overflow: hidden;
  background: var(--charcoal);
  aspect-ratio: 16 / 10;
}

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

.media--tilt {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 28px));
}

.media--tall { aspect-ratio: 3 / 4; }

.media--placeholder {
  background: repeating-linear-gradient(
    135deg,
    var(--charcoal) 0 12px,
    var(--rock) 12px 24px
  );
}

.media__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--cloud);
  font-size: 12px;
  letter-spacing: 0.12em;
}

/* ---------- 10. 标签 / 比分 / 状态条 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.5;
  background: var(--ink);
  color: var(--cloud);
}

.tag--orange { background: var(--orange); color: var(--ink); }
.tag--teal { background: var(--teal); color: var(--white); }

.tag--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mid);
}

.score {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.sync {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px var(--s2);
  padding: 10px var(--s2);
  background: var(--teal);
  color: var(--white);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.sync__dot {
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--teal-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .sync__dot { animation: sync-pulse 1.2s var(--ease) infinite; }
}

@keyframes sync-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.32; }
}

/* ---------- 11. 页头 ---------- */
.site-header {
  position: relative;
  background: var(--cloud);
}

.skip-link {
  position: absolute;
  left: var(--s2);
  top: -90px;
  z-index: 30;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--cloud);
  font-size: 14px;
  letter-spacing: 0.06em;
  transition: top .18s var(--ease);
}

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

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 999;
  pointer-events: none;
}

.progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.masthead {
  background: var(--cloud);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s2);
  padding-block: 20px;
}

.masthead__index {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  justify-self: start;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--mid);
  white-space: nowrap;
}

.masthead__index::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--orange);
}

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  gap: 2px;
  padding: 2px 12px;
}

.lockup__mark {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.04em;
}

.lockup__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.44em;
  text-indent: 0.44em;
  color: var(--mid);
}

.masthead__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: var(--s1);
}

.tool-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border: 1px solid var(--line);
  transition: background-color .18s var(--ease),
              border-color .18s var(--ease),
              color .18s var(--ease);
}

.tool-link:hover {
  background: var(--white);
  border-color: var(--ink);
}

.tool-link--accent {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cloud);
}

.tool-link--accent:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--s1);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px solid var(--ink);
}

.nav-toggle__bars {
  position: relative;
  display: block;
  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), opacity .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); }

.nav-toggle__text {
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* ---------- 12. 六格色带导航 ---------- */
.tracknav {
  background: var(--cloud);
  border-bottom: 1px solid var(--line);
}

.tracknav__list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.tracknav__list > li {
  display: flex;
  min-width: 0;
}

.tracknav__link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-align: center;
  transition: box-shadow .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease);
}

.tracknav__list > li:nth-child(1) .tracknav__link { background: var(--ink); color: var(--cloud); }
.tracknav__list > li:nth-child(2) .tracknav__link { background: var(--charcoal); color: var(--cloud); }
.tracknav__list > li:nth-child(3) .tracknav__link { background: var(--teal); color: var(--white); }
.tracknav__list > li:nth-child(4) .tracknav__link { background: var(--teal-soft); color: var(--ink); }
.tracknav__list > li:nth-child(5) .tracknav__link { background: var(--orange); color: var(--ink); }
.tracknav__list > li:nth-child(6) .tracknav__link { background: var(--rock); color: var(--cloud); }

.tracknav__link:hover { box-shadow: inset 0 0 0 200px rgba(255, 255, 255, 0.13); }

.tracknav__link[aria-current="page"] {
  font-weight: 700;
  box-shadow: inset 0 -4px 0 currentColor;
}

.tracknav__link:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: -5px;
}

/* ---------- 13. 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--ink);
  color: var(--cloud);
}

.footer__band {
  height: 10px;
  background: linear-gradient(
    to right,
    var(--orange) 0 46%,
    var(--teal) 46% 78%,
    var(--orange-deep) 78% 100%
  );
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px var(--s4);
  padding-block: 56px 40px;
  border-bottom: 1px solid var(--rock);
}

.footer__brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.footer__brand-en {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.44em;
  color: var(--orange);
}

.footer__line {
  font-size: 15px;
  color: rgba(246, 245, 242, 0.72);
  max-width: 34em;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: var(--s4) 40px;
  padding-block: 40px;
}

.footer__col { min-width: 0; }

.footer__title {
  margin-bottom: var(--s2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--orange);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  line-height: 1.6;
}

.footer__list a {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
  color: rgba(246, 245, 242, 0.86);
  transition: color .18s var(--ease);
}

.footer__list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--orange);
  transition: width .22s var(--ease);
}

.footer__list a:hover { color: var(--white); }
.footer__list a:hover::after { width: 100%; }

.footer__list a[aria-current="page"] { color: var(--orange); }

.footer__list--contact {
  gap: 12px;
  color: rgba(246, 245, 242, 0.86);
}

.footer__note {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(246, 245, 242, 0.55);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px var(--s4);
  padding-block: var(--s3) 44px;
  border-top: 1px solid var(--rock);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(246, 245, 242, 0.55);
}

.footer__compliance {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.footer__rhythm { flex: 1 1 320px; }

.footer__copy { margin-left: auto; white-space: nowrap; }

/* ---------- 14. 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 18px;
  line-height: 1;
  background: var(--ink);
  color: var(--cloud);
  border: 1px solid var(--rock);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .22s var(--ease),
              transform .22s var(--ease),
              background-color .18s var(--ease),
              color .18s var(--ease),
              border-color .18s var(--ease),
              visibility .22s;
}

.to-top[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

/* ---------- 15. 响应式 ---------- */
@media (max-width: 1100px) {
  .footer__grid { grid-template-columns: 1fr 1fr 1.2fr; gap: var(--s4) var(--s3); }
}

@media (max-width: 900px) {
  body { font-size: 16px; }

  .masthead__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-block: 12px;
  }

  .lockup {
    order: 1;
    flex: 1 0 100%;
    padding: 0;
  }

  .masthead__index {
    order: 2;
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .masthead__tools {
    order: 3;
    margin-left: auto;
    gap: 6px;
  }

  .tool-link { padding: 7px 10px; font-size: 12px; }

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

  .tracknav { display: none; }

  .tracknav[data-open="true"] { display: block; }

  .tracknav__list { grid-template-columns: 1fr; }

  .tracknav__link {
    justify-content: flex-start;
    padding: 16px var(--gutter);
    font-size: 15px;
    text-align: left;
  }

  .tracknav__link[aria-current="page"] {
    box-shadow: inset 4px 0 0 currentColor;
  }

  .footer__grid { grid-template-columns: 1fr 1fr; }

  .footer__col--wide { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .grid--12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

  .footer__top { padding-block: 40px var(--s4); }

  .footer__grid { grid-template-columns: 1fr; }

  .footer__col--wide { grid-column: auto; }

  .footer__bottom { flex-direction: column; align-items: flex-start; }

  .footer__copy { margin-left: 0; }

  .to-top { right: 16px; bottom: 16px; }

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

  .rail { position: static; }
}

/* ---------- 16. 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

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

  .to-top { transform: none; }
}
