/* ==========================================================================
   诺亚赛场 · 共享样式表 /assets/site.css
   轨道导航 + 编辑部内容区 + 深色页脚
   ========================================================================== */

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

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

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

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

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

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

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

table { border-collapse: collapse; width: 100%; }

/* ---------- 2. Tokens ---------- */
:root {
  --ink: #0B0D0C;
  --red: #D7263D;
  --green: #1F7A4D;
  --yellow: #F2B705;
  --neon: #D8FF3E;
  --warm: #B8B2A7;
  --paper: #F7F4EE;
  --char: #232725;
  --line: #D8D3C8;

  --rail-w: 264px;
  --head-h: 64px;
  --gap: clamp(16px, 2.4vw, 32px);
  --pad: clamp(20px, 4vw, 64px);
  --shell: 1280px;
  --skew: -6deg;

  --font-display: "Barlow Condensed", "Arial Narrow", "Source Han Sans SC",
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", "PingFang SC",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
}

/* ---------- 3. Base / 中文排版 ---------- */
body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  padding-top: var(--head-h);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1 { font-size: clamp(40px, 7vw, 96px); }
h2 { font-size: clamp(28px, 4vw, 56px); }
h3 { font-size: clamp(20px, 2.4vw, 30px); }

p { line-height: 1.75; }

strong { font-weight: 700; }

.mono,
[data-num] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.prose { max-width: 38em; }
.prose p + p { margin-top: 1em; }
.prose ul, .prose ol { margin: 1em 0; padding-left: 1.4em; }
.prose li { list-style: disc; margin: 0.35em 0; }

/* ---------- 4. Focus & skip link ---------- */
:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  transform: translateY(-140%);
  background-color: var(--neon);
  color: var(--ink);
  padding: 12px 22px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  transition: transform 0.18s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: -4px;
}

/* ---------- 5. 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 6. 侧边轨道页头 ---------- */
.site-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--head-h);
  z-index: 150;
  background-color: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid rgba(247, 244, 238, 0.14);
}

.site-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    115deg,
    rgba(247, 244, 238, 0.055) 0 1px,
    transparent 1px 14px
  );
}

.rail-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background-color: var(--red);
  z-index: 200;
  transition: height 0.08s linear;
  pointer-events: none;
}

.rail-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--head-h);
  padding: 0 16px;
}

.rail-top { display: none; }

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--paper);
  min-width: 0;
}

.rail-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background-color: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
}

.rail-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rail-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.rail-brand-slogan {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--warm);
  white-space: nowrap;
}

/* 汉堡按钮 */
.rail-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 12px;
  border: 1px solid rgba(247, 244, 238, 0.3);
  color: var(--paper);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.rail-toggle:hover { border-color: var(--neon); background-color: rgba(247, 244, 238, 0.06); }

.rail-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 18px;
}

.rail-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--neon);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-rail[data-open] .rail-toggle-bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-rail[data-open] .rail-toggle-bar:nth-child(2) { opacity: 0; }
.site-rail[data-open] .rail-toggle-bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* 移动端抽屉式导航 */
.rail-nav {
  position: fixed;
  top: var(--head-h);
  left: 0;
  right: 0;
  z-index: 149;
  background-color: var(--char);
  padding: 14px 14px 22px;
  border-bottom: 1px solid rgba(247, 244, 238, 0.14);
  box-shadow: 0 28px 48px rgba(11, 13, 12, 0.45);
  max-height: calc(100dvh - var(--head-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.site-rail[data-open] .rail-nav {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.rail-nav-item + .rail-nav-item { margin-top: 2px; }

.rail-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-left: 3px solid transparent;
  color: rgba(247, 244, 238, 0.78);
  font-size: 15px;
  line-height: 1.4;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.rail-nav-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(247, 244, 238, 0.42);
  transition: color 0.18s ease;
}

.rail-nav-label { min-width: 0; }

.rail-nav-link:hover {
  background-color: rgba(247, 244, 238, 0.07);
  color: var(--paper);
  border-left-color: var(--warm);
}

.rail-nav-link[aria-current="page"] {
  background-color: rgba(215, 38, 61, 0.18);
  color: var(--paper);
  border-left-color: var(--red);
}

.rail-nav-link[aria-current="page"] .rail-nav-num { color: var(--neon); }

.rail-nav-link[aria-current="page"]::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-left: auto;
  border-radius: 50%;
  background-color: var(--neon);
}

.rail-cta {
  display: block;
  margin-top: 18px;
  padding: 13px 18px;
  background-color: var(--red);
  color: #fff;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.05em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.rail-cta:hover { background-color: #ef3a52; transform: translateY(-2px); }
.rail-cta:focus-visible { outline-offset: 2px; }

.rail-foot { display: none; }

/* ---------- 7. 桌面端：轨道变竖排 ---------- */
@media (min-width: 1024px) {
  body {
    padding-top: 0;
    padding-left: var(--rail-w);
  }

  .site-rail {
    right: auto;
    bottom: 0;
    height: auto;
    width: var(--rail-w);
    border-bottom: 0;
    border-right: 1px solid rgba(247, 244, 238, 0.12);
  }

  .rail-inner {
    height: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 24px 18px 22px;
    overflow-y: auto;
  }

  .rail-top {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    line-height: 1.7;
    letter-spacing: 0.12em;
    color: rgba(247, 244, 238, 0.5);
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(247, 244, 238, 0.14);
  }

  .rail-brand { margin-right: 0; }

  .rail-brand-name { font-size: 23px; }

  .rail-toggle { display: none; }

  .rail-nav {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    background-color: transparent;
    padding: 0;
    border-bottom: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
  }

  .rail-nav-link { padding: 11px 12px; }

  .rail-foot {
    display: block;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(247, 244, 238, 0.14);
  }

  .rail-foot-title {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--yellow);
  }

  .rail-foot-note {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.65;
    color: rgba(247, 244, 238, 0.55);
  }
}

/* ---------- 8. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0.05em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease,
    color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }

.btn--primary { background-color: var(--red); color: #fff; }
.btn--primary:hover { background-color: #ef3a52; }

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

.btn--neon { background-color: var(--neon); color: var(--ink); }
.btn--neon:hover { background-color: #e6ff6b; }

/* ---------- 9. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: var(--yellow);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.tag--green { background-color: var(--green); color: #fff; }
.tag--red { background-color: var(--red); color: #fff; }
.tag--neon { background-color: var(--neon); color: var(--ink); }

/* ---------- 10. 卡片 ---------- */
.card {
  background-color: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: clamp(18px, 2.4vw, 28px);
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: 0 14px 30px rgba(11, 13, 12, 0.1);
}
.card--ink {
  background-color: var(--char);
  color: var(--paper);
  border-color: transparent;
}
.card--ink:hover { border-color: var(--warm); }
.card--accent { border-left: 6px solid var(--red); }

/* ---------- 11. 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 26px 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--char);
}
.breadcrumb a {
  border-bottom: 1px solid var(--line);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.breadcrumb a:hover { color: var(--red); border-bottom-color: var(--red); }
.breadcrumb-sep { color: var(--warm); }
.breadcrumb [aria-current="page"] { color: var(--red); }

/* ---------- 12. 章节大编号 ---------- */
.section-num {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(56px, 11vw, 160px);
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: var(--line);
  user-select: none;
}
@supports (-webkit-text-stroke: 1px #000) {
  .section-num {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--warm);
  }
}

/* ---------- 13. 图片容器基础规则 ---------- */
.figure {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background-color: var(--char);
  background-image: linear-gradient(135deg, var(--char) 0%, #3a403c 100%);
  border-radius: 2px;
}
.figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    115deg,
    rgba(247, 244, 238, 0.06) 0 1px,
    transparent 1px 16px
  );
}
.figure img,
.figure video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure--wide { aspect-ratio: 21 / 9; }
.figure--portrait { aspect-ratio: 3 / 4; }
.figure--square { aspect-ratio: 1 / 1; }

