@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

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

:root {
  --ink: #1f1726;
  --violet: #56228b;
  --brown: #8b4513;
  --cream: #f4ede3;
  --paper: #fffcf7;
  --mute: #6a6076;
  --line: rgba(31, 23, 38, .12);
  --soft: 0 16px 38px -24px rgba(31, 23, 38, .6);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

body {
  margin: 0;
  padding-bottom: 6.75rem;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38vw 32vw at 10% 2%, rgba(86, 34, 139, .20), transparent 70%),
    radial-gradient(34vw 30vw at 90% 16%, rgba(139, 69, 19, .17), transparent 72%),
    radial-gradient(46vw 38vw at 72% 94%, rgba(86, 34, 139, .14), transparent 70%),
    repeating-linear-gradient(115deg, rgba(31, 23, 38, .026) 0 2px, transparent 2px 7px);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 骨架 ---------- */

.page {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  max-width: 74rem;
  margin: 0 auto;
  padding: 0 1.25rem 1rem;
}

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

.hero {
  grid-column: 1 / -1;
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 3.5rem 1rem 2rem;
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 58% 42% 54% 46% / 48% 56% 44% 52%;
  filter: blur(1px);
}

.hero::before {
  width: clamp(11rem, 26vw, 18rem);
  height: clamp(9rem, 20vw, 14rem);
  left: 2%; top: 12%;
  background: radial-gradient(circle at 35% 30%, rgba(86, 34, 139, .28), rgba(86, 34, 139, .05) 70%);
  border-radius: 62% 38% 46% 54% / 42% 52% 48% 58%;
}

.hero::after {
  width: clamp(9rem, 22vw, 15rem);
  height: clamp(8rem, 18vw, 12rem);
  right: 3%; bottom: 6%;
  background: radial-gradient(circle at 60% 60%, rgba(139, 69, 19, .26), rgba(139, 69, 19, .04) 70%);
  border-radius: 40% 60% 58% 42% / 56% 44% 56% 44%;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.35rem, 8.6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.025em;
  max-width: 18ch;
}

.lead {
  margin: 1rem 0 0;
  max-width: 44ch;
  color: var(--mute);
  font-size: 1.0625rem;
}

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

.rail {
  position: sticky;
  top: 1.25rem;
  padding: 1rem;
  border-radius: 22px 26px 20px 24px;
  background: rgba(255, 252, 247, .82);
  border: 1px solid var(--line);
  box-shadow: var(--soft);
  backdrop-filter: blur(6px);
}

.rail-t {
  margin: 0 0 .75rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--brown);
}

.rail-t span { display: inline-block; padding-bottom: .1rem; border-bottom: 2px solid rgba(139, 69, 19, .28); }

.rail-list {
  display: grid;
  gap: .35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: .35rem .7rem;
  border-radius: 14px;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
  background: rgba(86, 34, 139, .07);
}

.rail-list a:hover,
.rail-list a:focus-visible {
  background: var(--violet);
  color: #fdf8ff;
}

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

.doc { min-width: 0; }

.doc > section {
  margin: 0 0 1.5rem;
  padding: clamp(1.25rem, 3.2vw, 2.35rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--soft);
  scroll-margin-top: 1.25rem;
}

.doc > section:nth-child(2n) { border-radius: 18px 26px 22px 20px / 22px 20px 26px 18px; }
.doc > section:nth-child(3n) { border-radius: 26px 20px 24px 18px / 20px 24px 18px 26px; }

.doc > section > h2,
.doc > section h2 {
  margin: 0 0 .85rem;
  font-size: clamp(1.4rem, 3.4vw, 1.95rem);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -.01em;
}

.doc > section h2 span,
.doc > section h3 span {
  display: inline;
  padding: 0 .12em .06em;
  border-radius: 8px;
  background: linear-gradient(transparent 64%, rgba(86, 34, 139, .16) 64%);
}

