:root {
  --ink-950: #06121F;
  --ink-900: #0A1A2B;
  --ink-800: #10263D;
  --mist-100: #E8F1F5;
  --mist-300: #B8C9D4;
  --steel-500: #7F98AA;
  --cyan-400: #30E0D0;
  --cyan-300: #7FF4E7;
  --amber-400: #F2B45E;
  --amber-300: #FFD39A;
  --line: #28465E;
  --rail: 88px;
  --head-h: 64px;
  --font-display: "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", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ink-950);
}

body {
  margin: 0;
  padding: 0;
  background: var(--ink-950);
  color: var(--mist-300);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-nav-open { overflow: hidden; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: 0.04em;
  color: var(--mist-100);
}

h1 { font-size: clamp(2.4rem, 5vw, 4.6rem); line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.45rem); }
h4 { font-size: 1rem; letter-spacing: 0.08em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--cyan-400); text-decoration: none; }
a:hover { color: var(--cyan-300); }

ul, ol { margin: 0; padding: 0; }
img, svg { max-width: 100%; }

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

::selection { background: rgba(48, 224, 208, 0.28); color: var(--mist-100); }

:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 布局基座 ---------- */

.wrap {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

.site-main { display: block; min-height: 60vh; }

#main-content { scroll-margin-top: 88px; }

.meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--steel-500);
  text-transform: uppercase;
}

.prose { max-width: 68ch; }
.prose p { font-size: 17px; line-height: 1.85; }

/* ---------- 跳过链接 ---------- */

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 12px 22px;
  background: var(--cyan-400);
  color: var(--ink-950);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 2px;
  transform: translateY(-220%);
  transition: transform 0.22s var(--ease);
  pointer-events: auto;
}

.skip-link:focus { transform: translateY(0); color: var(--ink-950); }

/* ---------- 头部 / 侧边轨道 ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 90;
  background: linear-gradient(180deg, #081624 0%, var(--ink-950) 62%);
  border-right: 1px solid var(--line);
}

.site-header::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: -1px;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(48, 224, 208, 0.5) 18%, rgba(48, 224, 208, 0.1) 58%, transparent 100%);
  pointer-events: none;
}

.runway { display: none; }

.site-rail {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.rail__brand {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 24px 8px 20px;
  border-bottom: 1px solid rgba(40, 70, 94, 0.6);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--mist-100);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--cyan-400);
  background: rgba(48, 224, 208, 0.07);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(48, 224, 208, 0.12);
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease), color 0.22s var(--ease);
}

.brand:hover .brand__mark,
.brand:focus-visible .brand__mark {
  border-color: var(--cyan-400);
  color: var(--cyan-300);
  box-shadow: 0 0 20px rgba(48, 224, 208, 0.24);
}

.brand__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.brand__name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--mist-100);
  line-height: 1.2;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--steel-500);
  line-height: 1.2;
}

.rail__nav {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0;
  scrollbar-width: none;
}

.rail__nav::-webkit-scrollbar { display: none; }

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin: auto 0;
}

.nav-list__item { width: 100%; }

.nav-link {
  position: relative;
  display: block;
  width: 100%;
  padding-inline: 15px;
  padding-block: 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.12em;
  color: var(--mist-300);
  text-decoration: none;
  transition: color 0.22s var(--ease), background-color 0.22s var(--ease);
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--cyan-400);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.26s var(--ease);
}

.nav-link:hover {
  color: var(--mist-100);
  background: rgba(48, 224, 208, 0.05);
}

.nav-link:hover::before { transform: scaleY(1); }

.nav-link[aria-current="page"] {
  color: var(--cyan-300);
  background: rgba(48, 224, 208, 0.08);
}
.nav-link[aria-current="page"]::before { transform: scaleY(1); }

.rail__foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 10px 24px;
  border-top: 1px solid rgba(40, 70, 94, 0.6);
}

.rail__domain {
  display: none;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--steel-500);
}

.nav-quick {
  list-style: none;
  display: grid;
  gap: 7px;
  width: 100%;
}

.quick-link {
  display: block;
  padding: 9px 3px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: #1A1205;
  background: var(--amber-400);
  border: 1px solid var(--amber-400);
  border-radius: 2px;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.nav-quick li + li .quick-link {
  background: transparent;
  color: var(--amber-300);
  border-color: rgba(242, 180, 94, 0.5);
}

.quick-link:hover {
  background: var(--amber-300);
  border-color: var(--amber-300);
  color: #1A1205;
}

.nav-quick li + li .quick-link:hover {
  background: rgba(242, 180, 94, 0.16);
  border-color: var(--amber-300);
  color: var(--amber-300);
}

/* ---------- 移动端顶部栏与抽屉开关 ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--head-h);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: rgba(6, 18, 31, 0.94);
  border-bottom: 1px solid var(--line);
  pointer-events: auto;
}

.brand--compact { flex-direction: row; align-items: center; gap: 10px; }
.brand--compact .brand__text { align-items: flex-start; gap: 2px; }
.brand--compact .brand__name { font-size: 14px; letter-spacing: 0.14em; }
.brand--compact .brand__sub { font-size: 10px; }
.brand--compact .brand__mark { width: 32px; height: 32px; font-size: 15px; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--mist-100);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-toggle:hover { border-color: var(--cyan-400); color: var(--cyan-300); }

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 13px;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform-origin: center;
  transition: transform 0.24s var(--ease), opacity 0.16s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(5.75px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-5.75px) rotate(-45deg); }
.nav-toggle[aria-expanded="true"] { border-color: var(--cyan-400); color: var(--cyan-300); }

/* ---------- 页脚 ---------- */

