/* ==========================================================
   天博看台 · 共享 site.css
   深夜看台计分牌：夜墨绿画布 / 荧光青柠比分 / 琥珀版本标记
   ========================================================== */

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

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

body { margin: 0; }

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

:root {
  --ink: #071A14;
  --ink-deep: #0E1210;
  --turf: #12352A;
  --line: #2C4A3C;
  --lime: #C8FF3D;
  --lime-soft: #E6FF9E;
  --amber: #FFB547;
  --amber-deep: #B86B00;
  --paper: #F4F7EE;
  --muted: #A8B5A6;

  --rail-w: 252px;
  --head-h: 62px;
  --maxw: 1180px;

  --r-lg: 26px;
  --r-md: 14px;
  --r-sm: 10px;

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

  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (min-width: 720px) {
  :root { --head-h: 68px; }
}

html, body { background: var(--ink); }

body {
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

@media (min-width: 1080px) {
  body { font-size: 17px; }
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.18;
  color: var(--paper);
}

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

/* ---------- 通用容器与工具 ---------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 48px);
}

.lede {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.85;
  color: var(--muted);
  max-width: 62ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--lime);
  font-weight: 500;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--lime);
  flex: none;
}

.annot {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

.display-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: .9;
  color: var(--lime);
}

.rule {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--line);
}

.panel {
  background: var(--turf);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 34px);
}

.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---------- 按钮与标签 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .22s var(--ease), background .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease);
}
.btn--solid {
  background: var(--lime);
  color: #06210F;
  border-color: var(--lime);
}
.btn--solid:hover { background: var(--lime-soft); transform: translateY(-2px); }
.btn--line {
  background: transparent;
  color: var(--paper);
  border-color: var(--line);
}
.btn--line:hover { border-color: var(--lime); color: var(--lime); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lime);
  border: 1px solid rgba(200, 255, 61, .32);
  border-radius: 999px;
  padding: 3px 10px;
  line-height: 1.6;
  white-space: nowrap;
}
.tag--amber {
  color: var(--amber);
  border-color: rgba(255, 181, 71, .4);
  background: rgba(255, 181, 71, .08);
}

/* ---------- 面包屑 ---------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 18px 0;
}
.breadcrumb a { text-decoration: none; color: var(--muted); transition: color .2s var(--ease); }
.breadcrumb a:hover { color: var(--lime); }
.breadcrumb__sep { color: var(--line); }
.breadcrumb [aria-current="page"] { color: var(--paper); }

/* ---------- 图片容器基础规则（页面阶段放占位图） ---------- */

.media-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: clamp(16px, 2vw, 26px);
  background: linear-gradient(140deg, var(--turf), #0A231B 72%);
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 26, 20, 0) 42%, rgba(7, 26, 20, .74) 100%);
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.72) contrast(1.06) brightness(.92);
}
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lime-soft);
}

/* ==========================================================
   页头
   ========================================================== */

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(-180%);
  background: var(--lime);
  color: #06210F;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .22s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}

.read-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(200, 255, 61, .12);
  z-index: 3;
  pointer-events: none;
}
.read-progress__bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--lime), var(--lime-soft));
  box-shadow: 0 0 10px rgba(200, 255, 61, .55);
  transition: width .14s linear;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--head-h);
  padding: 0 clamp(16px, 4vw, 24px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
  min-width: 0;
}
.brand__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--lime);
  color: #06210F;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand__name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}
.brand__sub {
  display: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.version-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 181, 71, .38);
  border-radius: 999px;
  background: rgba(255, 181, 71, .08);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  white-space: nowrap;
}
.version-chip__dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 181, 71, .8);
}
.version-chip__os { display: none; }
.version-chip__num { font-variant-numeric: tabular-nums; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--turf);
  color: var(--lime);
  font-size: 12px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.nav-toggle:hover { border-color: var(--lime); }
.nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 16px;
  flex: none;
}
.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .26s var(--ease), opacity .26s var(--ease);
}
.site-header[data-open] .nav-toggle__bars span:first-child { transform: translateY(3px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars span:last-child { transform: translateY(-3px) rotate(-45deg); }
.nav-toggle__label { line-height: 1; }

/* 移动抽屉 */
.site-nav {
  position: fixed;
  top: var(--head-h);
  left: 0;
  right: 0;
  max-height: calc(100dvh - var(--head-h));
  overflow-y: auto;
  padding: 20px clamp(16px, 4vw, 24px) 30px;
  background: var(--ink-deep);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s var(--ease);
}
.site-header[data-open] .site-nav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-nav__note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 12px;
  margin-bottom: 12px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  text-decoration: none;
  color: var(--muted);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.nav-link__idx {
  flex: none;
  width: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--line);
  transition: color .2s var(--ease);
}
.nav-link__label { position: relative; }
.nav-link:hover { color: var(--lime-soft); background: rgba(200, 255, 61, .06); }
.nav-link:hover .nav-link__idx { color: var(--lime); }
.nav-link[aria-current="page"] {
  color: var(--lime);
  background: var(--turf);
  border-color: rgba(200, 255, 61, .22);
}
.nav-link[aria-current="page"] .nav-link__idx { color: var(--lime); }
.nav-link[aria-current="page"]::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  flex: none;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}