.doc h3 {
  margin: 1.4rem 0 .5rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.doc p,
.doc li { max-width: 68ch; }

.doc p { margin: 0 0 1rem; }

.doc > section > p:last-child,
.doc > section > ul:last-child { margin-bottom: 0; }

.doc ul, .doc ol { padding-left: 1.25rem; }

.doc li { margin-bottom: .4rem; }

.doc a { color: var(--violet); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.doc img {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  display: block;
  margin: 1rem 0;
}

.doc blockquote {
  margin: 1rem 0;
  padding: .85rem 1.1rem;
  border-left: 4px solid rgba(139, 69, 19, .45);
  border-radius: 0 16px 16px 0;
  background: rgba(139, 69, 19, .07);
}

.doc blockquote p:last-child { margin-bottom: 0; }

.doc strong { font-weight: 700; }

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

.foot {
  display: grid;
  grid-template-columns: 1.05fr 1.35fr 1.05fr .85fr;
  gap: 1.75rem;
  align-items: start;
  max-width: 74rem;
  margin: 2.5rem auto 0;
  padding: 2.25rem 1.5rem 2.5rem;
  border-radius: 28px 28px 0 0;
  color: #f0e7dd;
  background:
    radial-gradient(30rem 16rem at 82% 0%, rgba(139, 69, 19, .5), transparent 70%),
    linear-gradient(165deg, #2a1e36, #1f1726 58%, #221a16);
}

.f-brand { min-width: 0; }

.f-logo {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
}

.f-logo .mark,
.brand-link .mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, .12);
}

.f-t {
  margin: 0 0 .7rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: rgba(240, 231, 221, .8);
}

.f-t span {
  display: inline-block;
  padding-bottom: .18rem;
  border-bottom: 1px solid rgba(240, 231, 221, .3);
}

.f-nav dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .15rem .9rem;
  margin: 0;
}

.f-nav dd { display: none; }

.f-nav dt a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: #f0e7dd;
  font-size: 1rem;
  text-decoration: none;
  padding: .3rem 0;
}

.f-nav dt a:hover,
.f-nav dt a:focus-visible { color: #d9b8ff; }

.sub { display: flex; flex-direction: column; gap: .5rem; }

.sub input {
  width: 100%;
  min-height: 44px;
  padding: .6rem .95rem;
  border-radius: 999px;
  border: 1px solid rgba(240, 231, 221, .28);
  background: rgba(255, 255, 255, .09);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
}

.sub input::placeholder { color: rgba(240, 231, 221, .6); }

.sub input:focus-visible { outline: 2px solid #d9b8ff; outline-offset: 2px; }

.sub button {
  min-height: 44px;
  padding: .6rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.sub button:hover { background: #6c30ab; }

.copy {
  margin: 0;
  align-self: end;
  font-size: 1rem;
  color: rgba(240, 231, 221, .72);
}

/* ---------- 底部胶囊导航 ---------- */

.topbar {
  position: fixed;
  left: .75rem;
  right: .75rem;
  bottom: .75rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(31, 23, 38, .95);
  box-shadow: 0 22px 44px -22px rgba(31, 23, 38, .95);
  backdrop-filter: blur(10px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex: 0 0 auto;
  min-height: 44px;
  padding: .4rem .8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.pills {
  display: flex;
  gap: .35rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

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

.pills a {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #efe4f8;
  font-size: 1rem;
  white-space: nowrap;
  text-decoration: none;
}

.pills a:hover,
.pills a:focus-visible { background: var(--violet); color: #fff; }

/* ---------- 揭示动效 ---------- */

.rv {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity .6s cubic-bezier(.2, .7, .3, 1),
    transform .6s cubic-bezier(.2, .7, .3, 1);
  transition-delay: calc(var(--i, 0) * 60ms);
}

.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
}

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

@media (max-width: 900px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding: 0 1rem 1rem;
  }

  .hero { min-height: 40vh; padding: 2.75rem .5rem 1.5rem; }
  .hero::before, .hero::after { opacity: .8; }

  .rail { position: static; padding: .8rem; border-radius: 20px; }

  .rail-t { margin-bottom: .55rem; }

  .rail-list {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .rail-list::-webkit-scrollbar { display: none; }

  .rail-list li { flex: 0 0 auto; }

  .rail-list a { white-space: nowrap; background: #fff; border: 1px solid var(--line); }

  .foot {
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem;
    padding: 2rem 1.1rem 2.25rem;
    border-radius: 24px 24px 0 0;
  }

  .copy { grid-column: 1 / -1; align-self: start; }

  .brand-link span:not(.mark) { font-size: 1rem; }
}

@media (max-width: 420px) {
  .f-nav dl { grid-template-columns: 1fr; }
  .pages { padding: 0 .85rem 1rem; }
}

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