/* ===========================================================
   爱游戏赛事 · site.css
   共享外壳：左侧轨道头部 / 页脚 / 通用组件
   =========================================================== */

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

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

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

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

a { color: inherit; }

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

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

/* ---------- tokens ---------- */
:root {
  --ink-deep: #0B1D3A;
  --teal-deep: #0F3B3A;
  --indigo: #2A2350;
  --cyan: #1FB6B0;
  --gold: #F2C94C;
  --paper: #F7F3EA;
  --mist: #A9B4C2;
  --ink: #071426;
  --wine: #7A2E3A;

  --line: rgba(169, 180, 194, 0.22);
  --line-strong: rgba(169, 180, 194, 0.45);
  --line-soft: rgba(169, 180, 194, 0.14);

  --font-display: "HarmonyOS Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail-w: 286px;
  --topbar-h: 62px;
  --maxw: 1180px;
  --pad: clamp(20px, 3.6vw, 56px);
  --ease: 0.26s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- base ---------- */
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.75 var(--font-body);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(34px, 5vw, 56px); }
h2 { font-size: clamp(26px, 3.4vw, 40px); }
h3 { font-size: clamp(19px, 2.2vw, 24px); }

strong { font-weight: 700; }

[data-year] { font-variant-numeric: tabular-nums; }

[id="main-content"] { scroll-margin-top: calc(var(--topbar-h) + 16px); }

/* ---------- focus ---------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 11px 20px;
  background: var(--gold);
  color: var(--ink);
  font: 600 14px/1 var(--font-body);
  letter-spacing: 0.06em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform var(--ease);
}

.skip-link:focus { transform: none; }

/* ===========================================================
   头部：固定左侧轨道
   =========================================================== */
.site-rail {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  display: flex;
  width: var(--rail-w);
  height: 100vh;
  background-color: var(--ink-deep);
  background-image:
    linear-gradient(180deg, rgba(31, 182, 176, 0.12) 0%, rgba(11, 29, 58, 0) 42%),
    repeating-linear-gradient(90deg, rgba(169, 180, 194, 0.07) 0 1px, rgba(11, 29, 58, 0) 1px 48px);
  color: var(--paper);
  border-right: 1px solid var(--line);
}

.rail__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 26px 22px 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 品牌 */
.brand {
  display: block;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.brand::before {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  margin-bottom: 15px;
  background: linear-gradient(90deg, var(--cyan) 0 58%, var(--gold) 58% 100%);
}

.brand__mark {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--paper);
  transition: color var(--ease);
}

.brand:hover .brand__mark { color: var(--gold); }

.brand__tag {
  display: block;
  margin-top: 9px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

/* 移动端开关 */
.rail__toggle {
  position: relative;
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: rgba(247, 243, 234, 0.05);
  cursor: pointer;
}

.rail__toggle-bar {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 2px;
  background: var(--gold);
  transform: translateX(-50%);
  transition: transform var(--ease);
}

.rail__toggle-bar:nth-child(1) { top: calc(50% - 5px); }
.rail__toggle-bar:nth-child(2) { top: calc(50% + 3px); }

.site-rail[data-open] .rail__toggle-bar:nth-child(1) {
  transform: translateX(-50%) translateY(4px) rotate(45deg);
}

.site-rail[data-open] .rail__toggle-bar:nth-child(2) {
  transform: translateX(-50%) translateY(-4px) rotate(-45deg);
}

/* 轨道导航 */
.nav { margin-top: 22px; }

.nav__list {
  display: flex;
  flex-direction: column;
}

.nav__item { border-bottom: 1px solid var(--line-soft); }

.nav__link {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 8px 12px 12px;
  color: rgba(247, 243, 234, 0.78);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color var(--ease), background-color var(--ease);
}

.nav__link:hover {
  color: var(--gold);
  background: rgba(31, 182, 176, 0.09);
}

.nav__link[aria-current="page"] {
  color: var(--gold);
  background: rgba(31, 182, 176, 0.15);
}

.nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--cyan);
}

.nav__index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--mist);
}

.nav__link[aria-current="page"] .nav__index,
.nav__link:hover .nav__index { color: var(--cyan); }

/* 轨道常驻入口 */
.rail__utility {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.rail__label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--mist);
}

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

.rail__link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(247, 243, 234, 0.82);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: color var(--ease);
}

.rail__link::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  background: var(--cyan);
}

.rail__link--bookmark::before { background: var(--gold); }

.rail__link:hover { color: var(--cyan); }

.rail__note {
  padding: 9px 11px;
  background: rgba(31, 182, 176, 0.14);
  border-left: 2px solid var(--cyan);
  font-size: 12px;
  line-height: 1.6;
  color: var(--paper);
}

.rail__note[hidden] { display: none; }

/* 滚动进度 */
.rail__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 2px;
  background: rgba(169, 180, 194, 0.16);
  pointer-events: none;
}

