/* ==========================================================================
   ball-legend-arena.com.cn — shared site kit
   /assets/site.css
   ========================================================================== */

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

ul, ol { list-style: none; }

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

button, input, select, textarea { font: inherit; color: inherit; }

button { background: none; border: 0; }

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

hr { border: 0; }

/* ---------- tokens ---------- */
:root {
  --void: #070907;
  --panel: #101512;
  --panel-deep: #0B0F0C;
  --cream: #F3EEE2;
  --cream-soft: #E9E3D6;
  --ink: #241C16;
  --neon: #B8FF3C;
  --neon-deep: #4FA83D;
  --heat: #FF6A2B;
  --amber: #FFC24B;
  --brick: #C2553F;
  --grid: #3A4A3C;
  --muted: #9AA79B;
  --line: rgba(58, 74, 60, 0.85);
  --line-soft: rgba(58, 74, 60, 0.45);

  --font-sans: "Source Han Sans SC", "Noto 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", ui-monospace, SFMono-Regular, Menlo,
    Consolas, "Noto Sans Mono CJK SC", monospace;

  --shell: 1240px;
  --gutter: 24px;
  --rail-h: 34px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- base ---------- */
body {
  min-height: 100vh;
  background-color: var(--void);
  background-image:
    linear-gradient(rgba(58, 74, 60, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 74, 60, 0.13) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  background-position: center top;
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--cream);
}

h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 1.8vw, 1.5rem); }
h4 { font-size: 1.0625rem; letter-spacing: 0; }

p { max-width: 70ch; }

::selection { background: var(--neon); color: var(--void); }

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(7, 9, 7, 0.92);
}

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

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.rule { height: 1px; background: var(--line-soft); }

/* ---------- layout shells ---------- */
.container {
  width: 100%;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(48px, 7vw, 96px);
  border-top: 1px solid var(--line-soft);
}

.section:first-of-type { border-top: 0; }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(24px, 3.5vw, 40px);
}

.section-title { font-size: clamp(1.75rem, 3vw, 2.5rem); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon);
  margin-bottom: 10px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.layout { display: grid; gap: 32px; }

@media (min-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 48px; }
}

@media (min-width: 1024px) {
  .layout__aside { position: sticky; top: calc(72px + var(--rail-h)); }
}

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--grid);
  background: transparent;
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn:hover {
  background: rgba(184, 255, 60, 0.1);
  border-color: var(--neon);
  color: var(--neon);
}

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

.btn--primary {
  background: var(--neon);
  border-color: var(--neon);
  color: var(--void);
}

.btn--primary:hover {
  background: var(--neon-deep);
  border-color: var(--neon-deep);
  color: var(--void);
}

.btn--ghost {
  background: rgba(243, 238, 226, 0.04);
  border-color: var(--line-soft);
}

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

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

.btn--sm { padding: 9px 14px; font-size: 13px; }
.btn--block { width: 100%; }

/* ---------- tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: rgba(16, 21, 18, 0.85);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tag--neon { color: var(--neon); border-color: rgba(184, 255, 60, 0.55); background: rgba(184, 255, 60, 0.08); }
.tag--heat { color: var(--heat); border-color: rgba(255, 106, 43, 0.5); background: rgba(255, 106, 43, 0.08); }
.tag--amber { color: var(--amber); border-color: rgba(255, 194, 75, 0.45); background: rgba(255, 194, 75, 0.08); }
.tag--brick { color: var(--brick); border-color: rgba(194, 85, 63, 0.5); background: rgba(194, 85, 63, 0.1); }
.tag--cream { color: var(--ink); border-color: var(--cream); background: var(--cream); }

/* ---------- cards ---------- */
.card {
  position: relative;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}

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

.card--cream {
  background: var(--cream);
  border-color: rgba(36, 28, 22, 0.28);
  color: var(--ink);
}

.card--cream:hover { border-color: var(--heat); }
.card--cream h2, .card--cream h3, .card--cream h4 { color: var(--ink); }
.card--cream .eyebrow { color: var(--brick); }
.card--cream .field-label { color: rgba(36, 28, 22, 0.65); }

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.card--cream .card__head { border-bottom-color: rgba(36, 28, 22, 0.2); }

