/* ============================================================
   时骨漫游 · 复古自然博物馆图鉴风格
   ============================================================ */
:root {
  --paper: #f2e8d5;
  --paper-deep: #e7d9bc;
  --ink: #3a2e22;
  --ink-soft: #6b5844;
  --brass: #b08d57;
  --brass-dark: #8a6a3d;
  --museum-green: #2e4036;
  --night: #141c18;
  --accent: #a8542f;
  --serif: "Songti SC", "STSong", "SimSun", serif;
  --sans: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html { scroll-behavior: auto; }

body {
  font-family: var(--sans);
  background: var(--night);
  color: var(--ink);
  overflow-x: hidden;   /* 兜底；注意 hidden 会破坏 sticky */
  overflow-x: clip;     /* 支持 clip 的浏览器用它，保住 position:sticky */
}

img { user-select: none; -webkit-user-drag: none; }

/* ============ 封面 ============ */
#cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  background:
    radial-gradient(ellipse at 50% 30%, #3a4a40 0%, var(--night) 75%);
  display: flex;
  align-items: stretch;
  transition: opacity .9s ease, visibility .9s;
}
#cover.leaving { opacity: 0; visibility: hidden; pointer-events: none; }

.cover-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 4vh 3vw 3vh;
}

.cover-head { text-align: center; margin-bottom: 2.5vh; }

.site-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 84px);
  letter-spacing: .35em;
  text-indent: .35em;
  color: var(--paper);
  text-shadow: 0 4px 24px rgba(0,0,0,.6);
}
.site-title::after {
  content: "";
  display: block;
  width: min(420px, 60vw);
  height: 2px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.site-sub {
  margin-top: 14px;
  color: var(--brass);
  letter-spacing: .3em;
  text-indent: .3em;
  font-size: clamp(12px, 1.3vw, 17px);
}
.cover-hint {
  margin-top: 2.2vh;
  color: #cfd6c9;
  font-size: clamp(13px, 1.2vw, 16px);
  letter-spacing: .12em;
  animation: hintPulse 2.6s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100% { opacity:.55 } 50% { opacity:1 } }

/* 昵称签名栏：羽毛笔 + 金线输入框 */
.nick-row {
  margin-top: 1.6vh;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.nick-quill { color: #e9c46a; font-size: 20px; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
#nickname {
  width: min(320px, 64vw);
  background: rgba(24,20,14,.38);
  border: none;
  border-bottom: 2px solid rgba(233,196,106,.65);
  border-radius: 10px 10px 0 0;
  padding: 9px 14px;
  color: #fff3d0;
  font: 20px "Xingkai SC","Yuanti SC","STSong","Songti SC",serif;
  letter-spacing: .08em;
  text-align: center;
  outline: none;
  transition: border-color .25s, background .25s;
}
#nickname::placeholder { color: rgba(242,232,213,.5); font-size: 16px; }
#nickname:focus { border-bottom-color: #f2d878; background: rgba(24,20,14,.55); }

.choices {
  flex: 1;
  display: flex;
  gap: 14px;
  min-height: 0;
}

.choice {
  position: relative;
  flex: 1;
  border: 3px solid rgba(176,141,87,.45);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: flex .55s cubic-bezier(.22,.9,.28,1), border-color .35s, box-shadow .35s, transform .35s;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  background: #000;
}
.choice:hover {
  flex: 1.65;
  border-color: var(--brass);
  box-shadow: 0 22px 70px rgba(176,141,87,.28);
  transform: translateY(-6px);
}

.choice-img { position: absolute; inset: 0; overflow: hidden; }
.choice-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: sepia(.28) brightness(.72) saturate(1.05);
  animation: kenburns 14s ease-in-out infinite alternate;
  transition: filter .4s;
}
.choice:nth-child(2) .choice-img img { animation-delay: -4.5s; }
.choice:nth-child(3) .choice-img img { animation-delay: -9s; }
.choice:hover .choice-img img { filter: sepia(.15) brightness(.95) saturate(1.15); }

@keyframes kenburns {
  from { transform: scale(1) translateY(0); }
  to   { transform: scale(1.12) translateY(-2.5%); }
}

.choice-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 40px 18px 20px;
  background: linear-gradient(transparent, rgba(12,16,13,.88) 55%);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}
.cname {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 40px);
  letter-spacing: .3em; text-indent: .3em;
}
.clatin {
  font-style: italic;
  font-family: Georgia, serif;
  color: var(--brass);
  font-size: clamp(12px, 1.05vw, 15px);
}
.ctag {
  font-size: clamp(11px, .95vw, 14px);
  color: #d8dccf;
  letter-spacing: .1em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s, transform .4s;
}
.choice:hover .ctag { opacity: 1; transform: none; }

.choice::after {
  content: "以 TA 的身份进入";
  position: absolute;
  top: 18px; left: 50%;
  transform: translateX(-50%) translateY(-6px);
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(176,141,87,.92);
  color: #241b10;
  font-size: 13px;
  letter-spacing: .15em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .35s, transform .35s;
}
.choice:hover::after { opacity: 1; transform: translateX(-50%); }

