/* ==========================================================================
   西华·女娲传说 H5 — 各页面样式（P1 ~ P12）
   ========================================================================== */

/* ===== 通用：岩画符号散布 ===== */
.rock-art { position: absolute; opacity: .38; pointer-events: none; }
.rock-art svg { width: 100%; height: 100%; }

/* ========================= P1 加载页 ========================= */
.page-1 {
  background:
    radial-gradient(ellipse at 50% 40%, #dcc08a, #bd9458 58%, #8a6335 100%);
}
.page-1 .loader-title {
  left: 0; right: 0; top: 32%; text-align: center;
  font-family: var(--title-font); font-size: 72px; letter-spacing: 12px;
  color: #4a3218; text-shadow: 0 3px 10px rgba(255, 235, 190, .5);
}
.page-1 .loader-sub {
  left: 0; right: 0; top: 46%; text-align: center;
  font-size: 28px; letter-spacing: 6px; color: #5a3f22;
}
.page-1 .loader-hint {
  left: 0; right: 0; bottom: 232px; text-align: center;
  font-size: 24px; letter-spacing: 3px; color: #5a3f22;
  animation: hintPulse 1.8s ease-in-out infinite;
}
.page-1 .loader-track {
  position: absolute; left: 150px; right: 150px; bottom: 190px;
  height: 16px; border-radius: 10px; overflow: hidden;
  background: rgba(60, 40, 20, .35);
  border: 1.5px solid rgba(110, 123, 122, .8);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.3);
}
.page-1 .loader-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #a7b8b5, #6e7b7a);
  box-shadow: 0 0 16px #a7b8b5;
  transition: width .12s linear;
}

/* ========================= P2 首页 ========================= */
.page-2 {
  background:
    radial-gradient(ellipse at 50% 30%, #3a3a44 0%, #23232b 45%, #141418 100%);
}
.page-2 .chaos-clouds {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 35%, rgba(180,170,200,.12), transparent 40%),
    radial-gradient(circle at 70% 55%, rgba(150,160,180,.10), transparent 45%),
    radial-gradient(circle at 50% 70%, rgba(120,110,140,.10), transparent 50%);
  filter: blur(8px);
}
.page-2 .star {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #f0e6c8; box-shadow: 0 0 8px #f0e6c8;
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.3); } }
/* 女娲剪影：侧边、低透明、文字下层 */
.page-2 .nuwa-silhouette {
  position: absolute; right: -40px; top: 200px; width: 360px; height: 760px;
  opacity: .22; z-index: 1; pointer-events: none;
  filter: drop-shadow(0 0 20px rgba(232,200,120,.3));
}
.page-2 .home-title {
  left: 0; right: 0; top: 200px; text-align: center; z-index: 5;
}
.page-2 .home-title h1 {
  font-family: var(--title-font); font-size: 96px; letter-spacing: 18px;
  color: var(--gold); text-shadow: 0 4px 18px rgba(0,0,0,.7), 0 0 30px rgba(232,200,120,.4);
}
.page-2 .home-title .home-sub {
  margin-top: 28px; font-size: 27px; line-height: 1.9; letter-spacing: 4px;
  color: var(--sand); text-shadow: 0 2px 8px rgba(0,0,0,.7);
  padding: 0 80px;
}
.page-2 .start-btn {
  left: 50%; transform: translateX(-50%); bottom: 280px;
  width: 420px; height: 110px; font-size: 38px; z-index: 6;
}
.page-2 .home-foot {
  left: 0; right: 0; bottom: 110px; text-align: center;
  font-size: 22px; letter-spacing: 4px; color: var(--celadon-light); opacity: .8;
}
.page-2 .home-progress {
  left: 0; right: 0; bottom: 56px; text-align: center;
  font-family: var(--title-font); font-size: 22px; letter-spacing: 4px; color: var(--celadon-light);
}

