/* ============================================================
   利来看台 · /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 头部 / 页脚 / 基础组件
   ============================================================ */

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

html {
  background: #04090A;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

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

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

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

button, input, select, textarea { font: inherit; color: inherit; }

button { background: none; border: 0; padding: 0; cursor: pointer; }

hr { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }

/* ---------- CSS 变量 ---------- */
:root {
  --bg: #071A16;
  --bg-2: #0E1D1A;
  --moss: #2E4A3C;
  --grid: #3C5A4C;
  --cyan: #3FE0C8;
  --cyan-soft: #9BF3E6;
  --orange: #FF8A3D;
  --clay: #B4693F;
  --paper: #F2EDE4;
  --ash: #8C9A94;
  --deep: #04090A;

  --line: rgba(60, 90, 76, 0.55);
  --line-soft: rgba(60, 90, 76, 0.30);
  --cyan-line: rgba(63, 224, 200, 0.55);

  --max: 1280px;
  --gutter: 24px;
  --band-h: 62px;

  --f12: 12px;
  --f14: 14px;
  --f16: 16px;
  --f20: 20px;
  --f28: 28px;
  --f44: 44px;

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

  --t-fast: 140ms ease;
  --t-base: 240ms ease;
  --t-slow: 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 中文排版与页面底纹 ---------- */
body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
  font-size: var(--f16);
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* 精密网格底：24px 细线，只作为背景层 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(60, 90, 76, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(60, 90, 76, 0.22) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 85%);
}

p { max-width: 40em; }

h1, h2, h3, h4 {
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--paper);
}

h1 { font-size: clamp(34px, 5.4vw, 72px); }
h2 { font-size: clamp(26px, 3.6vw, 44px); }
h3 { font-size: var(--f28); }
h4 { font-size: var(--f20); }

.mono,
.stat-num,
.chapter-num,
.band-status,
.media-overlay,
.media-badge,
.breadcrumb-list,
.footer-head {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.lead {
  font-size: var(--f20);
  line-height: 1.7;
  color: var(--paper);
  max-width: 34em;
}

::selection { background: var(--cyan); color: #04211C; }

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

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--cyan);
  color: #04211C;
  font-weight: 700;
  font-size: var(--f14);
  transition: top var(--t-base);
}

.skip-link:focus { top: 12px; }

/* ============================================================
   头部
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 26, 22, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header[data-side="away"] .nav-list a[aria-current="page"]::after {
  background: var(--orange);
}

.site-header[data-side="away"] .brand-glyph {
  border-color: var(--orange);
  color: var(--orange);
}

/* 滚动进度条（由 JS 插入） */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--cyan) 60%, var(--orange) 100%);
  pointer-events: none;
}

/* --- 上层信息条 --- */
.header-band {
  max-height: var(--band-h);
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  transition: max-height var(--t-base), opacity var(--t-base), border-color var(--t-base);
}

.site-header[data-collapsed] .header-band {
  max-height: 0;
  opacity: 0;
  border-bottom-color: transparent;
}

.band-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 9px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-glyph {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan-line);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: var(--f16);
  font-weight: 700;
  transition: color var(--t-base), border-color var(--t-base);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.brand-name {
  font-size: var(--f16);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--paper);
}

.brand-tag {
  font-family: var(--mono);
  font-size: var(--f12);
  color: var(--ash);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.band-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.band-status {
  font-size: var(--f12);
  color: var(--cyan-soft);
  border: 1px solid var(--line);
  padding: 3px 10px;
  white-space: nowrap;
}

.band-link {
  font-size: var(--f14);
  color: var(--ash);
  padding: 3px 4px;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.band-link:hover { color: var(--cyan-soft); border-bottom-color: var(--cyan); }

.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ash);
  font-family: var(--mono);
  font-size: var(--f14);
  transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.icon-btn:hover { color: var(--cyan); border-color: var(--cyan); }
.icon-btn:active { transform: scale(0.96); }

/* --- 下层主导航 --- */
.header-nav { border-top: 1px solid transparent; }

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: stretch;
  gap: 14px;
  min-height: 56px;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  align-self: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--paper);
  font-size: var(--f14);
}

.nav-toggle-bars {
  display: grid;
  gap: 4px;
  width: 16px;
}

.nav-toggle-bars span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform var(--t-base), opacity var(--t-base);
}

