@import url('https://fonts.googleapis.com/css2?family=Cormorant+Infant:wght@300;400;500;600;700&family=Great+VIbes&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Infant:wght@300;400;500;600;700&family=Great+Vibes&display=swap');
:root {
  --red: #E4576F;
  --red-d: #C33E56;
  --red-s: #F7D6DE;
  --cream: #FDF3EE;
  --cream-d: #F7E7DE;
  --ink: #33232B;
  --ink-s: #5C4A53;
  --line: #E7D2C9;
  --serif: 'Cormorant Infant', Georgia, 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', serif;
  --script: 'Great Vibes', 'Cormorant Infant', Georgia, 'Songti SC', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, sans-serif;
  --pad: clamp(16px, 4vw, 48px);
  --rail-h: 50px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--rail-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
svg { display: block; }
a { color: inherit; text-decoration: none; }
figure { margin: 0; }
button { font-family: inherit; }

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

/* ---------- 顶部 ---------- */
.top {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "navl brand navr";
  align-items: center;
  gap: 8px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 6px var(--pad);
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  padding: 0 10px;
  font-family: var(--script);
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  line-height: 1;
  color: var(--ink);
  letter-spacing: .02em;
  transition: color .16s ease;
}
.brand:hover { color: var(--red-d); }
.brand-mark { flex: 0 0 auto; }

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.2vw, 16px);
}
.top-nav.left { grid-area: navl; justify-content: flex-end; }
.top-nav.right { grid-area: navr; justify-content: flex-start; }

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  font-size: .98rem;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}
.top-nav a:hover { color: var(--red-d); border-bottom-color: var(--red); }

.menu-btn {
  display: none;
  grid-area: menu;
  min-height: 44px;
  padding: 0 14px;
  font-size: 1rem;
  color: var(--cream);
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

/* ---------- 粘性锚点条 ---------- */
.rail {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--red);
  border-bottom: 2px solid var(--ink);
}
.rail ul {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0 max(8px, calc(var(--pad) - 28px));
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.rail ul::-webkit-scrollbar { height: 0; }
.rail li { flex: 0 0 auto; }
.rail a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: var(--rail-h);
  padding: 0 11px;
  color: #fff;
  font-size: .94rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: background .16s ease, border-color .16s ease;
}
.rail a::before {
  content: "";
  width: 5px;
  height: 5px;
  background: #fff;
  flex: 0 0 auto;
}
.rail a:hover { background: var(--red-d); border-bottom-color: var(--ink); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(14px, 3vw, 28px);
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) var(--pad) 0;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  scroll-margin-top: calc(var(--rail-h) + 12px);
}

.hero-top {
  position: relative;
  z-index: 2;
  text-align: right;
}

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 6.6vw, 4.4rem);
  line-height: 1.07;
  letter-spacing: .01em;
  text-wrap: balance;
}

.hero-ghost {
  position: absolute;
  right: -.04em;
  top: 26%;
  z-index: 0;
  font-family: var(--script);
  font-size: clamp(84px, 23vw, 280px);
  line-height: .8;
  color: var(--red-s);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.hero-fig {
  position: relative;
  z-index: 1;
  align-self: end;
  min-height: 130px;
  background: var(--red-s);
  border-bottom: 5px solid var(--red);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}
.hero-img {
  width: 100%;
  height: 100%;
  max-height: 52svh;
  object-fit: cover;
}

/* ---------- 正文区 ---------- */
.doc {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 52px);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) var(--pad);
  scroll-margin-top: calc(var(--rail-h) + 12px);
}

.side {
  align-self: start;
  position: sticky;
  top: calc(var(--rail-h) + 14px);
  border-top: 2px solid var(--ink);
  padding-top: 12px;
}
.side small {
  display: block;
  font-size: .78rem;
  letter-spacing: .2em;
  color: var(--red-d);
  margin-bottom: 2px;
}
.side h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.34rem;
  letter-spacing: .06em;
  line-height: 1.3;
}
.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: sd;
}
.side-list li { counter-increment: sd; }
.side-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 5px 10px;
  font-size: .95rem;
  line-height: 1.4;
  border-bottom: 2px solid var(--line);
  border-radius: 10px;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.side-list a::before {
  content: counter(sd, decimal-leading-zero);
  font-family: var(--serif);
  font-size: .9rem;
  font-weight: 600;
  color: var(--red);
  flex: 0 0 auto;
}
.side-list a:hover {
  background: #fff;
  color: var(--red-d);
  border-bottom-color: var(--red);
}

