@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,500;0,700;1,300;1,500&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
  --ink: #26171a;
  --ink-soft: #553a40;
  --rose: #eb879c;
  --peach: #ffb6c1;
  --paper: #fdf5f2;
  --card: #fffbf9;
  --line: #efd8d6;
  --rail: 268px;
  --serif: "Crimson Pro", "Cormorant Garamond", "Songti SC", "Noto Serif SC", "SimSun", serif;
  --display: "Cormorant Garamond", "Crimson Pro", "Songti SC", "Noto Serif SC", serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding-left: var(--rail);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.72;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(120% 80% at 100% 0, #fff1ee 0, rgba(255, 241, 238, 0) 62%),
    linear-gradient(180deg, #fdf5f2 0, #fbeef1 58%, #fdf7f4 100%);
}

img { max-width: 100%; height: auto; }
a { color: #a63d57; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; border-radius: 8px; }

/* 左侧固定书脊导航 */
.site-head {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px 20px 28px;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff8f6, #fff3f2);
  border-right: 1px solid var(--line);
}

.brandrow { display: block; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--peach), var(--rose));
  color: #fffaf8; font-size: 20px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(38, 23, 26, 0.12);
}
.brand-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; display: block; }
.brand-text { font-family: var(--display); font-size: 1.32rem; font-weight: 700; letter-spacing: 0.05em; }

.find { display: flex; gap: 6px; margin: 0; }
.find input {
  flex: 1 1 auto; min-width: 0; min-height: 42px;
  padding: 8px 12px;
  font: inherit; font-size: 0.94rem; color: var(--ink);
  background: #fffdfb; border: 1px solid var(--line); border-radius: 9px;
  transition: border-color 0.22s ease;
}
.find input::placeholder { color: #9a7d82; }
.find input:focus { border-color: var(--rose); }
.find button {
  flex: 0 0 auto; min-height: 42px; padding: 0 12px;
  font: inherit; font-size: 0.9rem; color: var(--ink);
  background: #ffe7ea; border: 1px solid #f3c9ce; border-radius: 9px;
  cursor: pointer; transition: background 0.22s ease;
}
.find button:hover { background: #ffd8dd; }

.site-nav p { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.navlink {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 7px 10px;
  border-radius: 9px;
  color: var(--ink); text-decoration: none; font-size: 1rem;
  transition: background 0.22s ease, color 0.22s ease;
}
.navlink .tick {
  flex: 0 0 auto; width: 7px; height: 7px;
  border: 2px solid var(--rose); border-radius: 50%;
  transition: background 0.22s ease;
}
.navlink:hover { background: #ffeef1; }
.navlink:hover .tick { background: var(--rose); }

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(30px, 6vw, 62px) clamp(20px, 4.5vw, 56px) clamp(44px, 7vw, 70px);
  border-radius: 0 0 60px 60px / 0 0 44px 44px;
  background: linear-gradient(122deg, #ffe1e5, #ffd8c8 58%, #fff0f1);
}
.hero-ghost {
  position: absolute;
  top: -0.14em; left: 0.08em;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(72px, 13vw, 164px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.66);
  pointer-events: none;
  user-select: none;
}
.hero-art { position: absolute; inset: 0; z-index: 0; }
.hero-art img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; opacity: 0.92;
  transform: scale(1.06);
  will-change: transform;
}
.hero-art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(95deg, rgba(255, 241, 240, 0.94), rgba(255, 238, 236, 0.58) 48%, rgba(255, 236, 232, 0.14));
}
.hero h1 {
  position: relative; z-index: 2;
  margin: 0 0 0.34em;
  max-width: 19ch;
  font-family: var(--display);
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  font-weight: 700; line-height: 1.22; letter-spacing: 0.01em;
}
.hero-desc {
  position: relative; z-index: 2;
  margin: 0; max-width: 46ch;
  font-size: 1rem; color: var(--ink-soft);
}

/* 正文与侧栏 */
.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  align-items: start;
  gap: clamp(20px, 3vw, 42px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(26px, 4vw, 48px) clamp(16px, 4vw, 42px) 56px;
}

.sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(18px, 3vw, 34px);
}
.sheet > section { animation: rise 0.46s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.sheet > section + section {
  margin-top: 26px; padding-top: 24px;
  border-top: 1px dashed #f0d9d7;
}
.sheet > section:nth-child(2) { animation-delay: 0.06s; }
.sheet > section:nth-child(3) { animation-delay: 0.12s; }
.sheet > section:nth-child(4) { animation-delay: 0.18s; }
.sheet > section:nth-child(5) { animation-delay: 0.24s; }
.sheet > section:nth-child(6) { animation-delay: 0.3s; }
.sheet > section:nth-child(7) { animation-delay: 0.36s; }

.sheet section[id] { scroll-margin-top: 30px; }

.sheet h2, .sheet h3 {
  font-family: var(--display);
  font-weight: 700; line-height: 1.4;
  margin: 0.1em 0 0.62em;
}
.sheet h2 { font-size: clamp(1.34rem, 2.6vw, 1.86rem); }
.sheet h3 { font-size: clamp(1.14rem, 2vw, 1.4rem); }
.sheet h2 > span, .sheet h3 > span { position: relative; display: inline-block; }
.sheet h2 > span::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -0.16em;
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--rose), rgba(235, 135, 156, 0));
}
.sheet p { margin: 0 0 1.05em; max-width: 66ch; }
.sheet ul, .sheet ol { margin: 0 0 1.1em; padding-left: 1.3em; max-width: 66ch; }
.sheet li { margin: 0.32em 0; }
.sheet figure { margin: 1.4em 0; }
.sheet figure img { border-radius: 10px; display: block; }
.sheet blockquote {
  margin: 1.4em 0; padding: 12px 18px;
  background: #fff5f5; border-left: 3px solid var(--rose);
  border-radius: 0 10px 10px 0;
}
.sheet table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.sheet th, .sheet td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.sheet code { font-size: 0.94em; }