.rail__progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--gold) 100%);
  transition: width 0.12s linear;
}

/* 返回顶部 */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 70;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--cyan);
  background: var(--ink-deep);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--ease), transform var(--ease), visibility var(--ease),
    background-color var(--ease), color var(--ease), border-color var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

/* ===========================================================
   页脚
   =========================================================== */
.site-footer {
  margin-top: 0;
  padding: clamp(42px, 6vw, 76px) var(--pad) 30px;
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--line);
}

.footer__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  display: grid;
  gap: clamp(30px, 4vw, 52px);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 44px);
}

.footer__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--paper);
}

.footer__line {
  margin-top: 12px;
  max-width: 30ch;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(247, 243, 234, 0.72);
}

.footer__brand .btn { margin-top: 20px; }

.footer__title {
  display: block;
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--cyan);
}

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

.footer__link {
  display: inline-block;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(247, 243, 234, 0.8);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}

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

.footer__contact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding-top: 28px;
  border-top: 1px solid var(--line-strong);
}

.footer__contact-item { min-width: 0; }

.footer__meta {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: rgba(247, 243, 234, 0.9);
  overflow-wrap: anywhere;
}

.footer__note {
  grid-column: 1 / -1;
  padding-left: 12px;
  border-left: 2px solid var(--gold);
  font-size: 12px;
  line-height: 1.75;
  color: var(--mist);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.footer__legal {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--mist);
}

/* ===========================================================
   通用组件
   =========================================================== */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}

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

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

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

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

.btn--block { width: 100%; }

/* 章节小标 */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  color: var(--cyan);
}

.section-label::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--gold);
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.1em;
  color: var(--cyan);
}

.tag--gold { color: var(--gold); }

.tag--wine {
  color: var(--paper);
  background: var(--wine);
  border-color: var(--wine);
}

/* 面包屑 */
.breadcrumbs { margin: 0 0 20px; }

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.06em;
  color: var(--mist);
}

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

.breadcrumbs__item + .breadcrumbs__item::before {
  content: "/";
  color: rgba(169, 180, 194, 0.65);
}

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

.breadcrumbs__link:hover,
.breadcrumbs__link:focus-visible {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* 网格 */
.grid {
  display: grid;
  gap: clamp(18px, 2.4vw, 32px);
}

.grid--split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }

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

/* 正文 */
.prose {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
}

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

.prose h2 { margin-top: 1.9em; }

.prose h3 { margin-top: 1.6em; }

.prose li {
  position: relative;
  padding-left: 20px;
  margin-top: 0.45em;
}

.prose li::before {
  content: "";
  position: absolute;
  top: 0.78em;
  left: 0;
  width: 8px;
  height: 2px;
  background: var(--cyan);
}

/* 图片容器基础规则 */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--ink-deep) 0%, var(--teal-deep) 58%, var(--indigo) 100%);
}

.media-frame--wide { aspect-ratio: 21 / 9; }

.media-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame__caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(7, 20, 38, 0) 0%, rgba(7, 20, 38, 0.86) 100%);
  color: var(--paper);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.04em;
}

/* ===========================================================
   响应式
   =========================================================== */
@media (min-width: 1040px) {
  body { padding-left: var(--rail-w); }
}

@media (max-width: 1039px) {
  :root { --topbar-h: 62px; }

  body { padding-top: var(--topbar-h); }

  .site-rail {
    right: 0;
    width: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 36px rgba(7, 20, 38, 0.3);
  }

  .rail__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0 16px;
    min-height: var(--topbar-h);
    padding: 0 16px;
    overflow: visible;
  }

  .brand {
    padding: 0;
    border-bottom: 0;
  }

  .brand::before { display: none; }

  .brand__mark { font-size: 19px; }

  .brand__tag { display: none; }

  .rail__toggle { display: block; }

  .nav {
    display: none;
    grid-column: 1 / -1;
    margin: 0;
    padding: 6px 0 14px;
    border-top: 1px solid var(--line);
  }

  .rail__utility {
    display: none;
    grid-column: 1 / -1;
    margin: 0;
    padding: 16px 0 22px;
  }

  .site-rail[data-open] .nav { display: block; }

  .site-rail[data-open] .rail__utility { display: flex; }

  .site-rail[data-open] .rail__inner {
    max-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 26px;
  }

  .nav__link { padding: 14px 10px 14px 12px; }

  .rail__progress { height: 2px; }

  .to-top { width: 44px; height: 44px; }
}

@media (max-width: 900px) {
  .grid--split { grid-template-columns: 1fr; }

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

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

  .footer__brand { grid-column: 1 / -1; }

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

@media (max-width: 600px) {
  body { font-size: 15.5px; }

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

  .footer__grid { grid-template-columns: 1fr; }

  .footer__contact { grid-template-columns: 1fr; gap: 18px; }

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

  .prose { font-size: 16px; }
}

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