.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 112px);
  padding-block: clamp(48px, 6vw, 84px) 36px;
  background: linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 100%);
  border-top: 1px solid var(--line);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: clamp(120px, 18vw, 260px);
  height: 1px;
  background: var(--cyan-400);
  box-shadow: 0 0 14px rgba(48, 224, 208, 0.6);
}

.footer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 72px) clamp(32px, 5vw, 72px);
  align-items: start;
}

.footer-lede { min-width: 0; }

.footer-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--cyan-400);
}

.footer-kicker::before {
  content: "";
  flex: 0 0 auto;
  width: 28px;
  height: 1px;
  background: var(--cyan-400);
}

.footer-summary {
  margin: 0;
  max-width: 44ch;
  font-size: 16px;
  line-height: 1.9;
  color: var(--mist-300);
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  min-width: 0;
}

.footer-col { min-width: 0; }

.footer-col__title {
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--steel-500);
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 12px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 15px;
  color: var(--mist-300);
  text-decoration: none;
  transition: color 0.2s var(--ease), gap 0.22s var(--ease);
}

.footer-link::before {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  background: var(--cyan-400);
  transition: width 0.24s var(--ease);
}

.footer-link:hover,
.footer-link:focus-visible { color: var(--cyan-300); gap: 10px; }
.footer-link:hover::before,
.footer-link:focus-visible::before { width: 14px; }

.footer-contact {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.contact-item { min-width: 0; }

.contact-item__label {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--steel-500);
}

.contact-item__value {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--mist-100);
  overflow-wrap: anywhere;
}

.contact-item__value--mono {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--cyan-300);
}

.contact-item__note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--steel-500);
}

.footer-base {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-copy,
.footer-icp {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--steel-500);
}

.footer-legal {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-left: auto;
}

.footer-legal__link {
  font-size: 12.5px;
  color: var(--steel-500);
  transition: color 0.2s var(--ease);
}

.footer-legal__link:hover,
.footer-legal__link:focus-visible { color: var(--cyan-300); }

/* ---------- 通用按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--mist-100);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover { transform: translateY(-1px); }

.btn--amber {
  background: var(--amber-400);
  border-color: var(--amber-400);
  color: #1A1205;
}
.btn--amber:hover {
  background: var(--amber-300);
  border-color: var(--amber-300);
  color: #1A1205;
}

.btn--cyan {
  background: var(--cyan-400);
  border-color: var(--cyan-400);
  color: var(--ink-950);
}
.btn--cyan:hover {
  background: var(--cyan-300);
  border-color: var(--cyan-300);
  color: var(--ink-950);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--mist-100);
}
.btn--ghost:hover {
  border-color: var(--cyan-400);
  color: var(--cyan-300);
  background: rgba(48, 224, 208, 0.06);
}

/* ---------- 章节开场 / 标签 ---------- */

.sec-head {
  display: grid;
  gap: 14px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.sec-index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--cyan-400);
}

.sec-title {
  margin: 0;
  max-width: 26ch;
}

.sec-lead {
  margin: 0;
  max-width: 60ch;
  font-size: 17px;
  line-height: 1.85;
  color: var(--mist-300);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--mist-300);
  background: rgba(16, 38, 61, 0.5);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.tag:hover { border-color: var(--cyan-400); color: var(--cyan-300); }

