/* ==========================================================
   长城体育平台 /assets/site.css
   数字长城 · 共享头部与页脚 · 基础组件
   ========================================================== */

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

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

body {
  background-color: var(--bg);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--paper);
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--paper);
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

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

::selection {
  background: var(--red);
  color: var(--paper);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--brick);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--red-dark);
}

#main-content:focus {
  outline: none;
}

/* ---------- CSS Variables ---------- */
:root {
  --bg: #1B1E24;
  --bg-panel: #2A2F36;
  --bg-raised: #32373F;
  --brick: #3E454D;
  --red: #C0392B;
  --red-dark: #7B2D26;
  --gold: #D4A843;
  --teal: #4FC3C4;
  --paper: #F5F2E9;
  --muted: #A8A8A8;

  --font-heading: "思源宋体", "Source Han Serif SC", "Noto Serif CJK SC", serif;
  --font-body: "思源黑体", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-data: "SF Mono", "JetBrains Mono", "Cascadia Mono", monospace;

  --sidebar-w: 260px;
  --meta-h: 36px;
  --header-side-h: 68px;
  --header-total-h: calc(var(--meta-h) + var(--header-side-h));
  --radius: 2px;
  --speed: 0.3s;
  --bp-desktop: 1024px;
}

/* ---------- Base Typography ---------- */
.font-heading {
  font-family: var(--font-heading);
}

.font-data {
  font-family: var(--font-data);
}

.stat-value,
.data,
.mono {
  font-family: var(--font-data);
}

/* ---------- Container ---------- */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: fixed;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: var(--paper);
  padding: 10px 24px;
  font-size: 14px;
  line-height: 1.4;
  z-index: 3000;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  color: var(--paper);
}

.skip-link:hover {
  background: var(--red-dark);
  color: var(--paper);
}

/* ---------- Reading Progress ---------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  z-index: 2000;
  pointer-events: none;
  transition: width 0.12s linear;
}

/* ---------- Header Meta ---------- */
.header-meta {
  background: var(--bg);
  border-bottom: 1px solid var(--brick);
  display: flex;
  align-items: center;
  min-height: var(--meta-h);
  padding: 2px 16px;
}

.meta-text {
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Header Side ---------- */
.header-side {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--brick);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: var(--header-side-h);
  padding: 10px 16px;
}

/* ---------- Brand ---------- */
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  min-width: 0;
}

.site-brand:hover {
  color: var(--paper);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-en {
  display: none;
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Nav Toggle ---------- */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  width: 44px;
  height: 44px;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--brick);
  border-radius: var(--radius);
  transition: border-color 0.25s ease, background 0.25s ease;
  flex-shrink: 0;
}

.nav-toggle:hover {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.06);
}

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

.nav-toggle-text {
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
  letter-spacing: 0.1em;
  margin-top: 3px;
  display: block;
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle-text {
  color: var(--red);
}

/* ---------- Nav Drawer / Sidebar Nav ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--bg-panel);
  border-right: 1px solid var(--brick);
  transform: translateX(-105%);
  transition: transform 0.3s ease;
  padding: calc(var(--header-total-h) + 24px) 20px 24px;
  overflow-y: auto;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.site-nav[data-open] {
  transform: translateX(0);
  box-shadow: 10px 0 32px rgba(0, 0, 0, 0.35);
}

.nav-title {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--gold);
  letter-spacing: 0.14em;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--brick);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 0 auto;
}

.nav-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 15px;
  border-left: 3px solid transparent;
  background: transparent;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.nav-link:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link .nav-index {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.nav-link[aria-current="page"] {
  color: var(--paper);
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(192, 57, 43, 0.14), transparent 75%);
}

.nav-link[aria-current="page"] .nav-index {
  color: var(--red);
}

.nav-note {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--brick);
}

/* ---------- Backdrop ---------- */
body[data-nav-open]::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 998;
  pointer-events: auto;
}

/* ---------- Body Layout (Desktop fixed side) ---------- */
@media (min-width: 1024px) {
  body {
    padding-left: var(--sidebar-w);
    padding-top: var(--meta-h);
  }

  .site-header {
    position: static;
  }

  .header-meta {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    min-height: var(--meta-h);
    border-bottom: 1px solid var(--brick);
  }

  .header-side {
    position: fixed;
    top: var(--meta-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 28px 20px 20px;
    border-right: 1px solid var(--brick);
    border-bottom: none;
    z-index: 99;
    overflow-y: auto;
  }

  .site-brand {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--brick);
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    margin-bottom: 6px;
  }

  .brand-name {
    font-size: 22px;
  }

  .brand-en {
    display: block;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    width: auto;
    transform: none;
    background: transparent;
    border: none;
    padding: 20px 0 0;
    overflow: visible;
    box-shadow: none !important;
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .nav-title {
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .nav-note {
    margin-top: auto;
    padding-top: 12px;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg);
  color: var(--muted);
  margin-top: 0;
}

.brick-divider {
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--brick) 0px,
    var(--brick) 26px,
    var(--bg) 26px,
    var(--bg) 32px
  );
  border-top: 1px solid var(--brick);
  border-bottom: 1px solid var(--bg);
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 24px 28px;
}

