@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400&family=Playfair+Display:ital@1&display=swap');

:root {
  --violet: #56228b;
  --violet-deep: #421a6d;
  --clay: #8b4513;
  --clay-deep: #6f370f;
  --ink: #1f1726;
  --paper: #f7f2e8;
  --card: #fffdf8;
  --edge: #ded2c1;
  --muted: #5d5266;
  --rail: 158px;
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 18% 10%, rgba(139, 69, 19, 0.09), transparent 44%),
    radial-gradient(circle at 84% 4%, rgba(86, 34, 139, 0.10), transparent 46%);
  color: var(--ink);
  font-family: Inter, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.72;
}

/* 左侧竖排栏 */
.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 14px 22px;
  background: #fdf9f1;
  border-right: 1px solid var(--edge);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--violet), #7a3ab0);
  color: #fdf9f1;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  border-radius: 60% 40% 52% 48% / 46% 54% 46% 54%;
  transition: border-radius 0.5s ease, transform 0.35s ease;
}

.brand:hover .brand-mark {
  border-radius: 46% 54% 40% 60% / 56% 44% 56% 44%;
  transform: rotate(-6deg);
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

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

.rail-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 999px;
  border: 1px solid #e6dccd;
  background: #f3ebe0;
  color: #3a2f45;
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: var(--violet);
  border-color: var(--violet);
  color: #fdf9f1;
  transform: translateX(2px);
}

.rail-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff8ee;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.25s, transform 0.25s;
}

.rail-cta:hover { background: var(--clay-deep); transform: translateY(-2px); }

/* 主体两列 */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 52px;
  align-items: start;
  max-width: 1180px;
  margin-left: var(--rail);
  padding: 36px 40px 72px;
}

article { min-width: 0; }

/* 首屏 */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 24px 0 46px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
}

.hero-copy { flex: 1 1 auto; min-width: 0; }

.hero-title {
  margin: 0 0 18px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(38px, 5.2vw, 74px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.hero-lede {
  margin: 0 0 26px;
  max-width: 44ch;
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
}

.hero-jump {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--violet);
  color: #fdf9f1;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s, background 0.25s;
}

.hero-jump:hover { transform: translateY(-2px); background: var(--violet-deep); }

.hero-art { flex: 0 0 140px; }

.hero-bloom {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border: 1px solid var(--edge);
  background: #fff;
  border-radius: 58% 42% 46% 54% / 52% 48% 52% 48%;
}

.hero-blob {
  display: block;
  width: 140px;
  height: 140px;
  border: 1px solid var(--edge);
  border-radius: 58% 42% 46% 54% / 52% 48% 52% 48%;
  background: linear-gradient(150deg, #e8ddf6, #f3e4d4 60%, #dcc7ae);
}

.hero-ghost {
  position: absolute;
  right: 0;
  bottom: -4px;
  z-index: 1;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(52px, 8.4vw, 120px);
  line-height: 1;
  color: rgba(86, 34, 139, 0.13);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

/* 正文区（page.content 的 section 直接落在 article 下） */
article > section:not(.hero) {
  position: relative;
  margin: 0 0 34px;
  padding: 30px 28px 34px;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 24px 18px 26px 16px;
  scroll-margin-top: 30px;
  transition: border-color 0.3s;
}

article > section:not(.hero):hover { border-color: #c3aed9; }

article > section :where(h2, h3) {
  margin: 0 0 14px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(25px, 2.6vw, 34px);
  line-height: 1.22;
  color: var(--violet);
}

article > section :where(h3) {
  font-size: clamp(21px, 2vw, 26px);
  color: var(--clay);
}

article > section :where(h2, h3) > span {
  background-image: linear-gradient(rgba(139, 69, 19, 0.38), rgba(139, 69, 19, 0.38));
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 100%;
  padding-bottom: 4px;
}

article p { margin: 0 0 1.05em; max-width: 70ch; }

article a {
  color: var(--violet);
  text-decoration: underline;
  text-underline-offset: 3px;
}

article a:hover { color: var(--clay); }

article ul,
article ol { padding-left: 1.3em; max-width: 70ch; }

article li { margin: 0.35em 0; }

article img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--edge);
  border-radius: 18px;
}

article figure { margin: 1.2em 0; }

article figcaption { margin-top: 8px; font-size: 16px; color: var(--muted); }

article blockquote {
  margin: 1.2em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--clay);
  border-radius: 0 16px 16px 0;
  background: #f8f1e6;
  color: #4b3f36;
}

article table { width: 100%; border-collapse: collapse; font-size: 16px; }

article th,
article td { padding: 10px 8px; border-bottom: 1px solid var(--edge); text-align: left; }

/* 右侧目录 */
.side {
  position: sticky;
  top: 30px;
  align-self: start;
  padding-left: 22px;
  border-left: 1px solid var(--edge);
}

.side h2 {
  margin: 0 0 14px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.03em;
  color: var(--clay);
}

.side h2 > span {
  border-bottom: 1px dashed rgba(139, 69, 19, 0.45);
  padding-bottom: 3px;
}

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

.side li { counter-increment: toc; }

.side a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 2px;
  font-size: 16px;
  line-height: 1.35;
  color: #4a3d55;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.side a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: #a58cbb;
}

