/**
 * 鹿雅云 · H5 作品成品页(相册)样式
 * 视觉基准:design/prototypes/final-duotone.html 屏 04「影像集 · 成品」
 * 纪律:颜色一律走 assets/css/tokens.css 令牌,本文件禁止出现色值;
 *       阴影统一 var(--elev);动画只用 transform / opacity / filter(合成器属性)。
 */

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans SC', -apple-system, 'Noto Sans CJK SC', sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.serif { font-family: 'Noto Serif SC', 'Noto Sans CJK SC', serif; }

/* 暗房颗粒噪点(仅深色,--noise-op 控制;UI 规范 §1.7 参数) */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none;
  opacity: var(--noise-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ————— 书本容器 ————— */
.book {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
  box-shadow: var(--elev);
}

/* ————— 鹿角符号(结构见 index.html 内 #antler-paths,禁改弧线) ————— */
.antler {
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ————— 签名①:地平线 + mono 数据条 ————— */
.horizon { position: relative; }
.horizon::before { content: ""; display: block; height: 1px; background: var(--hairline); }
.horizon-data {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .08em;
  color: var(--text-2);
  padding-top: 7px;
}
.sunmark::after {
  content: "";
  position: absolute; top: -2px; right: 9%;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
}

/* ————— 签名②:相纸照片框 ————— */
.print {
  background: var(--print-paper);
  border: 1px solid var(--print-edge);
  border-radius: 5px;
  position: relative;
  box-shadow: var(--elev);
}
.pimg { overflow: hidden; border-radius: 3px; background: var(--surface-2); }
.pimg img { width: 100%; height: 100%; object-fit: cover; }
.pno {
  position: absolute; right: 7px; bottom: 3px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-style: normal;
  font-size: 7.5px; letter-spacing: .12em; line-height: 1.6;
  color: var(--print-no);
}

/* ————— 封面 ————— */
.cover {
  position: relative;
  height: 72vh; min-height: 430px; max-height: 720px;
  overflow: hidden;
}
.cover-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 62%;
  /* 封面专属做旧(覆盖相纸滤镜档) */
  --ph-filter: saturate(.74) sepia(.14) brightness(.9) contrast(.98);
}
.cover-scrim { position: absolute; inset: 0; background: var(--scrim); }
.cover-txt {
  position: absolute; left: 0; right: 0; top: 54%;
  z-index: 5; text-align: center;
  color: var(--on-photo);
}
.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .24em;
  color: var(--text-2);
}
.cover-txt .eyebrow { display: block; margin-bottom: 14px; color: var(--on-photo-dim); }
.cover-txt h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 38px; font-weight: 300;
  letter-spacing: .22em; text-indent: .22em;
}
.cover-txt .byline {
  font-size: 11px; letter-spacing: .18em;
  margin-top: 14px;
  color: var(--on-photo-dim);
}
/* 封面地平线数据行(图上白系变体) */
.cover-horizon { position: absolute; left: 20px; right: 20px; bottom: 44px; z-index: 5; }
.cover-horizon.horizon::before { background: var(--on-photo-faint); }
.cover-horizon .horizon-data { color: var(--on-photo-dim); }
/* 鹿角水印 · 封面左下角(原型屏 04 同位) */
.cover-mark {
  position: absolute; left: 16px; bottom: 12px; z-index: 6;
  display: flex; align-items: center; gap: 6px;
  color: var(--on-photo);
}
.cover-mark .antler { width: 20px; height: 13px; stroke-width: 5.5px; }
.cover-mark span {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 7px; letter-spacing: .32em;
}

/* ————— 章节 ————— */
.chapter { padding: 34px 28px 8px; }
.chapter-head h2 {
  font-size: 18px; font-weight: 400; letter-spacing: .14em;
  padding: 18px 0 12px; /* 日出线在标题上方(原型屏 04 结构) */
}
.chapter-head .horizon-data { padding-top: 0; }

.verse { padding: 28px 30px 22px; text-align: center; }
.verse .vtext {
  font-family: 'Noto Serif SC', serif;
  font-weight: 300; font-size: 19px;
  line-height: 2.15; letter-spacing: .2em;
}
.verse .vdate {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .24em;
  color: var(--text-2);
  margin-top: 14px;
}

.book-print { margin: 0 26px 24px; }
.book-print .print { padding: 5px 5px 16px; }
.book-print .pimg { aspect-ratio: 35 / 22; }
.pcap {
  display: flex; justify-content: space-between;
  margin: 9px 4px 0;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 9px; letter-spacing: .18em;
  color: var(--text-3);
}