.cover-foot {
  text-align: center;
  margin-top: 2vh;
  color: #7c8577;
  font-size: 12px;
  letter-spacing: .35em; text-indent: .35em;
}

/* ============ HUD：左上角时间进度条 ============ */
#hud {
  position: fixed;
  top: 18px; left: 20px;
  z-index: 50;
  width: min(480px, 44vw);
  padding: 12px 16px 14px;
  background: linear-gradient(160deg, rgba(242,232,213,.96), rgba(231,217,188,.94));
  border: 2px solid var(--brass-dark);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 0 40px rgba(176,141,87,.15);
  transition: opacity .5s ease, transform .5s ease;
}
#hud.faded { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.hud-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
#hud-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--brass-dark);
  background: #fff;
  object-fit: cover;
}
#hud-name {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .18em;
  color: var(--ink);
}
#hud-era {
  margin-left: auto;
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
}

.progress-wrap { padding: 0 6px; margin-top: 26px; }
.progress-bar {
  position: relative;
  height: 8px;
  border-radius: 99px;
  background: rgba(58,46,34,.18);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.25);
}
.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #5f8f6a, var(--brass) 60%, var(--accent));
}
.progress-ticks { position: absolute; inset: 0; }
.tick {
  position: absolute;
  top: 12px;
  transform: translateX(-50%);
  font-size: 10.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  letter-spacing: .02em;
}
.tick::before {
  content: "";
  position: absolute;
  left: 50%; top: -13px;
  width: 2px; height: 7px;
  background: var(--ink-soft);
  opacity: .6;
}
#walker {
  position: absolute;
  top: -32px;
  left: 0%;
  width: 42px; height: 42px;
  margin-left: -21px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  outline: 2px solid var(--brass-dark);
  background: #fff;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,.4);
  transition: left .1s linear;
}
#walker.walking { animation: walkBob .32s ease-in-out infinite; }
@keyframes walkBob {
  0%,100% { transform: translateY(0) rotate(-6deg); }
  50%     { transform: translateY(-5px) rotate(6deg); }
}

/* ============ 横向时间线 ============ */
#scroll-space { position: relative; }
#sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
#track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.panel {
  position: relative;
  flex: 0 0 auto;
  width: 96vw;
  height: 100%;
  overflow: hidden;
  border-right: 3px solid rgba(176,141,87,.35);
}
.panel.intro { width: 100vw; }

/* 年代面板背景：天空 + 地面 */
.panel.era .sky { position: absolute; inset: 0; }
.panel.era .ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 22%;
  background: linear-gradient(rgba(0,0,0,0) 0%, rgba(30,24,16,.55) 100%);
  border-top: 2px solid rgba(242,232,213,.18);
}
.panel.era::before {  /* 做旧纹理 */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255,255,255,.14), transparent 45%),
    radial-gradient(ellipse at 85% 90%, rgba(0,0,0,.3), transparent 55%);
  pointer-events: none;
}

