
/* 页面整体不滚动 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: rgb(246, 246, 246);
}

canvas.scroll-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  
  /* 避免阻挡交互 */
}


canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 0;
}


/* 每个分类容器（section） */
.scroll-section {
  width: 100vw;
  height: 100vh;
  display: none;
  position: relative;
}

.scroll-section.active {
  display: block;
}



/* 外部容器（canvas 父容器） */
.card-scroll-outer {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}


/* canvas 渲染容器 */
.card-scroll-outer canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ✅ 标题翻页动画 CSS */
#card-caption {
  position: fixed;
  left: 5%;
  bottom: 10%;
  transform: translate(0%, 0%);
  height: 18vh;
  /* 比如 12% 的宽度作为高度 */
  overflow: hidden;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ea
}

#card-caption.show {
  opacity: 1;
}

.caption-track {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  will-change: transform;
}

.caption-item {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 17.5vh;
  /* ✅ 字体大小为视口高度的 12% */
  color: black;
  height: 18vh;
  /* ✅ 与字体同步 */
  line-height: 18vh;
  /* ✅ 保证垂直居中 */
  white-space: nowrap;
  padding-right: 2vh;
  transform: translateY(-6.4vh);
  /* 适配字体高度的偏移 */
  /* 下面叠一层背景色的同样文字，向右下偏移，压到图片上时作为浅色阴影衬出黑字 */
  text-shadow: 0.012em 0.012em 0 rgb(246, 246, 246);
}

#image-intro {
  position: fixed;
  top: 20vh;
  left: 5vw;
  width: 40vw;
  font-family: 'Cormorant Garamond', serif;
  font-size: 3vh;
  /* ✅ 设置文字大小为 4vh */
  line-height: 1.6;
  color: black;
  text-align: justify;
  /* ✅ 两端对齐 */
  z-index: 999;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

#image-intro.hidden {
  opacity: 0;
  display: none !important;
}

#image-intro .intro-text::first-letter {
  float: left;
  font-size: 9.5vh;
  line-height: 1;
  padding-right: 0.5vw;
  margin-top: 0vh;
}



#image-intro.visible {
  opacity: 1;
}

#image-intro .intro-meta {
  opacity: 0;
  margin-top: 1vh;
  font-size: 3vh;
  /* ✅ 年份和角色稍微小一点 */
  text-align: left;
  transition: opacity 0.6s ease;
  color: #444;
}

#image-intro.show-meta .intro-meta {
  opacity: 1;
}







.learn-more-button {
  position: fixed;
  top: 67vh;
  left: 5vw;
  
  font-size: 3vh;
  font-family: 'Cormorant Garamond', serif;
  color: black;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 999;
  pointer-events: none;
  display: none;
  user-select: none;
}

.learn-more-button.visible {
  opacity: 1;
  pointer-events: auto;
}

.learn-more-button:hover {
  cursor: pointer;
}

/* learn more ↗ 用暗红色（与轨道特殊球、开场 Click 同色），下划线跟随文字颜色 */
#detail-button {
  color: #8b1e1e;
}

/* 与顶部按钮同样的下划线动画（.nav-text 定义在 fonts.css） */
.learn-more-button:hover .nav-text {
  background-position: left 92%;
  background-size: 100% 1px;
}

/* ===== 滚动提示：顶部 ↑ scroll ↑，底部 ↓ scroll ↓ ===== */
.scroll-group {
  position: fixed;
  left: 65%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4vh;
  font-family: 'Cormorant Garamond', serif;
  font-size: 3vh;
  color: rgb(95, 95, 95);
  z-index: 2000;
  pointer-events: none;
  user-select: none;
}

.scroll-group.top {
  top: 5vh;
}

.scroll-group.bottom {
  bottom: 5vh;
}

.scroll-word {
  font-style: italic;
  line-height: 1;
}

