/* ===== 迈斯姆 OC 展示站 ===== */
@font-face {
  font-family: 'Sansheng';
  src: url('../fonts/平方三生体.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
:root {
  --bg: #ecebe6;
  --text: #2c2c2c;
  --text-light: #666666;
  --text-faint: #999999;
  --accent: #8b7d7b;
  --border: #e5e4e0;
  --page-width: 1000px;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    /* 桌面木纹 */
    radial-gradient(ellipse 900px 500px at 50% 38%, rgba(185,160,140,0.18) 0%, transparent 100%),
    radial-gradient(ellipse at 50% 0%, rgba(139,125,123,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(139,125,123,0.03) 0%, transparent 50%),
    #ecebe6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background: repeating-conic-gradient(#3a3534 0.0001%, transparent 0.0002%);
  filter: blur(0.5px);
}

/* 顶部细条 */
.banner {
  width: 100%;
  height: 40px;
  background: linear-gradient(90deg, #3a2f2d 0%, #564a47 30%, #564a47 70%, #3a2f2d 100%);
}

/* 内页静态签名 */
.sig-static {
  opacity: 1 !important;
}

.sig-static .sig-reveal {
  animation: none !important;
  width: 600px;
}

.sig-chapter {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.82rem;
  color: #b5a89c;
  letter-spacing: 0.1em;
  position: relative;
  top: -28px;
  left: 52px;
}

/* 内页紧凑头部 */
.inner-header {
  width: 100%;
  max-width: var(--page-width);
  padding: 0.8rem 2.5rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: 'Great Vibes', cursive;
}

.inner-sig {
  font-size: 2rem;
  color: #3a3534;
  font-family: 'Great Vibes', cursive;
}

.inner-sub {
  font-size: 1rem;
  color: #8b7d7b;
  font-family: 'Zhi Mang Xing', cursive;
  margin-left: 0.3rem;
}

.inner-sep {
  color: #ccc;
  font-family: serif;
}

.inner-chapter {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.85rem;
  color: #8b7d7b;
  letter-spacing: 0.08em;
}

/* 签名 — 花体 Mushroom. */
.signature {
  width: 100%;
  padding: 1.2rem 0 0 48px;
  align-self: flex-start;
  opacity: 0;
}

.signature.ready {
  opacity: 1;
  transition: opacity 0.01s;
}

.signature svg {
  display: block;
  max-width: 600px;
  height: auto;
}

.signature-text {
  fill: #3a3534;
  font-family: 'Great Vibes', 'Dancing Script', 'Brush Script MT', cursive;
  font-size: 88px;
}

.sig-reveal {
  overflow: hidden;
  width: 0;
}

.signature.ready .sig-reveal {
  animation: sigReveal 3s cubic-bezier(0.15, 0.75, 0.15, 1) forwards;
}

@keyframes sigReveal {
  0% { width: 0; }
  100% { width: 600px; }
}

.signature svg {
  display: block;
}

/* 中文手写副标题 */
.sig-sub {
  font-family: 'Zhi Mang Xing', 'Liu Jian Mao Cao', 'Ma Shan Zheng', cursive;
  font-size: 28px;
  color: #8b7d7b;
  opacity: 0;
  position: relative;
  top: -25px;
  left: 50px;
}

.signature.ready .sig-sub {
  animation: sigFloatUp 0.5s ease-out 0.3s forwards;
}

@keyframes sigFloatUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 0.7;
    transform: translateY(0);
  }
}

.container {
  width: 100%;
  max-width: var(--page-width);
  margin: 0.5rem auto;
  padding: 0 1rem;
}

.book-spread {
  display: flex;
  gap: 8px;
  aspect-ratio: 1.7 / 1;
  background: #e8dcc8;
  border-radius: 2px 4px 4px 2px;
  position: relative;
  /* 书页层叠边缘 */
  box-shadow:
    1px 0 0 #efe3cb, 2px 0 0 #ede1c9, 3px 0 0 #ebe0c7, 4px 0 0 #e9dec5,
    -1px 0 0 #efe3cb, -2px 0 0 #ede1c9, -3px 0 0 #ebe0c7, -4px 0 0 #e9dec5,
    0 1px 0 #efe3cb, 0 2px 0 #ede1c9, 0 3px 0 #ebe0c7,
    /* 桌面投影 */
    0 8px 32px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.07),
    0 24px 64px rgba(0,0,0,0.04);
}

/* 书脊效果 — 中缝厚度 */
.book-spread::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 8px;
  height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(90deg,
    rgba(0,0,0,0.06) 0%,
    rgba(0,0,0,0.03) 20%,
    rgba(255,255,255,0.03) 50%,
    rgba(0,0,0,0.04) 80%,
    rgba(0,0,0,0.07) 100%
  );
  z-index: 5;
  pointer-events: none;
}

