@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Crimson+Pro:wght@400;500;600;700&display=swap');

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

:root {
  --crimson: #8C1C2B;
  --cream: #F3EADC;
  --ink: #241F1C;
  --deep: #140F0D;
  --line: rgba(243, 234, 220, .15);
  --dim: rgba(243, 234, 220, .64);
  --glass: rgba(243, 234, 220, .06);
  --hot: #C4595A;
  --serif: "Crimson Pro", "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", serif;
  --sans: "Atkinson Hyperlegible", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --r: 28px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  background: var(--deep);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100%;
  font: 400 17px/1.78 var(--sans);
  color: var(--cream);
  overflow-x: hidden;
  background:
    radial-gradient(1100px 720px at 78% -12%, rgba(140, 28, 43, .42), transparent 62%),
    radial-gradient(880px 620px at 4% 24%, rgba(140, 28, 43, .16), transparent 60%),
    linear-gradient(180deg, #1A1412 0%, var(--ink) 44%, #110D0B 100%);
  -webkit-font-smoothing: antialiased;
}

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  padding: 12px 18px; border-radius: 0 0 14px 0;
  background: var(--crimson); color: var(--cream); text-decoration: none; font-size: 16px;
}
.skip:focus { left: 0; }

/* ---------- 顶栏 ---------- */
.top {
  position: sticky; top: 0; z-index: 80;
  background: linear-gradient(180deg, rgba(20, 15, 13, .94), rgba(20, 15, 13, .6));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 1220px; margin: 0 auto;
  padding: 10px clamp(12px, 3vw, 28px);
}
.brand {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--glass); color: var(--cream);
  text-decoration: none; overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.brand:hover { transform: translateY(-1px); border-color: rgba(243, 234, 220, .45); }
.brand img { width: 100%; height: 100%; object-fit: cover; }
.mark-glyph {
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  color: var(--cream); line-height: 1;
}

