/* ===================================================================
   万合足球赛 · 共享样式 /assets/site.css
   球场切片构图：夜赛深蓝场景层 + 草皮绿结构层 + 哨声橙节奏点
   =================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --pitch: #0E6B3A;
  --night: #071A2B;
  --stand: #123A5A;
  --whistle: #FF6B1A;
  --whistle-soft: #FFE3D1;
  --whistle-ink: #9A3A05;
  --board: #F6F7F2;
  --mist: #DDEBDD;
  --rail: #6F8F7C;
  --glass: rgba(255, 255, 255, 0.10);
  --deep: #084826;

  --ink: #071A2B;
  --paper: #F6F7F2;
  --max: 1200px;
  --gutter: clamp(1.05rem, 4vw, 3rem);
  --radius: 2px;
  --ease: 180ms cubic-bezier(0.2, 0.7, 0.3, 1);

  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --font-mono: "Roboto Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, "Courier New", monospace;
}

/* ---------- 2. 重置与中文排版 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote {
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.15rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.18rem, 2vw, 1.55rem); }
h4 { font-size: 1.06rem; letter-spacing: 0; }

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

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

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

strong, b {
  font-weight: 700;
}

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

::selection {
  background: var(--whistle);
  color: var(--night);
}

/* ---------- 3. 工具类 ---------- */
.visually-hidden {
  position: absolute;
  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;
  top: -5rem;
  left: 1rem;
  z-index: 200;
  padding: 0.7rem 1.15rem;
  background: var(--whistle);
  color: var(--night);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top var(--ease);
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- 4. 头部：看台快线 ---------- */
.site-header {
  position: relative;
  z-index: 40;
}

.header-rail {
  background: var(--deep);
  color: #CFE3D6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rail-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: 0 var(--gutter);
}

.rail-mark {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rail);
  white-space: nowrap;
}

.rail-links {
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 2.4vw, 2rem);
  overflow-x: auto;
  scrollbar-width: none;
}

.rail-links::-webkit-scrollbar {
  display: none;
}

.rail-links a {
  position: relative;
  display: inline-block;
  padding: 0.6rem 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: #C2D8CB;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ease);
}

.rail-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.3rem;
  height: 2px;
  background: var(--whistle);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--ease);
}

.rail-links a:hover,
.rail-links a:focus-visible {
  color: var(--whistle);
}

.rail-links a:hover::after,
.rail-links a:focus-visible::after {
  transform: scaleX(1);
}

/* ---------- 5. 头部：主栏 ---------- */
.header-main {
  position: relative;
  background: var(--night);
  color: var(--board);
}

.header-main::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--pitch) 0 52%,
    var(--whistle) 52% 57%,
    var(--stand) 57% 100%
  );
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: 0.85rem var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--board);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  background: var(--pitch);
  color: var(--board);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  transition: background var(--ease);
}

.brand:hover .brand-mark {
  background: var(--whistle);
  color: var(--night);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.22;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.brand-tag {
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  color: #A8C2B1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 移动端抽屉按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  color: var(--board);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}

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

.nav-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--whistle);
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: background var(--ease);
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform var(--ease), top var(--ease);
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after  { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-toggle-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

/* 主导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 1.6vw, 1.4rem);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(0.1rem, 0.9vw, 0.7rem);
}

.nav-list a {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.55rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: #CBDCD2;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ease);
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.12rem;
  height: 2px;
  background: var(--whistle);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--ease);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--board);
}

.nav-list a:hover::after,
.nav-list a:focus-visible::after {
  transform: scaleX(1);
}

.nav-list a[aria-current="page"] {
  color: var(--board);
  font-weight: 700;
}

.nav-list a[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--whistle);
}

.nav-cta {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.5rem 0.95rem;
  background: var(--whistle);
  color: var(--night);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--ease), transform var(--ease);
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: #FF8A45;
  transform: translateY(-1px);
}

.nav-cta:active {
  transform: translateY(1px);
}

/* 阅读进度条 */
.scroll-meter {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 3px;
  background: var(--whistle);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 7vw, 6rem);
  background: var(--night);
  color: #B9CDC1;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--pitch) 0 46%,
    var(--whistle) 46% 52%,
    var(--stand) 52% 100%
  );
}

.footer-inner {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(2.2rem, 5vw, 3.6rem) var(--gutter) 1.6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.35fr 1fr;
  gap: clamp(1.6rem, 4vw, 3rem);
}

.footer-name {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--board);
}

.footer-name::after {
  content: "";
  display: block;
  width: 2.4rem;
  height: 3px;
  margin-top: 0.6rem;
  background: var(--whistle);
}

.footer-line {
  margin-top: 0.95rem;
  max-width: 26ch;
  font-size: 0.9rem;
  line-height: 1.85;
  color: #9FB8A9;
}

.footer-title {
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--whistle);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.92rem;
}

