/* =====================================================================
   041 · 收藏（Collection）
   参考：https://www.criterion.com/ （首页五屏专题流）
   参考页实测（1440×900）：一屏一张满幅图，图高等于视口高；居中标题
   80px 衬线 / 白色按钮 216×42、无圆角；左侧固定竖排刊名；左下竖排
   5 个圆点表示在第几屏；底部居中下箭头。
   本模块：同样的「一屏一张」，四屏；用宋体做大标题，和 04 的阅读页
   彻底拉开距离（04 是白纸左文右图，这里没有纸，图就是页面）。
   ===================================================================== */

/* Inter 自托管：一个可变字体文件覆盖 100–900 全部字重，只含拉丁子集。
   中文不在这个文件里，靠字体栈后面的系统中文字体接住。 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-italic.woff2") format("woff2");
}

/* ---------------------------------------------------------------------
   配色：本模块「常暗」。
   每一屏都被画面铺满，页面底色其实露不出来，浅色主题切过来也没有东西
   可切——所以这里不接 [data-theme]，nav 里也没放明暗钮（见 module.md）。
   变量仍声明在模块根节点上，nav.js 挂进来才读得到 --ink。
   --------------------------------------------------------------------- */
[data-page-module="collection"] {
  --serif: Georgia, "Times New Roman", "Songti SC", SimSun, "Noto Serif CJK SC", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --ink: #f4f0e8;
  --ink-2: rgba(244, 240, 232, 0.78);
  --ink-3: rgba(244, 240, 232, 0.55);
  --ink-4: rgba(244, 240, 232, 0.32);
  --line: rgba(244, 240, 232, 0.28);
  --paper: #0b0b0b;
  --cream: #f2ece1;
  --hint: 0.34em;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #0b0b0b;
}

/* 「玻璃珠」：滚动位置只在四屏的槽里停，不停在两个槽中间。
   mandatory = 必须吸附到某个槽；scroll-snap-stop: always（写在面板上）
   = 一次快速滑动也不许一口气越过两个槽。
   触控板和触屏的滑动交给这个；鼠标滚轮由 app.js 接管成「一格一格」。 */
html {
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
}

[data-page-module="collection"] {
  position: relative;
  width: 100%;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-page-module="collection"],
[data-page-module="collection"] *,
[data-page-module="collection"] *::before,
[data-page-module="collection"] *::after {
  box-sizing: border-box;
}

/* 顶部一条压暗：面包屑和导航压在画上时也读得清（本质是「安全带」，
   不过这里靠纯黑渐变，不用毛玻璃） */
[data-page-module="collection"]::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 152px;
  z-index: 29;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
}

/* ===================== 面包屑（全局统一组件） ===================== */

.page-trail {
  position: fixed;
  top: 40px;
  left: 40px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

.page-trail__item {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a.page-trail__item:hover {
  color: var(--ink);
}

.page-trail__sep {
  color: var(--line);
}

.page-trail__item--current {
  color: var(--ink-2);
}

/* ===================== 左侧竖排刊名 ===================== */

.cl-side {
  position: fixed;
  left: clamp(20px, 2.6vw, 36px);
  top: 50%;
  z-index: 30;
  margin: 0;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--hint);
  text-transform: uppercase;
  color: var(--ink-3);
  pointer-events: none;
  user-select: none;
}

/* ===================== 索引圆点 ===================== */

.cl-dots {
  position: fixed;
  left: 40px;
  bottom: 44px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: 0;
}

.cl-dots__dot {
  position: relative;
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink-4);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 圆点只有 7px，外扩一圈透明区域当点击热区 */
.cl-dots__dot::after {
  content: "";
  position: absolute;
  inset: -9px;
}

.cl-dots__dot:hover {
  background: var(--ink-2);
}

.cl-dots__dot.is-active {
  background: #f8f4ec;
  transform: scale(1.5);
}

.cl-dots__dot:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

/* ===================== 四屏 ===================== */

.cl-panels {
  display: block;
}

.cl-panel {
  position: relative;
  display: block;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  /* 每个面板就是一颗凹槽：吸到顶，且一次滑动只准越过一个 */
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.cl-panel__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cl-panel__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 从 1.02 起步，留一点余量给缩放，边缘不会露出底色 */
  transform: scale(1.02);
  transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* 压暗：四周重、中间稍轻，中间再补一层正对标题的暗斑 */
.cl-panel__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(58% 44% at 50% 56%, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0) 72%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.14) 24%, rgba(0, 0, 0, 0.2) 58%, rgba(0, 0, 0, 0.68) 100%);
}

.cl-panel__body {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 clamp(24px, 6vw, 88px);
  text-align: center;
}

