/* ==========================================================================
   IM看台 · 共享样式 /assets/site.css
   夜间记分牌视觉系统：暗场墨绿 + 夜场蓝 + 荧光黄绿 + 红黄牌语义色
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 104px;
}

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

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

img,
picture,
svg,
video {
  max-width: 100%;
}

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

/* ---------- 2. 变量 ---------- */
:root {
  color-scheme: dark;

  /* 色彩体系 */
  --ink: #08201a;
  --panel: #0f2e24;
  --night: #0d1b2e;
  --moss: #3e5c46;
  --stone: #9aa69b;
  --paper: #f3eee2;
  --lime: #c9f94b;
  --lime-strong: #dcff7a;
  --red: #f0442b;
  --amber: #f5a623;
  --clay: #b96a4c;

  /* 圆角 */
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;
  --r-pill: 999px;

  /* 字体 */
  --font-display: "Barlow Condensed", "Oswald", "Noto Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "Roboto Mono", "JetBrains Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, monospace;

  /* 节奏 */
  --gutter: clamp(20px, 4vw, 40px);
  --content: 1180px;
}

/* ---------- 3. 中文排版 ---------- */
body {
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

h1 {
  font-size: clamp(34px, 5.4vw, 56px);
}

h2 {
  font-size: clamp(28px, 3.8vw, 40px);
}

h3 {
  font-size: clamp(22px, 2.4vw, 28px);
}

h4 {
  font-size: clamp(18px, 1.6vw, 20px);
}

p {
  max-width: 34em;
}

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

a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--moss);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: var(--lime);
  text-decoration-color: var(--lime);
}

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

/* ---------- 4. 容器与基础排版组件 ---------- */
.wrap {
  width: min(100% - (var(--gutter) * 2), var(--content));
  margin-inline: auto;
}

.section {
  padding-block: clamp(56px, 8vw, 104px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
}

.lede {
  max-width: 34em;
  font-size: clamp(16.5px, 1.3vw, 18.5px);
  line-height: 1.6;
  color: var(--stone);
}

.chapter {
  display: flex;
  align-items: baseline;
  gap: clamp(12px, 1.6vw, 18px);
  margin-bottom: clamp(18px, 2vw, 26px);
}

.chapter__num {
  font-family: var(--font-mono);
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--lime);
}

.chapter__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--paper);
}

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 200;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  background: var(--lime);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: 2px;
  color: var(--ink);
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease,
    border-color 160ms ease;
}

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

.btn--lime:hover {
  background: var(--lime-strong);
  border-color: var(--lime-strong);
  color: var(--ink);
}

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

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

.btn--quiet {
  padding-inline: 4px;
  color: var(--stone);
  border-color: transparent;
  text-decoration: underline;
  text-decoration-color: var(--moss);
  text-underline-offset: 4px;
}

.btn--quiet:hover {
  color: var(--lime);
}

/* ---------- 7. 页头 · 居中刊头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink);
  border-bottom: 1px solid var(--moss);
}

.site-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: clamp(12px, 2vw, 28px);
  row-gap: 6px;
  padding-block: 18px 14px;
  transition: padding 180ms ease;
}

.masthead__kicker {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  max-width: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
  white-space: nowrap;
}

.masthead__brand {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 46px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.02em;
  text-decoration: none;
  transform: skewX(-2deg);
  transition: font-size 180ms ease;
}

.masthead__brand-mark {
  color: var(--lime);
  text-shadow: 0 0 0 var(--ink);
}

.masthead__brand-word {
  color: var(--paper);
}

.masthead__brand:hover .masthead__brand-word {
  color: var(--lime);
}

.masthead__tagline {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  max-width: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--stone);
  white-space: nowrap;
}

/* 导航条 */
.site-nav {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.site-nav__link {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--stone);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease,
    border-color 160ms ease;
}

.site-nav__link:hover {
  color: var(--paper);
  background: var(--panel);
  border-color: var(--moss);
  text-decoration: none;
}

.site-nav__link[aria-current="page"] {
  color: var(--lime);
  background: rgba(201, 249, 75, 0.08);
  border-color: var(--lime);
  font-weight: 700;
}

.header-actions {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--moss);
  border-radius: var(--r-pill);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  transition: border-color 160ms ease, color 160ms ease;
}

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

.nav-toggle__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 12px;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: transform 160ms ease, opacity 160ms ease;
}

.site-header[data-open="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.site-header[data-open="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.site-header[data-open="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* 压缩态 */
.site-header[data-compact="true"] .site-header__inner {
  padding-block: 7px 6px;
  row-gap: 4px;
}

.site-header[data-compact="true"] .masthead__kicker,
.site-header[data-compact="true"] .masthead__tagline {
  display: none;
}

.site-header[data-compact="true"] .masthead__brand {
  font-size: 26px;
}

.site-header[data-compact="true"] .site-nav__link {
  padding-block: 5px;
  font-size: 14px;
}

.site-header[data-compact="true"] .header-actions .btn {
  padding-block: 8px;
  font-size: 14px;
}

/* ---------- 8. 阅读进度条 ---------- */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.progress__bar {
  display: block;
  height: 2px;
  width: 0;
  background: var(--lime);
}

/* ---------- 9. 页脚 ---------- */
.site-footer {
  background: var(--night);
  color: var(--stone);
  border-top: 1px solid var(--moss);
  padding-block: clamp(48px, 6vw, 72px) clamp(24px, 3vw, 34px);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
  gap: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(28px, 3.4vw, 44px);
  border-bottom: 1px solid rgba(62, 92, 70, 0.7);
}

.footer-brand__logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-decoration: none;
  transform: skewX(-2deg);
}

.footer-brand__mark {
  color: var(--lime);
}

.footer-brand__logo:hover {
  color: var(--lime);
  text-decoration: none;
}

.footer-brand__note {
  margin-top: 14px;
  max-width: 22em;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--stone);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.footer-nav__title {
  max-width: none;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime);
}

