/* ==========================================================================
   FG电子狂欢主站 / assets/site.css
   共享外壳：reset · 变量 · 中文排版 · 头部 · 页脚 · 基础组件
   ========================================================================== */

:root {
  /* 色板 */
  --ink-900: #070B16;
  --ink-800: #0E1628;
  --ink-700: #131E36;
  --cyan: #44F5E4;
  --magenta: #FF3FA4;
  --amber: #FFB547;
  --ice: #F4FAFF;
  --silver: #A8B4C8;
  --violet: #7A5CFF;
  --acid: #65FFB0;

  --line: rgba(168, 180, 200, 0.16);
  --line-strong: rgba(68, 245, 228, 0.34);

  /* 字体族 */
  --font-display: "Archivo Narrow", "Arial Narrow", "Helvetica Neue", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  /* 度量 */
  --wrap: 1240px;
  --gutter: clamp(18px, 4vw, 44px);
  --radius: 14px;
  --radius-sm: 9px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--ink-900);
  color: var(--ice);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video, picture { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #8BFFF3; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ---------- 中文排版 ---------- */
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--ice);
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection {
  background: rgba(68, 245, 228, 0.28);
  color: var(--ice);
}

/* ==========================================================================
   头部
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink-900);
  border-bottom: 1px solid var(--line);
}

/* 跳过导航 */
.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 200;
  padding: 12px 22px;
  border-radius: 0 0 10px 10px;
  background: var(--cyan);
  color: #04121A;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: top 0.18s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible { top: 0; color: #04121A; }

/* 阅读进度 */
.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(168, 180, 200, 0.14);
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.scroll-meter__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 48%, var(--magenta));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.1s linear;
}

/* 第一层：品牌说明 + 移动端胶囊 */
.header-rail {
  background:
    linear-gradient(90deg, rgba(68, 245, 228, 0.13), rgba(122, 92, 255, 0.18) 44%, rgba(255, 63, 164, 0.13));
  border-bottom: 1px solid rgba(168, 180, 200, 0.12);
}
.header-rail__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 7px var(--gutter);
  font-size: 12px;
  line-height: 1.4;
}
.header-brandline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ice);
  white-space: nowrap;
}
.header-brandline__mark {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(68, 245, 228, 0.16), 0 0 12px rgba(68, 245, 228, 0.85);
  flex: none;
}
.header-brandline__text { letter-spacing: inherit; }
.header-tagline {
  color: rgba(168, 180, 200, 0.94);
  letter-spacing: 0.12em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-mobile-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid rgba(68, 245, 228, 0.5);
  background: rgba(68, 245, 228, 0.1);
  color: var(--ice);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.header-mobile-cta:hover {
  background: rgba(68, 245, 228, 0.22);
  border-color: var(--cyan);
  color: var(--ice);
  box-shadow: 0 0 0 4px rgba(68, 245, 228, 0.09);
}
.header-mobile-cta__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid);
  flex: none;
}

/* 第二层：栏目 */
.header-nav {
  position: relative;
  background: rgba(14, 22, 40, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.header-nav__inner {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 var(--gutter);
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: var(--ice);
}
.brand:hover { color: var(--ice); }
.brand__glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--violet) 55%, var(--magenta));
  color: #04121A;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 1px rgba(68, 245, 228, 0.35), 0 10px 24px -16px rgba(68, 245, 228, 0.95);
  flex: none;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ice);
}
.brand__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: rgba(168, 180, 200, 0.82);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border: 1px solid rgba(68, 245, 228, 0.42);
  border-radius: 999px;
  background: rgba(68, 245, 228, 0.08);
  color: var(--ice);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-toggle:hover { background: rgba(68, 245, 228, 0.18); }
.nav-toggle__bars { display: grid; gap: 4px; width: 16px; }
.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease);
}
.nav-toggle__label { line-height: 1; }

