/* ==========================================================================
   诺亚看台 · 共享外壳样式 /assets/site.css
   夜场轨道导航 · 展览画册网格 · 红黄牌状态色
   ========================================================================== */

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

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

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

ul, ol { list-style: none; }

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

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

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

:root {
  --ink: #061826;
  --stand: #0D2533;
  --pitch: #123D2F;
  --edge: #2E7D57;
  --chalk: #E8F0E8;
  --mute: #9EB2A8;
  --red: #D6342C;
  --yellow: #F2C230;
  --grid: #6F857C;
  --paper: #F5F2E8;

  --rail-w: 96px;
  --bar-h: 60px;
  --maxw: 1240px;
  --gutter: clamp(18px, 4vw, 56px);

  --hair: 1px solid rgba(111, 133, 124, 0.34);
  --hair-strong: 1px solid rgba(111, 133, 124, 0.58);

  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: 180ms ease;
}

html { scroll-padding-top: calc(var(--bar-h) + 16px); }

body {
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    radial-gradient(120% 78% at 84% -14%, rgba(46, 125, 87, 0.22), rgba(6, 24, 38, 0) 58%),
    repeating-linear-gradient(0deg, rgba(232, 240, 232, 0.022) 0 1px, transparent 1px 72px);
  color: var(--chalk);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

h1 { font-size: clamp(30px, 4.6vw, 52px); }
h2 { font-size: clamp(24px, 3.2vw, 38px); }
h3 { font-size: clamp(18px, 2vw, 22px); }

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

/* ── 跳到主要内容 ───────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--yellow);
  color: #0A1A12;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transform: translateY(-180%);
  transition: transform var(--ease);
}

.skip-link:focus { transform: translateY(0); }

/* ── 页头 / 轨道导航 ───────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: rgba(6, 24, 38, 0.97);
  border-bottom: var(--hair);
}

.mobile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--bar-h);
  padding: 0 clamp(14px, 4vw, 22px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.brand-mark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--chalk);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--mute);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(111, 133, 124, 0.55);
  background: rgba(13, 37, 51, 0.9);
  transition: border-color var(--ease), background-color var(--ease);
}

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

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--chalk);
  transition: transform var(--ease), opacity var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.side-nav {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--bar-h);
  max-height: calc(100vh - var(--bar-h));
  overflow-y: auto;
  padding: 20px clamp(14px, 4vw, 22px) 26px;
  background: var(--stand);
  border-bottom: var(--hair-strong);
  box-shadow: 0 28px 44px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity var(--ease), transform var(--ease), visibility 0s linear 200ms;
}

.side-nav[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--ease), transform var(--ease), visibility 0s;
}

body.nav-open { overflow: hidden; }

.rail-brand { display: none; }

.rail-nav { width: 100%; }

.rail-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 12px 16px;
  transition: background-color var(--ease), transform var(--ease), color var(--ease);
}

.rail-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: transparent;
  transition: background-color var(--ease);
}

.rail-link:hover {
  background: rgba(46, 125, 87, 0.16);
  transform: translateY(-2px);
}

.rail-link:hover .rail-text { color: #FFFFFF; }

.rail-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--grid);
  transition: color var(--ease);
}

.rail-text {
  font-size: 15px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--chalk);
}

.rail-link[aria-current="page"]::before { background: var(--red); }
.rail-link[aria-current="page"] .rail-num { color: var(--yellow); }
.rail-link[aria-current="page"] .rail-text { color: #FFFFFF; font-weight: 700; }

.rail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: var(--hair);
}

.rail-foot .btn { flex: 1 1 140px; }

.rail-hours {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--mute);
}

/* ── 阅读进度与回顶 ────────────────────────────────────────── */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 3px;
  background: rgba(111, 133, 124, 0.22);
  pointer-events: none;
}

.read-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--yellow);
  transition: width 100ms linear;
}