.rail {
  position: sticky;
  top: 26px;
  padding: 16px 14px;
  background: #fff9f8;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.rail-title { margin: 0 0 10px; font-size: 1rem; font-weight: 600; letter-spacing: 0.16em; font-family: var(--display); }
.rail-title span { display: inline-block; padding-bottom: 4px; border-bottom: 2px solid var(--peach); }
.toc { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.toc a {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px;
  border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 0.95rem;
  transition: background 0.2s ease;
}
.toc a:hover { background: #ffeef1; }
.toc em { font-style: normal; font-size: 0.78rem; letter-spacing: 0.1em; color: #b4687a; }

/* 页脚 */
footer { margin-top: clamp(24px, 4vw, 46px); }
.foot-cta {
  padding: clamp(34px, 6vw, 58px) 20px;
  text-align: center;
  border-radius: 36px 36px 0 0;
  background: linear-gradient(115deg, #eb879c, #ffb6c1 70%, #ffd0c6);
}
.cta-title { margin: 0; font-size: 1rem; letter-spacing: 0.06em; }
.cta-title span { display: inline-block; }
.cta-title a {
  display: inline-block;
  padding: 12px 30px;
  font-family: var(--display);
  font-size: clamp(1.24rem, 3.4vw, 1.82rem);
  font-weight: 700; letter-spacing: 0.04em;
  color: #2b161b; text-decoration: none;
  border: 1px solid rgba(38, 23, 26, 0.35);
  border-radius: 999px;
  transition: background 0.24s ease, transform 0.24s ease;
}
.cta-title a:hover { background: rgba(255, 255, 255, 0.5); transform: translateY(-2px); }
.foot-base { padding: 18px 16px; text-align: center; background: #2a181c; color: #f6e5e3; font-size: 0.9rem; }
.copy { margin: 0; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1000px) {
  .wrap { grid-template-columns: minmax(0, 1fr); padding-bottom: 40px; }
  .rail { position: static; order: 2; }
}

@media (max-width: 900px) {
  body { padding-left: 0; }
  .site-head {
    position: sticky;
    inset: auto;
    top: 0;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 8px;
    padding: 10px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: #fff8f6;
  }
  .brand-mark, .brand-logo { width: 34px; height: 34px; }
  .brand-text { font-size: 1.12rem; }
  .find { flex: 1 1 130px; }
  .find input, .find button { min-height: 40px; }
  .site-nav { flex: 1 1 100%; order: 3; margin: 0 -14px; padding: 0 14px 2px; overflow-x: auto; }
  .site-nav p { flex-direction: row; gap: 6px; }
  .navlink {
    min-height: 42px; padding: 8px 12px;
    font-size: 0.92rem; white-space: nowrap;
    border: 1px solid var(--line); border-radius: 999px;
  }
  .hero { min-height: auto; padding: 32px 20px 40px; border-radius: 0 0 32px 32px / 0 0 26px 26px; }
  .hero-ghost { font-size: clamp(54px, 17vw, 96px); opacity: 0.84; }
  .sheet { padding: 18px 16px; }
  .sheet section[id] { scroll-margin-top: 118px; }
  .foot-cta { border-radius: 24px 24px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

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