.era-head {
  position: absolute;
  top: 7vh; left: 4vw;
  max-width: 33vw;
  color: var(--paper);
  z-index: 3;
}
.era-head .era-time {
  display: inline-block;
  padding: 4px 14px;
  border: 1.5px solid rgba(242,232,213,.65);
  border-radius: 99px;
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: .2em;
  margin-bottom: 12px;
  background: rgba(0,0,0,.25);
}
.era-head h2 {
  font-family: "STSong", "Songti SC", "SimSun", serif;   /* 华文宋体 */
  font-weight: 700;
  font-style: italic;
  font-size: clamp(32px, 3.6vw, 56px);
  letter-spacing: .18em;
  text-shadow: 0 4px 18px rgba(0,0,0,.55);
}
.era-head .era-desc {
  margin-top: 10px;
  font-family: "STSong", "Songti SC", "SimSun", serif;   /* 华文宋体 */
  font-size: clamp(13px, 1.2vw, 16.5px);
  line-height: 1.9;
  letter-spacing: .05em;
  color: rgba(242,232,213,.92);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* 地层剖面装饰 */
.strata {
  position: absolute;
  right: 4vw; top: 12vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: .5;
  z-index: 2;
}
.strata i {
  display: block;
  width: 90px; height: 10px;
  border-radius: 6px;
  background: rgba(242,232,213,.35);
}
.strata i:nth-child(2n) { width: 64px; margin-left: 26px; }
.strata i:nth-child(3n) { width: 76px; margin-left: 8px; }

/* 动物热点 */
.hotspot {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -100%);
  text-align: center;
}
.hotspot .hs-ring {  /* 未激活时的引力点 */
  width: 18px; height: 18px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--era-color, var(--brass));
  box-shadow: 0 0 0 0 var(--era-color, var(--brass));
  animation: hsPulse 2.2s ease-out infinite;
  transition: opacity .4s;
}
@keyframes hsPulse {
  0%   { box-shadow: 0 0 0 0 rgba(242,232,213,.55); }
  100% { box-shadow: 0 0 0 18px rgba(242,232,213,0); }
}
.hotspot .hs-name {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  color: rgba(242,232,213,.9);
  letter-spacing: .12em;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
  transition: opacity .4s;
}
.hotspot .hs-badge {
  position: absolute;
  left: 50%; bottom: 26px;
  width: 150px; height: 150px;
  margin-left: -75px;
  border-radius: 50%;
  border: 5px solid #fff;
  outline: 4px solid var(--era-color, var(--brass));
  box-shadow: 0 14px 34px rgba(0,0,0,.55);
  object-fit: cover;
  background: #fff;
  opacity: 0;
  transform: scale(.2) translateY(30px);
  pointer-events: none;
}
.hotspot.on .hs-badge {
  animation: jumpOut .7s cubic-bezier(.34,1.56,.5,1) forwards;
}
@keyframes jumpOut {
  0%   { opacity: 0; transform: scale(.2) translateY(30px); }
  60%  { opacity: 1; transform: scale(1.12) translateY(-14px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.hotspot.on .hs-ring { opacity: 0; animation: none; }
.hotspot.on .hs-name { opacity: 0; }

/* 科普卡片（魔法书质感 + 真实化石照片，固定视口左下） */
.fact-card {
  position: fixed;
  left: 24px; bottom: 24px;
  z-index: 65;
  width: min(370px, 33vw);
  padding: 16px;
  background:
    linear-gradient(rgba(246,237,217,.94), rgba(234,217,184,.94)),
    url(assets/parchment.jpg) center/cover;
  border: 2px solid var(--brass-dark);
  border-radius: 6px 18px 6px 18px;
  box-shadow: 0 16px 44px rgba(0,0,0,.55), inset 0 0 30px rgba(176,141,87,.28);
  opacity: 0;
  transform: translateY(16px) rotate(-1.2deg) scale(.92);
  transition: opacity .45s ease, transform .45s cubic-bezier(.3,1.4,.5,1);
  pointer-events: none;
}
.fact-card.show { opacity: 1; transform: rotate(-1.2deg); }
.fc-main { display: flex; gap: 14px; }
.fact-card .fc-badge {
  flex: 0 0 74px;
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 3px solid var(--brass-dark);
  object-fit: cover;
  background: #fff;
}
.fc-name {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .12em;
  color: var(--ink);
}
.fc-meta {
  margin: 3px 0 7px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .04em;
}
.fc-fact {
  font-size: 13px;
  line-height: 1.75;
  color: #54432f;
}
.fc-fossil {
  margin-top: 12px;
  border: 1.5px solid var(--brass-dark);
  border-radius: 8px;
  overflow: hidden;
  background: #100d0a;
}
.fc-fossil img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  filter: sepia(.18) saturate(.95);
}
.fc-fossil figcaption {
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--brass);
  background: rgba(20,16,10,.85);
}
.fc-voice {
  position: absolute;
  top: -12px; right: 14px;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--museum-green);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: .1em;
  opacity: 0;
  transition: opacity .3s;
}
.fc-voice.on { opacity: 1; animation: hintPulse 1.4s ease-in-out infinite; }
.fact-card::before {  /* 图鉴钉角 */
  content: "";
  position: absolute;
  top: 7px; right: 10px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d9c08a, var(--brass-dark));
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* 序章面板 */
.panel.intro {
  background:
    radial-gradient(ellipse at 50% 0%, #3c5044 0%, var(--museum-green) 55%, #1d2922 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5vw;
  padding: 0 6vw;
  color: var(--paper);
}
.intro-text h2 {
  font-family: var(--serif);
  font-size: clamp(34px, 3.8vw, 56px);
  letter-spacing: .22em;
  margin-bottom: 3vh;
}
.intro-text h2::after {
  content: "";
  display: block;
  width: 120px; height: 2px;
  margin-top: 14px;
  background: var(--brass);
}
.intro-text p {
  font-size: clamp(13px, 1.2vw, 16.5px);
  line-height: 2.1;
  color: #d9dfd2;
}
.intro-text strong { color: var(--brass); font-weight: 600; }
.intro-video video {
  width: min(560px, 40vw);
  border: 3px solid var(--brass-dark);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  display: block;
}
.video-cap {
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  color: #aab4a2;
  letter-spacing: .25em;
}

/* 时代箭头引导 */
.panel.era::after {
  content: "❯";
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 34px;
  color: rgba(242,232,213,.35);
  z-index: 3;
  animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge { 0%,100% { transform: translateY(-50%) translateX(0) } 50% { transform: translateY(-50%) translateX(8px) } }

/* ============ 鼠标跟随物种 ============ */
#cursor-creature {
  position: fixed;
  z-index: 60;
  left: 0; top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(20,28,24,.82);
  border: 1.5px solid rgba(176,141,87,.7);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  backdrop-filter: blur(3px);
}
#cursor-creature.show { opacity: 1; transform: scale(1); }
#cursor-creature img {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  background: #fff;
}
#cursor-creature span {
  color: var(--paper);
  font-size: 13px;
  letter-spacing: .1em;
  white-space: nowrap;
}

