/* ============== 基础 ============== */
:root {
  --bg: #FAF7F2;
  --bg-soft: #F2EDE3;
  --ink: #3D3833;
  --ink-soft: #6B6359;
  --ink-fade: #A39A8E;
  --line: #E3DBCB;
  --accent: #7A8B8A;     /* 苍山黛青 */
  --accent2: #B8654A;    /* 落日陶土 */
  --accent3: #D9B89A;    /* 暮云驼色 */
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --shadow: 0 6px 24px rgba(61, 56, 51, 0.08);
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.85;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

/* ============== 封面 ============== */
.cover {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #2a2620;
}
.cover-img {
  position: absolute; inset: 0;
  display: block;
}
.cover-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.78) saturate(1.05);
  animation: kenburns 18s ease-out forwards;
}
.cover-img::after {
  /* 暗色径向蒙版，让中央标题更突出 */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(20,18,16,0.55) 0%, rgba(20,18,16,0.15) 55%, rgba(20,18,16,0.45) 100%),
    linear-gradient(to bottom, rgba(20,18,16,0.25) 0%, rgba(20,18,16,0) 30%, rgba(20,18,16,0) 70%, rgba(20,18,16,0.35) 100%);
  pointer-events: none;
}
@keyframes kenburns {
  from { transform: scale(1.08); }
  to   { transform: scale(1.0); }
}
.cover-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 0 24px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
  opacity: 0;
  animation: fadeUp 1.6s ease 0.4s forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cover-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 6px;
  font-weight: 300;
  opacity: 0.85;
  margin-bottom: 18px;
}
.cover-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 9vw, 56px);
  letter-spacing: 8px;
  margin-bottom: 20px;
}
.cover-sub {
  font-family: var(--serif);
  font-size: clamp(13px, 3.6vw, 16px);
  letter-spacing: 3px;
  opacity: 0.92;
  margin-bottom: 30px;
}
.cover-date {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 4px;
  opacity: 0.7;
  position: relative;
  padding-top: 16px;
}
.cover-date::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 1px;
  background: rgba(255,255,255,0.5);
}
.cover-scroll {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 36px;
  background: rgba(255,255,255,0.35);
  overflow: hidden;
}
.cover-scroll span {
  display: block;
  width: 100%; height: 12px;
  background: #fff;
  animation: scrollHint 2.2s ease-in-out infinite;
}
@keyframes scrollHint {
  0%   { transform: translateY(-12px); }
  60%  { transform: translateY(36px); }
  100% { transform: translateY(36px); }
}

/* ============== 散文段落 ============== */
.prose, .ending {
  max-width: 520px;
  margin: 0 auto;
  padding: 80px 32px;
  text-align: center;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2.4;
  color: var(--ink-soft);
  letter-spacing: 2px;
}
.prose p, .ending p {
  margin: 6px 0;
}
.ending {
  padding: 100px 32px 60px;
}
.ending-sign {
  margin-top: 40px !important;
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--ink-fade);
}

/* ============== 章节标题 ============== */
.chapter {
  text-align: center;
  padding: 70px 24px 40px;
  position: relative;
}
.chapter::before {
  content: "";
  display: block;
  width: 1px; height: 40px;
  background: var(--line);
  margin: 0 auto 28px;
}
.chapter-no {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--accent);
  margin-bottom: 14px;
}
.chapter-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 6.5vw, 32px);
  letter-spacing: 6px;
  color: var(--ink);
  margin-bottom: 14px;
}
.chapter-sub {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink-fade);
}

/* ============== 瀑布流 ============== */
.gallery {
  column-count: 1;
  column-gap: 14px;
  padding: 24px 14px 8px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 560px) {
  .gallery { column-count: 2; column-gap: 18px; padding: 32px 24px; }
}
@media (min-width: 960px) {
  .gallery { column-count: 3; column-gap: 24px; padding: 40px 32px; }
}

.gallery figure {
  break-inside: avoid;
  margin: 0 0 22px;
  background: #fff;
  border-radius: 3px;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.gallery figure.in-view {
  opacity: 1;
  transform: translateY(0);
}
.gallery figure picture {
  display: block;
  overflow: hidden;
}
.gallery figure img {
  width: 100%;
  transition: transform 0.8s ease;
}
.gallery figure:hover img,
.gallery figure:active img {
  transform: scale(1.04);
}
.gallery figcaption {
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.9;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
  padding: 14px 18px 18px;
  text-align: center;
  border-top: 1px dashed var(--line);
  background: #fdfbf6;
}

/* ============== 页脚 ============== */
footer {
  text-align: center;
  padding: 30px 24px 50px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-fade);
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

/* ============== 灯箱 ============== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 16, 0.96);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  display: flex;
  opacity: 1;
}
.lightbox .lb-pic {
  display: block;
  max-width: 100%;
  max-height: 90vh;
}
.lightbox .lb-pic img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  touch-action: pan-y;
}
.lightbox button {
  position: absolute;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-family: var(--serif);
  font-size: 26px;
  cursor: pointer;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.lightbox button:hover,
.lightbox button:active { background: rgba(255,255,255,0.18); }
.lb-close { top: 16px; right: 16px; font-size: 28px; }
.lb-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-counter {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 3px;
}

@media (max-width: 560px) {
  .lb-prev, .lb-next { display: none; }  /* 手机用滑动手势 */
}

/* ============== 减弱动画偏好 ============== */
@media (prefers-reduced-motion: reduce) {
  .cover-img img { animation: none; }
  .gallery figure { opacity: 1; transform: none; transition: none; }
  .cover-text { animation: none; opacity: 1; }
}