.find { flex: 1 1 auto; display: flex; justify-content: flex-end; margin: 0; }
.find input {
  width: min(260px, 52vw); height: 44px; padding: 0 16px;
  border-radius: 22px; border: 1px solid var(--line);
  background: rgba(243, 234, 220, .05); color: var(--cream);
  font: 400 16px/1 var(--sans);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.find input::placeholder { color: rgba(243, 234, 220, .45); }
.find input:focus {
  outline: none; border-color: var(--crimson);
  box-shadow: 0 0 0 3px rgba(140, 28, 43, .35);
}

.strip { position: relative; max-width: 1220px; margin: 0 auto; padding: 0 clamp(8px, 3vw, 20px); }
.strip ul {
  display: flex; gap: 6px; margin: 0; padding: 2px 0 10px;
  list-style: none; overflow-x: auto; scrollbar-width: none;
}
.strip ul::-webkit-scrollbar { display: none; }
.strip li { flex: 0 0 auto; }
.strip li.off { display: none; }
.strip a {
  display: flex; align-items: center; min-height: 44px;
  padding: 11px 14px; border-radius: 14px;
  border: 1px solid transparent; color: var(--dim);
  font-size: 16px; white-space: nowrap; text-decoration: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.strip a:hover { color: var(--cream); background: var(--glass); border-color: var(--line); }
.strip a[aria-current] {
  color: var(--cream); background: rgba(140, 28, 43, .34);
  border-color: rgba(243, 234, 220, .28);
}
.bar {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 2px;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--crimson), #D9765F);
  will-change: transform;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: 70vh; display: grid; place-items: center;
  overflow: hidden;
  padding: clamp(30px, 7vw, 76px) 20px clamp(48px, 9vw, 92px);
  perspective: 900px;
  border-bottom: 1px solid var(--line);
}
.layers { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.layer {
  position: absolute; inset: -14% -10%;
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}
.l1 { background: radial-gradient(58% 58% at 26% 34%, rgba(140, 28, 43, .62), transparent 70%); }
.l2 { background: radial-gradient(52% 52% at 78% 22%, rgba(217, 118, 95, .3), transparent 68%); }
.l3 {
  opacity: .5;
  background: repeating-linear-gradient(115deg, rgba(243, 234, 220, .06) 0 2px, transparent 2px 12px);
}
.word {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, calc(-50% + var(--py, 0px)));
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(56px, 19vw, 224px); line-height: .86; letter-spacing: .06em;
  color: rgba(243, 234, 220, .075); white-space: nowrap;
  will-change: transform;
}
.hero-in {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(14px, 3vw, 24px); text-align: center;
}
.hero-mark {
  display: grid; place-items: center;
  width: 72px; height: 72px; border-radius: 24px;
  border: 1px solid rgba(243, 234, 220, .28);
  background: rgba(243, 234, 220, .09);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.hero-mark img { width: 100%; height: 100%; object-fit: cover; }
.hero-mark .mark-glyph { font-size: 30px; }
.hero h1 {
  margin: 0; max-width: 16ch;
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 6.6vw, 68px); line-height: 1.16; letter-spacing: .04em;
  text-shadow: 0 22px 60px rgba(0, 0, 0, .6);
}
.hero-img {
  width: min(760px, 100%); height: auto; margin-top: 6px;
  border-radius: var(--r); border: 1px solid var(--line);
}
.cue {
  position: absolute; left: 50%; bottom: 20px; z-index: 2;
  width: 1px; height: 42px;
  background: linear-gradient(180deg, transparent, rgba(243, 234, 220, .6));
}

/* ---------- 舞台 ---------- */
.stage-sec { padding: clamp(26px, 5vw, 62px) clamp(12px, 3.4vw, 30px) clamp(40px, 7vw, 84px); }
.stage {
  max-width: 1220px; margin: 0 auto;
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(20px, 3.5vw, 48px); align-items: start;
}

.rail {
  position: sticky; top: 118px;
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.rail h2 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.35; }
.rail .subtitle { margin: 0; font-size: 16px; line-height: 1.7; color: var(--dim); }
.rail-nav ol {
  counter-reset: s; list-style: none;
  margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px;
}
.rail-nav li { counter-increment: s; }
.rail-nav a {
  display: flex; align-items: baseline; gap: 10px;
  min-height: 40px; padding: 8px 0; font-size: 16px;
  color: var(--dim); text-decoration: none;
  border-bottom: 1px dashed rgba(243, 234, 220, .12);
  transition: color .2s ease, transform .2s ease;
}
.rail-nav a::before {
  content: counter(s, decimal-leading-zero);
  font-family: var(--serif); font-size: 13px; color: var(--hot);
}
.rail-nav a:hover { color: var(--cream); transform: translateX(3px); }
.to-top {
  align-self: flex-start; display: inline-flex; align-items: center;
  min-height: 40px; padding: 6px 15px; border-radius: 20px;
  border: 1px solid var(--line); background: rgba(140, 28, 43, .28);
  color: var(--cream); font-size: 16px; text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}
.to-top:hover { background: rgba(140, 28, 43, .52); transform: translateY(-1px); }

/* ---------- 正文 ---------- */
.prose { min-width: 0; font-size: 17.5px; line-height: 1.86; }
.prose > div {
  position: relative;
  padding: clamp(22px, 4vw, 44px);
  margin: 0 0 clamp(22px, 4vw, 40px);
  border-radius: var(--r); border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  box-shadow: 0 24px 60px -42px #000;
  scroll-margin-top: 124px;
}
.prose > div::after {
  content: ""; position: absolute; top: 0;
  left: clamp(22px, 4vw, 44px); right: clamp(22px, 4vw, 44px); height: 1px;
  background: linear-gradient(90deg, rgba(140, 28, 43, .95), transparent);
}
.prose h2 {
  margin: 0 0 18px;
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(23px, 3.2vw, 36px); line-height: 1.3; letter-spacing: .02em;
}
.prose h2::before {
  content: ""; display: inline-block; width: 8px; height: .82em;
  margin-right: 14px; border-radius: 4px; vertical-align: -.05em;
  background: linear-gradient(180deg, var(--hot), var(--crimson));
}
.prose h3 {
  margin: 26px 0 10px; font-family: var(--serif);
  font-size: 20px; font-weight: 600; color: #F8F0E5;
}
.prose p { margin: 0 0 16px; color: rgba(243, 234, 220, .87); }
.prose > div > :last-child { margin-bottom: 0; }
.prose .subtitle {
  margin: -8px 0 18px; color: var(--dim);
  font-family: var(--serif); font-style: italic; font-size: 18px;
}
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.3em; }
.prose li { margin: 8px 0; }
.prose li::marker { color: var(--hot); }
.prose a {
  color: #F0C9A8; text-underline-offset: 4px;
  text-decoration-color: rgba(240, 201, 168, .5);
}
.prose a:hover { color: #fff; text-decoration-color: #fff; }
.prose strong { color: #fff; }
.prose img {
  max-width: 100%; height: auto; margin: 6px 0 18px;
  border-radius: 20px; border: 1px solid var(--line);
}
.prose blockquote {
  margin: 18px 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--crimson);
  color: var(--dim); font-family: var(--serif); font-size: 19px;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.prose pre { overflow-x: auto; padding: 14px; border-radius: 14px; background: rgba(0, 0, 0, .34); }
.prose code {
  font-size: .95em; padding: 1px 6px; border-radius: 6px;
  background: rgba(243, 234, 220, .1);
}
.prose pre code { background: none; padding: 0; }

/* ---------- 页脚 ---------- */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 26px;
  padding: 26px clamp(12px, 3.4vw, 30px) 34px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 15, 13, .35), #100C0A);
}
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--glass);
  text-decoration: none; color: var(--cream); overflow: hidden;
}
.foot-brand img { width: 100%; height: 100%; object-fit: cover; }
.foot-brand .mark-glyph { font-size: 20px; }
.foot-brand b { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .04em; }
.foot-nav { order: 2; flex: 1 1 320px; min-width: 0; }
.foot-nav dl { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; padding: 0; }
.foot-nav dt { margin: 0; }
.foot-nav dd { display: none; }
.foot-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 4px;
  color: var(--dim); font-size: 16px; text-decoration: none;
  transition: color .2s ease;
}
.foot-nav a:hover { color: var(--cream); }
.foot-legal { order: 3; }
.foot-legal p { margin: 0; font-size: 16px; color: rgba(243, 234, 220, .5); }