/* 箭头用网站字体的 ›（与 › Extra Links 同一字形）旋转 90° 得到上 / 下箭头 */
.arrow-glyph {
  display: inline-block;
  line-height: 1;
}

.arrow-glyph.up {
  transform: rotate(-90deg);
}

.arrow-glyph.down {
  transform: rotate(90deg);
}

/* 两组同时开始，周期 2s：闪烁和弹动作用在整组上，scroll 文字与箭头一起动
   顶部组向上弹、底部组向下弹 */
.scroll-group.hint-on {
  visibility: visible;
}

.scroll-group.top.hint-on {
  animation:
    breatheOpacity 2s ease-in-out infinite,
    groupNudgeUp 2s ease-in-out infinite;
}

.scroll-group.bottom.hint-on {
  animation:
    breatheOpacity 2s ease-in-out infinite,
    groupNudgeDown 2s ease-in-out infinite;
}

@keyframes groupNudgeUp {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -0.6vh); }
}

@keyframes groupNudgeDown {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 0.6vh); }
}

/* 链接类按钮（learn more ↗ / Full page ↗）的呼吸：2s，只在 1 ~ 0.35 之间，始终可读 */
@keyframes linkBreathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* 等淡入结束后再开始呼吸；悬停时停止呼吸并保持完全显示 */
.learn-more-button.visible {
  animation: linkBreathe 2s ease-in-out 0.5s infinite;
}

.learn-more-button.visible:hover {
  animation: none;
  opacity: 1;
}


@keyframes breatheOpacity {

  0%,
  100% {
    opacity: 0.1;
  }

  50% {
    opacity: 1;
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, 10px);
  }
}

/* ========= 分类目录页 ========= */
#category-index {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  padding-left: 5vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

body.index-open #category-index {
  opacity: 1;
  pointer-events: auto;
}

/* 列表高度与右侧预览图相同（60vh），首项顶边、末项底边分别与图片上下边对齐 */
.index-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 60vh;
}

.index-item {
  display: flex;
  align-items: baseline;
  gap: 1.2vw;
  width: fit-content;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 9vh;
  line-height: 1.1;
  color: black;
  text-shadow: 0.012em 0.012em 0 #fff;
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transform: translateY(2vh);
  transition: opacity 0.6s ease, transform 0.6s ease, color 0.3s ease;
}

body.index-open .index-item {
  opacity: 1;
  transform: none;
}

/* 悬停一项时其余变淡 */
.index-list.has-hover .index-item:not(.active) {
  color: rgba(0, 0, 0, 0.22);
}

.index-label {
  position: relative;
}

.index-label::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.1em;
  width: 100%;
  height: 1px;
  background: black;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.index-item.active .index-label::after {
  transform: scaleX(1);
}

.index-count {
  font-family: 'Lato', sans-serif;
  font-style: normal;
  font-weight: 300;
  font-size: 2vh;
  letter-spacing: 0.1em;
  color: #777;
}

.index-preview {
  position: fixed;
  right: 12vw;
  top: 50%;
  transform: translateY(-50%);
  width: 45vh;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#category-index.previewing .index-preview {
  opacity: 1;
}

/* 简介放在图片下方、不占高度，保证图片本身正好垂直居中 */
.index-preview .index-blurb {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
}

.index-preview-img {
  position: relative;
  width: 100%;
  height: 60vh;
}

/* 两层交替：切换分类时旧图淡出、新图淡入 */
.pv-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.pv-layer.on {
  opacity: 1;
}

.index-blurb {
  margin-top: 2vh;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 2.6vh;
  line-height: 1.4;
  color: #333;
  transition: opacity 0.25s ease;
}

.index-blurb.swapping {
  opacity: 0;
}

/* 目录打开时隐藏分类视图 */
canvas.scroll-canvas {
  transition: opacity 0.6s ease;
}

