/* ==========================================================================
   博奥体育站 · 全站共享样式
   文件: /assets/site.css
   ========================================================================== */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- CSS Variables ---------- */
:root {
  --c-brand: #00843D;
  --c-brand-dark: #006633;
  --c-brand-light: #E0F2E9;
  --c-ink: #1A1A1A;
  --c-text: #3D3D3D;
  --c-muted: #757575;
  --c-line: #D1D1D1;
  --c-bg: #F5F5F0;
  --c-paper: #FFFFFF;
  --c-alert: #E40046;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-heading: 'Alibaba PuHuiTi', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Roboto Mono', 'Cascadia Code', 'SF Mono', Consolas, monospace;
  --content-max: 1240px;
  --header-height: 64px;
  --skew: -6deg;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --shadow-card: 0 1px 0 var(--c-line), 0 4px 16px rgba(26, 26, 26, 0.05);
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-text);
  background-color: var(--c-bg);
}

main {
  flex: 1 0 auto;
  width: 100%;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  line-height: 1.25;
  color: var(--c-ink);
}

h1 { font-size: clamp(30px, 4vw, 48px); }
h2 { font-size: clamp(24px, 3vw, 36px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; }

p { margin-bottom: 1em; }

/* ---------- Selection / Focus ---------- */
::selection {
  background: var(--c-brand);
  color: var(--c-paper);
}

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

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

/* ---------- Skip Link ---------- */
.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 3000;
  padding: 8px 18px;
  background: var(--c-brand);
  color: var(--c-paper);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-260%);
  transition: transform 0.25s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--c-alert);
}

/* ---------- Reading Progress ---------- */
.site-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 4000;
  pointer-events: none;
}

.site-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--c-brand) 0%, var(--c-brand-dark) 100%);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--c-ink);
  border-bottom: 2px solid var(--c-brand);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  height: var(--header-height);
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--c-brand);
  color: var(--c-paper);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
}

.header-brand-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.04em;
  color: var(--c-paper);
  white-space: nowrap;
}

.header-brand-tag {
  display: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--c-brand-light);
  text-transform: uppercase;
  padding-left: var(--space-2);
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  white-space: nowrap;
}

@media (min-width: 1280px) {
  .header-brand-tag {
    display: inline-block;
  }
}

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  counter-reset: navIndex;
}

.nav-item a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  counter-increment: navIndex;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-item a::before {
  content: counter(navIndex, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-brand-light);
}

.nav-item a:hover {
  color: var(--c-paper);
  background: rgba(0, 132, 61, 0.28);
}

.nav-item a[aria-current="page"] {
  color: var(--c-paper);
  background: var(--c-brand);
}

.nav-item a[aria-current="page"]::before {
  color: rgba(255, 255, 255, 0.8);
}

.header-meta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--c-brand-light);
  background: rgba(0, 132, 61, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.header-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-brand);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 132, 61, 0.55);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(0, 132, 61, 0);
  }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--c-brand);
}

.nav-toggle[data-open] {
  border-color: var(--c-brand);
  background: rgba(0, 132, 61, 0.22);
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--c-paper);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[data-open] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[data-open] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[data-open] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Mobile Nav ---------- */
@media (max-width: 1023px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 999;
    display: block;
    background: var(--c-ink);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 2px solid var(--c-brand);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
    transform: translateY(-120%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
  }

  .site-nav[data-open] {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 0;
  }

  .nav-item a {
    display: flex;
    align-items: center;
    padding: 13px var(--space-3);
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

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

  .nav-item a::before {
    min-width: 24px;
    font-size: 12px;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-paper);
  border-top: 2px solid var(--c-ink);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-5) var(--space-3) var(--space-4);
  display: grid;
  grid-template-columns: 2.2fr 1fr 1.2fr 1fr;
  gap: var(--space-4);
}

.footer-brand {
  min-width: 0;
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 48px);
  color: var(--c-ink);
  line-height: 1.1;
  letter-spacing: 0.02em;
  transform: skewX(var(--skew));
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--c-brand);
  margin-top: -4px;
}

.footer-statement {
  margin-top: var(--space-2);
  padding-left: var(--space-2);
  border-left: 3px solid var(--c-brand);
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-muted);
  max-width: 32em;
}

.footer-col {
  min-width: 0;
}

.footer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--c-ink);
  border-bottom: 2px solid var(--c-ink);
}

.footer-title-index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-brand);
}

.footer-links a,
.footer-contact li {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-text);
  line-height: 1.9;
}

.footer-contact {
  margin-bottom: var(--space-1);
}

