/* =========================================================
   永乐高指南 · 共享样式 /assets/site.css
   ========================================================= */

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

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

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

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

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

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

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

:root {
  /* 色彩 */
  --ink: #060A12;
  --night: #0E1830;
  --lapis: #1D3560;
  --cinnabar: #C94532;
  --cinnabar-deep: #9E2F21;
  --butter: #E7B24C;
  --mist: #93A3BD;
  --cream: #F3EDE2;
  --pine: #2E6B62;
  --sand: #B98A5E;

  /* 结构 */
  --rail-w: 88px;
  --topbar-h: 38px;
  --mast-h: 60px;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;

  /* 边界 */
  --edge: rgba(147, 163, 189, 0.22);
  --edge-strong: rgba(147, 163, 189, 0.4);

  /* 字体 */
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow-plate: 0 26px 64px -30px rgba(2, 5, 12, 0.92);
}

/* ---------------------------------------------------------
   页面基底
   --------------------------------------------------------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  padding-top: var(--topbar-h);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--cream);
  background-color: var(--night);
  background-image:
    radial-gradient(1100px 620px at 92% -8%, rgba(29, 53, 96, 0.9), transparent 72%),
    radial-gradient(760px 520px at -6% 106%, rgba(46, 107, 98, 0.26), transparent 70%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.36), transparent 40%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.nav-open {
  overflow: hidden;
}

::selection {
  background: var(--cinnabar);
  color: var(--cream);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 4.6vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 2.9vw, 2.4rem); }
h3 { font-size: clamp(1.24rem, 2vw, 1.6rem); }

p {
  text-wrap: pretty;
}

#main-content {
  display: block;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------
   容器与网格
   --------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 64px);
}

.lattice {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

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

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

.stack {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.4vw, 28px);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ---------------------------------------------------------
   顶部状态条
   --------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.skip-link {
  pointer-events: auto;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius-pill);
  background: var(--butter);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  transform: translateY(-180%);
  transition: transform 0.3s var(--ease);
}

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

.topbar {
  pointer-events: auto;
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(16px, 3vw, 34px);
  background: rgba(6, 10, 18, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--mist);
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.topbar__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pine);
  box-shadow: 0 0 0 3px rgba(46, 107, 98, 0.28);
}

.topbar__progress {
  flex: 1 1 auto;
  min-width: 40px;
  height: 2px;
  border-radius: 2px;
  background: rgba(147, 163, 189, 0.2);
  overflow: hidden;
}

.topbar__progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--butter), var(--cinnabar));
  transition: width 0.12s linear;
}

/* ---------------------------------------------------------
   侧边轨道导航
   --------------------------------------------------------- */
.rail {
  pointer-events: auto;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 10px 18px;
  background: var(--ink);
  border-right: 1px solid var(--edge);
  z-index: 6;
}

.rail::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cinnabar), var(--butter), var(--pine));
  opacity: 0.85;
}

.rail__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  border-radius: var(--radius-md);
  transition: opacity 0.25s var(--ease);
}

.rail__brand:hover .rail__brand-text,
.rail__brand:focus-visible .rail__brand-text {
  color: var(--butter);
}

.rail__brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(155deg, var(--cinnabar), var(--cinnabar-deep));
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 24px -12px rgba(201, 69, 50, 0.95);
}

.rail__brand-text {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--mist);
  transition: color 0.25s var(--ease);
}

.rail__toggle {
  display: none;
}

.rail__nav {
  width: 100%;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(147, 163, 189, 0.35) transparent;
}

.rail__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 2px;
  border-radius: 14px;
  color: var(--mist);
  font-size: 0.68rem;
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-align: center;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.rail__link:hover,
.rail__link:focus-visible {
  background: rgba(29, 53, 96, 0.62);
  color: var(--cream);
}

.rail__glyph {
  font-size: 1rem;
  line-height: 1;
  color: var(--mist);
  transition: color 0.25s var(--ease);
}

.rail__link:hover .rail__glyph,
.rail__link:focus-visible .rail__glyph {
  color: var(--butter);
}

.rail__link[aria-current="page"] {
  background: rgba(201, 69, 50, 0.16);
  color: var(--cream);
  font-weight: 600;
}

.rail__link[aria-current="page"] .rail__glyph {
  color: var(--cinnabar);
}

.rail__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--cinnabar);
  transform: translateY(-50%);
}

