@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

:root {
  --ink: #1f1726;
  --grape: #56228b;
  --grape-soft: #7b3fae;
  --clay: #8b4513;
  --clay-soft: #b06a35;
  --paper: #f5ede3;
  --paper-2: #ece0d2;
  --card: #fdf8f2;
  --line: #d3c2b0;
  --moss: #4a6247;
  --r: 28px;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  background-image:
    radial-gradient(60% 40% at 88% 4%, rgba(139, 69, 19, .10), transparent 70%),
    radial-gradient(50% 36% at 6% 52%, rgba(86, 34, 139, .09), transparent 72%);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: .20;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 60;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--grape);
  color: var(--paper);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: top .2s ease;
}
.skip:focus { top: 12px; }

/* ---------- 头部：小屏吸顶横排 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--paper);
  background: linear-gradient(170deg, #241a2c, var(--ink) 62%, #33201a);
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  border-radius: 999px;
  border: 1px solid rgba(245, 237, 227, .28);
}
.brand-logo { width: 24px; height: 24px; border-radius: 50%; display: block; }
.brand-txt { white-space: nowrap; }

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

.rail-nav p {
  display: flex;
  gap: 8px;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.rail-nav p::-webkit-scrollbar { display: none; }

.rail-nav a {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(245, 237, 227, .30);
  color: var(--paper);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: var(--grape);
  border-color: var(--grape-soft);
  color: #fff;
}

/* ---------- 布局骨架 ---------- */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  padding: 14px 14px 0;
}

.stage { min-width: 0; }

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  padding: 76px 22px 110px;
  color: var(--paper);
  background: radial-gradient(120% 90% at 18% 8%, #43205c, #241a2c 58%, #2f1c13);
  border-bottom-left-radius: 46% 8%;
  border-bottom-right-radius: 46% 8%;
  border-bottom: 1px solid var(--line);
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 0;
}

.hero-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .52;
  filter: saturate(.86) contrast(1.06);
  transform: translate3d(0, 0, 0) scale(1.08);
  will-change: transform;
}

.hero-fig::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 23, 38, .55), rgba(31, 23, 38, .28) 45%, rgba(31, 23, 38, .78));
}

.hero-fig figcaption {
  position: absolute;
  left: 20px;
  bottom: 64px;
  z-index: 2;
  font-size: 11px;
  letter-spacing: .24em;
  color: rgba(245, 237, 227, .72);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 24ch;
  margin-bottom: 26px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 8.4vw, 54px);
  line-height: 1.24;
  letter-spacing: -.01em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}

.hero-lede {
  margin: 18px auto 0;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.8;
  color: rgba(245, 237, 227, .84);
}

/* ---------- 正文 ---------- */

.flow {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 2px 8px;
}

.flow-head { padding: 0 4px; }

h2 {
  margin: 0 0 8px;
  font-size: clamp(20px, 5.4vw, 27px);
  line-height: 1.35;
  color: var(--ink);
}

.subtitle {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--clay);
}

.passage > section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px 20px 26px;
  margin: 0 0 20px;
  scroll-margin-top: 92px;
  transition: opacity .55s ease, transform .55s ease;
  transition-delay: var(--d, 0ms);
}

.passage > section:nth-child(2n) { border-radius: 56px var(--r) var(--r) var(--r); }
.passage > section:nth-child(3n) { border-radius: var(--r) var(--r) 56px var(--r); }
.passage > section:nth-child(4n) { border-radius: var(--r) var(--r) var(--r) 56px; }
.passage > section:last-child { margin-bottom: 0; }

.js .passage > section { opacity: 0; transform: translateY(16px); }
.js .passage > section.in { opacity: 1; transform: none; }

.passage h2,
.passage h3 {
  margin: 0 0 12px;
  line-height: 1.4;
}
.passage h2 { font-size: clamp(19px, 5vw, 24px); }
.passage h3 { font-size: 18px; color: var(--grape); }

.passage p { margin: 0 0 16px; }
.passage p:last-child { margin-bottom: 0; }