/* ---------- 动效 ---------- */
@keyframes rise {
  from { opacity: .001; transform: translateY(30px) scale(.986); }
  to { opacity: 1; transform: none; }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .prose > div {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 6% cover 26%;
    }
  }
}

@media (prefers-reduced-motion: no-preference) {
  .rail-nav li { animation: slide-in .5s both; }
  .rail-nav li:nth-child(2) { animation-delay: .05s; }
  .rail-nav li:nth-child(3) { animation-delay: .1s; }
  .rail-nav li:nth-child(4) { animation-delay: .15s; }
  .rail-nav li:nth-child(5) { animation-delay: .2s; }
  .rail-nav li:nth-child(6) { animation-delay: .25s; }
  .rail-nav li:nth-child(7) { animation-delay: .3s; }
  .prose > div { transition: box-shadow .3s ease, border-color .3s ease; }
  .prose > div:hover { border-color: rgba(243, 234, 220, .28); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .prose > div { animation: none; opacity: 1; transform: none; }
  .rail-nav li { animation: none; }
  .layer, .word { will-change: auto; }
}

/* ---------- 断点 ---------- */
@media (max-width: 960px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; order: -1; padding: 20px; }
  .rail-nav ol { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; }
  .rail-nav a { border-bottom: 0; padding: 6px 0; }
  .prose > div { scroll-margin-top: 116px; }
}

@media (max-width: 620px) {
  .find input { width: min(150px, 42vw); padding: 0 12px; }
  .strip a { padding: 10px 12px; }
  .hero { min-height: 70vh; }
  .prose { font-size: 17px; }
  .foot { justify-content: flex-start; }
  .foot-legal { order: 4; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