/* ============ 结尾螺旋 ============ */
#finale {
  position: relative;
  min-height: 100vh;
  padding: 9vh 4vw 6vh;
  background:
    radial-gradient(ellipse at 50% 40%, #24383099 0%, transparent 70%),
    linear-gradient(#1a241f, var(--night));
  text-align: center;
}
.finale-title {
  font-family: var(--serif);
  font-size: clamp(30px, 3.6vw, 54px);
  letter-spacing: .28em; text-indent: .28em;
  color: var(--paper);
}
.finale-sub {
  margin-top: 2vh;
  color: #b9c2b0;
  font-size: clamp(12.5px, 1.1vw, 15.5px);
  line-height: 2;
}
.spiral-wrap {
  max-width: min(94vh, 96vw);
  margin: 4vh auto 0;
}
#spiral { width: 100%; height: auto; display: block; }

#spiral .spiral-path {
  fill: none;
  stroke: var(--brass);
  stroke-width: 3;
  opacity: .85;
}
#spiral.draw .spiral-path {
  stroke-dasharray: var(--plen);
  stroke-dashoffset: var(--plen);
  animation: spiralDraw 4.5s ease-out forwards;
}
@keyframes spiralDraw { to { stroke-dashoffset: 0; } }

#spiral .era-node { opacity: 0; transform-origin: center; transform-box: fill-box; }
#spiral.draw .era-node {
  animation: nodePop .5s cubic-bezier(.34,1.56,.5,1) forwards;
  animation-delay: var(--delay);
}
@keyframes nodePop {
  from { opacity: 0; transform: scale(.2); }
  to   { opacity: 1; transform: scale(1); }
}
#spiral .era-node circle.core {
  stroke: #fff;
  stroke-width: 2.5;
}
#spiral .era-node text {
  fill: var(--paper);
  font-family: var(--serif);
  letter-spacing: .08em;
}
#spiral .era-node .enode-time {
  fill: #b9c2b0;
  font-family: var(--sans);
}
#spiral .evt { opacity: 0; }
#spiral.draw .evt {
  animation: nodePop .5s ease forwards;
  animation-delay: var(--delay);
}
#spiral .evt text { fill: #e8b34c; font-family: var(--sans); }
#spiral .evt .star { fill: #e8b34c; }

.finale-foot {
  margin-top: 6vh;
  color: #77816f;
  font-size: 12.5px;
  letter-spacing: .1em;
  line-height: 2;
}
#restart {
  margin-top: 12px;
  padding: 10px 30px;
  font-size: 14px;
  letter-spacing: .2em; text-indent: .2em;
  color: var(--paper);
  background: transparent;
  border: 1.5px solid var(--brass);
  border-radius: 999px;
  cursor: pointer;
  transition: background .3s, color .3s;
}
#restart:hover { background: var(--brass); color: #241b10; }

/* ============ 窄屏适配 ============ */
@media (max-width: 760px) {
  .choices { flex-direction: column; }
  .choice:hover { flex: 1.6; }
  #hud { width: calc(100vw - 40px); }
  .panel { width: 100vw; }
  .era-head { max-width: 86vw; }
  .hotspot .hs-badge { width: 110px; height: 110px; margin-left: -55px; }
  .panel.intro { flex-direction: column; gap: 3vh; padding: 12vh 6vw 6vh; text-align: center; }
  .intro-text h2::after { margin-left: auto; margin-right: auto; }
  .intro-video video { width: 86vw; }
  .fact-card { width: min(320px, 82vw); }
}

/* ============================================================
   v2 新增：放大镜 · 地图探索 · 翻页 · 答题 · 徽章 · 魔法装饰
   ============================================================ */