.footer-list a {
  color: #D3E3D8;
  text-decoration: none;
  border-bottom: 1px solid rgba(211, 227, 216, 0.26);
  padding-bottom: 1px;
  transition: color var(--ease), border-color var(--ease);
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--whistle);
  border-color: var(--whistle);
}

.footer-contact {
  gap: 0.85rem;
}

.footer-contact li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.footer-k {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: #8FA79A;
}

.footer-v {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--board);
  word-break: break-word;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  margin-top: clamp(1.8rem, 4vw, 2.8rem);
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  color: #8FA79A;
}

.footer-copy {
  letter-spacing: 0.02em;
}

.footer-icp {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: #A8C2B1;
}

/* ---------- 7. 布局容器与分区 ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(2.2rem, 5.5vw, 4.5rem);
}

.section--night {
  background: var(--night);
  color: var(--board);
}

.section--board {
  background: var(--board);
  color: var(--ink);
}

.section--mist {
  background: var(--mist);
  color: var(--deep);
}

.section--night h2,
.section--night h3 {
  color: var(--board);
}

/* ---------- 8. 文本组件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pitch);
}

.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  background: var(--whistle);
}

.section--night .eyebrow {
  color: var(--whistle);
}

.lead {
  max-width: 36em;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.85;
  color: var(--stand);
}

.section--night .lead {
  color: #B9CDC1;
}

.section-index {
  display: inline-block;
  padding-left: 0.65rem;
  border-left: 3px solid var(--pitch);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--whistle-ink);
}

.section--night .section-index {
  color: var(--whistle);
  border-left-color: var(--whistle);
}

.prose {
  max-width: 38em;
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink);
}

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

.prose h2,
.prose h3 {
  margin-top: 1.9em;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--deep);
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose a {
  color: var(--pitch);
  text-decoration-color: var(--whistle);
  text-decoration-thickness: 2px;
}

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

/* ---------- 9. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--ease), color var(--ease),
    border-color var(--ease), transform var(--ease);
}

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

.btn--primary {
  background: var(--whistle);
  color: var(--night);
  border-color: var(--whistle);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: #FF8A45;
  border-color: #FF8A45;
}

.btn--solid {
  background: var(--pitch);
  color: var(--board);
  border-color: var(--pitch);
}

.btn--solid:hover,
.btn--solid:focus-visible {
  background: var(--deep);
  border-color: var(--deep);
}

.btn--ghost {
  background: transparent;
  color: currentColor;
  border-color: currentColor;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--whistle);
  color: var(--whistle);
}

/* ---------- 10. 面包屑 ---------- */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--rail);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color var(--ease), border-color var(--ease);
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--whistle-ink);
  border-color: var(--whistle);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--rail);
}

.breadcrumb [aria-current="page"] {
  color: var(--pitch);
  font-weight: 700;
}

/* ---------- 11. 网格 ---------- */
.grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.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)); }

/* ---------- 12. 图片容器基础规则 ---------- */
.figure {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
}

.figure-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--stand) 0%, var(--deep) 100%);
  border-radius: var(--radius);
}

.figure-media > img,
.figure-media > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.figure:hover .figure-media > img {
  transform: scale(1.03);
}

.figure-media--wide { aspect-ratio: 21 / 9; }
.figure-media--tall { aspect-ratio: 4 / 5; }
.figure-media--square { aspect-ratio: 1 / 1; }

.figure-caption {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--rail);
}

/* ---------- 13. 标签与比分牌 ---------- */
.tag {
  display: inline-block;
  padding: 0.26rem 0.6rem;
  background: var(--whistle-soft);
  color: var(--whistle-ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.5;
  border-radius: var(--radius);
}

.scoreboard {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1.1rem;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.scoreboard-digits {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--board);
}

/* ---------- 14. 响应式 ---------- */
@media (max-width: 1080px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100dvh - 7rem);
    overflow-y: auto;
    padding: 0.5rem var(--gutter) 1.35rem;
    background: linear-gradient(180deg, var(--night) 0%, var(--deep) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--ease), transform var(--ease),
      visibility 0s linear 200ms;
  }

  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity var(--ease), transform var(--ease), visibility 0s;
  }

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

  .nav-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  }

  .nav-list a {
    display: block;
    padding: 0.85rem 0.2rem;
    font-size: 1.02rem;
  }

  .nav-list a::after {
    left: 0.2rem;
    right: auto;
    bottom: 0.5rem;
    width: 1.6rem;
  }

  .nav-cta {
    align-self: flex-start;
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
  }

  .brand-tag {
    display: none;
  }

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

@media (max-width: 720px) {
  .rail-mark {
    display: none;
  }

  .rail-inner {
    justify-content: flex-start;
  }

  .rail-links {
    gap: 1.1rem;
  }

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

  .figure-media--wide {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-bottom {
    justify-content: flex-start;
  }

  .prose {
    font-size: 0.98rem;
  }
}

/* ---------- 15. 无障碍与降级动效 ---------- */
@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;
  }

  .figure:hover .figure-media > img {
    transform: none;
  }
}