/* 书页暗角 */
.book-spread::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.04) 0%, transparent 15%, transparent 85%, rgba(0,0,0,0.04) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.02) 0%, transparent 10%, transparent 90%, rgba(0,0,0,0.03) 100%);
  pointer-events: none;
  z-index: 1;
}

/* 侧边索引标签 */
.bm-rail {
  position: absolute;
  top: 2rem;
  left: calc(100% - 2px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bm-tab {
  background: #342a2b;
  height: 28px;
  width: 22px;
  clip-path: polygon(0% 0%, 100% 0%, calc(100% - 8px) 50%, 100% 100%, 0% 100%);
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: width 0.25s ease, background 0.2s;
  white-space: nowrap;
  box-shadow: 2px 1px 4px rgba(0,0,0,0.2);
  text-decoration: none;
}

.bm-tab span {
  color: rgba(255,255,255,0);
  font-size: 0.82rem;
  white-space: nowrap;
  font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
  font-weight: 500;
  padding: 0 6px 0 16px;
  transition: color 0.2s;
}

.bm-tab:hover {
  width: 90px;
  background: #4a3a3b;
}

.bm-tab:hover span {
  color: rgba(255,255,255,0.85);
}

.book-page {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  width: calc(50% - 4px);
  padding: 2rem 1.8rem;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
}

.book-page--left {
  background: linear-gradient(90deg, rgba(0,0,0,0.015) 0%, transparent 20%), #faf3e5;
  border-right: 1px solid rgba(0,0,0,0.04);
}

.book-page--right {
  background: linear-gradient(270deg, rgba(0,0,0,0.015) 0%, transparent 20%), #faf3e5;
}

.page-inner {
  flex: 1;
  min-height: 0;   /* 关键：让超长内容在页内滚动，而不是把书页撑破 */
  display: flex;
  flex-direction: column;
}

/* 换页 / 首屏：内容显影 —— 先淡入，模糊稍后收干，纸张本身不动 */
.page-enter {
  animation:
    pageFadeIn 0.5s ease-out both,
    pageDeBlur 0.6s ease-out both;
  will-change: opacity, filter;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pageDeBlur {
  from { filter: blur(10px); }
  to   { filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
  .page-enter { animation: none; }
}

.page-img {
  display: block;
  width: 36%;
  margin: 1rem 0 0 0;
  border-radius: 2px;
}

.page-name {
  text-align: left;
  font-size: 1.8rem;
  font-family: 'Great Vibes', cursive;
  color: #3a3534;
  margin-top: 1.2rem;
  line-height: 1.2;
  padding-left: 0.5rem;
}

.page-sub-name {
  text-align: left;
  font-size: 1rem;
  color: #8b7d7b;
  margin-top: 0.2rem;
  letter-spacing: 0.05em;
  padding-left: 0.5rem;
}

.page-quote {
  font-family: 'Sansheng', 'Liu Jian Mao Cao', cursive;
  font-size: 1.1rem;
  color: #8b7d7b;
  margin-top: 3.5rem;
  line-height: 1.8;
  text-align: left;
}

.quote-line--1 {
  padding-left: 8%;
}

.quote-line--2 {
  padding-left: 58%;
}

/* 翻页箭头 */
.page-arrow {
  position: absolute;
  bottom: 0.4rem;
  z-index: 25;
  font-size: 1.2rem;
  color: #b5a89c;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
  padding: 8px 12px;
}

.page-arrow:hover {
  color: #564a47;
}

.page-arrow--prev {
  left: 0.2rem;
}

.is-first .page-arrow--prev { display: none; }

/* 右下角交互区 */
.page-corner-zone {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 64px;
  height: 64px;
  z-index: 35;
  cursor: pointer;
}

.page-corner-zone .page-arrow--next {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 1.2rem;
  color: #b5a89c;
  transition: color 0.3s;
  user-select: none;
  padding: 8px 12px;
  z-index: 2;
}

.page-corner-zone:hover .page-arrow--next {
  color: #564a47;
}

.is-last .page-corner-zone { display: none; }

/* 翻页阴影 */
.page-flip-shadow {
  display: none;
}

/* 翻页光影 */
.flip-lighting {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background:
    linear-gradient(90deg,
      rgba(0,0,0,0.08) 0%,
      rgba(0,0,0,0.04) 25%,
      transparent 40%,
      transparent 100%
    ),
    linear-gradient(180deg,
      transparent 0%,
      rgba(0,0,0,0.02) 50%,
      transparent 100%
    );
}

.flip-lighting.active {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* 反向翻页光影 */
.flip-lighting-rev {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background:
    linear-gradient(270deg,
      rgba(0,0,0,0.08) 0%,
      rgba(0,0,0,0.04) 25%,
      transparent 40%,
      transparent 100%
    ),
    linear-gradient(180deg,
      transparent 0%,
      rgba(0,0,0,0.02) 50%,
      transparent 100%
    );
}

.flip-lighting-rev.active {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* 3D 翻页容器 */
.book-spread {
  perspective: 1200px;
}

.book-page--right.book-page--flip {
  padding: 0;
  overflow: visible;
  background: none;
}

.page-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform 0.6s cubic-bezier(0.32, 0.0, 0.05, 1);
}

.page-3d.flipping {
  transform: rotateY(-150deg);
}

.page-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.8rem;
}

.page-front {
  background: linear-gradient(270deg, rgba(0,0,0,0.015) 0%, transparent 20%), #faf3e5;
  z-index: 1;
}

.page-back {
  background: linear-gradient(90deg, rgba(0,0,0,0.015) 0%, transparent 20%), #faf3e5;
  transform: rotateY(180deg);
}

/* 反向 3D 翻页（左页向后翻） */
.book-page--left.book-page--flip-rev {
  padding: 0;
  overflow: visible;
  background: none;
}

.page-3d-rev {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform-origin: right center;
  transition: transform 0.6s cubic-bezier(0.32, 0.0, 0.05, 1);
}

.page-3d-rev.flipping {
  transform: rotateY(150deg);
}

.page-front-rev {
  background: linear-gradient(90deg, rgba(0,0,0,0.015) 0%, transparent 20%), #faf3e5;
  z-index: 1;
}

.page-back-rev {
  background: linear-gradient(270deg, rgba(0,0,0,0.015) 0%, transparent 20%), #faf3e5;
  transform: rotateY(-180deg);
}

/* 书角卷起 */
.page-curl {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 60px;
  z-index: 1;
  pointer-events: none;
}

.page-curl::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 0 0;
  border-color: transparent transparent #d4c8b8 transparent;
  transition: border-width 0.4s cubic-bezier(0.25, 0.0, 0.1, 1), border-color 0.4s;
}

.page-curl::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 0 0;
  border-color: transparent transparent #ecebe6 transparent;
  transition: border-width 0.4s cubic-bezier(0.25, 0.0, 0.1, 1);
  transition-delay: 0.05s;
}

.page-corner-zone:hover .page-curl::before {
  border-width: 0 0 34px 34px;
  border-color: transparent transparent #c4b8a4 transparent;
}

.page-corner-zone:hover .page-curl::after {
  border-width: 0 0 28px 28px;
}

/* 页面内容过渡 */
.book-page {
  transition: none;
}

/* 目录 */
.page-toc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.toc-title {
  font-size: 1.6rem;
  font-family: 'Great Vibes', cursive;
  color: #3a3534;
  letter-spacing: 0.3em;
}

.toc-divider {
  color: #8b7d7b;
  font-size: 1rem;
  margin: 0.6rem 0 1.2rem;
  opacity: 0.5;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-item {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  text-decoration: none;
  color: #5c4a3a;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px dotted rgba(0,0,0,0.08);
  transition: all 0.2s;
  min-width: 180px;
}

.toc-item:hover {
  color: #3a3534;
  padding-left: 1rem;
  border-bottom-color: rgba(0,0,0,0.2);
}

.toc-num {
  font-size: 0.8rem;
  color: #8b7d7b;
  font-family: 'Great Vibes', cursive;
  min-width: 1.2rem;
}

.toc-label {
  font-size: 1rem;
}

/* 内页内容 */
.inner-section {
  margin-bottom: 1.2rem;
}

.section-title {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #3a3534;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  letter-spacing: 0.05em;
}

.inner-text {
  font-size: 0.88rem;
  color: #4a4038;
  line-height: 1.85;
  text-indent: 2em;
  margin-bottom: 0.5rem;
}

/* 角色档案 — 左文字右图片 */
.profile-layout {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.profile-text {
  flex: 1 1 55%;
  min-width: 0;
}

.profile-image {
  flex: 0 0 38%;
  display: flex;
  align-items: flex-start;
  padding-top: 40px;
}

.profile-image img {
  width: 100%;
  border-radius: 2px;
}

.char-grid {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.char-item {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.8;
}

.char-label {
  color: #8b7d7b;
  flex-shrink: 0;
}

.char-label::after {
  content: '：';
}

.char-value {
  color: #3a3534;
}

/* 当前页标签高亮 */
.bm-tab.current {
  background: #4a3a3b;
  width: 22px;
}

.bm-tab.current span {
  color: rgba(255,255,255,0.7);
}

.page-number-bottom {
  margin-top: auto;
  text-align: center;
  font-family: 'Great Vibes', cursive;
  font-size: 0.9rem;
  color: rgba(0,0,0,0.2);
  padding-top: 2rem;
}

/* 内页引用块 */
.inner-quote {
  text-align: center;
  font-family: 'Sansheng', 'Liu Jian Mao Cao', cursive;
  font-size: 0.95rem;
  color: #8b7d7b;
  padding: 0.5rem 1.5rem;
  margin-top: auto;
  line-height: 1.8;
}

/* 内页注释 */
.inner-note {
  margin-top: auto;
  font-size: 0.78rem;
  color: #b5a89c;
  font-style: italic;
  padding-top: 0.8rem;
}

/* 画廊占位网格 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.gallery-grid--3 { grid-template-columns: repeat(3, 1fr); }
.gallery-grid--4 { grid-template-columns: repeat(4, 1fr); }

.gallery-item {
  aspect-ratio: 1;
  background: rgba(0,0,0,0.04);
  border: 1px dashed rgba(0,0,0,0.1);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #b5a89c;
  text-align: center;
  flex-direction: column;
}

.gallery-item small {
  font-size: 0.65rem;
  color: #ccc;
}

.gallery-item--wide {
  aspect-ratio: 1.6 / 1;
}

/* 创作风格对比 */
.style-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.style-compare > div {
  font-size: 0.85rem;
  color: #4a4038;
  line-height: 1.8;
}

.style-compare strong {
  color: #8b7d7b;
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

/* 时间线筛选 */
.timeline-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.tl-btn {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 2px;
  background: transparent;
  color: #8b7d7b;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.tl-btn.active,
.tl-btn:hover {
  background: #3a3534;
  color: #ecebe6;
  border-color: #3a3534;
}

.tl-search {
  width: 100%;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 2px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  background: rgba(255,255,255,0.5);
  color: #3a3534;
  margin-bottom: 0.4rem;
}

.tl-search::placeholder { color: #ccc; }

.timeline-count {
  font-size: 0.7rem;
  color: #b5a89c;
  margin-bottom: 0.4rem;
}

.timeline {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.9;
}

.timeline-entry {
  position: relative;
  display: flex;
  gap: 0.6rem;
  padding: 0.25rem 0 0.25rem 0.9rem;
  border-bottom: 1px dotted rgba(0,0,0,0.06);
}

/* 时间轴线：做在每条记录上首尾相接，滚动时跟着内容走 */
.timeline-entry::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(139, 125, 123, 0.3);
}

/* 年份组：年份单独一行当组标题，同年份的记录共用它 */
.tl-year {
  position: relative;
  padding: 0.9rem 0 0.15rem 0.9rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #6b5f5d;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.tl-year:first-child {
  padding-top: 0.2rem;   /* 第一组不留上方间距 */
}

/* 轴线也穿过年份行，让整条线连贯不断 */
.tl-year::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(139, 125, 123, 0.3);
}

.timeline-date {
  color: #a2958f;
  flex-shrink: 0;
  min-width: 2.4rem;
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.timeline-event { color: #3a3534; }

.timeline-entry.highlight .timeline-event {
  font-weight: 600;
}

/* 标签切换 */
.tab-bar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tab-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.8rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 2px;
  background: transparent;
  color: #8b7d7b;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.tab-btn.active,
.tab-btn:hover {
  background: #3a3534;
  color: #ecebe6;
  border-color: #3a3534;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* 公寓 */
.floorplan {
  width: 100%;
  aspect-ratio: 1.4;
  margin: 0.5rem 0;
}

.floorplan-placeholder {
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.03);
  border: 1px dashed rgba(0,0,0,0.12);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b5a89c;
  font-size: 0.8rem;
}

.room-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.room-card {
  text-align: center;
}

.room-image {
  aspect-ratio: 1.4;
  background: rgba(0,0,0,0.03);
  border: 1px dashed rgba(0,0,0,0.1);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b5a89c;
  font-size: 0.72rem;
  margin-bottom: 0.25rem;
}

.room-name {
  font-size: 0.8rem;
  color: #3a3534;
}

.footer {
  width: 100%;
  height: 40px;
  margin-top: auto;
  flex-shrink: 0;
  background: linear-gradient(90deg, #3a2f2d 0%, #564a47 30%, #564a47 70%, #3a2f2d 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 48px;
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
}

/* ===== 设定图（角色形象 / 公寓） ===== */
.figure {
  margin-bottom: 1rem;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.09);
}

.figure-cap {
  font-size: 0.72rem;
  color: #b5a89c;
  margin-top: 0.3rem;
  text-align: center;
  letter-spacing: 0.05em;
}

/* 左页整幅主图：长竖图完整显示，不裁切 */
.page-figure {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.page-figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

/* ===== 图片保护 ===== */
/* 指针事件穿透图片本身：在图上右键、拖拽，命中的都是外层容器，
   浏览器菜单里就不会出现「图片另存为」，也拖不走。
   纯 CSS，访问者关掉 JavaScript 也照样生效。 */
img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;   /* 移动端长按不弹保存菜单 */
}

/* ===== 页内滚动区（长文 / 多图） ===== */
.scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* ===== 滚动条 ===== */
/* 页内滚动区、时间线、以及第二页左页：滑块细、暖棕半透明，像贴在纸面上的一道痕 */
.scroll-area,
.timeline,
.book-page--left .page-inner:has(.char-grid) {
  scrollbar-gutter: stable;   /* 滑块出现时内容不左右跳动 */
}

.scroll-area::-webkit-scrollbar,
.timeline::-webkit-scrollbar,
.book-page--left .page-inner:has(.char-grid)::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.scroll-area::-webkit-scrollbar-track,
.timeline::-webkit-scrollbar-track,
.book-page--left .page-inner:has(.char-grid)::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-area::-webkit-scrollbar-thumb,
.timeline::-webkit-scrollbar-thumb,
.book-page--left .page-inner:has(.char-grid)::-webkit-scrollbar-thumb {
  background: rgba(139, 125, 123, 0.28);
  background-clip: content-box;
  border: 2px solid transparent;
  border-radius: 5px;
}

.scroll-area::-webkit-scrollbar-thumb:hover,
.timeline::-webkit-scrollbar-thumb:hover,
.book-page--left .page-inner:has(.char-grid)::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 125, 123, 0.5);
  background-clip: content-box;
}

.scroll-area::-webkit-scrollbar-thumb:active,
.timeline::-webkit-scrollbar-thumb:active,
.book-page--left .page-inner:has(.char-grid)::-webkit-scrollbar-thumb:active {
  background: rgba(139, 125, 123, 0.68);
  background-clip: content-box;
}

/* ===== 第二页左页：修「角色档案」区域压住下方容器 ===== */
/* 该行是 flex: 1 1 0%，剩余空间不够时会被压扁到 153px，而里面 8 项网格缩不了
   （要 252px），于是从框里溢出来压住下面的「生日／居住地」那节，实测重叠 99px；
   立绘同样被压（要 176px / 被压到 153px）。
   这里只改"能不能被压缩"，不动任何尺寸、间距、字体：该行不再收缩，
   多出来的高度由整页滚动承载，滚动条沿用上面统一的那套。 */
.book-page--left .page-inner:has(.char-grid) {
  overflow-y: auto;
}

.book-page--left .page-inner:has(.char-grid) .profile-layout {
  /* 原值是 flex: 1 1 0% —— basis 为 0，高度全靠剩余空间分配，空间不够就被压到 153px，
     内容却要 252px。只加 flex-shrink: 0 没用（没有负空间可缩，尺寸本来就来自 basis 0 + grow），
     必须把 basis 还成 auto，高度才会由内容决定。 */
  flex: 0 0 auto;
}

/* 去掉箭头按钮与角落方块 */
::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* 页面级滚动条（窗口不够高时） */
html::-webkit-scrollbar {
  width: 11px;
}

html::-webkit-scrollbar-track {
  background: #e9e7e1;
}

html::-webkit-scrollbar-thumb {
  background: rgba(139, 125, 123, 0.32);
  background-clip: content-box;
  border: 2px solid transparent;
  border-radius: 6px;
}

html::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 125, 123, 0.52);
  background-clip: content-box;
}

/* Firefox 不认 webkit 伪元素，改用标准属性给一个细滑块 */
@supports not selector(::-webkit-scrollbar) {
  html,
  .scroll-area,
  .timeline {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 125, 123, 0.35) transparent;
  }
}

/* ===== 长文排版 ===== */
.story-line {
  font-size: 0.88rem;
  color: #4a4038;
  line-height: 1.9;
  margin-bottom: 0.5rem;
}

/* 对白：左侧一道细线，区别于叙述 */
.story-line--quote {
  color: #5c4a3a;
  padding-left: 1rem;
  border-left: 2px solid rgba(139,125,123,0.22);
}

.story-break {
  text-align: center;
  color: #c4b8a4;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  margin: 0.9rem 0;
}

/* 设定条目列表 */
.inner-list {
  list-style: none;
  counter-reset: li;
}

.inner-list li {
  counter-increment: li;
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: #4a4038;
  line-height: 1.85;
}

.inner-list li::before {
  content: counter(li);
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'Great Vibes', cursive;
  font-size: 0.95rem;
  color: #8b7d7b;
}

/* 文末署名 */
.story-sign {
  text-align: right;
  font-family: 'Zhi Mang Xing', 'Liu Jian Mao Cao', cursive;
  font-size: 0.95rem;
  color: #8b7d7b;
  margin: 0.7rem 0 0.5rem;
}

/* ===== IF 线入口 ===== */
.if-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.if-entry {
  display: block;
  text-decoration: none;
  color: inherit;
}

.if-entry-img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(0,0,0,0.03);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.if-entry-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transition: transform 0.45s cubic-bezier(0.33, 0, 0.2, 1);
}

.if-entry:hover .if-entry-img img {
  transform: scale(1.05);
}

.if-entry-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #3a3534;
  margin-top: 0.4rem;
  letter-spacing: 0.05em;
}

.if-entry-sub {
  font-size: 0.72rem;
  color: #b5a89c;
  margin-top: 0.1rem;
  line-height: 1.5;
}

/* ===== 书签栏子项（IF 线四篇） ===== */
.bm-tab.sub {
  height: 24px;
  background: #4a3f3d;
}

.bm-tab.sub span {
  padding-left: 13px;
  font-size: 0.76rem;
}

.bm-tab.sub.current {
  background: #6d5a55;
  width: 22px;
}

.bm-tab.sub:hover {
  width: 84px;
}

/* ===== 目录子项 ===== */
.toc-item--sub {
  padding-left: 2.2rem;
}

.toc-item--sub .toc-label {
  font-size: 0.88rem;
  color: #8b7d7b;
}

.toc-item--sub .toc-num {
  font-size: 0.72rem;
}
