@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700&family=Barlow:wght@300;400;600&display=swap');

:root {
  --ink: #14100E;
  --amber: #E4703A;
  --cream: #F2E8DC;
  --line: rgba(242, 232, 220, .14);
  --rail: 238px;
  --head: "Barlow Condensed", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --body: "Barlow", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  padding-left: var(--rail);
  overflow-x: clip;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
  letter-spacing: .012em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 86% -8%, rgba(228, 112, 58, .18), transparent 62%),
    radial-gradient(900px 480px at -6% 104%, rgba(228, 112, 58, .1), transparent 68%);
}

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

a { color: inherit; }

/* ---------- 左侧固定竖栏 ---------- */
.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 30;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px 22px;
  overflow-y: auto;
  background: rgba(15, 12, 10, .84);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid rgba(228, 112, 58, .5);
  border-radius: 4px;
  color: var(--amber);
  background: rgba(228, 112, 58, .08);
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.mark:hover { background: var(--amber); color: #171210; transform: translateY(-2px); }
.mark svg { width: 22px; height: 22px; }
.mark-img { width: 26px; height: 26px; object-fit: contain; border-radius: 3px; }

.rail nav { flex: 1 1 auto; min-height: 0; }

.rail nav > ol,
.rail nav ol ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail nav ol ol {
  margin: 2px 0 8px 10px;
  padding-left: 10px;
  border-left: 1px dashed rgba(242, 232, 220, .2);
}

.rail nav ol ol li a { font-size: 15px; }

.rail a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: rgba(242, 232, 220, .82);
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
  transition: background .22s ease, color .22s ease, border-color .22s ease, transform .22s ease;
}

.rail a:hover,
.rail a:focus-visible,
.rail a.on {
  color: #171210;
  background: var(--amber);
  border-color: var(--amber);
  transform: translateX(2px);
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 4px;
  background: var(--amber);
  color: #171210;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .1em;
  text-decoration: none;
  transition: background .22s ease, color .22s ease, transform .22s ease;
}
.cta:hover { background: var(--cream); color: #171210; transform: translateY(-2px); }

/* ---------- 首屏 ---------- */
.hero {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100svh;
  min-height: 600px;
  margin-left: calc(var(--rail) * -1);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg span {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(140px, 27vw, 360px);
  line-height: .78;
  letter-spacing: -.02em;
  white-space: nowrap;
  color: rgba(242, 232, 220, .055);
  will-change: transform;
}

.hero-media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 56%;
  z-index: 2;
  overflow: hidden;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--ink) 4%, rgba(20, 16, 14, .55) 46%, rgba(20, 16, 14, .35));
}

.hero-media-flat {
  background:
    radial-gradient(70% 70% at 70% 30%, rgba(228, 112, 58, .35), transparent 70%),
    repeating-linear-gradient(115deg, rgba(242, 232, 220, .07) 0 2px, transparent 2px 16px);
}

.hero-img {
  position: absolute;
  inset: -8% 0;
  width: 100%;
  height: 116%;
  object-fit: cover;
  will-change: transform;
}

.hero-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 0 clamp(20px, 4vw, 64px) clamp(48px, 10vh, 104px) calc(var(--rail) + clamp(20px, 4vw, 56px));
}

.hero-copy { max-width: 36ch; }

.hero-copy h1 {
  margin: 0;
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.16;
  letter-spacing: .012em;
  text-wrap: balance;
}

.hero-rule {
  width: 66px;
  height: 2px;
  margin: 20px 0;
  border: 0;
  background: var(--amber);
}

.hero-desc {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.7;
  color: rgba(242, 232, 220, .74);
}

/* ---------- 正文区 ---------- */
main {
  position: relative;
  z-index: 2;
  background: var(--ink);
  border-top: 1px solid var(--line);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 56px);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: clamp(26px, 4vw, 64px);
  align-items: start;
  padding: clamp(38px, 7vw, 96px) 0 clamp(20px, 4vw, 48px);
}

.prose {
  min-width: 0;
  max-width: 68ch;
  counter-reset: chap;
}

.prose > section {
  position: relative;
  counter-increment: chap;
  margin: 0 0 clamp(20px, 3vw, 34px);
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(242, 232, 220, .06), rgba(242, 232, 220, .018));
  backdrop-filter: blur(7px);
  scroll-margin-top: 44px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}

.prose > section.is-in { opacity: 1; transform: none; }

html:not(.js) .prose > section { opacity: 1; transform: none; }

.prose > section::before {
  content: counter(chap, decimal-leading-zero);
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: var(--head);
  font-size: 13px;
  letter-spacing: .24em;
  color: rgba(228, 112, 58, .66);
}

.prose > section:hover { border-color: rgba(228, 112, 58, .34); }

.prose h2 {
  margin: .1em 0 .55em;
  font-family: var(--head);
  font-weight: 600;
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.34;
  letter-spacing: .015em;
}

