/* ============================================================
   爱游戏娱乐赛 · 共享样式表 /assets/site.css
   纸白纸面 + 深墨绿分区 + 红黄牌节奏点
   ============================================================ */

:root {
  --red: #E02424;
  --red-deep: #9E1418;
  --yellow: #FFC43D;
  --gold: #C08A16;
  --green-deep: #0B3B2E;
  --green-pitch: #1E6B4B;
  --orange: #FF7A45;
  --paper: #FBF7EF;
  --sand: #F3E9D6;
  --ink: #12181A;
  --mist: #5C6B63;
  --coal: #16211D;

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 24px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --shell: 1320px;
  --narrow: 700px;

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

  --shadow-1: 0 2px 0 rgba(18, 24, 26, .08);
  --shadow-2: 0 22px 40px -26px rgba(11, 59, 46, .55);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
}

img { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-deep); }
button { font: inherit; }
figure { margin: 0; }
hr { border: 0; border-top: 1px solid rgba(18, 24, 26, .12); margin: 32px 0; }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 6px;
}

#main-content { scroll-margin-top: 104px; }
[data-chapter] { scroll-margin-top: 118px; }

/* ---------------- 容器与网格 ---------------- */
.wrap {
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
}
.wrap--narrow {
  width: min(100% - 40px, var(--narrow));
  margin-inline: auto;
}
.section { padding: clamp(40px, 6vw, 80px) 0; }

.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
}
.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)); }

@media (max-width: 1000px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ---------------- 排版零件 ---------------- */
.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 8px;
}
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.01em;
}
.text-mist { color: var(--mist); }

.arc-divider {
  height: 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--red) 0 12%, var(--yellow) 12% 24%, var(--green-deep) 24% 100%);
  opacity: .9;
}

/* ---------------- 页头 ---------------- */
.site-header {
  --nav-ink: var(--ink);
  --nav-line: rgba(18, 24, 26, .16);
  --nav-hover: rgba(224, 36, 36, .1);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  padding: 12px 0 0;
  transition: padding .3s var(--ease);
}
.site-header[data-stuck="true"] {
  --nav-ink: var(--paper);
  --nav-line: rgba(251, 247, 239, .3);
  --nav-hover: rgba(255, 196, 61, .2);
}

.header-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--yellow));
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .12s linear;
}

.header-shell {
  width: min(100% - 48px, var(--shell));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 14px 0;
  background: transparent;
  border-radius: var(--radius-pill);
  transition: background .3s var(--ease), padding .3s var(--ease),
    box-shadow .3s var(--ease), width .3s var(--ease);
}
.site-header:not([data-stuck="true"]) .header-shell {
  border-bottom: 1px solid rgba(18, 24, 26, .1);
}
.site-header[data-stuck="true"] .header-shell {
  width: min(100% - 32px, 1160px);
  padding: 10px 22px;
  background: var(--green-deep);
  box-shadow: 0 20px 38px -24px rgba(11, 59, 46, .8);
}

.brand { display: flex; align-items: center; }
.brand__link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--nav-ink);
  text-decoration: none;
}
.brand__link:hover { color: var(--nav-ink); }
.brand__cards { display: inline-flex; align-items: center; }
.ref-card {
  display: block;
  width: 16px;
  height: 25px;
  border-radius: 5px;
  box-shadow: 0 2px 4px -2px rgba(11, 59, 46, .6);
}
.ref-card--yellow { background: var(--yellow); transform: rotate(-9deg); }
.ref-card--red { background: var(--red); transform: rotate(7deg); margin-left: -7px; }
.brand__text { display: block; }
.brand__name {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
}
.brand__sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--mist);
  line-height: 1.4;
}
.site-header[data-stuck="true"] .brand__sub { color: rgba(251, 247, 239, .72); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.site-nav__link {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--nav-line);
  border-radius: var(--radius-pill);
  color: var(--nav-ink);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease),
    border-color .2s var(--ease);
}
.site-nav__link:hover {
  background: var(--nav-hover);
  border-color: var(--red);
  color: var(--red);
}
.site-header[data-stuck="true"] .site-nav__link:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}
.site-nav__link[aria-current="page"] {
  background: var(--yellow);
  border-color: var(--gold);
  color: var(--coal);
}
.site-nav__cta { padding: 10px 18px; font-size: 14px; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--nav-line);
  border-radius: var(--radius-pill);
  color: var(--nav-ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.nav-toggle:hover { border-color: var(--red); color: var(--red); }
.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s var(--ease), top .2s var(--ease);
}
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }
.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); }