.site-header[data-open] .nav-toggle {
  background: rgba(255, 63, 164, 0.16);
  border-color: rgba(255, 63, 164, 0.62);
}
.site-header[data-open] .nav-toggle__bars span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

.primary-nav { margin-left: auto; }
.primary-nav__list { display: flex; align-items: center; gap: 2px; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  border-radius: 8px;
  color: rgba(244, 250, 255, 0.78);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s var(--ease);
}
.nav-link:hover { color: var(--ice); background: rgba(68, 245, 228, 0.08); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link[aria-current="page"] {
  color: var(--ice);
  background: rgba(68, 245, 228, 0.13);
}
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 10% 0%, rgba(122, 92, 255, 0.18), transparent 58%),
    radial-gradient(90% 80% at 94% 6%, rgba(255, 63, 164, 0.14), transparent 62%),
    var(--ink-800);
  color: var(--ice);
  border-top: 1px solid var(--line-strong);
}
.footer-beacon {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 38%, var(--magenta) 72%, var(--amber));
  opacity: 0.88;
}
.footer-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) minmax(240px, 1.15fr);
  gap: clamp(24px, 4vw, 56px);
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(42px, 6vw, 76px) var(--gutter) clamp(28px, 4vw, 46px);
}

.footer-lead { min-width: 0; }
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ice);
}
.footer-brand:hover { color: var(--ice); }
.footer-brand__glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--violet) 55%, var(--magenta));
  color: #04121A;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  flex: none;
}
.footer-brand__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.footer-summary {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.78;
  color: rgba(196, 207, 224, 0.9);
}
.footer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 20px;
}
.footer-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(168, 180, 200, 0.95);
}
.footer-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
.footer-legend__dot--v1 { background: var(--cyan); }
.footer-legend__dot--v2 { background: var(--amber); }
.footer-legend__dot--v3 { background: var(--magenta); }
.footer-legend__dot--v4 { background: var(--ice); }

.footer-col { min-width: 0; }
.footer-col__title,
.footer-contact__title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--cyan);
  border-bottom: 1px solid var(--line);
}
.footer-links { display: grid; gap: 2px; }
.footer-links__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  color: rgba(196, 207, 224, 0.92);
  transition: color 0.16s var(--ease), transform 0.16s var(--ease);
}
.footer-links__link::before {
  content: "";
  width: 10px;
  height: 1px;
  background: var(--violet);
  flex: none;
  transition: width 0.18s var(--ease), background 0.18s var(--ease);
}
.footer-links__link:hover {
  color: var(--ice);
  transform: translateX(3px);
}
.footer-links__link:hover::before { width: 18px; background: var(--cyan); }

.footer-contact { min-width: 0; }
.footer-contact__line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  line-height: 1.65;
  border-bottom: 1px dashed rgba(168, 180, 200, 0.14);
}
.footer-contact__label {
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--silver);
}
.footer-contact__value {
  color: rgba(226, 236, 250, 0.94);
  word-break: break-word;
}
.footer-contact__note {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(255, 181, 71, 0.94);
}

.footer-base {
  position: relative;
  border-top: 1px solid var(--line);
  background: rgba(7, 11, 22, 0.55);
}
.footer-base__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 16px var(--gutter);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(168, 180, 200, 0.9);
}
.footer-base__copy { margin: 0; }
.footer-base__icp { margin: 0; }

/* ==========================================================================
   共享基础组件
   ========================================================================== */
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(24px, 4vw, 42px);
}

.chapter-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan);
}
.chapter-tag::before {
  content: "";
  width: 16px;
  height: 1px;
  background: currentColor;
  flex: none;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--silver);
}

.v-note {
  position: absolute;
  top: 0;
  right: 0;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(168, 180, 200, 0.7);
  pointer-events: none;
  user-select: none;
}

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