.footer-brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--paper);
  letter-spacing: 0.04em;
}

.footer-about {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 360px;
}

.footer-trust {
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted);
  opacity: 0.7;
  max-width: 400px;
  border-left: 2px solid var(--brick);
  padding-left: 12px;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--brick);
}

.footer-link-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-link-list a {
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-link-list a:hover {
  color: var(--paper);
  padding-left: 4px;
}

.footer-contact p {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.contact-phone {
  font-family: var(--font-data);
  font-size: 22px;
  color: var(--red);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.contact-email {
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--gold);
  word-break: break-all;
}

.contact-hours {
  font-size: 13px;
  color: var(--teal);
  border-left: 2px solid var(--teal);
  padding-left: 8px;
  margin-top: 10px;
}

.contact-note {
  font-size: 12px;
  opacity: 0.65;
}

.footer-bottom {
  border-top: 1px solid var(--brick);
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.footer-copy {
  margin: 0;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.footer-legal a {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s ease;
}

.footer-legal a:hover {
  color: var(--paper);
}

.legal-sep {
  color: var(--brick);
}

.footer-icp {
  margin: 0;
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--brick);
  cursor: pointer;
  text-decoration: none;
  border-radius: 0;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

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

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

.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--paper);
}

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

.btn-ghost:hover {
  background: rgba(192, 57, 43, 0.1);
  color: var(--red);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--paper);
}

.breadcrumb-sep {
  color: var(--brick);
}

.breadcrumb-current {
  color: var(--paper);
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: 1fr;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 1024px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* ---------- Panel ---------- */
.gw-panel {
  background: var(--bg-panel);
  border: 1px solid var(--brick);
  border-top: 3px solid var(--red);
  padding: 28px;
  border-radius: 0;
}

/* ---------- Beacon Card ---------- */
.beacon-card {
  background: var(--bg-panel);
  border: 1px solid var(--brick);
  padding: 24px;
  position: relative;
  clip-path: polygon(
    0 0,
    calc(100% - 16px) 0,
    100% 16px,
    100% 100%,
    16px 100%,
    0 calc(100% - 16px)
  );
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.beacon-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  width: 34px;
  height: 3px;
  background: var(--red);
}

.beacon-card::after {
  content: "";
  position: absolute;
  left: 16px;
  bottom: 10px;
  width: 14px;
  height: 14px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  opacity: 0.4;
}

.beacon-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

/* ---------- Stat Block ---------- */
.stat-block {
  padding: 20px;
  background: var(--bg);
  border-left: 3px solid var(--teal);
  margin-bottom: 16px;
}

.stat-value {
  font-family: var(--font-data);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--paper);
  display: block;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
  display: block;
}

.stat-trend {
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--teal);
  margin-top: 4px;
  display: block;
}

/* ---------- Image Frame ---------- */
.image-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--brick);
  aspect-ratio: 16 / 9;
}

.image-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent 0 8px,
    rgba(255, 255, 255, 0.02) 8px 16px
  );
  pointer-events: none;
}

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

/* ---------- Reveal Animation ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

[data-reveal][data-visible] {
  opacity: 1;
  transform: none;
}

/* ---------- Footer Responsive ---------- */
@media (min-width: 640px) {
  .footer-main {
    grid-template-columns: 2fr 1fr;
  }

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

@media (min-width: 1024px) {
  .footer-main {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
  }

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

/* ---------- Mobile Drawer Overrides ---------- */
@media (max-width: 1023px) {
  body[data-nav-open] {
    overflow: hidden;
  }
}

/* ---------- 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: 0ms !important;
  }

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

  .reading-progress {
    transition: none;
  }

  .site-nav {
    transition: none;
  }

  .nav-toggle-bar {
    transition: none;
  }

  .skip-link {
    transition: none;
  }

  .beacon-card,
  .btn,
  .nav-link,
  .footer-link-list a {
    transition: none;
  }
}