/* ————— 尾页(版权页) ————— */
.colophon { padding: 58px 28px 88px; text-align: center; color: var(--text-2); }
.colophon .antler { width: 40px; height: 25px; stroke-width: 2.4px; margin: 0 auto; color: var(--text-2); }
.colophon .press {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 8px; letter-spacing: .32em; text-indent: .32em;
  margin-top: 13px;
}
.colophon .horizon { margin: 28px 8px 0; }
.colophon-note {
  font-size: 11px; line-height: 1.7; letter-spacing: .06em;
  color: var(--text-3);
  margin-top: 18px;
}

/* ————— 「鹿雅云制作」引流角标(右下角固定) ————— */
.made-badge {
  position: fixed; right: 12px; bottom: 12px; z-index: 80;
  display: flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  background: var(--surface);
  border-radius: 6px;
  box-shadow: var(--elev);
  color: var(--text-2);
  font-size: 9px; letter-spacing: .18em;
  text-decoration: none;
}
.made-badge .antler { width: 14px; height: 9px; stroke-width: 4px; color: var(--gold-ink); }

/* 加载失败提示 */
.load-error {
  padding: 120px 24px; text-align: center;
  font-size: 12px; letter-spacing: .1em;
  color: var(--text-3);
}

/* ================================================================
   动效 · 克制基础版(docs/requirements/动效与交互设计要点.md)
   只用 transform / opacity / filter;prefers-reduced-motion 全关。
================================================================ */

/* 滚动浮现(IntersectionObserver 加 .in;--d 为 stagger 延迟) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--motion-ease), transform .7s var(--motion-ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* 标题渐显(封面标题 / 章节标题,更慢更轻) */
.reveal-title {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.05s var(--motion-ease), transform 1.05s var(--motion-ease);
  transition-delay: var(--d, 0ms);
}
.reveal-title.in { opacity: 1; transform: none; }

/* 照片「显影」加载:模糊+压暗 → 清晰(onload 后摘 .dev) */
.ph {
  filter: var(--ph-filter);
  transition: opacity .8s ease-out, filter 1.2s ease-out;
}
.ph.dev {
  opacity: 0;
  filter: var(--ph-filter) blur(14px) brightness(.6);
}

/* Ken Burns 缓推:仅每章第一张,进入视口后 8s 推一次,不循环 */
@keyframes kb {
  from { transform: scale(1.065); }
  to   { transform: scale(1); }
}
.kb .pimg img { will-change: transform; }
.kb.kb-run .pimg img { animation: kb 8s var(--motion-ease) 1 both; }

/* ================================================================
   大屏模式壳(?mode=screen)· 活动现场投屏示意
================================================================ */
body.screen-mode { background: var(--screen-bg); overflow: hidden; }

.stage { position: fixed; inset: 0; background: var(--screen-bg); }
.slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: var(--ph-filter);
  transition: opacity 1.4s ease;
}
.slide.on { opacity: 1; animation: kb 11s linear 1 both; }
.stage-scrim { position: absolute; inset: 0; background: var(--scrim); }

.screen-head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 30px 40px;
  color: var(--on-photo);
}
.screen-title { display: flex; align-items: center; gap: 16px; }
.screen-title .antler { width: 34px; height: 21px; stroke-width: 3.4px; }
.screen-title h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 26px; font-weight: 300; letter-spacing: .3em;
}
.screen-count {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px; letter-spacing: .24em;
  color: var(--on-photo-dim);
}
.screen-count i {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); margin-right: 10px; vertical-align: 1px;
}
.screen-count b { color: var(--gold); font-weight: 500; }

/* 底部滚动条文(祝福弹幕示意,内容重复两遍做无缝循环) */
.screen-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--screen-bar);
  padding: 15px 0;
  overflow: hidden;
}
.ticker {
  display: flex; gap: 72px; width: max-content;
  color: var(--on-photo-dim);
  font-size: 14px; letter-spacing: .08em;
  white-space: nowrap;
  animation: ticker 36s linear infinite;
}
.ticker b { color: var(--gold); font-weight: 400; margin-left: 10px; }
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.screen-mark {
  position: absolute; right: 22px; bottom: 62px; z-index: 5;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 9px; letter-spacing: .3em;
  color: var(--on-photo-faint);
}

/* ================================================================
   prefers-reduced-motion:全部动效关闭,内容直接呈现
================================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-title { opacity: 1; transform: none; transition: none; }
  .ph { transition: none; }
  .ph.dev { opacity: 1; filter: var(--ph-filter); }
  .kb.kb-run .pimg img { animation: none; }
  .slide { transition: none; }
  .slide.on { animation: none; }
  .ticker { animation: none; }
}