/* ---------- 封面魔法小巷侧翼 + 星光 ---------- */
.cover-alley {
  position: absolute;
  top: 0; bottom: 0;
  width: 13vw;
  background: url(assets/alley.jpg) center/cover;
  opacity: .34;
  filter: saturate(1.1);
  pointer-events: none;
}
.cover-alley.left  { left: 0;  mask-image: linear-gradient(90deg, #000, transparent); -webkit-mask-image: linear-gradient(90deg, #000, transparent); }
.cover-alley.right { right: 0; mask-image: linear-gradient(-90deg, #000, transparent); -webkit-mask-image: linear-gradient(-90deg, #000, transparent); }
.cover-inner { position: relative; z-index: 2; }

#sparkles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
#sparkles i {
  position: absolute;
  color: #ffd98a;
  text-shadow: 0 0 8px rgba(255,217,138,.9);
  opacity: 0;
  animation: twinkle 5s ease-in-out infinite;
  font-style: normal;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: translateY(0) scale(.6) rotate(0deg); }
  50%      { opacity: .95; transform: translateY(-26px) scale(1.1) rotate(40deg); }
}

.snd-hint {
  margin-top: 1.2vh;
  font-size: 12.5px;
  color: #e8c877;
  letter-spacing: .2em;
  animation: hintPulse 2.2s ease-in-out infinite;
}
.snd-hint.off { display: none; }

/* ---------- 年代面板左列：化石标本框 / 考察手账 ---------- */
.specimen {
  position: absolute;
  left: 4vw; top: 36vh;
  width: min(300px, 26vw);
  z-index: 3;
}
.sp-frame {
  padding: 8px;
  background: linear-gradient(150deg, #241d14, #171310);
  border: 3px solid var(--brass-dark);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0,0,0,.55), inset 0 0 24px rgba(176,141,87,.2);
  transform: rotate(-1.6deg);
}
.sp-frame img {
  width: 100%;
  height: 20vh;
  object-fit: cover;
  display: block;
  border-radius: 5px;
  filter: sepia(.16) saturate(.95);
}
.sp-plate {
  margin: 8px auto 0;
  width: fit-content;
  max-width: 100%;
  padding: 4px 14px;
  background: linear-gradient(180deg, #d9bd82, var(--brass));
  border-radius: 3px;
  color: #2a2013;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.45);
}
.specimen.notebook .sp-note {
  padding: 16px 18px;
  background:
    linear-gradient(rgba(246,237,217,.93), rgba(231,217,188,.93)),
    url(assets/parchment.jpg) center/cover;
  border: 2px solid var(--brass-dark);
  border-radius: 4px 14px 4px 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  transform: rotate(-2deg);
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.9;
  color: #4a3a28;
}
.sp-note .quill { font-size: 20px; }

/* ---------- 右侧：挂轴式大地图 ---------- */
.mapbox {
  position: absolute;
  right: 3.5vw; top: 8vh;
  width: 54vw; height: 80vh;
  z-index: 2;
}
.map-rod {
  position: absolute;
  left: -14px; right: -14px;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #6d543a, #3f2f1e);
  box-shadow: 0 4px 10px rgba(0,0,0,.5);
  z-index: 4;
}
.map-rod.top { top: -7px; }
.map-rod.bottom { bottom: -7px; }
.map-inner {
  position: absolute;
  inset: 7px 0;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.45), 0 18px 50px rgba(0,0,0,.5);
  cursor: none;
  background: #1c2a3a;
}
.map-pan {
  position: absolute;
  width: 152%; height: 152%;
  left: -26%; top: -26%;
  background: url(assets/worldmap.jpg);
  background-size: 100% 100%;
  transition: transform .3s ease-out;
}
.map-inner::after {  /* 做旧光晕 */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(20,14,8,.5) 100%);
  pointer-events: none;
}
.map-tag {
  position: absolute;
  left: 14px; bottom: 10px;
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: .3em;
  color: rgba(242,232,213,.75);
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  z-index: 3;
}
.map-count {
  position: absolute;
  right: 14px; top: 10px;
  padding: 3px 12px;
  border-radius: 99px;
  background: rgba(20,28,24,.78);
  border: 1.5px solid rgba(176,141,87,.7);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: .12em;
  z-index: 3;
}
.map-count.done { background: #5f8f4a; border-color: #d9e8b0; }

/* 地图上的动物光点 */
.dot {
  position: absolute;
  width: 0; height: 0;
  z-index: 2;
}
.dot-pulse {
  position: absolute;
  left: -9px; top: -9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe9a8, #e8a33c);
  border: 2px solid #fff2cf;
  box-shadow: 0 0 10px 2px rgba(255,220,140,.8);
  animation: hsPulse 2s ease-out infinite;
  transition: transform .3s, opacity .3s;
}
.dot-badge {
  position: absolute;
  left: -26px; top: -26px;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid #fff;
  outline: 3px solid var(--era-color, var(--brass));
  box-shadow: 0 8px 20px rgba(0,0,0,.6);
  object-fit: cover;
  background: #f2e8d5;
  opacity: 0;
  transform: scale(.2);
  transition: opacity .45s cubic-bezier(.34,1.56,.5,1), transform .45s cubic-bezier(.34,1.56,.5,1);
}
.dot.found .dot-pulse { transform: scale(.45); opacity: .7; animation: none; }
.dot.found .dot-badge { opacity: 1; transform: scale(1); }

/* ---------- 放大镜（3D 黄铜镜） ---------- */
#lens {
  position: fixed;
  z-index: 70;
  left: 0; top: 0;
  width: 180px; height: 180px;
  margin: -90px 0 0 -90px;
  border-radius: 50%;
  /* 3D 亮金镜圈：抛光黄铜的高光与暗面（参考：金圈木柄放大镜） */
  background:
    conic-gradient(from 215deg,
      #8a6a1c 0deg, #d4af37 36deg, #fff0b8 84deg, #f7e08c 118deg,
      #e9c96a 160deg, #a87f24 210deg, #caa45e 262deg, #f2d878 310deg, #8a6a1c 360deg);
  outline: 2px solid rgba(247,224,140,.9);           /* 外侧描金细环 */
  outline-offset: 1.5px;
  box-shadow:
    0 22px 46px rgba(0,0,0,.6),
    0 4px 10px rgba(0,0,0,.45),
    inset 0 2px 3px rgba(255,244,214,.75),
    inset 0 -3px 6px rgba(46,32,10,.65);
  pointer-events: none;
  opacity: 0;
  transform: perspective(700px) rotate(20deg) scale(.6);   /* 整体顺时针 20° */
  transition: opacity .25s;
  will-change: transform;
}
#lens.show { opacity: 1; }
#lens .lens-glass {
  position: absolute; inset: 11px;         /* 让黄铜环露出来 */
  border-radius: 50%;
  overflow: hidden;
  background-image: var(--zoom-img, none);
  background-size: 340px 340px;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(255, 246, 220, .12);
  /* 镜片纵深感：内凹阴影 + 边缘暗角 */
  box-shadow:
    inset 0 10px 24px rgba(43,28,8,.55),
    inset 0 -8px 18px rgba(43,28,8,.35),
    inset 0 0 0 3px rgba(70,50,20,.55),
    inset 0 0 42px rgba(30,18,4,.35);
}
#lens .lens-glass::before {  /* 斜向玻璃反光 */
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg,
    rgba(255,255,255,.38) 0%, rgba(255,255,255,.10) 22%,
    transparent 42%, transparent 70%, rgba(255,255,255,.08) 100%);
}
#lens .lens-glass::after {  /* 球面高光 */
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.65), transparent 30%),
    radial-gradient(circle at 72% 84%, rgba(255,255,255,.16), transparent 32%);
}
#lens::before {  /* 红棕木柄：顶部金箍咬入镜圈，末端金头收尾，一体成形 */
  content: "";
  position: absolute;
  right: 0px; bottom: -52px;
  width: 26px; height: 104px;
  clip-path: polygon(6% 0, 94% 0, 76% 100%, 24% 100%);   /* 微微收分的柄身 */
  background:
    /* 末端金头 */
    linear-gradient(90deg, #8a6a1c, #f2d878 45%, #fff0b8 55%, #a87f24) 0 100% / 100% 11px no-repeat,
    /* 顶部金箍 */
    linear-gradient(90deg, #8a6a1c, #f2d878 45%, #fff0b8 55%, #a87f24) 0 0 / 100% 9px no-repeat,
    /* 玫瑰木柄身 */
    linear-gradient(90deg,
      #33130c 0%, #6e2a1a 22%, #a04528 44%, #c05a34 54%, #8a3520 70%, #4a1c10 88%, #33130c 100%);
  transform: rotate(-64deg);       /* 柄轴延长线穿过镜圈圆心（径向） */
  transform-origin: top center;
  box-shadow: 0 14px 24px rgba(0,0,0,.55);
}
#lens::after {  /* 手柄顶部金箍已咬入镜圈充当连接，无需独立颈件 */
  content: none;
  display: none;
}
#lens.zoom {
  box-shadow:
    0 22px 46px rgba(0,0,0,.6),
    0 4px 10px rgba(0,0,0,.45),
    0 0 38px rgba(233,209,150,.55),
    inset 0 2px 3px rgba(255,244,214,.75),
    inset 0 -3px 6px rgba(46,32,10,.65);
}
#lens.zoom .lens-glass {
  background-color: #f2e8d5;
  /* 头部特写：放大并偏向图像上部（头部区域） */
  background-size: 660px 660px;
  background-position: 50% 20%;
}

