/* ==========================================================================
   球盟会赛场 · 共享站点样式 /assets/site.css
   奶油纸出版底 × 夜赛深蓝块面 × 草皮绿数据区 × 哨声黄/数据青点色
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

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%; }

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

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

table { border-collapse: collapse; width: 100%; }

/* ── 1. 设计令牌 ─────────────────────────────────────────── */
:root {
  --cream: #F3EBDD;
  --ink: #1D1712;
  --night: #0C1B2A;
  --turf: #1E5B3A;
  --whistle: #F2C14E;
  --data: #33B7B0;
  --ember: #D4552D;
  --fog: #8B9B8C;
  --paper: #FFFDF7;

  --line: rgba(29, 23, 18, 0.16);
  --line-strong: rgba(29, 23, 18, 0.38);
  --line-invert: rgba(255, 253, 247, 0.18);
  --ink-soft: rgba(29, 23, 18, 0.78);
  --paper-soft: rgba(255, 253, 247, 0.78);

  --font-display: "Barlow Condensed", "Oswald", "Roboto Condensed", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

  --shell: min(1240px, calc(100% - 48px));
  --header-h: 78px;
  --rail: 38px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── 2. 基础排版与色彩节奏 ───────────────────────────────── */
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.01em;
  padding-right: var(--rail);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

p { max-width: 68ch; }
strong { font-weight: 700; }

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

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

#main-content { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ── 3. 跳过链接 ─────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 12px;
  top: -90px;
  z-index: 200;
  display: inline-block;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--whistle);
  border-left: 4px solid var(--data);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  line-height: 1.3;
  transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ── 4. 头部 ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--cream);
  border-bottom: 1px solid var(--line-strong);
}

.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--turf) 0%,
    var(--turf) 58%,
    var(--whistle) 58%,
    var(--whistle) 74%,
    var(--ember) 74%,
    var(--ember) 100%
  );
}

.header-inner {
  width: var(--shell);
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 0 auto;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 4px 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--ink);
  transition: color 0.18s var(--ease);
}
.brand-mark:hover .brand-name { color: var(--turf); }

.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--turf);
  white-space: nowrap;
}

.version-badge {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  background: var(--ink);
  color: var(--whistle);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.14em;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-toggle:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.nav-toggle-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
}
.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.nav-toggle-label {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.14em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1px;
}

.nav-link {
  display: inline-block;
  padding: 8px 9px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-link:hover { color: var(--turf); border-bottom-color: var(--data); }
.nav-link[aria-current="page"] {
  color: var(--turf);
  font-weight: 700;
  border-bottom-color: var(--ember);
}

.nav-library {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background: var(--turf);
  border: 1px solid var(--turf);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.1em;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-library:hover {
  background: var(--whistle);
  border-color: var(--whistle);
  color: var(--ink);
}

/* ── 5. 右缘版本条 ───────────────────────────────────────── */
.version-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 16px 9px;
  background: var(--night);
  color: var(--paper);
  border-left: 3px solid var(--whistle);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.2;
  letter-spacing: 0.2em;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.version-rail:hover { background: var(--turf); color: var(--paper); }

.version-rail-code {
  color: var(--whistle);
  letter-spacing: 0.1em;
}

/* ── 6. 页脚 ─────────────────────────────────────────────── */
.site-footer {
  position: relative;
  background-color: var(--night);
  color: var(--paper);
  border-top: 4px solid var(--turf);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, rgba(255, 253, 247, 0.055) 1px, transparent 1px);
  background-size: 88px 100%;
}

.footer-inner {
  position: relative;
  width: var(--shell);
  margin-inline: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(0, 2fr);
  gap: 48px;
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--line-invert);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.footer-brand-mark {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 33px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--paper);
  border-bottom: 2px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-brand-mark:hover { color: var(--whistle); border-bottom-color: var(--whistle); }

.footer-tagline {
  font-size: 13px;
  line-height: 1.8;
  color: var(--paper-soft);
  max-width: 26ch;
}

.footer-version {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid var(--line-invert);
  background: rgba(243, 235, 221, 0.04);
}

.footer-version-label {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  color: rgba(255, 253, 247, 0.6);
}

.footer-version-code {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  color: var(--whistle);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.footer-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.18em;
  color: var(--whistle);
}
.footer-col-title::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--data);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-link {
  display: inline-block;
  width: fit-content;
  padding: 5px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 253, 247, 0.82);
  transition: color 0.16s var(--ease), padding-left 0.16s var(--ease);
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--whistle);
  padding-left: 6px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 40px;
  padding: 24px 0 46px;
}

.footer-legal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
}