/* ========================= P3 混沌蒙昧 ========================= */
.page-3 { background: radial-gradient(ellipse at 50% 45%, #2f3a3e, #1c2428 60%, #0f1517); }
.page-3 .chaos-mist {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 40% 50%, rgba(110,123,122,.2), transparent 50%);
  animation: mistDrift 12s ease-in-out infinite alternate;
}
@keyframes mistDrift { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
.page-3 .star-point {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle, #5a5a55, #33332f);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  transition: all .4s ease; cursor: pointer; z-index: 4;
}
.page-3 .star-point .sp-core { width: 14px; height: 14px; border-radius: 50%; background: #666; transition: all .4s; }
.page-3 .star-point.lit { background: radial-gradient(circle, #fff4cf, var(--gold) 50%, var(--gold-deep)); box-shadow: 0 0 22px 6px rgba(232,200,120,.8); }
.page-3 .star-point.lit .sp-core { background: #fff; box-shadow: 0 0 12px #fff; }
.page-3 .star-point .sp-ripple { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gold); opacity: 0; }
.page-3 .star-point.lit .sp-ripple { animation: ripple 1s ease-out; }

/* ========================= P4 抟土造人 ========================= */
.page-4 {
  background: linear-gradient(180deg, #d8c79a 0%, #c9ad74 45%, #b38f54 100%);
}
.page-4 .river {
  position: absolute; left: 0; right: 0; bottom: 0; height: 360px;
  background: linear-gradient(180deg, rgba(120,160,170,.5), rgba(70,110,130,.75));
}
.page-4 .river::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(255,255,255,.18) 60px, rgba(255,255,255,.18) 90px);
  animation: waterFlow 6s linear infinite;
}
@keyframes waterFlow { from { background-position: 0 0; } to { background-position: 150px 0; } }
.page-4 .nuwa-side {
  position: absolute; left: 30px; top: 320px; width: 280px; height: 560px; z-index: 2;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.4));
}
.page-4 .palm-zone {
  position: absolute; left: 230px; top: 600px; width: 200px; height: 200px;
  border: 2px dashed rgba(255,255,255,.45); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
}
.page-4 .palm-zone.over { border-color: var(--gold); background: rgba(232,200,120,.18); box-shadow: 0 0 24px rgba(232,200,120,.6); }
.page-4 .clay {
  position: absolute; width: 80px; height: 72px; border-radius: 50% 50% 45% 45%;
  background: radial-gradient(ellipse at 35% 30%, #c8924f, #8a5a2b 70%, #5a3818);
  box-shadow: inset 0 -6px 10px rgba(0,0,0,.4), 0 4px 10px rgba(0,0,0,.3);
  cursor: grab; touch-action: none; z-index: 5;
}
.page-4 .clay:active { cursor: grabbing; }
.page-4 .clay.dragging { z-index: 50; transform: scale(1.12); }
.page-4 .clay.used { display: none; }
.page-4 .water-drop {
  position: absolute; width: 64px; height: 78px; cursor: grab; touch-action: none; z-index: 5;
}
.page-4 .water-drop svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.page-4 .water-drop.dragging { z-index: 50; transform: scale(1.12); }
.page-4 .water-drop.used { display: none; }
.page-4 .mini-person {
  position: absolute; width: 40px; height: 60px; z-index: 4;
  animation: personHop 1.2s ease-out;
}
@keyframes personHop {
  0% { transform: scale(0) translateY(0); opacity: 0; }
  40% { transform: scale(1.15) translateY(-10px); opacity: 1; }
  70% { transform: scale(1) translateY(-22px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.page-4 .mini-person .halo { position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle, rgba(232,200,120,.55), transparent 70%); animation: glow 2.2s ease-in-out infinite; }

/* ========================= P5 引绳挥洒 ========================= */
.page-5 { background: linear-gradient(180deg, #cdbb8c 0%, #b89e66 55%, #9c7d45 100%); }
.page-5 .ground { position: absolute; left: 0; right: 0; bottom: 0; height: 320px; background: linear-gradient(180deg, #a07d44, #7a5c30); }
.page-5 .nuwa-hold { position: absolute; left: 60px; top: 300px; width: 260px; height: 560px; z-index: 2; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); }
.page-5 .vine {
  position: absolute; left: 300px; top: 360px; width: 70px; height: 320px;
  cursor: grab; touch-action: none; z-index: 6;
  transform-origin: top center;
  display: flex; justify-content: center;
}
.page-5 .vine svg { height: 100%; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.page-5 .vine.pulling { cursor: grabbing; }
.page-5 .mud-pool {
  position: absolute; left: 250px; top: 700px; width: 240px; height: 80px; border-radius: 50%;
  background: radial-gradient(ellipse, #6b4a22, #4a3115);
  box-shadow: inset 0 4px 10px rgba(0,0,0,.5);
}
.page-5 .watcher { position: absolute; width: 34px; height: 52px; z-index: 2; }
.page-5 .mud-splash { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #6b4a22; z-index: 5; }

/* ========================= P6 人间繁兴 ========================= */
.page-6 { background: linear-gradient(180deg, #cdd9a8 0%, #a8c078 50%, #8aa85a 100%); }
.page-6 .grass { position: absolute; left: 0; right: 0; bottom: 0; height: 300px; background: linear-gradient(180deg, #7fa04e, #5e7d38); }
.page-6 .tree { position: absolute; z-index: 2; }
.page-6 .stream {
  position: absolute; right: 0; bottom: 60px; width: 280px; height: 220px;
  background: linear-gradient(180deg, rgba(130,175,185,.6), rgba(90,140,160,.7));
  border-radius: 60% 0 0 0;
}
.page-6 .villager {
  position: absolute; width: 46px; height: 62px; cursor: pointer; z-index: 4;
  transition: transform .25s;
}
.page-6 .villager:hover { transform: scale(1.1); }
.page-6 .villager .v-halo { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); animation: twinkle 1.8s ease-in-out infinite; }
.page-6 .villager-bubble {
  position: absolute; transform: translate(-50%, -120%); padding: 12px 20px;
  background: var(--sand); border: 1.5px solid var(--ochre-dark); border-radius: 16px;
  font-size: 24px; color: var(--ink); white-space: nowrap; z-index: 50;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.page-6 .villager-bubble.show { opacity: 1; animation: bubblePop .35s ease; }
@keyframes bubblePop { from { transform: translate(-50%, -110%) scale(.7); opacity: 0; } to { transform: translate(-50%, -120%) scale(1); opacity: 1; } }
.page-6 .easter-egg {
  position: absolute; right: 60px; bottom: 90px; width: 34px; height: 34px; z-index: 5;
  cursor: pointer; opacity: .75;
}

/* ========================= P7 天倾浩劫 ========================= */
.page-7 { background: linear-gradient(180deg, #4a1f1f 0%, #2e1414 60%, #1a0a0a 100%); }
.page-7 .sky-crack {
  position: absolute; left: 50%; top: 120px; transform: translateX(-50%);
  width: 80px; height: 500px; z-index: 1;
}
.page-7 .sky-crack svg { width: 100%; height: 100%; }
.page-7 .fire-fall { position: absolute; width: 10px; height: 0; background: linear-gradient(180deg, #ffb347, #ff5722); border-radius: 4px; z-index: 2; box-shadow: 0 0 14px #ff7043; }
.page-7 .flood { position: absolute; left: 0; right: 0; bottom: 0; height: 180px; background: linear-gradient(180deg, rgba(60,90,120,.7), rgba(20,40,70,.9)); }
.page-7 .match-col { position: absolute; top: 640px; z-index: 5; }
.page-7 .match-col.left { left: 80px; }
.page-7 .match-col.right { right: 80px; }
.page-7 .match-item {
  width: 200px; padding: 18px 14px; margin-bottom: 22px; text-align: center;
  font-family: var(--title-font); font-size: 24px; letter-spacing: 2px;
  background: rgba(30, 18, 18, .7); border: 1.5px solid rgba(232, 200, 120, .5);
  border-radius: 10px; color: var(--sand);
}
.page-7 .match-item.left { cursor: grab; color: var(--gold); }
.page-7 .match-item.right.done { background: rgba(180, 60, 40, .4); border-color: var(--c-red); }
.page-7 .match-svg { position: absolute; inset: 0; z-index: 4; pointer-events: none; }

/* ========================= P8 炼石补天 ========================= */
.page-8 { background: linear-gradient(180deg, #2a2530 0%, #3a2a28 40%, #4a3322 100%); }
.page-8 .broken-sky {
  position: absolute; left: 0; right: 0; top: 0; height: 440px; z-index: 1;
  background: radial-gradient(ellipse at 50% 100%, rgba(60,50,70,.6), transparent 60%);
}
.page-8 .mountain {
  position: absolute; left: 0; right: 0; bottom: 0; height: 520px; z-index: 1;
  background: linear-gradient(180deg, transparent, #2a1f16 30%),
              linear-gradient(180deg, #4a3322, #241810);
  clip-path: polygon(0 60%, 20% 35%, 40% 55%, 55% 25%, 75% 50%, 100% 30%, 100% 100%, 0 100%);
}
.page-8 .divine-fire {
  position: absolute; left: 50%; transform: translateX(-50%); top: 640px;
  width: 180px; height: 240px; z-index: 4;
}
.page-8 .flame { position: absolute; bottom: 0; width: 60px; height: 160px; background: linear-gradient(180deg, #ffe082, #ff7043 55%, #b71c1c); border-radius: 50% 50% 30% 30%; filter: blur(1px); animation: flameFlicker .5s ease-in-out infinite alternate; }
@keyframes flameFlicker { from { transform: scaleY(1) scaleX(1); opacity: .95; } to { transform: scaleY(1.12) scaleX(.92); opacity: 1; } }
.page-8 .colored-stone {
  position: absolute; width: 80px; height: 72px; border-radius: 45% 55% 50% 50%;
  cursor: grab; touch-action: none; z-index: 6;
  box-shadow: inset 0 -6px 10px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.4), 0 0 14px currentColor;
  transition: transform .2s;
}
.page-8 .colored-stone:hover { transform: scale(1.08); }
.page-8 .colored-stone.dragging { z-index: 60; transform: scale(1.15); }
.page-8 .colored-stone.used { display: none; }
.page-8 .sky-stream { position: absolute; left: 50%; transform: translateX(-50%); top: 600px; width: 14px; height: 0; border-radius: 8px; z-index: 3; box-shadow: 0 0 20px currentColor; }

/* ========================= P9 苍天复宁 ========================= */
.page-9 {
  background:
    linear-gradient(180deg, #f0d9a8 0%, #e8c078 30%, #c9a06a 60%, #a8c0a0 100%);
}
.page-9 .peace-river { position: absolute; left: 0; right: 0; bottom: 0; height: 280px; background: linear-gradient(180deg, rgba(150,190,180,.6), rgba(90,140,150,.85)); }
.page-9 .dark-cloud {
  position: absolute; inset: 0; z-index: 8; touch-action: none;
}
.page-9 .heritage-icon {
  position: absolute; width: 110px; height: 110px; border-radius: 50%;
  background: rgba(30,22,14,.55); border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--title-font); font-size: 22px; letter-spacing: 3px; color: var(--gold);
  cursor: pointer; z-index: 10; box-shadow: 0 0 18px rgba(232,200,120,.4);
  transition: transform .3s; right: 40px;
}
.page-9 .heritage-icon:hover { transform: scale(1.08); }

/* ========================= P10 答题考验 ========================= */
.page-10 { background: linear-gradient(180deg, #ece0c6 0%, #d9c8a4 100%); }
.page-10 .quiz-title {
  left: 0; right: 0; top: 130px; text-align: center;
  font-family: var(--title-font); font-size: 44px; letter-spacing: 8px; color: var(--ochre-deep);
}
.page-10 .quiz-score {
  left: 0; right: 0; top: 210px; text-align: center;
  font-size: 26px; color: var(--celadon-deep); letter-spacing: 3px;
}
.page-10 .quiz-area {
  position: absolute; left: 60px; right: 60px; top: 320px; z-index: 5;
}
.page-10 .quiz-q {
  font-size: 32px; line-height: 1.7; color: var(--ink); margin-bottom: 40px; text-align: center;
}
.page-10 .quiz-opts { display: flex; flex-direction: column; gap: 22px; }
.page-10 .quiz-opt {
  width: 100%; padding: 26px 28px; text-align: left; font-size: 28px;
  background: rgba(255,255,255,.55); border: 2px solid var(--ochre-dark); border-radius: 14px;
  color: var(--ink); transition: all .25s; letter-spacing: 2px;
}
.page-10 .quiz-opt:hover { background: rgba(255,255,255,.8); transform: translateX(6px); }
.page-10 .quiz-opt.correct { background: #c8e6c9; border-color: #4a8c4f; color: #2e5d32; }
.page-10 .quiz-opt.wrong { background: #f3c0bd; border-color: #b8412e; color: #7a281c; animation: shake .4s ease; }
.page-10 .quiz-opt:disabled { cursor: default; }

/* ========================= P11 总结盖章 ========================= */
.page-11 { background: linear-gradient(180deg, #d8c79a 0%, #bda06a 55%, #8a6e44 100%); }
.page-11 .nuwa-far {
  position: absolute; left: 50%; transform: translateX(-50%); top: 180px;
  width: 260px; height: 480px; opacity: .25; z-index: 1;
}
.page-11 .light-dots { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.page-11 .light-dots .ld { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff3c4; box-shadow: 0 0 10px #fff3c4; animation: twinkle 3s ease-in-out infinite; }
.page-11 .stele {
  position: absolute; left: 50%; transform: translateX(-50%); top: 380px;
  width: 300px; height: 360px; z-index: 4; cursor: pointer;
  background: linear-gradient(160deg, #6e5a40, #4a3c28);
  border: 3px solid #3a2e1c; border-radius: 12px 12px 6px 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5), inset 0 2px 8px rgba(255,235,190,.15);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s;
}
.page-11 .stele:hover { transform: translateX(-50%) translateY(-4px); }
.page-11 .stele-text { font-family: var(--title-font); font-size: 46px; letter-spacing: 10px; color: var(--gold); writing-mode: vertical-rl; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.page-11 .stamp-mark {
  position: absolute; right: 70px; bottom: 230px; width: 130px; height: 130px; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--title-font); font-size: 34px; letter-spacing: 2px; color: #fff;
  background: var(--c-red); border: 3px solid #7a1a10; border-radius: 12px;
  opacity: 0; transform: scale(2) rotate(-12deg);
  box-shadow: 0 0 20px rgba(184,65,46,.6);
}
.page-11 .stamp-mark.stamped { animation: stampDown .7s cubic-bezier(.2,.9,.3,1.3) forwards; }
@keyframes stampDown { to { opacity: .92; transform: scale(1) rotate(-6deg); } }
.page-11 .video-btn { left: 50%; transform: translateX(-50%); top: 800px; width: 360px; height: 76px; font-size: 28px; }

/* ========================= P12 尾页 ========================= */
.page-12 { background: linear-gradient(180deg, #efe6d2 0%, #e0d2b4 100%); }
.page-12 .end-line { position: absolute; left: 0; right: 0; top: 430px; text-align: center; }
.page-12 .end-title {
  font-family: var(--title-font); font-size: 62px; letter-spacing: 14px;
  color: var(--ochre-deep); text-shadow: 0 2px 8px rgba(122,85,48,.3);
}
.page-12 .end-sub { margin-top: 28px; font-size: 28px; letter-spacing: 6px; color: var(--celadon-deep); }
.page-12 .end-btns { position: absolute; left: 0; right: 0; top: 620px; display: flex; flex-direction: column; align-items: center; gap: 30px; }
.page-12 .end-btn { width: 380px; height: 92px; font-size: 30px; }
.page-12 .nuwa-line { position: absolute; opacity: .25; }

/* ========================= 交互补充样式 ========================= */
/* P3 全部点亮后画面提亮、云雾散开 */
.page-3 { transition: background 1.2s ease; }
.page-3 .chaos-mist { transition: opacity 1.2s ease; }
.page-3.lit { background: radial-gradient(ellipse at 50% 45%, #4a5860, #2c363a 60%, #1c2326); }
.page-3.lit .chaos-mist { opacity: .18; }

/* P4 掌心黄泥堆 */
.page-4 .mound {
  position: absolute; width: 80px; height: 52px; border-radius: 50%;
  background: radial-gradient(ellipse at 35% 30%, #c8924f, #7a4a20);
  box-shadow: inset 0 -6px 10px rgba(0,0,0,.45); z-index: 3;
}

/* P5 飞溅泥点 + 落地行走小人 */
.page-5 .mud-splash { transition: transform 1s cubic-bezier(.35,.6,.45,1), opacity .3s; }
.page-5 .walker {
  position: absolute; width: 34px; height: 52px; z-index: 3;
  animation: walkerX var(--dur, 8s) ease-in-out infinite alternate;
}
@keyframes walkerX { from { transform: translateX(0); } to { transform: translateX(var(--dx, 80px)); } }

/* P7 连线完成后裂缝高亮动画 */
.page-7 .sky-crack { transition: filter .6s ease, opacity .6s ease; }
.page-7 .sky-crack.crack-active { animation: crackGlow 1.2s ease; filter: drop-shadow(0 0 18px #ff7043); }
@keyframes crackGlow { 0% { opacity: .4; } 50% { opacity: 1; transform: translateX(-50%) scale(1.06); } 100% { opacity: 1; } }

/* P9 标题/正文/提示/按钮在乌云之上，避免被画布遮挡 */
.page-9 .chapter-title,
.page-9 .chapter-body,
.page-9 .chapter-hint,
.page-9 .chapter-progress,
.page-9 .continue-btn { z-index: 12; }