/* ---------- 羊皮纸翻页 ---------- */
#pageflip {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  perspective: 1600px;
}
#pageflip .leaf {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(240,226,196,.35), rgba(200,170,110,.5)),
    url(assets/parchment.jpg) center/cover;
  transform-origin: left center;
  transform: rotateY(95deg);
  box-shadow: 20px 0 60px rgba(0,0,0,.5);
  backface-visibility: hidden;
  opacity: 0;
}
#pageflip.snap .leaf {
  transition: none !important;
  transform: rotateY(95deg) !important;
  opacity: 0 !important;
}
#pageflip .leaf.back {
  filter: brightness(.82);
  transition: transform 1.1s cubic-bezier(.6,.05,.3,1) .08s, opacity .18s;
}
#pageflip .leaf.front {
  transition: transform 1.05s cubic-bezier(.55,.06,.35,1), opacity .18s;
  border-right: 4px solid rgba(122,90,48,.6);
}
#pageflip.turn .leaf { transform: rotateY(-95deg); opacity: 1; }
#pageflip.turn .leaf.front { transform: rotateY(-100deg); }

/* ---------- 答题小框 ---------- */
#quiz {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 14, 8, .5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .4s;
}
#quiz[hidden] { display: none; }
#quiz.open { opacity: 1; }
.quiz-card {
  width: min(440px, 88vw);
  padding: 0 0 20px;
  background:
    linear-gradient(rgba(246,237,217,.96), rgba(231,217,188,.96)),
    url(assets/parchment.jpg) center/cover;
  border: 3px solid var(--brass-dark);
  outline: 2px solid rgba(242,232,213,.7);
  outline-offset: -7px;
  border-radius: 6px 22px 6px 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 60px rgba(232,179,76,.15);
  transform: translateY(30px) rotate(1.5deg) scale(.9);
  transition: transform .5s cubic-bezier(.3,1.4,.5,1);
}
#quiz.open .quiz-card { transform: rotate(1.5deg); }
.quiz-head {
  padding: 14px 20px 10px;
  border-bottom: 2px dashed rgba(122,90,48,.5);
  text-align: center;
}
.quiz-head h3 {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.quiz-era {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 16px;
  border-radius: 99px;
  color: #fff;
  font-size: 12px;
  letter-spacing: .15em;
  box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.quiz-q {
  padding: 16px 24px 6px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  text-align: center;
}
.quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 28px 4px;
}
.quiz-opt {
  padding: 10px 16px;
  font-size: 14.5px;
  font-family: var(--serif);
  letter-spacing: .08em;
  color: var(--paper);
  background: linear-gradient(160deg, #4a5a68, #2e4036);
  border: 2px solid var(--brass);
  border-radius: 10px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.quiz-opt:nth-child(2) { background: linear-gradient(160deg, #7a4a3a, #5a2e28); }
.quiz-opt:nth-child(3) { background: linear-gradient(160deg, #3f5a44, #274034); }
.quiz-opt:hover:not(:disabled) {
  transform: translateX(4px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,.4), 0 0 14px rgba(232,179,76,.4);
}
.quiz-opt.right { background: linear-gradient(160deg, #6a9a4a, #3f6a2e) !important; box-shadow: 0 0 22px rgba(160,220,110,.6); }
.quiz-opt.bad { background: linear-gradient(160deg, #8a8a8a, #555) !important; opacity: .75; }
.quiz-result {
  min-height: 24px;
  padding: 8px 20px 0;
  text-align: center;
  font-size: 13.5px;
  letter-spacing: .08em;
}
.quiz-result.ok { color: #3f6a2e; font-weight: 700; }
.quiz-result.no { color: #a8542f; }

/* ---------- 右上角：徽章托盘 ---------- */
#side-tray {
  position: fixed;
  top: 18px; right: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transition: opacity .5s;
}
#side-tray.faded { opacity: 0; pointer-events: none; }
#snd-toggle {
  width: 62px; height: 62px;
  padding: 0;
  border: none;                     /* 无底图、无边框 */
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.55));
  transition: transform .25s, filter .25s, opacity .25s;
}
#snd-toggle:hover { transform: translateY(-3px) rotate(-4deg); }
#snd-toggle svg { width: 100%; height: 100%; display: block; }
#snd-toggle.muted { opacity: .45; filter: grayscale(.7) drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
#snd-toggle.muted::after {          /* 静音斜杠 */
  content: "";
  position: absolute;
  left: 6px; right: 6px; top: 50%;
  height: 4px;
  background: #a8542f;
  border-radius: 2px;
  transform: rotate(-38deg);
  box-shadow: 0 0 0 2px rgba(242,232,213,.9);
}
#badge-tray {
  padding: 0;
  background: transparent;          /* 去掉米白底 */
  border: none;
  box-shadow: none;
  text-align: center;
}
.tray-title {
  font-size: 11px;
  letter-spacing: .25em;
  text-indent: .25em;
  color: #f2e8d5;
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
  margin-bottom: 6px;
}
.tray-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 62vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.tray-list:empty::after {
  content: "答题可获徽章";
  font-size: 10.5px;
  color: rgba(242,232,213,.85);
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
  letter-spacing: .1em;
  writing-mode: vertical-rl;
  margin: 6px auto;
}
.tray-badge {
  width: 62px;
  animation: badgeIn .7s cubic-bezier(.34,1.56,.5,1);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.4));
}
.tray-badge svg { display: block; width: 100%; height: auto; }
@keyframes badgeIn {
  0%   { opacity: 0; transform: scale(.2) rotate(-40deg); }
  60%  { opacity: 1; transform: scale(1.25) rotate(8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* ---------- 结尾：徽章回顾 ---------- */
#my-badges { display: none; margin-top: 3vh; }
#my-badges.has { display: block; }
.mb-title {
  color: #e8c877;
  font-size: clamp(13px, 1.2vw, 16px);
  letter-spacing: .25em;
  margin-bottom: 1.6vh;
}
.mb-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.mb-badge {
  width: clamp(64px, 7vw, 92px);
  animation: badgeIn .7s cubic-bezier(.34,1.56,.5,1);
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.5));
}
.mb-badge svg { display: block; width: 100%; height: auto; }

/* ---------- 窄屏适配补充 ---------- */
@media (max-width: 760px) {
  .era-head { max-width: 60vw; }
  .specimen { display: none; }
  .mapbox { width: 88vw; right: 6vw; height: 52vh; top: 34vh; }
  #lens { width: 130px; height: 130px; margin: -65px 0 0 -65px; }
  #lens::before { height: 50px; bottom: -26px; transform: rotate(-52deg); }   /* 短柄同样咬入镜圈并指向圆心 */
  .fact-card { width: min(330px, 84vw); }
  .cover-alley { display: none; }
}

/* ---------- 更新世终章：人类演化行走 ---------- */
#evo {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
  /* 当前页面慢慢虚化 */
  backdrop-filter: blur(0px) brightness(1);
  -webkit-backdrop-filter: blur(0px) brightness(1);
  background: radial-gradient(ellipse at 50% 62%, rgba(43,32,18,0) 30%, rgba(28,20,10,.55) 100%);
}
#evo.on {
  opacity: 1;
  backdrop-filter: blur(14px) brightness(.72) sepia(.28);
  -webkit-backdrop-filter: blur(14px) brightness(.72) sepia(.28);
  transition: opacity 1.5s ease, backdrop-filter 2.2s ease;
}
#evo .evo-stage { position: absolute; inset: 0; }
#evo .evo-title {
  position: absolute;
  top: 7vh; left: 0; right: 0;
  text-align: center;
  font-family: "STSong", "Songti SC", serif;
  font-weight: 700; font-style: italic;
  font-size: clamp(22px, 2.6vw, 40px);
  letter-spacing: .3em;
  color: #f2e8d5;
  text-shadow: 0 4px 20px rgba(0,0,0,.7);
}
#evo .evo-lineup {
  position: absolute;
  inset: 0;
}
#evo .evo-fig {
  position: absolute;
  bottom: 15vh;
  height: 50vh;
  transition: left 3.9s cubic-bezier(.3,.55,.35,1);
  filter: drop-shadow(0 16px 20px rgba(0,0,0,.55));
}
#evo .evo-fig img {
  height: 100%;
  /* 无边框、无底图：边缘椭圆渐隐，只留水彩人物 */
  background: transparent;
  -webkit-mask-image: radial-gradient(ellipse 64% 70% at 50% 46%, #000 52%, transparent 76%);
  mask-image: radial-gradient(ellipse 64% 70% at 50% 46%, #000 52%, transparent 76%);
}
#evo .evo-fig.walking img {
  /* 双步节奏：一周期两次抬落 + 左右微倾，像两条腿走路 */
  animation: evo-step 0.82s ease-in-out infinite;
  transform-origin: 50% 92%;
}
@keyframes evo-step {
  0%   { transform: translateY(0) translateX(0) rotate(.9deg); }
  22%  { transform: translateY(-10px) translateX(-2px) rotate(-.7deg); }
  46%  { transform: translateY(0) translateX(0) rotate(.9deg); }
  50%  { transform: translateY(-2px) translateX(1px) rotate(.4deg); }
  72%  { transform: translateY(-10px) translateX(2px) rotate(-.7deg); }
  96%  { transform: translateY(0) translateX(0) rotate(.9deg); }
  100% { transform: translateY(0) translateX(0) rotate(.9deg); }
}
#evo.freeze .evo-fig img { animation: none; }
#evo.freeze .evo-title {
  text-shadow: 0 0 26px rgba(233,209,150,.65), 0 4px 20px rgba(0,0,0,.7);
}