.rail__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--mist);
}

.rail__status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pine);
}

.rail__scrim {
  display: none;
}

/* ---------------------------------------------------------
   画板 · 标题区 · 标签
   --------------------------------------------------------- */
.board {
  position: relative;
  padding: clamp(22px, 3.4vw, 44px);
  border: 1px solid var(--edge);
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg, rgba(29, 53, 96, 0.72), rgba(14, 24, 48, 0.88));
  box-shadow: var(--shadow-plate);
}

.board--deep {
  background: linear-gradient(165deg, rgba(8, 13, 24, 0.94), rgba(6, 10, 18, 0.78));
}

.board--signal {
  background: linear-gradient(150deg, rgba(201, 69, 50, 0.92), rgba(158, 47, 33, 0.94));
  border-color: rgba(243, 237, 226, 0.22);
}

.board--rise {
  border-radius: clamp(22px, 3vw, 32px) clamp(22px, 3vw, 32px) 6px 6px;
}

.plate-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 18px;
}

.plate-no {
  display: inline-block;
  padding: 0.2rem 0.62rem;
  border: 1px solid rgba(231, 178, 76, 0.42);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--butter);
}

.plate-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.32rem, 2.4vw, 2rem);
  line-height: 1.26;
  letter-spacing: -0.01em;
}

.plate-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--mist);
}

.lede {
  max-width: 34em;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.85;
  color: #DCD5C7;
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--mist);
}

.ridge-rule {
  height: 2px;
  border: 0;
  margin: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--sand) 14%, var(--butter) 50%, var(--sand) 86%, transparent);
  opacity: 0.55;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.24rem 0.78rem;
  border: 1px solid rgba(231, 178, 76, 0.3);
  border-radius: var(--radius-pill);
  background: rgba(231, 178, 76, 0.14);
  color: var(--butter);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
}

.pill--pine {
  border-color: rgba(46, 107, 98, 0.6);
  background: rgba(46, 107, 98, 0.26);
  color: #9FD8CB;
}

.pill--mist {
  border-color: var(--edge-strong);
  background: rgba(147, 163, 189, 0.12);
  color: var(--mist);
}

/* ---------------------------------------------------------
   按钮
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.68em 1.24em;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn--primary {
  background: var(--cinnabar);
  color: var(--cream);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: #D9543F;
  transform: translateY(-2px);
}

.btn--ghost {
  border-color: var(--edge-strong);
  background: rgba(29, 53, 96, 0.42);
  color: var(--cream);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--butter);
  color: var(--butter);
  transform: translateY(-2px);
}

.btn--quiet {
  padding-inline: 0.2em;
  border-radius: 4px;
  color: var(--butter);
  text-decoration: underline;
  text-decoration-color: rgba(231, 178, 76, 0.45);
  text-underline-offset: 5px;
}

.btn--quiet:hover,
.btn--quiet:focus-visible {
  text-decoration-color: var(--butter);
}

/* ---------------------------------------------------------
   面包屑
   --------------------------------------------------------- */
.crumbs {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--mist);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.crumbs li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.crumbs li + li::before {
  content: "/";
  color: var(--sand);
}

.crumbs a:hover,
.crumbs a:focus-visible {
  color: var(--butter);
}

.crumbs [aria-current="page"] {
  color: var(--cream);
}

/* ---------------------------------------------------------
   图片容器（页面阶段使用）
   --------------------------------------------------------- */
.frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  background: var(--lapis);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(14, 24, 48, 0.18), rgba(6, 10, 18, 0.8)),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(147, 163, 189, 0.14) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(147, 163, 189, 0.14) 39px 40px);
}

.frame--wide { aspect-ratio: 16 / 9; }
.frame--tall { aspect-ratio: 3 / 4; }
.frame--square { aspect-ratio: 1 / 1; }
.frame--band { aspect-ratio: 21 / 9; }

.frame__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--cream);
  background: linear-gradient(180deg, transparent, rgba(6, 10, 18, 0.9));
}