.footer-nav__list {
  display: grid;
  gap: 10px;
}

.footer-nav__link {
  position: relative;
  display: inline-block;
  font-size: 15px;
  color: var(--stone);
  text-decoration: none;
  transition: color 160ms ease;
}

.footer-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 160ms ease;
}

.footer-nav__link:hover {
  color: var(--paper);
  text-decoration: none;
}

.footer-nav__link:hover::after {
  transform: scaleX(1);
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  padding-block: clamp(20px, 2.4vw, 28px);
  border-bottom: 1px solid rgba(62, 92, 70, 0.7);
}

.footer-contact__item {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  max-width: none;
  font-size: 13px;
}

.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  opacity: 0.75;
}

.footer-contact__value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: clamp(18px, 2.2vw, 26px);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--stone);
}

.footer-legal__line {
  max-width: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
}

/* ---------- 10. 通用内容组件 ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--stone);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb__list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb__list li + li::before {
  content: "/";
  color: var(--moss);
}

.breadcrumb a {
  color: var(--stone);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--lime);
}

/* Bento 面板 */
.panel {
  position: relative;
  padding: clamp(20px, 2.4vw, 30px);
  background: var(--panel);
  border: 1px solid var(--moss);
  border-radius: var(--r-xl);
  transition: border-color 180ms ease, transform 180ms ease,
    background-color 180ms ease;
}

.panel__label {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
}

@media (hover: hover) {
  .panel:hover {
    border-color: var(--lime);
    transform: translateY(-2px);
  }
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 18px);
}

.bento > * {
  grid-column: span 12;
  min-width: 0;
}

@media (min-width: 760px) {
  .bento__four {
    grid-column: span 4;
  }
  .bento__six {
    grid-column: span 6;
  }
  .bento__eight {
    grid-column: span 8;
  }
  .bento__twelve {
    grid-column: span 12;
  }
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.5;
  white-space: nowrap;
}

.tag--lime {
  color: var(--lime);
  background: rgba(201, 249, 75, 0.1);
}

.tag--red {
  color: var(--red);
  background: rgba(240, 68, 43, 0.12);
}

.tag--amber {
  color: var(--amber);
  background: rgba(245, 166, 35, 0.12);
}

.tag--clay {
  color: var(--clay);
  background: rgba(185, 106, 76, 0.14);
}

/* 状态读数 */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat__num {
  font-family: var(--font-mono);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ---------- 11. 通用图片容器 ---------- */
.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--panel);
  border: 1px solid var(--moss);
  border-radius: var(--r-lg);
}

.media > img,
.media > svg,
.media > picture,
.media > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media > picture {
  height: 100%;
}

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

.media--portrait {
  aspect-ratio: 4 / 5;
}

.media--square {
  aspect-ratio: 1 / 1;
}

.media--phone {
  aspect-ratio: 9 / 19.5;
  max-width: 260px;
  border-radius: 26px;
}

.media__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 16px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--paper);
  background: linear-gradient(
    to top,
    rgba(8, 32, 26, 0.94),
    rgba(8, 32, 26, 0)
  );
}

/* ---------- 12. 响应式 · 移动与平板 ---------- */
@media (max-width: 1099px) {
  .masthead__kicker {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .masthead__tagline {
    font-size: 11px;
  }

  .site-nav__link {
    padding-inline: 11px;
    font-size: 14px;
  }
}

@media (max-width: 899px) {
  html {
    scroll-padding-top: 82px;
  }

  .site-header {
    position: sticky;
  }

  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    row-gap: 12px;
    column-gap: 12px;
    padding-block: 12px 12px;
  }

  .masthead__kicker,
  .masthead__tagline {
    display: none;
  }

  .masthead__brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    font-size: clamp(26px, 7vw, 32px);
  }

  .nav-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    display: none;
  }

  .header-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;
    display: none;
    gap: 8px;
  }

  .site-header[data-open="true"] .site-nav {
    display: block;
    padding-top: 12px;
    border-top: 1px solid var(--moss);
  }

  .site-header[data-open="true"] .header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 4px;
  }

  .site-header[data-open="true"] .header-actions .btn {
    width: 100%;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .site-nav__link {
    display: block;
    padding: 12px 14px;
    border-radius: var(--r-md);
    font-size: 16px;
  }

  .site-nav__link[aria-current="page"] {
    border-color: transparent;
    background: rgba(201, 249, 75, 0.12);
    color: var(--lime);
  }

  .site-header[data-compact="true"] .site-header__inner {
    padding-block: 10px;
  }

  .site-header[data-compact="true"] .masthead__brand {
    font-size: 24px;
  }

  .site-header[data-compact="true"] .site-nav__link {
    font-size: 15px;
    padding-block: 10px;
  }

  /* 页脚折叠 */
  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 20px;
  }

  .footer-contact {
    flex-direction: column;
    gap: 10px;
  }

  .footer-legal {
    flex-direction: column;
  }
}

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

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

/* ---------- 13. 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .panel:hover {
    transform: none;
  }

  .skip-link {
    transition: none;
  }
}