.prose {
  max-width: 70ch;
  font-size: 1.0625rem;
  line-height: 1.85;
}
.prose > section {
  scroll-margin-top: calc(var(--rail-h) + 16px);
  padding: clamp(24px, 4vw, 44px) 0;
  border-top: 1px solid var(--line);
}
.prose > section:first-child { border-top: 0; padding-top: 0; }

.prose small {
  display: block;
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .2em;
  color: var(--red-d);
  margin-bottom: 6px;
}

.prose h2 {
  margin: 0 0 .6em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 3.2vw, 2.3rem);
  line-height: 1.22;
  letter-spacing: .01em;
}

.prose h3 {
  margin: 1.6em 0 .5em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.3;
}

.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose a {
  color: var(--red-d);
  border-bottom: 1px solid currentColor;
  transition: color .16s ease;
}
.prose a:hover { color: var(--ink); }
.prose strong { font-weight: 700; }

.prose figure,
.prose aside {
  margin: 1.4em 0;
  padding: 14px 16px;
  background: var(--cream-d);
  border-bottom: 4px solid var(--red);
  border-radius: 10px;
}
.prose figure:empty { min-height: 90px; }
.prose img { border-radius: 4px; }

.prose blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--red);
  color: var(--ink-s);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: .98rem;
}
.prose th, .prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.prose th { background: var(--red-s); font-weight: 700; }

/* ---------- 页脚 ---------- */
.foot {
  display: grid;
  grid-template-columns: 1.1fr 1fr .9fr;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(28px, 5vw, 56px) var(--pad) 24px;
  background: var(--ink);
  color: var(--cream);
  border-top: 3px solid var(--red);
}

.foot-big {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(2rem, 6.4vw, 3.8rem);
  line-height: 1;
  color: var(--red);
  word-break: break-word;
}

.foot dl { margin: 0; }
.foot dt {
  font-size: .78rem;
  letter-spacing: .2em;
  color: var(--red-s);
  margin-bottom: 4px;
}
.foot dd { margin: 0; }
.foot dd a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  border-bottom: 1px solid rgba(253, 243, 238, .18);
  transition: color .16s ease, border-color .16s ease;
}
.foot dd a:hover { color: var(--red); border-bottom-color: var(--red); }

.foot-legal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.copy { margin: 0; font-size: .95rem; color: var(--red-s); }

.to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 44px;
  padding: 0 18px;
  font-size: .95rem;
  color: var(--cream);
  border: 1px solid rgba(253, 243, 238, .4);
  border-radius: 10px;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.to-top:hover { background: var(--red); border-color: var(--red); }

/* ---------- 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .45s ease;
}
.reveal.is-in { opacity: 1; transform: none; }

.side-list li.is-stag {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .32s ease, transform .32s ease;
}
.side-list li.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .side-list li.is-stag {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * { transition-duration: .01ms !important; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .top-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand menu"
      "navl navl"
      "navr navr";
    gap: 0 10px;
  }
  .brand { justify-content: flex-start; }
  .menu-btn { display: block; align-self: center; }

  .top-nav { display: none; flex-direction: column; align-items: stretch; gap: 0; }
  .top-inner.is-open .top-nav { display: flex; }
  .top-nav.left, .top-nav.right { justify-content: flex-start; }
  .top-nav a {
    min-height: 46px;
    padding: 0 2px;
    border-bottom: 1px solid var(--line);
  }
  .top-nav a:hover { border-bottom-color: var(--line); }

  .hero { min-height: 0; padding-top: 22px; }
  .hero-title { font-size: clamp(1.85rem, 8vw, 2.6rem); }
  .hero-ghost { top: 40%; font-size: clamp(70px, 26vw, 140px); }
  .hero-fig { min-height: 96px; }
  .hero-img { max-height: 34svh; }

  .doc { grid-template-columns: 1fr; }
  .side { position: static; top: auto; padding-bottom: 4px; }
  .side-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .side-list::-webkit-scrollbar { height: 0; }
  .side-list li { flex: 0 0 auto; }
  .side-list a {
    min-width: max-content;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    padding: 6px 12px;
  }

  .foot {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .foot dd a { justify-content: center; }
  .foot-big { font-size: clamp(2.4rem, 12vw, 3.2rem); }
}

@media (max-width: 400px) {
  body { font-size: 16px; }
  .prose { font-size: 1rem; }
}

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