.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(216px, 1fr)); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn--primary {
  background: linear-gradient(120deg, var(--cyan), var(--violet) 68%, var(--magenta));
  color: #04121A;
  box-shadow: 0 16px 34px -22px rgba(68, 245, 228, 0.95);
}
.btn--primary:hover {
  color: #04121A;
  transform: translateY(-1px);
  box-shadow: 0 20px 40px -20px rgba(255, 63, 164, 0.85);
}
.btn--ghost {
  border-color: rgba(68, 245, 228, 0.45);
  background: rgba(68, 245, 228, 0.06);
  color: var(--ice);
}
.btn--ghost:hover {
  border-color: var(--cyan);
  background: rgba(68, 245, 228, 0.14);
  color: var(--ice);
  transform: translateY(-1px);
}

/* 面包屑 */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--silver);
}
.crumbs__link { color: rgba(196, 207, 224, 0.85); }
.crumbs__link:hover { color: var(--cyan); }
.crumbs__sep { color: rgba(122, 92, 255, 0.9); }
.crumbs__current { color: var(--ice); }

/* 版本色标 */
.v-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
}
.v-badge--v1 { color: var(--cyan); background: rgba(68, 245, 228, 0.1); }
.v-badge--v2 { color: var(--amber); background: rgba(255, 181, 71, 0.1); }
.v-badge--v3 { color: var(--magenta); background: rgba(255, 63, 164, 0.1); }
.v-badge--v4 { color: var(--ice); background: rgba(244, 250, 255, 0.1); }

/* 图片容器（页面阶段放置 img 或内联 SVG） */
.media-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, var(--ink-800), var(--ink-900) 62%, rgba(122, 92, 255, 0.26));
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(68, 245, 228, 0.14), transparent 46%, rgba(255, 63, 164, 0.16));
  mix-blend-mode: screen;
}
.media-frame img,
.media-frame svg,
.media-frame picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--std { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame__caption {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  padding: 4px 9px;
  border: 1px solid rgba(168, 180, 200, 0.22);
  border-radius: 5px;
  background: rgba(7, 11, 22, 0.72);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(244, 250, 255, 0.92);
}

/* 浅色阅读面板 */
.reading-panel {
  border-radius: var(--radius);
  padding: clamp(20px, 3.4vw, 42px);
  background: rgba(244, 250, 255, 0.97);
  color: #0E1628;
  box-shadow: 0 26px 60px -46px rgba(68, 245, 228, 0.7);
}
.reading-panel h2,
.reading-panel h3 { color: #0A1222; }
.reading-panel p { color: #26314A; }
.reading-panel a { color: #0B63A8; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 显现动效 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1080px) {
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-lead { grid-column: 1 / -1; }
}

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

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    margin: 0;
    padding: 10px var(--gutter) 22px;
    background: rgba(9, 15, 30, 0.99);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 30px 54px -34px #000000;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }
  .site-header[data-open] .primary-nav { display: block; }

  .primary-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link {
    width: 100%;
    padding: 14px 12px;
    font-size: 16px;
    border-bottom: 1px solid rgba(168, 180, 200, 0.1);
    border-radius: 8px;
  }
  .nav-link::after { display: none; }
  .nav-link[aria-current="page"] {
    background: rgba(68, 245, 228, 0.14);
    box-shadow: inset 3px 0 0 var(--cyan);
  }
}

@media (max-width: 720px) {
  .header-rail__inner { gap: 12px; }
  .header-tagline { display: none; }
  .header-mobile-cta { padding: 5px 12px; font-size: 11px; }
  .header-nav__inner { min-height: 56px; gap: 14px; }
  .brand__glyph { width: 34px; height: 34px; font-size: 12px; }
  .brand__name { font-size: 15px; }
  .brand__meta { letter-spacing: 0.18em; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-base__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .header-brandline { letter-spacing: 0.1em; font-size: 11px; }
  .header-mobile-cta { letter-spacing: 0.04em; }
  .btn { width: 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;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .nav-link:hover,
  .footer-links__link:hover,
  .btn:hover { transform: none; }
}
