/* ==========================================================================
   M6体育赛场 · /assets/site.css
   共享层：reset / 变量 / 中文排版 / 页头 / 页脚 / 通用组件
   ========================================================================== */

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

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

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

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

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

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

a { color: inherit; }

/* --- 2. 变量 ------------------------------------------------------------ */
:root {
  --space-900: #071A33;
  --space-800: #0A2440;
  --midnight: #0E2A4A;
  --teal: #0B6B75;
  --orange: #FF6A00;
  --cyan: #22D3EE;
  --chili: #E23A2E;
  --paper: #F4EFE6;
  --ink: #1A120B;
  --mist: #8CA3B8;
  --pulse: #FFC53D;
  --body-text: #DCE6F0;

  --line: rgba(140, 163, 184, 0.26);
  --line-soft: rgba(140, 163, 184, 0.14);
  --line-strong: rgba(140, 163, 184, 0.45);

  --font-head: "Barlow Condensed", "Oswald", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body: "Noto Sans SC", system-ui, -apple-system, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, monospace;

  --shell: 1280px;
  --radius: 3px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.22s;
}

/* --- 3. 基础与中文排版 -------------------------------------------------- */
body {
  background-color: var(--space-900);
  background-image:
    radial-gradient(1100px 620px at 10% -12%, rgba(34, 211, 238, 0.09), transparent 62%),
    radial-gradient(900px 520px at 102% -4%, rgba(255, 106, 0, 0.08), transparent 60%),
    repeating-linear-gradient(90deg, rgba(140, 163, 184, 0.05) 0 1px, transparent 1px 96px);
  background-attachment: fixed;
  color: var(--body-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  color: var(--paper);
  line-height: 1.1;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 4.8rem); font-weight: 300; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.55rem); font-weight: 500; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { line-height: 1.75; }

a { text-decoration: none; }
a:hover { color: var(--cyan); }

strong { color: var(--paper); font-weight: 600; }

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

:where(a, button, [tabindex], summary):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

#main-content { display: block; }

/* --- 4. 布局工具 -------------------------------------------------------- */
.shell {
  width: min(100% - 2rem, var(--shell));
  margin-inline: auto;
}

.section { padding: 3rem 0; }
.section--tight { padding: 1.75rem 0; }
.section--wide { padding: 4.5rem 0; }

.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.prose { max-width: 72ch; }
.prose p { margin-bottom: 1.15em; color: var(--body-text); }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { margin-top: 1.8em; margin-bottom: 0.55em; }
.prose h3 { margin-top: 1.5em; margin-bottom: 0.5em; }
.prose ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 1.15em; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--cyan); border-bottom: 1px solid rgba(34, 211, 238, 0.45); }
.prose a:hover { border-color: var(--cyan); }

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--line-strong), transparent 78%);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -120px;
  z-index: 300;
  background: var(--pulse);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 0.6rem; }

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

.idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pulse);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mist);
}

/* --- 5. 按钮 ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.btn--primary {
  background: var(--orange);
  color: #12080A;
}
.btn--primary:hover { background: var(--pulse); color: var(--ink); }

.btn--ghost {
  background: rgba(14, 42, 74, 0.6);
  border-color: var(--line-strong);
  color: var(--paper);
}
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn--paper {
  background: var(--paper);
  color: var(--ink);
}
.btn--paper:hover { background: var(--pulse); color: var(--ink); }

/* --- 6. 面板 / 标签 / 印刷件 ------------------------------------------- */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(14, 42, 74, 0.94), rgba(9, 32, 58, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}
.panel::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 14px; height: 14px;
  border-top: 2px solid var(--orange);
  border-left: 2px solid var(--orange);
}

.panel--paper {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}
.panel--paper::before { border-color: var(--chili); }
.panel--paper h2, .panel--paper h3, .panel--paper h4 { color: var(--ink); }
.panel--paper p { color: #33261A; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--mist);
}
.tag--hot { border-color: var(--orange); color: var(--orange); }
.tag--cyan { border-color: rgba(34, 211, 238, 0.65); color: var(--cyan); }
.tag--chili { border-color: var(--chili); color: #FF8E82; }
.tag--paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* --- 7. 图片容器（页面阶段放置占位） ---------------------------------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(148deg, rgba(11, 107, 117, 0.35), rgba(7, 26, 51, 0.9) 60%),
    var(--midnight);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--21x9 { aspect-ratio: 21 / 9; }

.media__tag {
  position: absolute;
  left: 0; bottom: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.6rem;
}

.media__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(34, 211, 238, 0.12) 0 1px,
    transparent 1px 4px
  );
  mix-blend-mode: screen;
  pointer-events: none;
}

/* --- 8. 分段标签页（页面级同级内容切换） ------------------------------ */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.segmented__tab {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--mist);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.42rem 0.85rem;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease),
    color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.segmented__tab:hover { border-color: var(--cyan); color: var(--cyan); }
.segmented__tab[aria-selected="true"] {
  background: var(--orange);
  border-color: var(--orange);
  color: #12080A;
}

[data-tab-panel][hidden] { display: none; }

/* --- 9. 面包屑 ---------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--mist);
}
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li::after {
  content: "/";
  margin: 0 0.45rem;
  color: rgba(140, 163, 184, 0.5);
}
.breadcrumb li:last-child::after { content: ""; margin: 0; }
.breadcrumb a { color: var(--mist); }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb [aria-current="page"] { color: var(--paper); }

/* --- 10. 页头 ----------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(180deg, rgba(7, 26, 51, 0.98), rgba(7, 26, 51, 0.92));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(2, 9, 18, 0.45);
  backdrop-filter: blur(8px);
}

/* 赛程脉冲条 */
.ticker {
  background:
    repeating-linear-gradient(90deg, rgba(34, 211, 238, 0.09) 0 1px, transparent 1px 88px),
    linear-gradient(90deg, #082040, #071A33 58%, #0A2440);
  border-bottom: 1px solid var(--line-soft);
}
.ticker__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 38px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: min-height var(--dur) var(--ease);
}
.ticker__inner::-webkit-scrollbar { display: none; }

