/* ============================================
   场景交互层：光标墨迹 / 水面涟漪 / 视差 / 进度
   ============================================ */

/* ===== 光标拖尾墨迹 ===== */
.ink-trail {
  position: fixed;
  pointer-events: none;
  z-index: 9997;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  background: radial-gradient(circle,
    rgba(40, 25, 10, 0.55) 0%,
    rgba(40, 25, 10, 0.25) 55%,
    transparent 100%);
  filter: blur(1.5px);
  animation: inkTrailFade 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  mix-blend-mode: multiply;
}

@keyframes inkTrailFade {
  0%   { opacity: 0.85; transform: translate(-50%, -50%) scale(0.6) rotate(var(--r, 0deg)); }
  35%  { opacity: 0.55; transform: translate(-50%, -50%) scale(1.05) rotate(var(--r, 0deg)); }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(1.4) rotate(var(--r, 0deg)) translateY(8px); }
}

/* ===== 水面涟漪（在场景内点击/移动触发） ===== */
.water-ring {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(245, 235, 210, 0.55);
  box-shadow:
    0 0 8px rgba(232, 220, 190, 0.32),
    inset 0 0 4px rgba(232, 220, 190, 0.22);
  transform: translate(-50%, -50%) scale(0.4);
  animation: waterRing 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  mix-blend-mode: screen;
}

@keyframes waterRing {
  0%   { opacity: 0;    transform: translate(-50%, -50%) scale(0.4) scaleY(0.35); }
  20%  { opacity: 0.75; }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(7) scaleY(0.35); border-color: transparent; }
}

/* ===== 视差层（仅场景内激活） ===== */
.scene .scene-bg-video,
.scene .scene-bg-fallback {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.scene .tags-layer {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.scene .water-ripple {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== 已游观奇物：图鉴卡片朱印 ===== */
.atlas-card.viewed::after {
  content: '游';
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  background: var(--c-seal);
  color: #f7ecd2;
  font-family: var(--font-kai);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  box-shadow:
    0 0 0 1.5px rgba(255, 240, 210, 0.7) inset,
    1px 2px 4px rgba(0, 0, 0, 0.25);
  transform: rotate(-8deg);
  opacity: 0.92;
  z-index: 5;
  animation: stampImpress 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

@keyframes stampImpress {
  0%   { opacity: 0;    transform: rotate(20deg) scale(2.2); }
  60%  { opacity: 1;    transform: rotate(-12deg) scale(0.92); }
  100% { opacity: 0.92; transform: rotate(-8deg) scale(1); }
}

/* 标签自身在场景里也可显示"已游观"小印 */
.tag.viewed .tag-text {
  background: rgba(255, 245, 220, 0.96);
}

.tag.viewed .tag-dot {
  background: var(--c-seal);
  box-shadow: 0 0 10px rgba(184, 69, 62, 0.6);
}

/* ===== Hero / Ending 进度条 ===== */
.progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--font-kai);
  color: var(--c-ink-light);
  letter-spacing: 4px;
  font-size: 12px;
  opacity: 0;
  animation: fadeIn 1.2s 3.8s forwards;
}

#ending .progress-wrap {
  margin-top: -28px;
  animation-delay: 3.4s;
}

.progress-text .pg-num {
  color: var(--c-seal);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  margin: 0 2px;
}

.progress-extra {
  font-family: var(--font-kai);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--c-ink-muted);
  margin-top: 4px;
}

.progress-extra .pg-num {
  color: var(--c-seal);
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0 2px;
}

.progress-bar {
  width: 220px;
  height: 4px;
  background: rgba(160, 120, 70, 0.18);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pg, 0%);
  background: linear-gradient(90deg, var(--c-gold) 0%, var(--c-gold-light) 100%);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px rgba(232, 184, 94, 0.55);
}

/* ===== 场景集齐：题字浮现 ===== */
.scene-complete-banner {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}

.scene-complete-banner.show {
  animation: bannerShow 4.2s ease forwards;
}

.scene-complete-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 60px;
  background: rgba(245, 235, 215, 0.82);
  border: 1px solid var(--c-gold);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.scene-complete-title {
  font-family: var(--font-kai);
  font-size: 30px;
  letter-spacing: 14px;
  color: var(--c-ink);
  font-weight: 600;
  padding-left: 14px;
}

.scene-complete-sub {
  font-family: var(--font-kai);
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--c-ink-light);
}

.scene-complete-seal {
  width: 48px;
  height: 48px;
  background: var(--c-seal);
  color: #f7ecd2;
  font-family: var(--font-kai);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.25);
  margin-top: 4px;
  transform: rotate(-6deg);
}

@keyframes bannerShow {
  0%   { opacity: 0; transform: scale(0.94); }
  18%  { opacity: 1; transform: scale(1); }
  78%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); }
}

/* 集齐之后：场景里所有标签发金光呼吸 */
.scene.all-viewed .tag .tag-dot {
  animation: pulseGold 2.2s ease-in-out infinite;
}

@keyframes pulseGold {
  0%, 100% {
    box-shadow: 0 0 8px rgba(232, 184, 94, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 22px rgba(232, 184, 94, 1);
    transform: scale(1.3);
  }
}

/* 用户偏好减少动效时，关闭装饰性动画 */
@media (prefers-reduced-motion: reduce) {
  .ink-trail,
  .water-ring,
  .scene-complete-banner,
  .scene .scene-bg-video,
  .scene .scene-bg-fallback,
  .scene .mist-1,
  .scene .mist-2,
  .scene .tags-layer {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* 落叶粒子：靠近光标时点亮放大 */
.particle {
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.particle.pushed {
  filter: drop-shadow(0 0 6px rgba(232, 184, 94, 0.85)) brightness(1.4);
  opacity: 1 !important;
}

/* 移动端：关闭墨迹/视差等鼠标特性 */
@media (max-width: 900px), (pointer: coarse) {
  .ink-trail { display: none; }
}