.to-top {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(111, 133, 124, 0.6);
  background: var(--stand);
  color: var(--chalk);
  font-family: var(--font-mono);
  font-size: 15px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--ease), transform var(--ease), visibility 0s linear 200ms, border-color var(--ease);
}

.to-top[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--ease), transform var(--ease), visibility 0s, border-color var(--ease);
}

.to-top:hover { border-color: var(--yellow); color: var(--yellow); }

/* ── 页脚 ─────────────────────────────────────────────────── */
.site-footer {
  margin-top: clamp(40px, 7vw, 88px);
  background: var(--stand);
  border-top: var(--hair-strong);
}

.footer-inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(32px, 5vw, 56px) var(--gutter) 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(26px, 4vw, 48px);
  padding-bottom: clamp(24px, 4vw, 40px);
  border-bottom: var(--hair);
}

.footer-mark {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--chalk);
}

.footer-tagline {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--yellow);
}

.footer-note {
  margin-top: 16px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--mute);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: clamp(20px, 3vw, 32px);
}

.footer-col-title {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: var(--hair);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--mute);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  display: inline-block;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  font-size: 14px;
  color: var(--chalk);
  transition: color var(--ease), border-color var(--ease);
}

.footer-links a:hover {
  color: var(--yellow);
  border-bottom-color: rgba(242, 194, 48, 0.55);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mute);
}

.footer-contact { font-size: 11.5px; letter-spacing: 0.04em; }
.footer-legal { color: var(--grid); }
.footer-copy { color: var(--mute); }

/* ── 主体容器 ─────────────────────────────────────────────── */
.site-main { padding-top: var(--bar-h); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: 68ch; }
.prose p + p { margin-top: 1em; }
.prose h3 { margin-top: 1.6em; margin-bottom: 0.5em; }
.prose ul { margin-top: 0.8em; display: flex; flex-direction: column; gap: 0.4em; }

/* ── 章节与网格 ───────────────────────────────────────────── */
.section {
  padding-block: clamp(36px, 6vw, 76px);
  border-top: var(--hair);
}

.section--flush { border-top: 0; padding-top: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--mute);
}

.section-title {
  font-size: clamp(23px, 3.2vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--chalk);
}

.section-lede {
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.8;
  color: var(--mute);
}

.rule {
  width: 100%;
  height: 1px;
  border: 0;
  background: rgba(111, 133, 124, 0.34);
}

.grid {
  display: grid;
  gap: var(--gap, clamp(16px, 2.4vw, 28px));
}

.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

/* ── 面板 ─────────────────────────────────────────────────── */
.panel {
  padding: clamp(18px, 2.4vw, 26px);
  background: var(--stand);
  border: var(--hair);
  transition: transform var(--ease), border-color var(--ease), background-color var(--ease);
}

.panel--pitch {
  background: var(--pitch);
  border-color: rgba(46, 125, 87, 0.45);
}

.panel--interactive:hover {
  transform: translateY(-2px);
  border-color: var(--edge);
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--mute);
  margin-bottom: 10px;
}

/* ── 标签 ─────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(111, 133, 124, 0.6);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  line-height: 1.8;
  color: var(--mute);
  white-space: nowrap;
}

.tag--red {
  background: var(--red);
  border-color: var(--red);
  color: #FFFFFF;
}

.tag--yellow {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #0A1A12;
}

/* ── 数字 ─────────────────────────────────────────────────── */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.num--xl {
  font-size: clamp(56px, 10vw, 120px);
  font-weight: 600;
  line-height: 0.92;
  color: var(--chalk);
}

/* ── 面包屑 ───────────────────────────────────────────────── */
.breadcrumb {
  padding-block: 14px;
  border-bottom: var(--hair);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mute);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.breadcrumb-list a { color: var(--mute); transition: color var(--ease); }