.footer-legal-link {
  display: inline-block;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.1em;
  color: rgba(255, 253, 247, 0.78);
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.footer-legal-link:hover,
.footer-legal-link:focus-visible {
  color: var(--data);
  border-bottom-color: var(--data);
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.footer-legal {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: rgba(255, 253, 247, 0.72);
}

.footer-contact {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: rgba(255, 253, 247, 0.64);
  max-width: 48ch;
}

.footer-address {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255, 253, 247, 0.58);
  max-width: 44ch;
}

/* ── 7. 内容容器与通用区块 ───────────────────────────────── */
.container {
  width: var(--shell);
  margin-inline: auto;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  padding: 20px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--fog);
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.breadcrumb li + li::before {
  content: "/";
  color: var(--fog);
}
.breadcrumb a {
  color: var(--turf);
  transition: color 0.16s var(--ease);
}
.breadcrumb a:hover { color: var(--ember); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.18em;
  color: var(--turf);
}
.eyebrow::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 2px;
  background: var(--ember);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: 0.01em;
}

.lede {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* ── 8. 按钮族 ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-align: center;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--cream); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--turf);
  border-color: var(--turf);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--whistle);
}

.btn-accent {
  background: var(--whistle);
  border-color: var(--whistle);
  color: var(--ink);
}
.btn-accent:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--whistle);
}

.btn-ghost {
  background: transparent;
  border-color: var(--paper);
  color: var(--paper);
}
.btn-ghost:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

/* ── 9. 网格 ─────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 20px;
}
.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)); }

/* ── 10. 记分牌数字卡 ────────────────────────────────────── */
.data-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  background: var(--turf);
  color: var(--paper);
  border-top: 3px solid var(--whistle);
}
.data-card-value {
  font-family: var(--font-mono);
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--whistle);
}
.data-card-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: 0.14em;
  color: rgba(255, 253, 247, 0.76);
}
.data-card-note {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 253, 247, 0.88);
  max-width: 32ch;
}

/* ── 11. 展览标签 ────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.tag-data { border-color: var(--data); color: var(--turf); }
.tag-ember { border-color: var(--ember); color: var(--ember); }

/* ── 12. 主题筛选 ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.filter-btn:hover { border-color: var(--turf); color: var(--turf); }
.filter-btn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--whistle);
}

[data-filter-item][hidden] { display: none !important; }

[data-filter-item].is-entering {
  animation: filter-in 0.22s var(--ease) both;
}

@keyframes filter-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── 13. 图片容器基础规则 ───────────────────────────────── */
.figure-frame {
  position: relative;
  display: block;
  overflow: hidden;
  margin: 0;
  background: var(--night);
  border-bottom: 3px solid var(--turf);
}
.figure-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.figure-frame-wide { aspect-ratio: 16 / 9; }
.figure-frame-square { aspect-ratio: 1 / 1; }
.figure-frame-tall { aspect-ratio: 3 / 4; }
.figure-frame-band { aspect-ratio: 21 / 9; }

.figure-caption {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--fog);
  max-width: 62ch;
}
.figure-caption::before {
  content: "FIG.";
  flex: 0 0 auto;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--ember);
}

/* ── 14. 平板断点 ────────────────────────────────────────── */
@media (max-width: 1024px) {
  body { padding-right: 0; }
  .version-rail { display: none; }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 24px 24px;
    background: var(--night);
    border-bottom: 4px solid var(--turf);
    box-shadow: 0 24px 44px rgba(12, 27, 42, 0.3);
  }
  .site-nav[data-open],
  .site-nav[data-open="true"] { display: flex; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-link {
    display: block;
    padding: 14px 4px;
    font-size: 16px;
    color: var(--paper);
    border-bottom: 1px solid var(--line-invert);
  }
  .nav-link:hover,
  .nav-link:focus-visible {
    color: var(--whistle);
    border-bottom-color: var(--data);
  }
  .nav-link[aria-current="page"] {
    color: var(--whistle);
    border-bottom-color: var(--ember);
  }

  .nav-library {
    margin-top: 16px;
    padding: 14px 16px;
    font-size: 12px;
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding: 44px 0 36px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-meta {
    text-align: left;
    align-items: flex-start;
  }
  .footer-tagline { max-width: 46ch; }
}

/* ── 15. 手机断点 ────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-3,
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  :root {
    --header-h: 64px;
    --shell: calc(100% - 32px);
    --rail: 0px;
  }

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

  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .footer-brand-mark { font-size: 26px; }
  .footer-version { flex-wrap: wrap; row-gap: 4px; }
  .filter-btn { padding: 7px 11px; font-size: 10.5px; }
}

@media (max-width: 480px) {
  .brand-sub { display: none; }
  .brand-block { gap: 8px; }
  .nav-toggle { padding: 8px 10px; }
  .site-nav { padding: 8px 16px 20px; }
}

/* ── 16. 降低动态偏好 ────────────────────────────────────── */
@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;
    scroll-behavior: auto !important;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1),
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) {
    transform: none;
  }
}