.rail-foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rail-foot__note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.rail-foot__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--muted);
}
.rail-foot__dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 181, 71, .7);
}

/* --- 平板：抽屉收窄为右侧面板 --- */
@media (min-width: 720px) {
  .site-nav {
    left: auto;
    width: min(420px, 100%);
    border-left: 1px solid var(--line);
    border-bottom-left-radius: var(--r-lg);
    transform: translateY(-12px);
  }
  .nav-link { font-size: 16px; }
}

/* --- 桌面：左侧固定窄栏 --- */
@media (min-width: 1080px) {
  html { scroll-padding-top: 28px; }

  body { padding-left: var(--rail-w); }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 30px 22px 22px;
    overflow-y: auto;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, #0A231B 0%, #071A14 44%, #071A14 100%);
  }

  .header-top {
    height: auto;
    padding: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .brand__mark { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
  .brand__name { font-size: 18px; }
  .brand__sub { display: block; }

  .version-chip { margin-left: 0; font-size: 10.5px; padding: 5px 10px; }
  .version-chip__os { display: inline; }

  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 24px 0 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .site-nav__note { padding-left: 10px; margin-bottom: 10px; }
  .nav-link { font-size: 14.5px; padding: 10px 10px 10px 9px; }
  .nav-link__idx { width: 18px; font-size: 10.5px; }
  .rail-foot { margin-top: auto; padding-top: 16px; }
}

/* ==========================================================
   页脚
   ========================================================== */

.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: clamp(52px, 8vw, 110px);
  padding-top: clamp(38px, 5vw, 64px);
  background: var(--ink-deep);
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -42%;
  right: -12%;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(200, 255, 61, .11), transparent 68%);
  pointer-events: none;
}
.site-footer::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 18px);
  opacity: .7;
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(28px, 4vw, 52px);
  grid-template-columns: 1fr;
  padding-bottom: clamp(30px, 4vw, 52px);
}

.footer-brand { max-width: 26ch; }
.footer-brand__name {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--paper);
}
.footer-brand__tag {
  margin: 10px 0 16px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--muted);
}

.footer-cols {
  display: grid;
  gap: clamp(20px, 3vw, 34px);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.footer-col__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--paper);
}
.footer-col__title::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--lime);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 14.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.footer-links a::before {
  content: "";
  width: 10px;
  height: 1px;
  flex: none;
  background: var(--line);
  transition: width .22s var(--ease), background .22s var(--ease);
}
.footer-links a:hover { color: var(--lime); }
.footer-links a:hover::before { width: 16px; background: var(--lime); }

.footer-text {
  display: inline-block;
  padding: 4px 0;
  font-size: 14.5px;
  color: var(--muted);
}

.footer-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  padding-top: 20px;
  padding-bottom: 30px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}
.footer-meta__legal {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--amber);
  border: 1px solid rgba(255, 181, 71, .3);
  border-radius: 6px;
  padding: 3px 8px;
}
.footer-meta__contact { flex: 1 1 320px; min-width: 240px; }
.footer-meta__area { flex: 1 1 260px; min-width: 220px; }
.footer-meta__copy {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--line);
}

@media (min-width: 720px) {
  .footer-inner { grid-template-columns: minmax(200px, .9fr) 2fr; align-items: start; }
}

@media (min-width: 1080px) {
  .footer-inner { grid-template-columns: minmax(220px, .85fr) 2fr; }
}

/* ==========================================================
   进入视口显现（JS 添加 .is-pending）
   ========================================================== */

[data-reveal] { transition: opacity .6s var(--ease), transform .6s var(--ease); }
[data-reveal].is-pending { opacity: 0; transform: translateY(16px); }

/* ==========================================================
   动效降级
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal],
  [data-reveal].is-pending { opacity: 1 !important; transform: none !important; }
  .read-progress__bar { transition: none !important; }
  .btn--solid:hover { transform: none; }
}