@media (max-width: 1000px) {
  .nav-toggle { display: inline-flex; }
  .header-shell { padding: 12px 0; }
  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    width: min(100vw - 40px, 520px);
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    background: var(--green-deep);
    border-radius: var(--radius-l);
    box-shadow: 0 26px 44px -26px rgba(11, 59, 46, .85);
    --nav-ink: var(--paper);
    --nav-line: rgba(251, 247, 239, .28);
    --nav-hover: rgba(255, 196, 61, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }
  .site-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .site-nav__link {
    padding: 12px 16px;
    font-size: 16px;
    color: var(--paper);
    border-color: rgba(251, 247, 239, .2);
  }
  .site-nav__link:hover { color: var(--yellow); border-color: var(--yellow); }
  .site-nav__cta { justify-content: center; text-align: center; }
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: clamp(48px, 8vw, 96px);
  background: var(--green-deep);
  color: var(--paper);
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -150px;
  width: min(1200px, 140%);
  height: 300px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 196, 61, .18), transparent 72%);
  pointer-events: none;
}
.footer-shell {
  position: relative;
  width: min(100% - 40px, var(--shell));
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) 0 28px;
}
.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
}
.footer-col--brand { max-width: 34ch; }
.footer-brand {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--paper);
}
.footer-brand::after {
  content: "";
  display: block;
  width: 56px;
  height: 5px;
  margin-top: 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--red) 0 50%, var(--yellow) 50% 100%);
}
.footer-tagline {
  margin: 12px 0 8px;
  font-size: 15px;
  color: rgba(251, 247, 239, .86);
}
.footer-note {
  margin: 0;
  font-size: 13px;
  color: rgba(251, 247, 239, .62);
}
.footer-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--yellow);
}
.footer-list {
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 15px;
  color: rgba(251, 247, 239, .9);
}
.footer-list--plain { font-size: 14px; }
.footer-list__hint { color: rgba(251, 247, 239, .62); font-size: 13px; }
.footer-list a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.footer-list a:hover {
  color: var(--red);
  border-bottom-color: var(--yellow);
}
.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: 20px;
  border-top: 1px solid rgba(251, 247, 239, .18);
  font-size: 13.5px;
  color: rgba(251, 247, 239, .72);
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
}
.footer-legal__links {
  display: flex;
  gap: 18px;
  list-style: none;
}
.footer-legal__links a {
  color: rgba(251, 247, 239, .82);
  text-decoration: none;
}
.footer-legal__links a:hover {
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: var(--yellow);
}

@media (max-width: 1000px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-col--brand { max-width: none; grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-base { flex-direction: column; align-items: flex-start; }
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease),
    color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-4px); }