.nav-toggle[aria-expanded="true"] { color: var(--cyan); border-color: var(--cyan-line); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:first-child { transform: translateY(2.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:last-child { transform: translateY(-2.5px) rotate(-45deg); }

.nav-toggle-label { font-family: var(--mono); font-size: var(--f12); letter-spacing: 0.14em; }

.site-nav { flex: 1 1 auto; min-width: 0; }

.nav-list {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.nav-list li { display: flex; }

.nav-list a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  font-size: var(--f14);
  color: var(--ash);
  letter-spacing: 0.04em;
  transition: color var(--t-fast), background-color var(--t-fast);
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--t-base);
}

.nav-list a:hover { color: var(--paper); background: rgba(46, 74, 60, 0.35); }
.nav-list a:hover::after { transform: scaleX(1); }

.nav-list a[aria-current="page"] {
  color: var(--cyan-soft);
  background: rgba(63, 224, 200, 0.06);
}

.nav-list a[aria-current="page"]::after { transform: scaleX(1); }

/* 主客队视角切换 */
.side-switch {
  display: inline-flex;
  align-items: center;
  align-self: center;
  border: 1px solid var(--line);
  overflow: hidden;
}

.side-btn {
  padding: 7px 14px;
  font-family: var(--mono);
  font-size: var(--f12);
  letter-spacing: 0.08em;
  color: var(--ash);
  transition: color var(--t-fast), background-color var(--t-fast);
}

.side-btn + .side-btn { border-left: 1px solid var(--line); }

.side-btn:hover { color: var(--paper); }

.side-btn[aria-pressed="true"] {
  background: rgba(63, 224, 200, 0.12);
  color: var(--cyan);
}

/* ---------- 通用按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: var(--f14);
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--t-base);
}

.btn:hover::after { transform: scaleX(1); }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #04211C; }
.btn-primary:hover { background: var(--cyan-soft); border-color: var(--cyan-soft); }

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

.btn-ghost:hover { background: rgba(255, 138, 61, 0.12); color: #FFB183; }

.btn-line { border-color: var(--line); color: var(--paper); }
.btn-line:hover { border-color: var(--cyan-line); color: var(--cyan-soft); }

.nav-cta { align-self: center; padding: 9px 16px; }

/* ---------- 浮动返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(14, 29, 26, 0.92);
  border: 1px solid var(--cyan-line);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: var(--f16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base), background-color var(--t-fast);
}

.to-top[data-visible] { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: rgba(63, 224, 200, 0.14); }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  background: var(--deep);
  border-top: 1px solid var(--line);
  color: var(--ash);
  font-size: var(--f14);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px var(--gutter) 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.4fr 1fr;
  gap: 32px 24px;
  align-items: start;
}

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

.footer-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--orange);
  color: var(--orange);
  font-family: var(--mono);
  font-size: var(--f16);
  font-weight: 700;
}

.footer-name {
  font-size: var(--f20);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--paper);
}

.footer-meta { font-size: var(--f12); color: var(--ash); max-width: 22em; }

.footer-head {
  font-size: var(--f12);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--cyan);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.footer-list { display: grid; gap: 8px; }

.footer-list a {
  display: inline-block;
  color: var(--ash);
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.footer-list a:hover { color: var(--cyan-soft); border-bottom-color: var(--cyan); }

.contact-list { display: grid; gap: 12px; }

.contact-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.contact-label {
  flex: 0 0 100%;
  font-family: var(--mono);
  font-size: var(--f12);
  letter-spacing: 0.14em;
  color: var(--moss);
  color: #6E8A7F;
}

.contact-value {
  font-family: var(--mono);
  font-size: var(--f14);
  color: var(--paper);
  word-break: break-all;
}

.copy-btn {
  padding: 2px 8px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--f12);
  color: var(--ash);
  transition: color var(--t-fast), border-color var(--t-fast);
}

.copy-btn:hover { color: var(--cyan); border-color: var(--cyan-line); }
.copy-btn[data-copied] { color: var(--cyan); border-color: var(--cyan); }

.footer-legal {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 8px;
}

.footer-legal-line {
  font-size: var(--f12);
  color: var(--ash);
  max-width: none;
}

.footer-note { font-size: var(--f12); color: #6E8A7F; max-width: 60em; }

/* ============================================================
   正文容器与栅格
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: clamp(56px, 7vw, 112px) 0; }
.section + .section { border-top: 1px solid var(--line-soft); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: start;
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ---------- 面包屑 ---------- */
.breadcrumb { padding: 20px 0 0; }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--f12);
  color: var(--ash);
}

.breadcrumb-list li { display: flex; align-items: center; gap: 8px; }
.breadcrumb-list li + li::before { content: "/"; color: var(--grid); }
.breadcrumb-list a:hover { color: var(--cyan-soft); }
.breadcrumb-current { color: var(--cyan-soft); }