.cl-panel__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 46em;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.cl-panel.is-in .cl-panel__inner {
  opacity: 1;
  transform: none;
}

.cl-panel__kicker {
  margin: 0 0 clamp(18px, 3vh, 32px);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--hint);
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0;
  transition: opacity 0.9s ease 0.04s;
}

.cl-panel__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 7.2vw, 112px);
  line-height: 1.06;
  letter-spacing: 0.03em;
  color: #fbf8f2;
  text-shadow: 0 2px 46px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.9s ease 0.12s;
}

.cl-panel__sub {
  margin: clamp(16px, 2.4vh, 26px) 0 0;
  max-width: 30em;
  font-size: 15px;
  line-height: 1.8;
  color: rgba(244, 240, 232, 0.72);
  opacity: 0;
  transition: opacity 0.9s ease 0.2s;
}

.cl-panel.is-in .cl-panel__kicker,
.cl-panel.is-in .cl-panel__title,
.cl-panel.is-in .cl-panel__sub {
  opacity: 1;
}

/* 按钮：无圆角米白块，跟 04 里「细边框 + 零阴影」是一路审美，只是反色 */
.cl-panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(28px, 4.4vh, 50px);
  padding: 17px 34px;
  background: var(--cream);
  color: #14110d;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.16em;
  text-indent: 0.16em; /* 抵消尾字后面多出来的字距，视觉才真居中 */
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.9s ease 0.28s, background 0.35s ease,
    color 0.35s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cl-panel.is-in .cl-panel__cta {
  opacity: 1;
}

.cl-panel__cta svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 悬停：只做「亮一点 + 抬 2px + 箭头走一步」，不做放大，免得跟宋体抢戏 */
@media (hover: hover) {
  .cl-panel:hover .cl-panel__media img {
    transform: scale(1.075);
  }

  .cl-panel:hover .cl-panel__cta {
    background: #ffffff;
    transform: translateY(-2px);
  }

  .cl-panel:hover .cl-panel__cta svg {
    transform: translateX(4px);
  }
}

.cl-panel:focus-visible {
  outline: none;
}

.cl-panel:focus-visible .cl-panel__cta {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* ===================== 底部下箭头 ===================== */

.cl-chevron {
  position: fixed;
  left: 50%;
  bottom: 36px;
  z-index: 30;
  margin-left: -13px;
  width: 26px;
  height: 26px;
  color: rgba(244, 240, 232, 0.72);
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.cl-chevron.is-hidden {
  opacity: 0;
}

.cl-chevron svg {
  display: block;
  width: 26px;
  height: 26px;
  animation: cl-bob 2.8s ease-in-out infinite;
}

@keyframes cl-bob {
  0%,
  100% {
    transform: translateY(-2px);
  }
  50% {
    transform: translateY(4px);
  }
}

/* ===================== 窄屏 ===================== */

@media (max-width: 680px) {
  .page-trail {
    top: 20px;
    left: 20px;
    font-size: 13px;
  }

  /* 竖排刊名在手机上会跟圆点抢左下角，直接撤掉 */
  .cl-side {
    display: none;
  }

  .cl-dots {
    left: 20px;
    bottom: 26px;
    gap: 11px;
  }

  .cl-chevron {
    bottom: 20px;
    margin-left: -11px;
    width: 22px;
    height: 22px;
  }

  .cl-chevron svg {
    width: 22px;
    height: 22px;
  }

  .cl-panel {
    min-height: 480px;
  }

  .cl-panel__title {
    font-size: clamp(34px, 11.5vw, 62px);
  }

  .cl-panel__kicker {
    letter-spacing: 0.26em;
    margin-bottom: 16px;
  }

  .cl-panel__sub {
    font-size: 14.5px;
    line-height: 1.7;
  }

  .cl-panel__cta {
    padding: 15px 27px;
    letter-spacing: 0.14em;
    text-indent: 0.14em;
  }
}

/* 视线很矮的窗口（横屏手机）：一屏塞不下大标题，压一档 */
@media (max-height: 560px) and (orientation: landscape) {
  .cl-panel {
    min-height: 380px;
  }

  .cl-panel__title {
    font-size: clamp(30px, 5.4vw, 56px);
  }

  .cl-panel__sub {
    display: none;
  }

  .cl-panel__cta {
    margin-top: 22px;
    padding: 13px 24px;
  }
}

/* ===================== 减少动效 ===================== */

@media (prefers-reduced-motion: reduce) {
  .cl-panel__inner,
  .cl-panel__kicker,
  .cl-panel__title,
  .cl-panel__sub,
  .cl-panel__cta {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cl-panel__media img,
  .cl-chevron svg {
    transition: none;
    animation: none;
  }

  .cl-dots__dot {
    transition: background 0.2s ease;
  }
}
