/* ============================================================
   龙8看台 · /assets/site.css
   共享外壳与基础组件（页面专属布局由后续页面 CSS 承接）
   ============================================================ */

/* ---------- 1. 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, li, dl, dt, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
hr { border: 0; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

/* ---------- 2. tokens ---------- */
:root {
  --flame: #FF4D2E;
  --ember: #B3261E;
  --deep: #0B1B2B;
  --navy: #1E3A5F;
  --concrete: #6E7378;
  --warm: #E8E3DB;
  --paper: #F4F0E8;
  --chalk: #FAF7F0;
  --neon: #2AF5D6;
  --neon-ink: #0E9484;
  --ink: #121212;

  --text: #16222E;
  --text-mid: #45525E;
  --line: rgba(11, 27, 43, 0.14);
  --line-strong: rgba(11, 27, 43, 0.3);
  --line-dark: rgba(250, 247, 240, 0.14);
  --on-dark: rgba(250, 247, 240, 0.76);
  --on-dark-dim: rgba(250, 247, 240, 0.5);

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

  --wrap: 1180px;
  --wrap-wide: 1360px;
  --gutter: clamp(16px, 4vw, 42px);
  --radius: 2px;
  --shadow: 0 1px 0 rgba(18, 18, 18, 0.05), 0 10px 30px -22px rgba(11, 27, 43, 0.5);
}

/* ---------- 3. base ---------- */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.05vw, 17.5px);
  line-height: 1.75;
  color: var(--text);
  background-color: var(--warm);
  background-image:
    repeating-linear-gradient(48deg, rgba(18, 18, 18, 0.028) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-48deg, rgba(11, 27, 43, 0.022) 0 1px, transparent 1px 4px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--deep);
}
h1 { font-size: clamp(2.2rem, 5.6vw, 4rem); line-height: 0.98; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); letter-spacing: -0.02em; }
h4 { font-size: clamp(1rem, 1.4vw, 1.15rem); letter-spacing: -0.01em; }

p { text-wrap: pretty; }

::selection { background: var(--flame); color: #fff; }

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  border-radius: 1px;
}
.band--dark :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible { outline-color: var(--neon); }

/* ---------- 4. utilities ---------- */
.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}
.wrap--wide { width: min(100% - (var(--gutter) * 2), var(--wrap-wide)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.rule { height: 1px; background: var(--line); }
.band--dark .rule, .site-footer .rule { background: var(--line-dark); }

.prose { max-width: 68ch; font-size: clamp(16px, 1.05vw, 17.5px); line-height: 1.75; color: var(--text-mid); }
.prose > * + * { margin-top: 1em; }
.prose strong { color: var(--deep); font-weight: 800; }

/* 色彩分区 */
.band { padding-block: clamp(48px, 7vw, 96px); }
.band--dark { background: var(--deep); color: var(--on-dark); }
.band--dark h1, .band--dark h2, .band--dark h3, .band--dark h4 { color: var(--chalk); }
.band--navy { background: var(--navy); color: rgba(250, 247, 240, 0.82); }
.band--navy h1, .band--navy h2, .band--navy h3, .band--navy h4 { color: var(--chalk); }
.band--paper { background: var(--paper); border-block: 1px solid var(--line); }

/* 网格 */
.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)); }

/* 面板 */
.panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow);
}
.panel--dark { background: var(--deep); color: var(--on-dark); border-color: var(--line-dark); }
.panel--dark h2, .panel--dark h3, .panel--dark h4 { color: var(--chalk); }
.panel--navy { background: var(--navy); color: rgba(250, 247, 240, 0.84); border-color: rgba(250, 247, 240, 0.16); }
.panel--navy h2, .panel--navy h3, .panel--navy h4 { color: var(--chalk); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: transform 0.18s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn--flame { background: var(--flame); color: #fff; box-shadow: 0 10px 24px -14px rgba(255, 77, 46, 0.9); }
.btn--flame:hover { background: var(--ember); transform: translateY(-2px); }
.btn--ghost { border-color: rgba(250, 247, 240, 0.3); color: var(--chalk); }
.btn--ghost:hover { border-color: var(--neon); color: var(--neon); transform: translateY(-2px); }
.btn--line { border-color: var(--line-strong); color: var(--deep); }
.btn--line:hover { border-color: var(--flame); color: var(--flame); transform: translateY(-2px); }
.btn--sm { padding: 10px 16px; font-size: 12.5px; }

/* 等宽标签 / 大编号 / 状态点 */
.mono-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--concrete);
}
.mono-label--flame { color: var(--flame); }
.mono-label--neon { color: var(--neon-ink); }
.band--dark .mono-label--neon, .panel--dark .mono-label--neon, .panel--navy .mono-label--neon { color: var(--neon); }