body.index-open canvas.scroll-canvas,
body.index-open #card-caption,
body.index-open #image-intro,
body.index-open #detail-button,
body.index-open .scroll-group {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 标题未显示时不响应悬停，避免看不见的下拉菜单被触发 */
#section-title:not(.visible) {
  pointer-events: none;
}

/* 右上角名字：点击进入 CV，悬停时左侧淡入提示 */
/* ===== learn more 转场（page-transition.js） ===== */
#cover-fly {
  position: fixed;
  z-index: 8500;
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
}

#cover-fly img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#cover-fly .fly-cover {
  opacity: 0;
}

/* 转场开始：文字、按钮、其他图片和轨道用 0.7s 淡出，全页不再响应点击 */
body.leaving #card-caption,
body.leaving #image-intro,
body.leaving #detail-button,
body.leaving #section-title,
body.leaving #about-toggle,
body.leaving #site-name,
body.leaving #index-toggle,
body.leaving .scroll-group,
body.leaving #scroll-canvas,
body.leaving #intro-orbit {
  opacity: 0 !important;
  transition: opacity 0.7s ease !important;
}

body.leaving * {
  pointer-events: none !important;
}

/* 目录项里的简介：横屏隐藏（由右侧预览显示），竖屏显示 */
.index-desc {
  display: none;
}

/* ===== 竖屏适配：不追求效果，保证信息完整 ===== */
@media (max-aspect-ratio: 3/4) {
  .index-preview {
    display: none;
  }

  /* 分类目录：分类名 + 数量，下一行是简介 */
  #category-index {
    padding: 0 6vw;
  }

  .index-list {
    height: auto;
    justify-content: flex-start;
    gap: 3vh;
  }

  .index-item {
    font-size: 9vw;
    flex-wrap: wrap;
    column-gap: 3vw;
    row-gap: 0.4vh;
  }

  .index-count {
    font-size: 3vw;
  }

  .index-desc {
    display: block;
    flex-basis: 100%;
    font-size: 3.6vw;
    line-height: 1.4;
    color: #555;
    text-shadow: none;
  }

  /* 分类标题：移到顶部按钮下方（dropdown.css 在后面加载，加 body 前缀提高优先级） */
  body #section-title {
    top: 9vh;
    font-size: 7vw;
  }

  /* 竖屏只显示当前分类名，不弹下拉菜单（换分类用右上角 Index） */
  .right-arrow-placeholder,
  #section-title .dropdown {
    display: none !important;
  }

  body #section-title {
    pointer-events: none;
  }

  #index-toggle,
  a#site-name {
    font-size: 4.2vw;
  }

  /* 竖屏没有悬停，也放不下说明 */
  a#site-name::after,
  #index-toggle::before,
  #about-toggle::after {
    display: none;
  }

  /* 图片画布只占 15vh ~ 51vh */
  canvas.scroll-canvas {
    top: 15vh;
    height: 36vh;
  }

  /* 项目名 */
  #card-caption {
    left: 6vw;
    top: 52vh;
    bottom: auto;
    width: 88vw;
    height: 12vw;
  }

  .caption-item {
    font-size: 9vw;
    height: 12vw;
    line-height: 12vw;
    transform: none;
  }

  /* 简介：项目名下方，放不下时可在文字区内滚动 */
  #image-intro {
    top: calc(52vh + 13vw);
    left: 6vw;
    width: 88vw;
    max-height: calc(36vh - 13vw);
    overflow-y: auto;
    font-size: 3.6vw;
    text-align: left;
    pointer-events: auto;
    scrollbar-width: none;
  }

  #image-intro::-webkit-scrollbar {
    display: none;
  }

  #image-intro .intro-text::first-letter {
    font-size: 2.6em;
  }

  #image-intro .intro-meta {
    font-size: 3.4vw;
  }

  .learn-more-button {
    top: auto;
    bottom: 5vh;
    left: 6vw;
    font-size: 4.2vw;
  }

  .scroll-group {
    font-size: 3.6vw;
  }
}