@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
  --rose: #eb879c;
  --blush: #ffb6c1;
  --ink: #26171a;
  --ink-2: #4a3238;
  --muted: #6f525b;
  --paper: #fff8f9;
  --paper-2: #fdeef1;
  --card: #fffdfd;
  --line: #f0d6dc;
  --dock: 208px;
  --r: 10px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  overflow-wrap: break-word;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(38, 23, 26, 0.055) 1px, transparent 0.7px);
  background-size: 5px 5px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; }

:where(a, summary):focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- 左侧固定竖排 ---------- */
.dock {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--dock);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.15rem 0.9rem 1.5rem;
  background: linear-gradient(178deg, #fff5f7 0%, #fde9ee 62%, #fbe0e7 100%);
  border-right: 1px solid var(--line);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.8), 8px 0 26px -22px rgba(38, 23, 26, 0.55);
  overflow-y: auto;
}

.mark {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(148deg, #ffdde4, #f3a2b4);
  color: #3a1f26;
  text-decoration: none;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(38, 23, 26, 0.14), 0 7px 16px -9px rgba(38, 23, 26, 0.6);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.mark:hover { transform: translateY(-2px); }

.mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* ---------- details / summary / menu ---------- */
.drawer { display: block; }

.drawer__btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fffdfd;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.22s ease;
}

.drawer__btn::-webkit-details-marker { display: none; }

.drawer__btn::before {
  content: '';
  width: 15px;
  height: 2px;
  flex: none;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor;
  margin: 0 0.1rem;
}

.drawer__btn:hover { background: var(--paper-2); }

.drawer__menu {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
}

.drawer__menu li { min-width: 0; }

.drawer__menu a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  padding: 0.45rem 0.55rem;
  border-radius: var(--r);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.5;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.drawer__menu a::before {
  content: '';
  width: 8px;
  height: 8px;
  flex: none;
  border: 2px solid var(--rose);
  transform: rotate(45deg);
  border-radius: 1px;
  transition: background 0.22s ease;
}

.drawer__menu a:hover {
  background: #fffdfd;
  color: var(--ink);
  transform: translateX(2px);
}

.drawer__menu a:hover::before { background: var(--rose); }

/* ---------- 主区 ---------- */
.page {
  position: relative;
  z-index: 1;
  margin-left: var(--dock);
  max-width: 1220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 2rem;
  align-items: start;
  padding: 1.75rem clamp(1rem, 3vw, 2.25rem) 2.5rem;
}

.article { min-width: 0; }

.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  text-align: center;
  padding: 2.75rem 1.25rem 3.5rem;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(165deg, #2c1a1f 0%, #4a2730 46%, #7c3e4e 100%);
  color: #fff4f6;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 46px), 0 100%);
}

.hero::before {
  content: '';
  position: absolute;
  left: -14%;
  width: 128%;
  height: 92px;
  top: 58%;
  transform: rotate(-5.5deg);
  background: linear-gradient(92deg, rgba(235, 135, 156, 0.9), rgba(255, 182, 193, 0.16));
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  background: linear-gradient(100deg, var(--blush), var(--rose) 72%);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  z-index: 2;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 44rem;
}

.hero__title {
  margin: 0;
  font-family: 'Playfair Display', 'Songti SC', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.85rem, 4.4vw, 3rem);
  line-height: 1.16;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.hero__lead {
  margin: 1rem auto 0;
  max-width: 33rem;
  font-size: 17px;
  line-height: 1.72;
  color: #ffdde4;
}

.hero__media {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  place-items: center;
  margin-top: 1.5rem;
}

.hero__media img,
.hero__img {
  display: block;
  width: auto;
  max-width: min(100%, 30rem);
  max-height: 32vh;
  object-fit: cover;
  border-radius: var(--r);
  border: 1px solid rgba(255, 244, 246, 0.35);
}

/* ---------- 正文容器 ---------- */
.content {
  margin-top: 1.75rem;
  padding: clamp(1.05rem, 2.6vw, 2.15rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-width: 0;
}

.content > div[id] { scroll-margin-top: 1.25rem; }

.content > div + div {
  margin-top: 2.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.content :where(p, ul, ol) { margin: 0 0 1.05em; }
.content :where(ul, ol) { padding-left: 1.35em; }
.content :where(p, ul, ol, figure, blockquote):last-child { margin-bottom: 0; }

.content :where(h2, h3, h4) {
  font-family: 'Playfair Display', 'Songti SC', Georgia, serif;
  font-weight: 600;
  line-height: 1.32;
  color: var(--ink);
  margin: 1.85em 0 0.65em;
}

.content h2 { font-size: clamp(1.35rem, 2.4vw, 1.68rem); }
.content h3 { font-size: clamp(1.13rem, 1.8vw, 1.3rem); }
.content :where(h2, h3, h4):first-child { margin-top: 0; }

.content :where(h2, h3, h4) > span {
  background-image: linear-gradient(transparent 64%, rgba(255, 182, 193, 0.8) 64%);
  background-repeat: no-repeat;
  padding-bottom: 0.12em;
}

.content a { color: #a3395a; text-underline-offset: 2px; }
.content img { max-width: 100%; height: auto; border-radius: var(--r); }
.content strong { font-weight: 600; }
.content blockquote {
  margin: 1.25em 0;
  padding: 0.25em 0 0.25em 1rem;
  border-left: 3px solid var(--blush);
  color: var(--ink-2);
}

/* ---------- 右侧边栏 ---------- */
.rail {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.rail__title {
  margin: 0 0 0.55rem;
  font-family: 'Playfair Display', 'Songti SC', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.rail__title > span {
  background-image: linear-gradient(transparent 62%, var(--blush) 62%);
  padding-bottom: 0.1em;
}

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

.rail__list a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
  transition: background 0.22s ease, transform 0.22s ease, color 0.22s ease;
}

.rail__list a::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--rose);
  transition: transform 0.22s ease;
}

.rail__list a:hover {
  background: var(--paper-2);
  color: var(--ink);
  transform: translateX(3px);
}

.rail__list a:hover::before { transform: scale(1.6); }

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 1;
  margin-left: var(--dock);
  padding: 1.6rem clamp(1rem, 3vw, 2.25rem) 2.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 16px;
  color: var(--muted);
}

.foot p { margin: 0; }

.foot__brand {
  font-family: 'Playfair Display', 'Songti SC', Georgia, serif;
  font-size: 1.05rem;
  color: var(--ink);
}

.foot small { font-size: 16px; }

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: none; }
  }

  .drawer__menu li,
  .rail__list li {
    animation: rise 0.28s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }

  .drawer__menu li:nth-child(1) { animation-delay: 0.03s; }
  .drawer__menu li:nth-child(2) { animation-delay: 0.06s; }
  .drawer__menu li:nth-child(3) { animation-delay: 0.09s; }
  .drawer__menu li:nth-child(4) { animation-delay: 0.12s; }
  .drawer__menu li:nth-child(5) { animation-delay: 0.15s; }
  .drawer__menu li:nth-child(6) { animation-delay: 0.18s; }
  .drawer__menu li:nth-child(7) { animation-delay: 0.21s; }

  .rail__list li:nth-child(1) { animation-delay: 0.08s; }
  .rail__list li:nth-child(2) { animation-delay: 0.12s; }
  .rail__list li:nth-child(3) { animation-delay: 0.16s; }
  .rail__list li:nth-child(4) { animation-delay: 0.2s; }
  .rail__list li:nth-child(5) { animation-delay: 0.24s; }
  .rail__list li:nth-child(6) { animation-delay: 0.28s; }
  .rail__list li:nth-child(7) { animation-delay: 0.32s; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .dock {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 24px -20px rgba(38, 23, 26, 0.6);
    z-index: 60;
  }

  .mark { width: 40px; height: 40px; font-size: 19px; }

  .drawer {
    margin-left: auto;
    position: relative;
  }

  .drawer__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    margin-top: 0;
    width: min(18rem, calc(100vw - 1.7rem));
    padding: 0.45rem;
    background: #fffdfd;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(38, 23, 26, 0.06), 0 20px 40px -20px rgba(38, 23, 26, 0.5);
    z-index: 70;
  }

  .page {
    margin-left: 0;
    max-width: none;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
    padding: 4.55rem 0.85rem 2rem;
  }

  .hero {
    min-height: 0;
    padding: 2.1rem 1rem 2.5rem;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), 0 100%);
  }

  .hero::before { height: 62px; top: 62%; }
  .hero::after { height: 30px; }
  .hero__media { margin-top: 1.15rem; }
  .hero__media img,
  .hero__img { max-height: 24vh; }

  .content { margin-top: 1.2rem; }
  .content > div[id] { scroll-margin-top: 76px; }

  .rail { position: static; }

  .foot {
    margin-left: 0;
    padding: 1.4rem 0.85rem 2rem;
  }
}

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