.passage ul,
.passage ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.passage li { margin-bottom: 8px; }

.passage a {
  color: var(--grape);
  text-underline-offset: 3px;
}

.passage figure {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--paper-2);
}
.passage img { display: block; width: 100%; border-radius: 18px; }
.passage figcaption {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--clay);
}

.passage blockquote {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--clay);
  border-radius: 0 18px 18px 0;
  background: var(--paper-2);
}

.passage table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin-bottom: 16px;
}
.passage th,
.passage td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

/* ---------- 侧栏 ---------- */

.rail {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px 16px 20px;
  background: var(--paper-2);
  transition: opacity .5s ease, transform .5s ease;
  transition-delay: var(--d, 0ms);
}

.js .rail li { opacity: 0; transform: translateX(10px); }
.js .rail li.in { opacity: 1; transform: none; }

.rail h2 {
  font-size: 14px;
  letter-spacing: .18em;
  color: var(--grape);
  margin: 0 0 12px;
}

.rail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.rail li { transition: opacity .4s ease, transform .4s ease; transition-delay: var(--d, 0ms); }

.rail a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.rail a:hover,
.rail a:focus-visible {
  background: var(--grape);
  border-color: var(--grape);
  color: var(--paper);
}

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

.foot {
  margin-top: 54px;
  padding: 30px 16px 18px;
  color: var(--paper);
  background: linear-gradient(200deg, #2b1f33, var(--ink) 58%, #2d1b14);
  border-top-left-radius: 44px;
  border-top-right-radius: 44px;
}

.foot-cta {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: 24px 20px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--grape), var(--clay));
  border: 1px solid rgba(245, 237, 227, .22);
}

.cta-name {
  margin: 0;
  font-size: clamp(22px, 6vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.cta-go {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(245, 237, 227, .7);
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
}
.cta-go:hover { background: rgba(245, 237, 227, .18); }

.foot-split {
  display: grid;
  gap: 26px;
  margin-top: 28px;
}

.foot-name {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .03em;
}

.foot-kw {
  margin: 0;
  max-width: 30ch;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(245, 237, 227, .68);
}

.foot-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.foot-links dl { margin: 0; }

.foot-links dt {
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--clay-soft);
  margin-bottom: 6px;
}

.foot-links dd { margin: 0; }

.foot-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 4px;
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
  color: rgba(245, 237, 227, .92);
  border-bottom: 1px dashed rgba(245, 237, 227, .22);
}
.foot-links a:hover { color: #fff; border-bottom-color: var(--clay-soft); }

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 237, 227, .16);
  font-size: 13px;
  color: rgba(245, 237, 227, .7);
}
.foot-base p { margin: 0; }

.base-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  text-decoration: none;
  border-bottom: 1px dashed rgba(245, 237, 227, .3);
}

/* ---------- 断点 ---------- */

@media (min-width: 700px) {
  .foot-split { grid-template-columns: 1fr 1.6fr; align-items: start; }
  .foot-cta { grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .passage > section { padding: 30px 28px 32px; }
  .shell { padding: 20px 20px 0; }
}

@media (min-width: 1024px) {
  body { padding-left: 264px; }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 264px;
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    padding: 28px 18px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-radius: 0 34px 34px 0;
    overflow-y: auto;
  }

  .brand { align-self: flex-start; }

  .rail-nav p {
    flex-direction: column;
    gap: 10px;
    overflow: visible;
  }

  .rail-nav a { white-space: normal; }

  .shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 30px 0;
  }

  .passage > section { scroll-margin-top: 24px; }
  .hero { border-bottom-left-radius: 40% 7%; border-bottom-right-radius: 40% 7%; }
}

@media (min-width: 1180px) {
  .shell { grid-template-columns: minmax(0, 1fr) 296px; gap: 34px; }
  .rail { position: sticky; top: 24px; align-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .passage > section,
  .js .rail li { opacity: 1; transform: none; transition: none; }
  .hero-fig img { transform: none; }
}

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