.figure-label {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 9px 16px;
  background-color: var(--ink);
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
}

/* ---------- 14. 页脚 ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: clamp(40px, 7vw, 104px);
  padding: clamp(40px, 6vw, 76px) var(--pad) 0;
  background-color: var(--ink);
  color: var(--paper);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-image: linear-gradient(
    90deg,
    var(--red) 0 38%,
    var(--yellow) 38% 62%,
    var(--green) 62% 100%
  );
}

.site-footer::after {
  content: "WHISTLE NOAH";
  position: absolute;
  right: -8px;
  bottom: -34px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(64px, 13vw, 176px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgba(247, 244, 238, 0.045);
  pointer-events: none;
  white-space: nowrap;
}

.footer-shell {
  position: relative;
  z-index: 1;
  max-width: var(--shell);
  margin-inline: auto;
}

.footer-grid {
  display: grid;
  gap: clamp(28px, 4vw, 52px);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  }
}

.footer-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--warm);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.footer-slogan {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 23px);
  letter-spacing: 0.03em;
  color: var(--neon);
}

.footer-desc {
  margin-top: 14px;
  max-width: 24em;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(247, 244, 238, 0.66);
}

.footer-stamp {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--warm);
}

.footer-stamp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--red);
}

.footer-col-title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--yellow);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(247, 244, 238, 0.18);
}

.footer-list li + li { margin-top: 2px; }

.footer-link {
  display: inline-block;
  padding: 6px 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(247, 244, 238, 0.82);
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.footer-link:hover {
  color: var(--neon);
  border-bottom-color: var(--neon);
}

.footer-contact-band {
  margin-top: clamp(30px, 4vw, 52px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid rgba(247, 244, 238, 0.16);
  display: grid;
  gap: clamp(22px, 3vw, 40px);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .footer-contact-band {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
  }
}

.footer-contact-list {
  display: grid;
  gap: 18px 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .footer-contact-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.footer-contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--yellow);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.footer-contact-value {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(247, 244, 238, 0.86);
  word-break: break-word;
}

.footer-service-note {
  font-size: 13px;
  line-height: 1.8;
  color: var(--warm);
  border-left: 3px solid var(--green);
  padding-left: 14px;
}

.footer-bottom {
  margin-top: clamp(30px, 5vw, 52px);
  padding: 20px 0 30px;
  border-top: 1px solid rgba(247, 244, 238, 0.16);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--warm);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.footer-legal-link {
  color: rgba(247, 244, 238, 0.8);
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.footer-legal-link:hover {
  color: var(--neon);
  border-bottom-color: var(--neon);
}

.footer-icp,
.footer-copy {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--warm);
}

/* ---------- 15. 滚动显现 ---------- */
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.has-js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 16. 降低动态效果 ---------- */
@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;
  }

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

  .rail-progress { transition: none; }
  .btn:hover,
  .card:hover,
  .rail-cta:hover { transform: none; }
}