.card__body > * + * { margin-top: 10px; }

.card__foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.card--cream .card__foot { border-top-color: rgba(36, 28, 22, 0.2); }

/* ---------- metrics & meters ---------- */
.metric { display: flex; flex-direction: column; gap: 4px; }

.metric__value {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--neon);
  font-variant-numeric: tabular-nums;
}

.metric__label { font-size: 13px; color: var(--muted); }

.meter {
  position: relative;
  display: block;
  height: 6px;
  background: rgba(58, 74, 60, 0.45);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

.meter__fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--neon);
  transition: width 0.6s var(--ease);
}

.meter--heat .meter__fill { background: var(--heat); }
.meter--amber .meter__fill { background: var(--amber); }

/* ---------- media frames ---------- */
.media-frame {
  position: relative;
  display: block;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  overflow: hidden;
}

.media-frame::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.media-frame--portrait::before { padding-top: 133%; }
.media-frame--square::before { padding-top: 100%; }
.media-frame--tall::before { padding-top: 72%; }

.media-frame__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.05);
}

.media-frame--pending::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(58, 74, 60, 0.35) 0 1px,
    transparent 1px 10px
  );
  pointer-events: none;
}

.media-frame__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 12px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--cream);
  background: linear-gradient(to top, rgba(7, 9, 7, 0.92), rgba(7, 9, 7, 0));
}

/* ---------- breadcrumb ---------- */
.breadcrumb {
  padding-block: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
}

.breadcrumb__item { display: flex; align-items: center; gap: 8px; }

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: var(--grid);
}

.breadcrumb a:hover { color: var(--neon); }
.breadcrumb [aria-current="page"] { color: var(--cream); }

/* ---------- prose ---------- */
.prose { max-width: 74ch; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.8em; }
.prose ul > li {
  position: relative;
  padding-left: 20px;
  margin-top: 0.5em;
}
.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 9px;
  height: 1px;
  background: var(--neon);
}
.prose a {
  color: var(--cream);
  border-bottom: 1px solid var(--neon-deep);
}
.prose a:hover { color: var(--neon); border-bottom-color: var(--neon); }
.card--cream .prose { color: var(--ink); }
.card--cream .prose a { color: var(--ink); border-bottom-color: var(--brick); }

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--neon);
  color: var(--void);
  font-size: 14px;
  font-weight: 700;
  transition: top 0.18s var(--ease);
}

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

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: transparent;
  transition: background 0.25s var(--ease);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: transparent;
  transition: background 0.25s var(--ease);
}

.site-header[data-scrolled="true"] {
  background: rgba(7, 9, 7, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-header[data-scrolled="true"]::after { background: var(--grid); }

.header-rail {
  max-height: var(--rail-h);
  overflow: hidden;
  background: rgba(11, 15, 12, 0.9);
  border-bottom: 1px solid var(--line-soft);
  transition: max-height 0.3s var(--ease), opacity 0.25s var(--ease);
}

.site-header[data-scrolled="true"] .header-rail {
  max-height: 0;
  opacity: 0;
}

.header-rail__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--rail-h);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.rail-mark { color: var(--cream); white-space: nowrap; }

.rail-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--neon);
  white-space: nowrap;
}

.rail-dot {
  width: 6px;
  height: 6px;
  background: var(--neon);
  animation: railPulse 2.4s ease-in-out infinite;
}

@keyframes railPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.rail-links { display: flex; gap: 18px; }
.rail-link { color: var(--muted); }
.rail-link:hover { color: var(--neon); }

.header-bar { padding-block: 14px; transition: padding 0.25s var(--ease); }
.site-header[data-scrolled="true"] .header-bar { padding-block: 9px; }

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

/* brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__mark {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--neon);
  color: var(--void);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.brand__name {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--cream);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* nav */
.site-nav { grid-column: 2; justify-self: center; }

.site-nav__list { display: flex; align-items: center; gap: 2px; }