/* ---------- 纪念海报弹层 ---------- */
#poster {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20,28,24,.78);
  backdrop-filter: blur(10px);
}
#poster[hidden] { display: none; }
.poster-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: posterIn .6s cubic-bezier(.3,1.4,.5,1);
}
@keyframes posterIn {
  from { transform: translateY(36px) scale(.86); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.poster-img {
  height: min(78vh, 1100px);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 0 6px rgba(242,232,213,.9);
}
.poster-actions { display: flex; gap: 16px; }
.poster-save, .poster-close {
  padding: 12px 30px;
  border-radius: 99px;
  border: 2px solid var(--brass-dark);
  background: linear-gradient(160deg, #f2e8d5, #e7d9bc);
  color: var(--ink);
  font-size: 16px;
  font-family: "STSong", "Songti SC", serif;
  font-weight: 700;
  letter-spacing: .15em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
  transition: transform .2s;
}
.poster-save:hover, .poster-close:hover { transform: translateY(-2px); }

/* 纪念海报按钮 */
#poster-btn {
  margin-top: 14px;
  padding: 12px 30px;
  border-radius: 99px;
  border: 2px solid var(--brass-dark);
  background: linear-gradient(160deg, #f2e8d5, #e7d9bc);
  color: var(--ink);
  font-size: 17px;
  font-family: "STSong", "Songti SC", serif;
  font-weight: 700;
  letter-spacing: .18em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
  transition: transform .25s, box-shadow .25s;
}
#poster-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 34px rgba(0,0,0,.5), 0 0 24px rgba(233,209,150,.5);
}