.num-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--flame);
}

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--flame); flex: none; }
.dot--neon { background: var(--neon); box-shadow: 0 0 8px rgba(42, 245, 214, 0.7); }
.dot--concrete { background: var(--concrete); }

/* 面包屑 */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--concrete);
}
.breadcrumbs__item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumbs__item[aria-current="page"] { color: var(--deep); }
.breadcrumbs__link { border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.breadcrumbs__link:hover { color: var(--flame); border-bottom-color: var(--flame); }
.breadcrumbs__sep { color: var(--line-strong); }
.band--dark .breadcrumbs, .band--dark .breadcrumbs__item[aria-current="page"] { color: var(--on-dark-dim); }

/* 图片容器（页面阶段放置 <img> / <picture>） */
.figure {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.figure__media {
  position: relative;
  aspect-ratio: var(--ratio, 16 / 9);
  background-image: linear-gradient(140deg, var(--navy), var(--deep));
  overflow: hidden;
}
.figure__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, transparent 0 22px, rgba(250, 247, 240, 0.055) 22px 23px);
  pointer-events: none;
}
.figure__media img { width: 100%; height: 100%; object-fit: cover; }
.figure__cap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 14px;
  background: var(--deep);
  color: var(--on-dark-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.figure--ratio-4x3 { --ratio: 4 / 3; }
.figure--ratio-1x1 { --ratio: 1 / 1; }
.figure--ratio-3x4 { --ratio: 3 / 4; }
.figure--ratio-21x9 { --ratio: 21 / 9; }

/* ---------- 5. 显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- 6. header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--deep);
  color: var(--chalk);
  border-bottom: 1px solid var(--line-dark);
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 10px;
  z-index: 120;
  transform: translate(-50%, -220%);
  padding: 10px 20px;
  background: var(--flame);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border-radius: var(--radius);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.7);
  transition: transform 0.22s ease;
}
.skip-link:focus { transform: translate(-50%, 0); }

.header-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
  padding: 9px var(--gutter);
  max-height: 48px;
  overflow: hidden;
  border-bottom: 1px solid rgba(250, 247, 240, 0.1);
  background: rgba(0, 0, 0, 0.16);
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}
.rail-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--on-dark-dim);
}
.rail-tag--dim { color: rgba(250, 247, 240, 0.38); }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--flame);
  flex: none;
  animation: rail-pulse 2.6s ease-out infinite;
}
@keyframes rail-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 77, 46, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 77, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 46, 0); }
}

.header-core {
  width: min(100% - (var(--gutter) * 2), var(--wrap-wide));
  margin-inline: auto;
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px 0 12px;
  transition: padding 0.3s ease;
}
.masthead__side {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(250, 247, 240, 0.46);
}
.masthead__side--end { grid-column: 3; justify-content: flex-end; }

.masthead__brand { grid-column: 2; display: block; text-align: center; }
.masthead__name {
  display: block;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(22px, 3.4vw, 34px);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--chalk);
  transition: font-size 0.3s ease;
}
.masthead__name em { font-style: normal; color: var(--flame); }
.masthead__byline {
  display: block;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--neon);
  opacity: 0.82;
}

.masthead__cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--on-dark);
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(250, 247, 240, 0.28);
  transition: color 0.2s, border-color 0.2s;
}
.masthead__cta:hover { color: var(--flame); border-bottom-color: var(--flame); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(250, 247, 240, 0.26);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--chalk);
  transition: border-color 0.2s, color 0.2s;
}
.nav-toggle:hover { border-color: var(--neon); color: var(--neon); }
.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 11px;
}
.nav-toggle__bars i {
  display: block;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { transform: translateY(4.75px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { transform: translateY(-4.75px) rotate(-45deg); }

.site-nav { border-top: 1px solid rgba(250, 247, 240, 0.12); }
.site-nav__list {
  display: flex;
  justify-content: flex-start;
  justify-content: safe center;
  gap: clamp(10px, 2.4vw, 34px);
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav__list::-webkit-scrollbar { display: none; }
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 2px 13px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(250, 247, 240, 0.6);
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.site-nav__link::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--concrete);
  opacity: 0.55;
  transition: background-color 0.2s, opacity 0.2s, box-shadow 0.2s;
}
.site-nav__link:hover { color: var(--chalk); }
.site-nav__link[aria-current="page"] {
  color: var(--chalk);
  border-bottom-color: var(--flame);
}
.site-nav__link[aria-current="page"]::before {
  background: var(--neon);
  opacity: 1;
  box-shadow: 0 0 9px rgba(42, 245, 214, 0.85);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(250, 247, 240, 0.08);
}
.scroll-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background-image: linear-gradient(90deg, var(--ember), var(--flame) 55%, var(--neon));
}

/* 滚动压缩 */
.site-header.is-compact .header-rail {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom-color: transparent;
}
.site-header.is-compact .masthead { padding: 9px 0 7px; }
.site-header.is-compact .masthead__name { font-size: clamp(18px, 2.4vw, 24px); }

/* ---------- 7. footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 8vw, 104px);
  padding-bottom: clamp(24px, 4vw, 42px);
  background: var(--deep);
  color: var(--on-dark);
}
.site-footer::before {
  content: "";
  display: block;
  height: 8px;
  background-image: repeating-linear-gradient(90deg, var(--flame) 0 22px, transparent 22px 32px);
  opacity: 0.85;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.5fr;
  gap: clamp(24px, 3.2vw, 46px);
  padding-top: clamp(36px, 5vw, 62px);
}
.footer-col { min-width: 0; }
.footer-col--brand { max-width: 34ch; }
.footer-col--contact { min-width: 0; }

.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand__name {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--chalk);
}
.footer-brand__name em { font-style: normal; color: var(--flame); }
.footer-brand__byline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--neon);
  opacity: 0.8;
}
.footer-lede {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--on-dark-dim);
}
.footer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.footer-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-dark-dim);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-dark);
}
.footer-list { display: flex; flex-direction: column; gap: 10px; }
.footer-link {
  display: inline-block;
  font-size: 14px;
  color: var(--on-dark);
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.footer-link:hover { color: var(--neon); border-bottom-color: var(--neon); transform: translateX(3px); }

.footer-contact { display: grid; gap: 4px; }
.footer-contact dt {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(250, 247, 240, 0.4);
}
.footer-contact dt:first-child { margin-top: 0; }
.footer-contact dd {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(250, 247, 240, 0.84);
  overflow-wrap: anywhere;
}
.footer-contact__note {
  margin-top: 18px;
  padding-left: 13px;
  border-left: 2px solid var(--flame);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--on-dark-dim);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 28px;
  margin-top: clamp(34px, 4.5vw, 54px);
  padding-top: 18px;
  border-top: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(250, 247, 240, 0.48);
}
.footer-legal__text { max-width: 62ch; }
.footer-legal__text--dim { color: rgba(250, 247, 240, 0.34); }

.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 30px);
  bottom: clamp(14px, 3vw, 30px);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--deep);
  color: var(--chalk);
  border: 1px solid rgba(250, 247, 240, 0.2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, border-color 0.2s, color 0.2s;
}
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--neon); color: var(--neon); }

/* ---------- 8. 响应式 ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    max-height: 0;
    overflow: hidden;
    background: var(--deep);
    border-top: 1px solid var(--line-dark);
    box-shadow: 0 28px 50px -20px rgba(0, 0, 0, 0.75);
    transition: max-height 0.32s ease;
  }
  .site-nav[data-open] { max-height: 78vh; overflow-y: auto; }
  .site-nav__list {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: 8px var(--gutter) 22px;
    overflow-x: visible;
  }
  .site-nav__link {
    width: 100%;
    padding: 15px 0 15px 12px;
    font-size: 15px;
    border-bottom: 1px solid rgba(250, 247, 240, 0.1);
    border-left: 2px solid transparent;
    border-bottom-width: 1px;
  }
  .site-nav__link[aria-current="page"] {
    border-bottom-color: rgba(250, 247, 240, 0.1);
    border-left-color: var(--flame);
  }

  .masthead { padding: 12px 0 10px; }
}

@media (max-width: 760px) {
  .masthead__side:not(.masthead__side--end) { display: none; }
  .masthead__cta { display: none; }
  .footer-legal { flex-direction: column; }
}

@media (max-width: 620px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .footer-col--brand { max-width: none; }
  .header-rail { padding-inline: var(--gutter); }
  .rail-tag--dim { display: none; }
  .btn { padding: 12px 18px; }
}

/* ---------- 9. 减少动态 ---------- */
@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;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .pulse-dot { animation: none; }
}