.site-nav__item { display: block; }

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 10px 13px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 2px;
  background: var(--neon);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease);
}

.site-nav__link:hover {
  color: var(--cream);
  background: rgba(243, 238, 226, 0.05);
}

.site-nav__link:hover::after { transform: scaleX(1); }

.site-nav__link[aria-current="page"] {
  color: var(--neon);
  background: rgba(184, 255, 60, 0.07);
}

.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

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

.nav-toggle__bars {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 10px;
}

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

.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { bottom: 0; }

.site-header[data-open="true"] .nav-toggle__bars::before { transform: translateY(4.25px) rotate(45deg); }
.site-header[data-open="true"] .nav-toggle__bars::after { transform: translateY(-4.25px) rotate(-45deg); }

/* tools */
.header-tools { display: flex; align-items: center; gap: 10px; }

/* scroll progress */
.header-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  height: 2px;
  width: 0;
  background: var(--heat);
  transition: width 0.12s linear;
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 110px);
  background: var(--panel-deep);
  border-top: 1px solid var(--grid);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    100deg,
    rgba(184, 255, 60, 0) 20%,
    rgba(184, 255, 60, 0.05) 50%,
    rgba(184, 255, 60, 0) 80%
  );
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-block: clamp(40px, 6vw, 72px);
}

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

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1.5fr;
    gap: 24px;
  }
}

.footer-brand__note {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 14px;
  color: var(--muted);
}

.brand--footer .brand__name { font-size: 17px; }

.footer-col__title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--neon);
}

.footer-links > li + li { margin-top: 8px; }

.footer-links a {
  display: inline-block;
  position: relative;
  padding-left: 14px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}

.footer-links a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 1px;
  background: var(--grid);
  transition: background 0.18s var(--ease);
}

.footer-links a:hover { color: var(--neon); transform: translateX(2px); }
.footer-links a:hover::before { background: var(--neon); }

.footer-contact__list { display: block; }

.footer-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-block: 9px;
  border-bottom: 1px dashed var(--line-soft);
}

.footer-field__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.footer-field__value {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--cream);
  word-break: break-word;
}

.footer-contact__note {
  margin-top: 12px;
  max-width: 32ch;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.footer-bottom {
  border-top: 1px solid var(--line-soft);
  padding-block: 18px 26px;
}

.footer-bottom__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.footer-legal, .footer-meta { max-width: none; }
.footer-meta { color: var(--grid); }
.footer-meta span { color: var(--cream); }

/* ---------- reveal ---------- */
html.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

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

/* ---------- responsive header ---------- */
@media (max-width: 960px) {
  .rail-links { display: none; }

  .header-inner {
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "brand cta toggle"
      "nav nav nav";
    gap: 10px 12px;
  }

  .brand { grid-area: brand; }
  .header-tools { grid-area: cta; justify-self: end; }
  .nav-toggle { display: inline-flex; grid-area: toggle; }
  .site-nav { grid-area: nav; justify-self: stretch; }

  .site-nav {
    display: none;
    border-top: 1px solid var(--line-soft);
    padding-bottom: 8px;
  }

  .site-header[data-open="true"] .site-nav { display: block; }

  .site-nav__list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding-block: 12px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .site-nav__link {
    padding: 8px 12px;
    border: 1px solid var(--line);
    font-size: 14px;
    white-space: nowrap;
  }

  .site-nav__link::after {
    left: 12px;
    right: 12px;
    bottom: 2px;
  }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; --rail-h: 30px; }

  .brand__sub { display: none; }
  .brand__name { font-size: 15px; }
  .brand__mark { width: 30px; height: 30px; font-size: 15px; }
  .rail-mark { display: none; }
  .header-rail__inner { font-size: 10.5px; }

  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand toggle"
      "nav nav"
      "cta cta";
  }

  .header-tools { display: none; justify-self: stretch; }
  .site-header[data-open="true"] .header-tools { display: flex; }
  .site-header[data-open="true"] .header-tools .btn { width: 100%; }

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

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .card:hover { transform: none; }
  .footer-links a:hover { transform: none; }

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