/* ==========================================
   生物多样性互动海报
   ========================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #d5cfb8;
  overflow: hidden;
  height: 100vh; width: 100vw;
  color: #3a3628;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 导航点 ---------- */
.nav-dots {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 10px;
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(0,0,0,0.15); cursor: pointer;
  transition: all 0.4s;
}
.dot.active { background: #8b7a3a; transform: scale(1.5); box-shadow: 0 0 10px rgba(140,120,50,0.3); }

/* ---------- 滚动轨道 ---------- */
.track {
  position: relative; z-index: 1;
  height: 100vh; width: 100vw;
  overflow-y: scroll; scroll-snap-type: y mandatory;
}
.track::-webkit-scrollbar { display: none; }

.page {
  height: 100vh; width: 100vw;
  scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  position: relative; z-index: 0; overflow: hidden;
}

/* ---------- 全局固定背景 ---------- */
.global-poster {
  position: fixed; bottom: 0; left: 0;
  width: 100vw; height: auto;
  z-index: 0;
  pointer-events: none;
}

/* ==========================================
   Page 0: 封面
   ========================================== */
.cover-page { background: transparent; }

.cover-layout {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 40px;
  max-width: 960px; width: 90%; padding: 40px;
  animation: fadeUp 1s ease-out;
}
.cover-title-img {
  width: min(45%, 380px); object-fit: contain;
  filter: drop-shadow(0 8px 30px rgba(0,0,0,0.1));
  animation: floatIn 1.2s ease-out;
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cover-side {
  flex: 1; min-width: 200px;
}
.cover-sub {
  font-size: 13px; letter-spacing: 0.35em;
  color: #8b7a5a; text-transform: uppercase; margin-bottom: 16px;
}
.cover-desc {
  font-size: clamp(13px, 1.6vw, 15px);
  line-height: 2; color: #5a5240;
  margin-bottom: 28px;
}
.cover-hint {
  font-size: 12px; color: #c0b890;
  animation: hintPulse 2.5s infinite;
}
@keyframes hintPulse {
  0%,100% { opacity: 0.3; }
  50%     { opacity: 0.9; }
}

/* ==========================================
   Page 1: 转盘 + 花花草草
   ========================================== */
.disc-intro-page { background: transparent; }

.disc-intro-layout {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
}

/* 花花草草 — 在圆盘下方，拖拽时浮现 */
.flowers-area {
  position: absolute;
  z-index: 0;
  width: min(70vw, 70vh, 440px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.flowers-area img {
  width: 100%; object-fit: contain;
}

/* 圆盘 */
.disc-zone {
  z-index: 1;
  width: min(60vw, 60vh, 380px); aspect-ratio: 1;
  cursor: grab; user-select: none; -webkit-user-select: none;
  position: relative;
}
.disc-zone:active, .disc-zone.dragging { cursor: grabbing; }
.disc-zone img {
  width: 100%; object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.08));
}
.spin-hint {
  text-align: center; margin-top: 6px;
  font-size: 11px; color: #c0b890;
  transition: opacity 0.4s;
}

.disc-intro-text {
  text-align: center; z-index: 1;
}
.disc-intro-text h2 {
  font-size: clamp(16px, 2.5vw, 22px);
  color: #6b5a38; letter-spacing: 0.08em;
}
.disc-intro-text p {
  font-size: 13px; color: #9a9078; margin-top: 4px;
}

/* ==========================================
   Page 2: 半圆盘品类选择
   ========================================== */
.category-page { background: transparent; }

.category-layout {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 30px; width: 90%; max-width: 860px;
}

/* 左：半圆盘裁剪 */
.wheel-half {
  flex-shrink: 0;
  position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.wheel-clip {
  width: min(45vw, 45vh, 320px); aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  cursor: grab; user-select: none; -webkit-user-select: none;
  box-shadow: 0 6px 30px rgba(0,0,0,0.08);
}
.wheel-clip:active { cursor: grabbing; }
.wheel-clip.dragging { cursor: grabbing; }
.wheel-img {
  width: 100%; object-fit: contain;
  pointer-events: none;
}

/* 右：品类图展示 */
.category-display {
  flex: 1; min-width: 200px;
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.cat-show-img {
  width: 100%; max-width: 380px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  transition: opacity 0.3s ease;
}

.cat-indicator {
  display: flex; gap: 8px;
}
.cat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.3s;
}
.cat-dot.active { background: #8b7a3a; transform: scale(1.4); }

/* ==========================================
   Page 3: 转盘 + 信息展示
   ========================================== */
.info-page { background: transparent; }

.info-layout {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; justify-content: center;
  gap: 30px; width: 92%; max-width: 900px;
}

/* 左：圆盘 */
.info-disc-area {
  flex-shrink: 0;
  width: min(38vw, 38vh, 280px); aspect-ratio: 1;
  cursor: grab; user-select: none; -webkit-user-select: none;
  display: flex; flex-direction: column; align-items: center;
}
.info-disc-area:active, .info-disc-area.dragging { cursor: grabbing; }
.info-disc-img {
  width: 100%; object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.08));
}

/* 右：信息区 */
.info-right {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 14px;
}

/* 选中品类大图 */
.info-featured {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.info-featured img {
  width: 100%; display: block;
  object-fit: contain;
  max-height: 30vh;
}

/* 品类缩略图网格 — 3×2 大尺寸 */
.info-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.info-thumb {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  background: rgba(255,255,255,0.5);
  transition: all 0.3s;
}
.info-thumb:hover {
  background: rgba(255,255,255,0.8);
  transform: translateY(-2px);
}
.info-thumb.active {
  border-color: #8b7a3a;
  background: rgba(200,180,100,0.15);
}
.info-thumb img {
  width: 100%;
  object-fit: contain;
  aspect-ratio: 1890 / 1417;
}
.info-thumb span {
  font-size: 11px; color: #6b5a38; font-weight: 600;
}

/* 文字说明 */
.info-text {
  background: rgba(255,255,255,0.6);
  border-radius: 10px; padding: 14px 16px;
}
.info-text h3 {
  font-size: 16px; color: #6b5a38; margin-bottom: 6px;
}
.info-text p {
  font-size: 13px; line-height: 1.6; color: #5a5240;
}

/* ========== 响应式 ========== */

/* ==========================================
   Page 4: 结尾黑场
   ========================================== */
.end-page { background: transparent; }

.end-content {
  position: relative; z-index: 1;
  text-align: center;
  animation: fadeUp 0.8s ease-out;
}
.end-content h2 {
  font-size: clamp(20px, 3.5vw, 30px);
  color: #6b5a38; letter-spacing: 0.1em; margin-bottom: 10px;
}
.end-content p {
  font-size: 14px; color: #8b7a5a; margin-bottom: 24px;
}
.end-img {
  max-width: 320px; width: 70%;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.1));
}

/* 黑场覆盖层 */
.black-overlay {
  position: absolute; inset: 0;
  background: #000;
  opacity: 0; pointer-events: none;
  transition: opacity 4s ease;
  z-index: 10;
}
.black-overlay.on { opacity: 1; }

/* ========== 公共动画 ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
  .cover-layout {
    flex-direction: column; gap: 20px; text-align: center;
  }
  .cover-title-img { width: 70%; }
  .category-layout {
    flex-direction: column; gap: 16px;
  }
  .wheel-clip { width: min(55vw, 55vh, 260px); }
  .cat-show-img { max-width: 280px; }
  .info-layout {
    flex-direction: column; gap: 16px;
  }
  .info-disc-area { width: min(45vw, 45vh, 220px); }
  .info-card { padding: 16px; }
}
@media (min-width: 1024px) {
  .cover-title-img { width: min(42%, 400px); }
  .disc-zone { width: min(50vw, 50vh, 400px); }
  .wheel-clip { width: min(40vw, 40vh, 360px); }
  .info-disc-area { width: min(36vw, 36vh, 320px); }
}