.breadcrumb-list a:hover { color: var(--yellow); }
.breadcrumb-list [aria-current="page"] { color: var(--chalk); }
.breadcrumb-sep { color: rgba(111, 133, 124, 0.7); }

/* ── 图像容器基础规则 ─────────────────────────────────────── */
.figure {
  margin: 0;
  background: var(--pitch);
  border: var(--hair);
}

.figure__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(155deg, rgba(18, 61, 47, 0.95), rgba(6, 24, 38, 0.98));
}

.figure__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(232, 240, 232, 0.06) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(232, 240, 232, 0.06) 0 1px, transparent 1px 48px);
}

.figure__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.04);
}

.figure__caption {
  padding: 12px 14px;
  border-top: var(--hair);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--mute);
}

.figure--wide .figure__media { aspect-ratio: 21 / 9; }
.figure--tall .figure__media { aspect-ratio: 3 / 4; }
.figure--square .figure__media { aspect-ratio: 1 / 1; }

/* ── 按钮 ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(111, 133, 124, 0.6);
  background: transparent;
  color: var(--chalk);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  background: rgba(46, 125, 87, 0.18);
  border-color: var(--edge);
}

.btn--card {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #0A1A12;
  font-weight: 700;
}

.btn--card:hover {
  background: #FFD65C;
  border-color: #FFD65C;
  color: #06180F;
}

.btn--ghost {
  background: transparent;
  border-color: rgba(111, 133, 124, 0.6);
  color: var(--chalk);
}

.btn--ghost:hover {
  background: rgba(242, 194, 48, 0.08);
  border-color: var(--yellow);
  color: var(--yellow);
}

.btn-label { display: inline-block; }

/* ── 桌面端：左侧竖轨 ─────────────────────────────────────── */
@media (min-width: 900px) {
  body { padding-left: var(--rail-w); }

  .site-header {
    right: auto;
    width: var(--rail-w);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--stand);
    border-bottom: 0;
    border-right: var(--hair-strong);
  }

  .mobile-bar { display: none; }

  .skip-link { left: calc(var(--rail-w) + 10px); }

  .side-nav {
    position: static;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: none;
    overflow: hidden;
    padding: 18px 0 14px;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .rail-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0 0 14px;
    border-bottom: var(--hair);
  }

  .rail-brand-mark {
    writing-mode: vertical-rl;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.14em;
    color: var(--chalk);
  }

  .rail-brand-tag {
    writing-mode: vertical-rl;
    font-family: var(--font-mono);
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0.2em;
    color: var(--mute);
  }

  .rail-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--grid) transparent;
  }

  .rail-list { gap: 0; }

  .rail-link {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px 0;
  }

  .rail-link::before {
    top: 6px;
    bottom: 6px;
    width: 2px;
  }

  .rail-num { font-size: 9px; letter-spacing: 0.1em; }

  .rail-text {
    writing-mode: vertical-rl;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.12em;
  }

  .rail-foot {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-top: 0;
    padding: 14px 0 0;
  }

  .rail-foot .btn {
    width: 100%;
    min-height: 0;
    padding: 12px 0;
  }

  .rail-foot .btn-label {
    writing-mode: vertical-rl;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.16em;
  }

  .rail-hours { display: none; }

  body.nav-open { overflow: auto; }

  .read-progress { left: var(--rail-w); }

  .to-top { left: calc(var(--rail-w) + 14px); bottom: 20px; }

  .site-main { padding-top: 0; }

  .footer-top { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}

/* ── 平板与手机 ───────────────────────────────────────────── */
@media (max-width: 899px) {
  .cols-2,
  .cols-3,
  .split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-contact { line-height: 1.9; }
  .section-title { letter-spacing: -0.01em; }
}

@media (max-width: 359px) {
  .brand-sub { display: none; }
}

/* ── 动效降级 ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .rail-link:hover,
  .btn:hover,
  .panel--interactive:hover { transform: none; }

  .read-progress__bar { transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