.side a:hover { color: var(--violet); border-bottom-color: #b8a3cb; }

/* 页脚 */
footer {
  margin-left: var(--rail);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  padding: 56px 40px 22px;
  background-color: #1f1726;
  background-image:
    radial-gradient(circle at 12% 6%, rgba(139, 69, 19, 0.34), transparent 46%),
    radial-gradient(circle at 88% 0%, rgba(86, 34, 139, 0.52), transparent 54%);
  color: #efe6da;
  border-radius: 48px 48px 0 0;
}

footer h2 {
  margin: 0 0 18px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
  color: #f6ede1;
}

footer h2 > span {
  border-bottom: 1px solid rgba(203, 182, 230, 0.5);
  padding-bottom: 6px;
}

.foot-cta-btn {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff7ec;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s, background 0.25s;
}

.foot-cta-btn:hover { transform: translateY(-2px); background: #a2551a; }

.foot-links h2 { font-size: 20px; color: #cbb6e6; }

.foot-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.foot-links a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 0;
  color: #d9cbee;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(239, 230, 218, 0.12);
}

.foot-links a:hover { color: #fff; }

.foot-base {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(239, 230, 218, 0.18);
  font-size: 16px;
  color: #bcaecb;
}

.foot-base p { margin: 0; }

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(239, 230, 218, 0.3);
  border-radius: 999px;
  color: #efe6da;
  text-decoration: none;
}

.foot-base a:hover { background: rgba(239, 230, 218, 0.12); }

/* 入场动画基类 */
.will-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.will-in.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .will-in { opacity: 1 !important; transform: none !important; transition: none !important; }
  .brand-mark,
  .rail-nav a,
  .rail-cta,
  .hero-jump,
  .foot-cta-btn { transition: none; }
}

@media (max-width: 960px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding: 26px 24px 56px;
  }

  .hero { min-height: auto; }

  .side {
    position: static;
    padding: 18px 0 0;
    border-left: 0;
    border-top: 1px solid var(--edge);
  }
}

@media (max-width: 720px) {
  :root { --rail: 0px; }

  .rail {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--edge);
  }

  .brand { flex: 0 0 auto; gap: 8px; min-height: 42px; }

  .brand-mark { flex: 0 0 38px; width: 38px; height: 38px; font-size: 19px; }

  .brand-name { display: none; }

  .rail-nav { flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; }

  .rail-nav ul { flex-direction: row; gap: 8px; }

  .rail-nav a {
    min-height: 42px;
    padding: 8px 14px;
    white-space: nowrap;
    border-radius: 999px;
  }

  .rail-cta {
    flex: 0 0 auto;
    margin-top: 0;
    min-height: 42px;
    padding: 8px 14px;
    font-size: 15px;
    white-space: nowrap;
  }

  main { padding: 18px 16px 48px; }

  .hero { padding: 10px 0 26px; }

  .hero-inner { gap: 16px; align-items: flex-start; }

  .hero-title { font-size: clamp(34px, 9.6vw, 46px); margin-bottom: 14px; }

  .hero-lede { font-size: 17px; margin-bottom: 20px; }

  .hero-art { flex: 0 0 84px; }

  .hero-bloom,
  .hero-blob { width: 84px; height: 84px; }

  .hero-ghost { font-size: 54px; bottom: -2px; }

  article > section:not(.hero) {
    padding: 22px 16px 26px;
    margin-bottom: 24px;
    scroll-margin-top: 78px;
    border-radius: 20px 16px 22px 14px;
  }

  footer {
    margin-left: 0;
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 36px 18px 18px;
    border-radius: 32px 32px 0 0;
  }
}

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