/* ---------- 编号章节 ---------- */
.chapter {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.chapter-num {
  flex: 0 0 auto;
  font-size: clamp(64px, 9vw, 120px);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.04em;
  color: rgba(63, 224, 200, 0.22);
}

@supports (-webkit-text-stroke: 1px #000) {
  .chapter-num {
    color: transparent;
    -webkit-text-stroke: 1px rgba(63, 224, 200, 0.6);
  }
}

.chapter-note {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--mono);
  font-size: var(--f12);
  letter-spacing: 0.34em;
  color: var(--ash);
  padding-top: 6px;
}

.chapter-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.chapter-sub {
  font-size: var(--f14);
  color: var(--ash);
  margin-top: 6px;
}

/* ---------- 数据条 ---------- */
.stat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  flex: 1 1 150px;
  background: var(--bg-2);
  padding: 16px 18px;
}

.stat-num {
  display: block;
  font-size: var(--f28);
  font-weight: 700;
  line-height: 1.2;
  color: var(--cyan-soft);
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: var(--f12);
  letter-spacing: 0.08em;
  color: var(--ash);
}

/* ---------- 面板 ---------- */
.panel {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 22px;
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
}

.panel:hover {
  border-color: var(--cyan-line);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 rgba(63, 224, 200, 0.12);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-title { font-size: var(--f20); font-weight: 900; letter-spacing: -0.01em; }
.panel-body { font-size: var(--f14); color: var(--ash); }
.panel-body p + p { margin-top: 10px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--clay);
  color: #E0AE8C;
  font-family: var(--mono);
  font-size: var(--f12);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tag-cyan { border-color: var(--cyan-line); color: var(--cyan); }
.tag-live { border-color: var(--orange); color: var(--orange); }

/* ---------- 图片容器基础规则 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  width: 100%;
}

.media-frame[data-ratio="16:9"] { aspect-ratio: 16 / 9; }
.media-frame[data-ratio="4:3"] { aspect-ratio: 4 / 3; }
.media-frame[data-ratio="1:1"] { aspect-ratio: 1 / 1; }
.media-frame[data-ratio="3:4"] { aspect-ratio: 3 / 4; }

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

.media-frame[data-empty]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(60, 90, 76, 0.35) 0,
    rgba(60, 90, 76, 0.35) 1px,
    transparent 1px,
    transparent 11px
  );
}

.media-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 14px 12px;
  font-size: var(--f12);
  color: var(--cyan-soft);
  background: linear-gradient(to top, rgba(4, 9, 10, 0.9), rgba(4, 9, 10, 0));
}

.media-badge { position: absolute; top: 10px; left: 10px; }
.media-badge-right { position: absolute; top: 10px; right: 10px; }

.media-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--cyan);
}

.media-caption {
  margin-top: 10px;
  font-size: var(--f12);
  color: var(--ash);
}

/* ---------- 文字工具 ---------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--f14);
  font-weight: 700;
  color: var(--cyan);
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.link-arrow::after { content: "→"; font-family: var(--mono); }
.link-arrow:hover { color: var(--cyan-soft); border-bottom-color: var(--cyan); }

.note { font-size: var(--f12); color: var(--ash); }

/* ---------- 显现动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}

.reveal[data-visible] { opacity: 1; transform: none; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: span 3; }
}

@media (max-width: 960px) {
  :root { --gutter: 16px; --band-h: 58px; }

  .brand-tag { display: none; }

  .nav-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px var(--gutter);
    min-height: 0;
  }

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

  .side-switch { order: 2; margin-left: auto; }

  .nav-cta { order: 3; padding: 8px 14px; }

  .site-nav {
    order: 4;
    flex: 1 1 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--t-base);
  }

  .site-nav[data-open] {
    max-height: 70vh;
    overflow-y: auto;
    border-top: 1px solid var(--line-soft);
  }

  .nav-list { flex-direction: column; height: auto; }

  .nav-list a {
    height: 50px;
    padding: 0 4px;
    border-bottom: 1px solid var(--line-soft);
    font-size: var(--f16);
  }

  .nav-list a::after { display: none; }

  .nav-list a[aria-current="page"] {
    color: var(--cyan);
    border-left: 2px solid var(--cyan);
    padding-left: 12px;
  }

  .col-3, .col-4, .col-6, .col-8 { grid-column: span 6; }

  .chapter { gap: 14px; }
  .chapter-note { display: none; }
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: span 2; }
  .footer-inner { padding: 40px var(--gutter) 24px; }
  .band-status { display: none; }
  .to-top { right: 12px; bottom: 12px; }
}

@media (max-width: 560px) {
  .col-3, .col-4, .col-6, .col-8 { grid-column: span 12; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
  .band-link { display: none; }
  .stat { flex: 1 1 100%; }
}

/* ============================================================
   动效降级
   ============================================================ */
@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;
  }

  .reveal { opacity: 1; transform: none; }
  .to-top { transform: none; }
}