.ticker__label,
.ticker__day,
.ticker__leagues {
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.ticker__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--pulse);
  font-weight: 700;
}

.ticker__dates { display: inline-flex; gap: 1rem; flex: 0 0 auto; }
.ticker__day { color: var(--mist); }
.ticker__day--live { color: var(--cyan); }
.ticker__leagues { color: rgba(140, 163, 184, 0.8); margin-left: auto; }

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(255, 106, 0, 0.7);
  animation: pulse-breath 2.4s var(--ease) infinite;
}
@keyframes pulse-breath {
  0% { box-shadow: 0 0 0 0 rgba(255, 106, 0, 0.65); }
  70% { box-shadow: 0 0 0 9px rgba(255, 106, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 106, 0, 0); }
}

/* 主体框架 */
.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 0;
  transition: padding var(--dur) var(--ease);
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding-left: 0.85rem;
  color: var(--paper);
}
.brand::before {
  content: "";
  position: absolute;
  left: 0; top: 2px; bottom: 2px;
  width: 3px;
  background: linear-gradient(180deg, var(--orange), var(--pulse) 48%, var(--cyan));
}
.brand:hover { color: var(--paper); }

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--orange);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--orange);
  background: rgba(255, 106, 0, 0.07);
  transition: width var(--dur) var(--ease), height var(--dur) var(--ease),
    font-size var(--dur) var(--ease);
}

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--font-head);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.07em;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mist);
}

/* 主导航 */
.main-nav { justify-self: center; }
.main-nav__list { display: flex; align-items: center; gap: 0.2rem; }

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 0.92rem;
  color: var(--paper);
  letter-spacing: 0.02em;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.main-nav a:hover {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.07);
  border-color: rgba(34, 211, 238, 0.4);
}
.main-nav a[aria-current="page"] {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.main-nav a[aria-current="page"] .nav-idx { color: var(--chili); }

.nav-idx {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--pulse);
}

/* 右侧捷径轨道 */
.header-rail {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rail-link {
  font-size: 0.82rem;
  color: var(--mist);
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--line-strong);
}
.rail-link:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px; height: 38px;
  padding: 0;
  background: rgba(14, 42, 74, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--cyan); }

.nav-toggle__bar {
  display: block;
  width: 18px; height: 2px;
  background: var(--paper);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(6px) 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(-6px) rotate(-45deg);
}

/* 滚动进度 */
.progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(140, 163, 184, 0.14);
  pointer-events: none;
}
.progress span {
  display: block;
  width: 100%; height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--orange), var(--pulse) 46%, var(--cyan));
}

/* 收窄状态 */
.site-header[data-compact] .masthead { padding: 0.45rem 0; }
.site-header[data-compact] .ticker__inner { min-height: 32px; }
.site-header[data-compact] .brand__mark {
  width: 34px; height: 34px; font-size: 0.92rem;
}

/* --- 11. 页脚 ----------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: 4rem;
  background: linear-gradient(180deg, #071A33, #04101F);
  border-top: 1px solid var(--line);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--pulse) 30%, var(--cyan) 66%, var(--teal));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr 1.3fr 1.15fr;
  gap: 2rem;
  padding: 3rem 0 2.25rem;
}

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

.footer-col--brand .brand { padding-left: 0.85rem; margin-bottom: 1rem; }
.footer-col--brand .btn { margin-top: 1.1rem; }

.brand--footer .brand__mark { width: 38px; height: 38px; font-size: 0.96rem; }

.footer-note {
  font-size: 0.9rem;
  color: var(--mist);
  max-width: 34ch;
}

.footer-title {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--pulse);
  margin-bottom: 0.9rem;
}

.footer-list { display: flex; flex-direction: column; gap: 0.42rem; }
.footer-list a {
  font-size: 0.9rem;
  color: var(--body-text);
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer-list a:hover { color: var(--cyan); border-bottom-color: rgba(34, 211, 238, 0.5); }

.footer-list--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem 1rem;
}

.footer-list--plain li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--mist);
  word-break: break-word;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.15rem 0 1.75rem;
  border-top: 1px solid var(--line-soft);
}

.footer-copy,
.footer-icp {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--mist);
}

.footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.footer-links a {
  font-size: 0.82rem;
  color: var(--body-text);
}
.footer-links a:hover { color: var(--cyan); }

/* --- 12. 响应式 --------------------------------------------------------- */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr; gap: 1.75rem; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .masthead {
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    display: none;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line-soft);
  }
  .main-nav[data-open] { display: block; }
  .main-nav__list { flex-direction: column; align-items: stretch; gap: 0.1rem; }
  .main-nav a {
    padding: 0.7rem 0.4rem;
    border-radius: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .header-rail { justify-self: end; }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 720px) {
  .section { padding: 2.25rem 0; }
  .section--wide { padding: 3rem 0; }
  .ticker__leagues { display: none; }
  .rail-link { display: none; }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 2.25rem 0 1.5rem; }
  .footer-base { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .brand__mark { width: 36px; height: 36px; font-size: 0.92rem; }
  .brand__sub { display: none; }
  .footer-list--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- 13. 动效降级 ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .pulse { animation: none; }
}