/* ---------------------------------------------------------
   页脚
   --------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 10vw, 140px);
  padding-top: clamp(48px, 7vw, 92px);
  background: var(--ink);
  color: var(--cream);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cinnabar), var(--butter) 45%, var(--pine) 78%, transparent);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(30px, 5vw, 72px);
  align-items: start;
}

.footer__kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  color: var(--butter);
}

.footer__brand {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.footer__line {
  margin-top: 14px;
  max-width: 32em;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--mist);
}

.footer__heading {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cream);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--edge);
}

.footer__list {
  display: grid;
  gap: 0;
  margin-top: 16px;
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(147, 163, 189, 0.14);
}

.footer__label {
  min-width: 46px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--mist);
}

.footer__value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--cream);
  overflow-wrap: anywhere;
}

.footer__copy {
  margin-left: auto;
  padding: 0.24rem 0.72rem;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--mist);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.footer__copy:hover,
.footer__copy:focus-visible {
  border-color: var(--butter);
  color: var(--butter);
}

.footer__copy[data-copied="true"] {
  border-color: var(--pine);
  color: #9FD8CB;
}

.footer__note {
  margin-top: 16px;
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--mist);
  max-width: 38em;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: clamp(30px, 4vw, 52px);
}

.footer__link {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--cream);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.footer__link:hover,
.footer__link:focus-visible {
  border-color: var(--butter);
  color: var(--butter);
  transform: translateY(-2px);
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: clamp(28px, 4vw, 46px);
  padding-block: 22px 28px;
  border-top: 1px solid var(--edge);
}

.footer__base-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--mist);
}

/* ---------------------------------------------------------
   滚动显现
   --------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

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

/* ---------------------------------------------------------
   平板与手机
   --------------------------------------------------------- */
@media (max-width: 959px) {
  body {
    padding-left: 0;
    padding-top: var(--mast-h);
  }

  .topbar {
    display: none;
  }

  .rail {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: var(--mast-h);
    bottom: auto;
    padding: 0 14px;
    background: rgba(6, 10, 18, 0.96);
    backdrop-filter: blur(12px);
    border-right: 0;
    border-bottom: 1px solid var(--edge);
  }

  .rail::before {
    height: 2px;
    opacity: 0.7;
  }

  .rail__brand {
    flex-direction: row;
    gap: 10px;
    padding-top: 0;
    margin-right: auto;
  }

  .rail__brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 1.05rem;
  }

  .rail__brand-text {
    writing-mode: horizontal-tb;
    font-size: 0.86rem;
    letter-spacing: 0.14em;
    color: var(--cream);
  }

  .rail__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--edge-strong);
    border-radius: 14px;
    background: rgba(29, 53, 96, 0.42);
  }

  .rail__bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 18px;
  }

  .rail__bars span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--cream);
    transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
  }

  .rail__toggle[aria-expanded="true"] .rail__bars span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .rail__toggle[aria-expanded="true"] .rail__bars span:nth-child(2) {
    opacity: 0;
  }

  .rail__toggle[aria-expanded="true"] .rail__bars span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .rail__nav {
    position: fixed;
    top: var(--mast-h);
    left: 0;
    bottom: 0;
    z-index: 8;
    flex: 0 0 auto;
    width: min(86vw, 340px);
    padding: 18px 16px 30px;
    background: var(--ink);
    border-right: 1px solid var(--edge-strong);
    border-radius: 0 26px 26px 0;
    box-shadow: 26px 0 64px -30px rgba(0, 0, 0, 0.92);
    transform: translateX(-103%);
    transition: transform 0.36s var(--ease);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .rail[data-open] .rail__nav {
    transform: translateX(0);
  }

  .rail__list {
    gap: 6px;
  }

  .rail__link {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 1rem;
    text-align: left;
  }

  .rail__link[aria-current="page"] {
    background: rgba(201, 69, 50, 0.2);
  }

  .rail__link[aria-current="page"]::before {
    left: 0;
    width: 4px;
    height: 26px;
    border-radius: 2px;
  }

  .rail__glyph {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
  }

  .rail__status {
    display: none;
  }

  .rail__scrim {
    display: block;
    position: fixed;
    top: var(--mast-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 7;
    background: rgba(6, 10, 18, 0.66);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }

  .rail[data-open] .rail__scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .lattice {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .footer__inner {
    grid-template-columns: 1fr;
  }

  #main-content {
    scroll-margin-top: calc(var(--mast-h) + 12px);
  }
}

@media (max-width: 599px) {
  body {
    font-size: 16px;
  }

  .lattice {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board {
    border-radius: 24px;
  }

  .footer__row {
    gap: 4px 10px;
  }

  .footer__copy {
    margin-left: 0;
  }
}

/* ---------------------------------------------------------
   降低动效偏好
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

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