.footer-links a {
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.footer-links a:hover {
  color: var(--c-brand);
  border-bottom-color: var(--c-brand);
}

.footer-note {
  margin-top: var(--space-2);
  padding-top: var(--space-1);
  border-top: 1px dashed var(--c-line);
  font-size: 12px;
  line-height: 1.65;
  color: var(--c-muted);
}

.footer-bottom {
  border-top: 1px solid var(--c-line);
  background: var(--c-bg);
}

.footer-bottom-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px var(--space-3);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-muted);
}

/* ---------- Container & Editorial Sections ---------- */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section {
  padding-block: var(--space-5);
}

.section-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-1);
  border-bottom: 2px solid var(--c-ink);
}

.chapter-index {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--c-brand);
}

.chapter-title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--c-ink);
  transform: skewX(var(--skew));
}

.chapter-note {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--c-muted);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: var(--c-ink);
  background: var(--c-paper);
  border: 1px solid var(--c-ink);
  overflow: hidden;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.1s ease;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 115%;
  height: 100%;
  z-index: -1;
  background: var(--c-brand);
  transform: translateX(-110%) skewX(var(--skew));
  transition: transform 0.3s ease;
}

.btn:hover {
  color: var(--c-paper);
  border-color: var(--c-brand);
}

.btn:hover::before {
  transform: translateX(0) skewX(var(--skew));
}

.btn:active {
  transform: scale(0.97);
  color: var(--c-paper);
  border-color: var(--c-brand-dark);
}

.btn:active::before {
  transform: translateX(0) skewX(var(--skew));
  background: var(--c-brand-dark);
}

.btn--primary {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: var(--c-paper);
}

.btn--primary::before {
  background: var(--c-brand-dark);
}

.btn--primary:hover,
.btn--primary:active {
  border-color: var(--c-brand-dark);
  color: var(--c-paper);
}

.btn--ghost {
  background: transparent;
  border-color: var(--c-brand);
  color: var(--c-brand);
}

.btn--ghost:hover,
.btn--ghost:active {
  color: var(--c-paper);
}

/* ---------- Cards ---------- */
.card {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: var(--c-brand);
  box-shadow: 0 2px 0 var(--c-brand), 0 8px 24px rgba(26, 26, 26, 0.06);
}

.card--padded {
  padding: var(--space-3);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
}

.badge--live {
  color: var(--c-paper);
  background: var(--c-brand);
  border-color: var(--c-brand);
}

.badge--alert {
  color: var(--c-paper);
  background: var(--c-alert);
  border-color: var(--c-alert);
}

.badge--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulse 2s ease-in-out infinite;
}

/* ---------- Data Table ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-paper);
  border: 1px solid var(--c-line);
}

.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-paper);
  background: var(--c-ink);
  border-bottom: 2px solid var(--c-brand);
  white-space: nowrap;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--c-line);
  vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
  background: var(--c-brand-light);
}

.data-table tbody tr:hover {
  background: var(--c-brand-light);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-score {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--c-ink);
  white-space: nowrap;
}

/* ---------- Media Frames ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  aspect-ratio: 16 / 9;
}

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

.media-frame--wide {
  aspect-ratio: 21 / 9;
}

.media-frame--square {
  aspect-ratio: 1 / 1;
}

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

.media-frame::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 30px;
  height: 30px;
  border-right: 3px solid var(--c-brand);
  border-bottom: 3px solid var(--c-brand);
  pointer-events: none;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  padding: var(--space-2) 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-muted);
}

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

.breadcrumbs a {
  color: var(--c-text);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--c-brand);
  border-bottom-color: var(--c-brand);
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--c-line);
}

.breadcrumb-current {
  color: var(--c-brand);
  font-weight: 500;
}

/* ---------- Scroll Spy ---------- */
.spy-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  color: var(--c-muted);
  border-left: 2px solid transparent;
  background: transparent;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.spy-item:hover {
  color: var(--c-ink);
  background: var(--c-bg);
}

.spy-item[data-active] {
  color: var(--c-brand);
  background: var(--c-brand-light);
  border-left-color: var(--c-brand);
  font-weight: 500;
}

/* ---------- Reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4) var(--space-3);
    padding-block: var(--space-4);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .container {
    padding-inline: var(--space-2);
  }

  .section {
    padding-block: var(--space-4);
  }

  .section-head {
    gap: 8px var(--space-2);
  }

  .chapter-note {
    margin-left: 0;
    flex-basis: 100%;
  }

  .btn {
    padding: 8px 16px;
    font-size: 14px;
  }

  .header-inner {
    padding-inline: var(--space-2);
    gap: var(--space-2);
  }

  .header-live-text {
    display: none;
  }

  .header-live {
    padding: 5px 8px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    padding-block: var(--space-4) var(--space-3);
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

/* ---------- Reduced Motion ---------- */
@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;
    transition-delay: 0s !important;
  }

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

  .header-live-dot,
  .badge--live::before {
    animation: none;
  }
}