.prose h3 {
  margin: 1.5em 0 .45em;
  font-size: 19px;
  line-height: 1.5;
  color: #fff;
}

.prose hr {
  height: 1px;
  border: 0;
  margin: 0 0 20px;
  background: linear-gradient(90deg, rgba(228, 112, 58, .85), rgba(242, 232, 220, .06));
}

.prose p { margin: 0 0 1.05em; color: rgba(242, 232, 220, .87); }

.prose ul,
.prose ol { margin: 0 0 1.1em; padding-left: 1.25em; }
.prose li { margin-bottom: .45em; color: rgba(242, 232, 220, .87); }
.prose li::marker { color: var(--amber); }

.prose a { color: var(--amber); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--cream); }

.prose strong { color: #fff; font-weight: 600; }

.prose blockquote {
  margin: 0 0 1.1em;
  padding: 13px 20px;
  border-left: 2px solid var(--amber);
  background: rgba(228, 112, 58, .07);
  color: rgba(242, 232, 220, .82);
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* ---------- 右侧栏 ---------- */
.rail-aside {
  position: sticky;
  top: 28px;
  padding: 18px 18px 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(242, 232, 220, .055);
  backdrop-filter: blur(10px);
}

.rail-aside h2 {
  margin: 0;
  font-family: var(--head);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .26em;
  color: var(--amber);
}

.rail-aside hr {
  height: 1px;
  border: 0;
  margin: 12px 0 14px;
  background: linear-gradient(90deg, var(--amber), transparent);
}

.toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.toc a {
  display: block;
  padding: 7px 5px;
  border-radius: 3px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(242, 232, 220, .72);
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

.toc a:hover,
.toc a.on { color: var(--amber); background: rgba(228, 112, 58, .12); }

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 2;
  margin-top: clamp(36px, 6vw, 76px);
  padding: clamp(38px, 6vw, 72px) clamp(18px, 4vw, 56px) 26px;
  background: #120e0b;
  border-top: 1px solid var(--line);
}

.foot-brand {
  margin: 0 0 26px;
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(46px, 9vw, 128px);
  line-height: .88;
  letter-spacing: .01em;
  color: rgba(242, 232, 220, .13);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.foot dl { margin: 0; }
.foot dt {
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: .22em;
  color: var(--amber);
}
.foot dd { margin: 0 0 5px; font-size: 15px; line-height: 1.55; color: rgba(242, 232, 220, .76); }
.foot dd a { text-decoration: none; color: var(--cream); padding: 4px 0; display: inline-block; }
.foot dd a:hover { color: var(--amber); }

.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: rgba(242, 232, 220, .55);
}
.foot-base p { margin: 0; }
.foot-base a { color: var(--amber); text-decoration: none; padding: 6px 0; }
.foot-base a:hover { color: var(--cream); }

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  body { padding-left: 0; font-size: 16px; }

  .rail {
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .mark { width: 40px; height: 40px; }
  .rail nav { flex: 1 1 auto; overflow-x: auto; }
  .rail nav > ol { flex-direction: row; align-items: center; gap: 4px; }
  .rail nav ol ol { flex-direction: row; margin: 0; padding: 0; border-left: 0; gap: 4px; }
  .has-sub { display: flex; align-items: center; gap: 4px; }
  .rail a { min-height: 42px; padding: 9px 12px; white-space: nowrap; font-size: 15px; }
  .rail a:hover { transform: none; }
  .cta { margin-top: 0; min-height: 44px; font-size: 15px; letter-spacing: .04em; padding: 9px 14px; }

  .hero {
    position: relative;
    height: auto;
    min-height: 0;
    margin-left: 0;
    display: block;
    padding-top: 68px;
  }

  .hero-bg { align-items: flex-start; inset: 60px 0 auto 0; height: 46vh; }
  .hero-bg span { font-size: 27vw; }

  .hero-media {
    position: relative;
    inset: auto;
    width: 100%;
    height: 40svh;
    margin-top: 18px;
  }
  .hero-media::after { background: linear-gradient(180deg, rgba(20, 16, 14, .55), transparent 45%, var(--ink)); }
  .hero-img { inset: 0; height: 100%; }

  .hero-inner { padding: 26px 16px 30px; }
  .hero-copy { max-width: none; }

  .wrap { padding: 0 16px; }
  .stage { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 26px 0 12px; }
  .prose { max-width: none; }
  .prose > section { scroll-margin-top: 78px; padding: 20px 18px; }
  .prose > section::before { top: 10px; right: 12px; }

  .rail-aside { position: static; order: 2; }

  .foot-cols { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .foot-base { flex-direction: column; }
}

@media (max-width: 420px) {
  .hero-copy h1 { font-size: 30px; }
  .foot dd { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .prose > section { transition: none; opacity: 1; transform: none; }
  .hero-img,
  .hero-bg span { transform: none !important; }
  .mark:hover,
  .cta:hover,
  .rail a:hover { transform: none; }
}

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