/* ---------- 网格 ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.grid--5-7 > *:nth-child(1) { grid-column: span 5; }
.grid--5-7 > *:nth-child(2) { grid-column: span 7; }
.grid--4-8 > *:nth-child(1) { grid-column: span 4; }
.grid--4-8 > *:nth-child(2) { grid-column: span 8; }
.grid--3-9 > *:nth-child(1) { grid-column: span 3; }
.grid--3-9 > *:nth-child(2) { grid-column: span 9; }

/* ---------- 图片容器基础规则 ---------- */

.media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(40, 70, 94, 0.35) 0 1px, transparent 1px 14px),
    linear-gradient(135deg, var(--ink-800) 0%, var(--ink-900) 100%);
  border: 1px solid var(--line);
}

.media img,
.media svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1 / 1; }

/* ---------- 筛选条 ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--mist-300);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.filter-btn:hover { border-color: var(--cyan-400); color: var(--cyan-300); }

.filter-btn[aria-pressed="true"] {
  background: rgba(48, 224, 208, 0.12);
  border-color: var(--cyan-400);
  color: var(--cyan-300);
}

.filter-status {
  margin: 0 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--steel-500);
}

/* ---------- 显现动效 ---------- */

.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
}

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

/* ---------- 桌面端主体偏移 ---------- */

@media (min-width: 1024px) {
  body { padding-left: var(--rail); }
  .topbar { display: none; }
  #main-content { scroll-margin-top: 32px; }
}

/* ---------- 平板与移动端 ---------- */

@media (max-width: 1023px) {
  body { padding-top: var(--head-h); }

  .site-header {
    position: fixed;
    inset: 0;
    width: auto;
    border: 0;
    background: transparent;
    pointer-events: none;
    z-index: 90;
  }

  .site-header::after { display: none; }

  .site-rail {
    position: fixed;
    top: var(--head-h);
    left: 0;
    bottom: 0;
    width: min(84vw, 340px);
    height: auto;
    padding: 24px 22px 32px;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: linear-gradient(180deg, #0B1E31 0%, var(--ink-950) 78%);
    border-right: 1px solid var(--line);
    box-shadow: 28px 0 64px rgba(0, 0, 0, 0.5);
    transform: translateX(-104%);
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    transition: transform 0.32s var(--ease), visibility 0.32s var(--ease);
  }

  .site-rail[data-open] {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .rail__brand {
    justify-content: flex-start;
    padding: 0 0 20px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }

  .brand { flex-direction: row; align-items: center; gap: 12px; }
  .brand__text { align-items: flex-start; }
  .brand__name { font-size: 15px; letter-spacing: 0.14em; }
  .brand__sub { font-size: 10.5px; }

  .rail__nav {
    flex: 0 0 auto;
    display: block;
    padding: 8px 0 0;
    overflow: visible;
  }

  .nav-list { gap: 0; width: 100%; margin: 0; }

  .nav-link {
    writing-mode: horizontal-tb;
    text-orientation: initial;
    width: 100%;
    padding: 14px 4px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    border-bottom: 1px solid rgba(40, 70, 94, 0.55);
  }

  .nav-link::before { display: none; }

  .nav-link[aria-current="page"] {
    background: rgba(48, 224, 208, 0.08);
    color: var(--cyan-300);
    box-shadow: inset 2px 0 0 var(--cyan-400);
  }

  .rail__foot {
    margin-top: 22px;
    padding: 18px 0 0;
    align-items: stretch;
    border-top: 1px solid var(--line);
  }

  .rail__domain { display: block; margin-bottom: 4px; }

  .nav-quick { grid-template-columns: 1fr 1fr; gap: 10px; }

  .quick-link { padding: 12px 8px; font-size: 13px; letter-spacing: 0.04em; }

  .footer-contact { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 900px) {
  .footer-shell { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .footer-summary { max-width: none; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }

  .footer-cols { gap: 28px; }
  .footer-actions .btn { flex: 1 1 auto; }
  .footer-legal { margin-left: 0; }

  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid--5-7 > *,
  .grid--4-8 > *,
  .grid--3-9 > * { grid-column: span 6; }

  .filter-status { margin-left: 0; flex-basis: 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;
  }

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

  .btn:hover { transform: none; }
  .site-rail { transition: none; }
}