.btn--flag {
  background: var(--red);
  color: var(--paper);
  box-shadow: 0 12px 22px -16px var(--red);
}
.btn--flag:hover { background: var(--red-deep); border-color: var(--yellow); color: var(--paper); }
.btn--card {
  background: var(--yellow);
  color: var(--coal);
  border-color: var(--gold);
}
.btn--card:hover { background: var(--gold); color: var(--coal); }
.btn--ghost {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.btn--ghost:hover { border-color: var(--red); color: var(--red); }
.btn--quiet {
  background: var(--sand);
  color: var(--ink);
  border-color: rgba(18, 24, 26, .12);
}
.btn--quiet:hover { border-color: var(--red); color: var(--red-deep); }

/* ---------------- 标签与卡片 ---------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--sand);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
}
.chip--red { background: var(--red); color: var(--paper); }
.chip--yellow { background: var(--yellow); color: var(--coal); }
.chip--green { background: var(--green-pitch); color: var(--paper); }
.chip--ghost { background: transparent; border: 1px solid currentColor; }

.card {
  background: #fff;
  border: 1px solid rgba(18, 24, 26, .1);
  border-radius: var(--radius-l);
  padding: clamp(18px, 2.4vw, 26px);
  transition: transform .22s var(--ease), border-color .22s var(--ease),
    box-shadow .22s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--red);
  box-shadow: var(--shadow-2);
}

.tile {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(18, 24, 26, .1);
  border-radius: var(--radius-xl);
  background: var(--sand);
  padding: clamp(18px, 2.4vw, 26px);
}
.tile--1x1 { aspect-ratio: 1 / 1; }
.tile--2x1 { aspect-ratio: 2 / 1; }
.tile--2x2 { aspect-ratio: 1 / 1; }
.tilt-l { transform: rotate(-4deg); }
.tilt-r { transform: rotate(4deg); }

.stat { display: grid; gap: 4px; }
.stat__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--red);
}
.stat__label {
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--mist);
}

/* ---------------- 编号章节 ---------------- */
.chapter { position: relative; }
.chapter__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  margin-bottom: 14px;
}
.chapter__index {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.02em;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--red);
}
.chapter__title {
  font-size: clamp(26px, 4.2vw, 48px);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
}
.chapter__lead {
  max-width: var(--narrow);
  margin: 10px 0 0;
  font-size: 17px;
  color: var(--mist);
}

/* ---------------- 面包屑 ---------------- */
.breadcrumbs { font-size: 13px; letter-spacing: .04em; }
.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  color: var(--mist);
}
.breadcrumbs__list li::after {
  content: "/";
  margin-left: 8px;
  color: rgba(18, 24, 26, .3);
}
.breadcrumbs__list li:last-child::after { content: ""; }
.breadcrumbs__list a { color: var(--mist); text-decoration: none; }
.breadcrumbs__list a:hover { color: var(--red); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 700; }

/* ---------------- 图片容器 ---------------- */
.media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(18, 24, 26, .12);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--green-deep), var(--green-pitch));
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--16x9 { aspect-ratio: 16 / 9; }
.media-frame--4x3 { aspect-ratio: 4 / 3; }
.media-frame--1x1 { aspect-ratio: 1 / 1; }
.media-frame--tilt-l { transform: rotate(-4deg); }
.media-frame--tilt-r { transform: rotate(4deg); }
.media-frame--scrim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 59, 46, 0) 45%, rgba(11, 59, 46, .68));
  pointer-events: none;
}
.media-frame__caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 2;
  margin: 0;
  color: var(--paper);
  font-size: 13px;
  letter-spacing: .06em;
}

/* ---------------- 横向滚动切片 ---------------- */
.slice { position: relative; }
.slice__rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) rgba(18, 24, 26, .08);
  -webkit-overflow-scrolling: touch;
}
.slice__rail > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.slice__rail::-webkit-scrollbar { height: 8px; }
.slice__rail::-webkit-scrollbar-track {
  background: rgba(18, 24, 26, .08);
  border-radius: var(--radius-pill);
}
.slice__rail::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: var(--radius-pill);
}
.slice__controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.slice__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid rgba(18, 24, 26, .16);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.slice__btn:hover { border-color: var(--red); color: var(--red); }
.slice__btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- 锚点标签导航 ---------------- */
.tag-nav { display: grid; gap: 8px; }
.tag-nav__list { display: grid; gap: 8px; list-style: none; }
.tag-nav__link {
  display: block;
  padding: 10px 14px;
  border: 1px solid rgba(18, 24, 26, .14);
  border-left: 4px solid rgba(18, 24, 26, .14);
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.tag-nav__link:hover { background: var(--sand); border-left-color: var(--red); }
.tag-nav__link[aria-current="true"],
.tag-nav__link.is-active {
  background: var(--sand);
  border-left-color: var(--yellow);
  color: var(--red-deep);
}
.site-footer .tag-nav__link,
.site-footer .tag-nav__link:hover { color: var(--paper); }

/* ---------------- 减少动态偏好 ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn:hover,
  .card:hover { transform: none; }
}
