/* ============================================================
 * 人类群星闪耀时 —— 全部样式与动画
 * ============================================================ */

:root {
  --ink: #e8ecf8;
  --glass: rgba(14, 20, 44, .55);
  --glass-border: rgba(150, 170, 255, .22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  color: var(--ink);
  overflow: hidden;
  background:
    radial-gradient(1000px 700px at 12% -12%, rgba(28, 48, 118, .32), transparent 60%),
    linear-gradient(180deg, #050718 0%, #070a24 46%, #0b0e30 100%);
}

/* 银河光带（极淡的环境底光，主视觉由 canvas 绘制；随鼠标轻微漂移）
   注：CSS 渐变角是"颜色过渡方向"，光带走向与其垂直，故用 45deg */
body::before {
  content: "";
  position: fixed; inset: -20%;
  transform: translate(calc(var(--gx, 0) * 34px), calc(var(--gy, 0) * 22px));
  background: linear-gradient(45deg,
    transparent 36%,
    rgba(150, 160, 255, .025) 45%,
    rgba(198, 168, 240, .03) 50%,
    rgba(150, 160, 255, .025) 55%,
    transparent 64%);
  filter: blur(28px);
  pointer-events: none;
}

#starfield { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#starfield.person-hover { cursor: pointer; }


/* ———— 背景轻音乐开关（右上角小圆钮） ———— */

.music-btn {
  position: fixed; top: 16px; right: 16px; z-index: 10;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(14, 20, 44, .5);
  border: 1px solid rgba(150, 170, 255, .18);
  color: rgba(235, 240, 255, .9);
  font-size: 16px; line-height: 1;
  cursor: pointer; backdrop-filter: blur(8px);
  transition: all .25s ease;
}
.music-btn:hover { transform: scale(1.1); }
.music-btn.off { opacity: .45; }

/* 场景打开时淡出页面控件，保持沉浸 */
.music-btn, .site-footer, .footer-beian { transition: opacity .4s ease; }
body.scene-open .music-btn,
body.scene-open .site-footer { opacity: 0; pointer-events: none; }

/* ———— 湖上帆船（纯装饰，湖面下方偏右） ———— */
.sailboat {
  position: fixed;
  right: 9vw; bottom: 7vh;
  width: 128px; z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(130,155,220,.10));
  animation: boatSway 4.6s ease-in-out infinite;
  -webkit-box-reflect: below 4px linear-gradient(transparent 58%, rgba(255,255,255,.11));
  transition: opacity .4s ease;
}
.sailboat svg { display: block; width: 100%; height: auto; }
@keyframes boatSway {
  0%, 100% { transform: translate(0, 0) rotate(-1.3deg); }
  50% { transform: translate(2px, -3px) rotate(1.6deg); }
}
body.scene-open .sailboat { opacity: 0; }
@media (max-width: 640px) {
  .sailboat { width: 84px; right: 7vw; bottom: 9vh; }
}

/* ———— 底部提示 与 公司页脚 ———— */


.footer-beian {
  position: fixed; bottom: 5px; left: 50%; transform: translateX(-50%);
  z-index: 10; pointer-events: auto;
  display: flex; align-items: center; gap: 14px; white-space: nowrap;
  font-size: 11px; letter-spacing: .04em;
}
.footer-beian a { color: rgba(190, 203, 240, .38); text-decoration: none; transition: color .25s; }
.footer-beian a:hover { color: rgba(190, 203, 240, .75); }
.site-footer {
  position: fixed;
  /* 月亮悬在天空偏下（logo 即月；天空占视口上方 62%，月中线 ≈ 40vh） */
  top: calc(40vh - 34px);
  left: 50%; transform: translateX(-50%);
  z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* ———— 月亮（公司 logo 即月面） ———— */
.footer-star.moon {
  position: relative;
  width: 64px; height: 64px;
  padding: 0; border: none; border-radius: 50%;
  background: radial-gradient(circle at 42% 38%,
    rgba(255,250,235,1), rgba(248,240,222,.92) 62%, rgba(235,226,205,.85));
  cursor: pointer;
  box-shadow:
    0 0 12px rgba(255,247,225,.36),
    0 0 28px rgba(240,238,255,.16),
    0 0 60px rgba(235,238,255,.07);
  overflow: visible;
  transition: box-shadow .4s ease;
  animation: moonBreath 6s ease-in-out infinite;
}
.footer-star.moon img {
  width: 100%; height: 100%; border-radius: 50%; display: block;
  opacity: .96;
}
.footer-star.moon:hover {
  box-shadow:
    0 0 16px rgba(255,247,225,.5),
    0 0 40px rgba(240,238,255,.24),
    0 0 80px rgba(235,238,255,.12);
}
/* 月晕：贴着月面的大而极淡的月华（刻意很浅） */
.moon-halo {
  position: absolute; left: 50%; top: 50%;
  width: 160px; height: 160px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(255,248,228,.16), rgba(235,238,255,.05) 46%, transparent 70%);
  pointer-events: none;
  animation: moonHalo 6s ease-in-out infinite;
}
@keyframes moonBreath {
  0%, 100% { transform: translateX(0) scale(1); }
  50% { transform: translateX(0) scale(1.035); }
}
@keyframes moonHalo {
  0%, 100% { opacity: .8; }
  50% { opacity: 1; }
}
@media (max-width: 640px) {
  .footer-star.moon { width: 52px; height: 52px; }
  .moon-halo { width: 128px; height: 128px; }
  .site-footer { top: calc(40vh - 26px); gap: 10px; }
}
.footer-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 20px;
  background: rgba(14, 20, 44, .78);
  border: 1px solid rgba(150, 170, 255, .28);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  text-align: center; white-space: nowrap;
  animation: cardUp .35s ease both;
}
.footer-card[hidden] { display: none; }
.footer-card strong {
  font-size: 13.5px; letter-spacing: .16em; font-weight: 600;
  color: rgba(235, 240, 252, .95);
}
.footer-card span { font-size: 11.5px; letter-spacing: .1em; color: rgba(190, 203, 240, .7); }
.footer-tel {
  display: block;
  font-size: 12.5px; letter-spacing: .1em; font-weight: 500;
  color: #ffd98a; text-decoration: none;
  padding: 3px 10px; border-radius: 8px;
  transition: all .2s ease;
}
.footer-tel:hover { background: rgba(255, 217, 138, .14); transform: scale(1.04); }
@keyframes cardUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ———— 星星悬停标签 ———— */

.star-label {
  position: fixed; z-index: 20; pointer-events: none;
  transform: translate(-50%, -135%);
  background: rgba(14, 20, 44, .88);
  border: 1px solid var(--glass-border);
  border-radius: 10px; padding: 8px 16px;
  text-align: center; white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  animation: labelIn .18s ease both;
}
.star-label-name { font-size: 17px; letter-spacing: .14em; color: var(--c); }
.star-label-title { display: block; margin-top: 3px; font-size: 11px; letter-spacing: .2em; color: rgba(200, 212, 245, .66); }
@keyframes labelIn { from { opacity: 0; transform: translate(-50%, -120%) scale(.9); } }

/* ============================================================
 * 人物场景（全屏）
 * ============================================================ */

.scene {
  position: fixed; inset: 0; z-index: 100;
  opacity: 0; visibility: hidden;
  transition: opacity .45s ease, visibility .45s;
  background: rgba(4, 6, 20, .38);
}
.scene.open { opacity: 1; visibility: visible; }

/* 场景打开时，星空 canvas 自身加滤镜变虚变暗（不用 backdrop-filter，
   部分内核下它会吞掉场景内绝对定位的动画元素） */
#starfield { transition: filter .5s ease; }
#starfield.blurred { filter: blur(14px) brightness(.7); }

.scene-bg { position: absolute; inset: 0; z-index: 1; overflow: hidden; opacity: .95; }

/* 顶部/底部轻暗角 + 主题色氛围；文案可读性由 .scene-text 自身的玻璃面板保证 */
.scene::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background:
    radial-gradient(90% 90% at 50% 0%, var(--accent-glow, rgba(255, 217, 138, .14)), transparent 55%),
    linear-gradient(180deg, rgba(4, 6, 20, .3) 0%, rgba(4, 6, 20, .08) 38%, rgba(4, 6, 20, .3) 100%);
}
.scene-content {
  position: relative; z-index: 3; height: 100%;
  display: grid; place-items: center;
  padding: clamp(70px, 10vh, 110px) 6vw 48px;
}

/* 入场：文字卡片浮现 */
.scene.open .scene-text { animation: cardPop .7s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes cardPop {
  0% { transform: translateY(34px) scale(.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* 入场：文案逐条升起 */
.scene-text {
  width: min(680px, 92vw);
  background: linear-gradient(165deg, rgba(7, 10, 28, .56), rgba(7, 10, 28, .38));
  border: 1px solid rgba(160, 175, 230, .18);
  border-radius: 22px;
  padding: clamp(20px, 3vw, 40px) clamp(22px, 3.2vw, 44px);
}
.scene.open .scene-text > * { animation: rise .55s ease both; }
.scene.open .scene-text > *:nth-child(1) { animation-delay: .08s; }
.scene.open .scene-text > *:nth-child(2) { animation-delay: .16s; }
.scene.open .scene-text > *:nth-child(3) { animation-delay: .24s; }
.scene.open .scene-text > *:nth-child(4) { animation-delay: .32s; }
.scene.open .scene-text > *:nth-child(5) { animation-delay: .40s; }
.scene.open .scene-text > *:nth-child(6) { animation-delay: .48s; }
.scene.open .scene-text > *:nth-child(7) { animation-delay: .56s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* ———— 文案样式 ———— */

.scene-field { font-size: 12.5px; letter-spacing: .32em; color: var(--c, #ffd98a); }
.scene-name {
  margin-top: 10px;
  font-size: clamp(38px, 5.2vw, 58px); font-weight: 600;
  letter-spacing: .16em; color: #fff;
  text-shadow: 0 0 26px var(--c, #ffd98a), 0 2px 6px rgba(0, 0, 0, .5);
}
.scene-title-era { margin-top: 10px; color: rgba(205, 215, 240, .72); letter-spacing: .12em; font-size: clamp(12.5px, 1.4vw, 15.5px); }

.scene-quote {
  margin: clamp(18px, 3vh, 28px) 0 8px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(21px, 2.7vw, 33px);
  color: #fff; line-height: 1.5;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .6), 0 0 24px var(--c, #ffd98a);
}
.scene-quote .q-mark { color: var(--c, #ffd98a); opacity: .8; }
.scene-quote .q-mark.end { opacity: 0; transition: opacity .5s; }
.scene-quote.done .q-mark.end { opacity: .8; }
.type-cursor {
  display: inline-block; width: 3px; height: .95em; margin-left: 5px;
  border-radius: 2px; background: var(--c, #ffd98a);
  vertical-align: -.12em;
  animation: cursorBlink 1s steps(1) infinite;
}
.scene-quote.done .type-cursor { display: none; }
@keyframes cursorBlink { 50% { opacity: 0; } }

.scene-quote-source {
  color: rgba(190, 200, 230, .58); font-size: 13.5px; letter-spacing: .14em;
  opacity: 0; transform: translateY(4px); transition: all .5s ease .1s;
}
.scene-quote.done ~ .scene-quote-source { opacity: 1; transform: translateY(0); }

.scene-facts { list-style: none; margin-top: clamp(16px, 2.6vh, 24px); display: flex; flex-direction: column; gap: 10px; }
.scene-facts li {
  position: relative; padding-left: 22px;
  color: rgba(228, 234, 250, .88);
  font-size: clamp(13px, 1.4vw, 15.5px); line-height: 1.55;
}
.scene-facts li::before {
  content: "✦"; position: absolute; left: 0; top: .3em;
  color: var(--accent, #ffd98a); font-size: 10.5px;
  text-shadow: 0 0 8px var(--accent, #ffd98a);
}
.scene-intro {
  margin-top: clamp(18px, 3vh, 28px); padding-left: 14px;
  border-left: 3px solid var(--accent, #ffd98a);
  color: rgba(235, 240, 252, .7);
  font-size: clamp(13.5px, 1.5vw, 17px); letter-spacing: .1em;
}

/* ———— 场景控件 ———— */

.scene-close {
  position: absolute; top: 22px; right: 24px; z-index: 7;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(20, 26, 52, .55); border: 1px solid rgba(160, 175, 230, .3);
  color: #e8ecf8; font-size: 17px; cursor: pointer;
  backdrop-filter: blur(6px); transition: all .25s ease;
}
.scene-close:hover { border-color: var(--accent, #ffd98a); box-shadow: 0 0 18px var(--accent-glow, rgba(255, 217, 138, .3)); transform: rotate(90deg); }

.scene-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 7;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(20, 26, 52, .55); border: 1px solid rgba(160, 175, 230, .3);
  color: #e8ecf8; font-size: 26px; line-height: 1; font-family: inherit;
  cursor: pointer; backdrop-filter: blur(6px); transition: all .25s ease;
}
.scene-nav:hover { border-color: var(--accent, #ffd98a); color: #fff; box-shadow: 0 0 20px var(--accent-glow, rgba(255, 217, 138, .3)); }
.scene-prev { left: 26px; }
.scene-next { right: 26px; }

/* 入场闪光与粒子迸发 */
.scene-flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.scene.open .scene-flash::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 55%);
  animation: flashAnim .9s ease-out both;
}
@keyframes flashAnim { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }

.burst { position: absolute; left: 50%; top: 44%; z-index: 6; pointer-events: none; }
.burst i {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 12px var(--c);
  animation: burstFly 1s cubic-bezier(.1, .6, .3, 1) both;
}
@keyframes burstFly {
  from { transform: translate(0, 0) scale(1.15); opacity: 1; }
  to { transform: translate(var(--tx), var(--ty)) scale(.15); opacity: 0; }
}

/* ============================================================
 * Q 版人物的小动画（SVG 内）
 * ============================================================ */

.f-float { animation: fFloat 3.4s ease-in-out infinite; animation-delay: var(--fd, 0s); transform-box: fill-box; transform-origin: center; }
.f-bob { animation: fBob 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.f-glow { animation: fGlowPulse 2.2s ease-in-out infinite; }
.f-spin { animation: slowSpin 7s linear infinite; transform-box: fill-box; transform-origin: center; }
.f-wave-g path { stroke-dasharray: 7 7; animation: dashFlow 1.5s linear infinite; }

@keyframes fFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fBob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-9px) rotate(3deg); } }
@keyframes fGlowPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes slowSpin { to { transform: rotate(360deg); } }
@keyframes dashFlow { to { stroke-dashoffset: -56; } }

/* ============================================================
 * 意境场景（按人物）
 * ============================================================ */

/* —— 漂浮微粒（多场景复用） —— */
.sc-motes i {
  position: absolute; bottom: -2vh; left: var(--l);
  width: 5px; height: 5px; border-radius: 50%;
  opacity: 0;
  animation: scFloatUp var(--dur, 8s) linear infinite;
  animation-delay: var(--d, 0s);
}
.sc-motes.gold i { background: #ffd98a; box-shadow: 0 0 9px #ffd98a; }
.sc-motes.pink i { background: #ffd0e0; box-shadow: 0 0 9px #ffd0e0; }
.sc-motes.green i { background: #9df5b8; box-shadow: 0 0 10px #9df5b8; }
.sc-motes.violet i { background: #c9a8ff; box-shadow: 0 0 9px #c9a8ff; }
@keyframes scFloatUp {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: .9; }
  85% { opacity: .5; }
  100% { transform: translateY(-88vh); opacity: 0; }
}

/* —— 李白 · 月下独酌 —— */
.sc-moon {
  position: absolute; top: 6vh; right: 9vw;
  width: clamp(130px, 17vw, 230px); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fffbe8, #ffe9b0 46%, #eac27c 74%, #d8a860);
  box-shadow:
    0 0 60px 20px rgba(255, 230, 170, .22),
    0 0 150px 60px rgba(255, 230, 170, .1);
  animation: moonBreath 6s ease-in-out infinite;
}
.sc-moon.small { width: clamp(80px, 9vw, 120px); top: 10vh; right: auto; left: 10vw; }
@keyframes moonBreath { 0%, 100% { box-shadow: 0 0 60px 20px rgba(255, 230, 170, .22), 0 0 150px 60px rgba(255, 230, 170, .1); } 50% { box-shadow: 0 0 74px 26px rgba(255, 230, 170, .3), 0 0 170px 70px rgba(255, 230, 170, .15); } }

.sc-cloud { position: absolute; width: 30vw; height: 9vh; border-radius: 50%; background: rgba(175, 185, 228, .09); filter: blur(22px); }
.sc-cloud.c1 { top: 17%; left: 6%; animation: cloudDrift 26s ease-in-out infinite alternate; }
.sc-cloud.c2 { top: 31%; right: 10%; animation: cloudDrift 32s ease-in-out infinite alternate-reverse; }
@keyframes cloudDrift { from { transform: translateX(-4vw); } to { transform: translateX(5vw); } }

.sc-wine { position: absolute; left: 6vw; bottom: 9vh; width: clamp(88px, 10vw, 140px); opacity: .92; }
.sc-shine { animation: shineTwinkle 2.4s ease-in-out infinite; }
@keyframes shineTwinkle { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }

/* —— 杜甫 · 秋风茅屋 —— */
.sc-hut {
  position: absolute; left: 9vw; bottom: 7vh;
  width: min(34vw, 320px); height: clamp(90px, 16vh, 150px);
  background: linear-gradient(180deg, rgba(88, 70, 44, .9), rgba(56, 44, 28, .92));
  clip-path: polygon(50% 0%, 100% 40%, 89% 42%, 94% 100%, 6% 100%, 11% 42%, 0% 40%);
  opacity: .85;
}
.sc-hut::after {
  content: ""; position: absolute; left: 42%; top: 58%;
  width: 16%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 200, 110, .75), rgba(255, 180, 90, .1) 70%);
  border-radius: 2px;
  animation: hutWindow 4s ease-in-out infinite;
}
@keyframes hutWindow { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

.sc-wind {
  position: absolute; width: 32vw; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  opacity: 0;
}
.sc-wind.w1 { top: 28%; left: 0; animation: windMove 5.5s linear infinite; }
.sc-wind.w2 { top: 45%; right: 0; animation: windMoveR 6.5s linear infinite 2s; }
@keyframes windMove { 0% { transform: translateX(-32vw); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(70vw); opacity: 0; } }
@keyframes windMoveR { 0% { transform: translateX(32vw); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(-70vw); opacity: 0; } }

.leaf {
  position: absolute; top: -5vh; left: var(--l);
  width: 14px; height: 22px;
  border-radius: 0 60% 0 60%;
  background: linear-gradient(135deg, #d8a04a, #a86a2e);
  opacity: 0;
  animation: leafFall var(--dur, 7s) linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes leafFall {
  0% { transform: translate(0, -5vh) rotate(0deg); opacity: 0; }
  8% { opacity: .95; }
  100% { transform: translate(-9vw, 110vh) rotate(560deg); opacity: .65; }
}

/* —— 苏轼 · 大江东去 —— */
.sc-boat {
  position: absolute; left: 57vw; bottom: 17vh;
  width: clamp(80px, 9vw, 130px);
  animation: boatBob 5s ease-in-out infinite;
}
@keyframes boatBob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-10px) rotate(1.5deg); } }

.sc-waves { position: absolute; left: 0; bottom: 0; width: 100%; height: clamp(180px, 32vh, 320px); }
.wv { animation: waveMove 10s linear infinite; }
.wv1 { animation-duration: 13s; }
.wv2 { animation-duration: 10s; }
.wv3 { animation-duration: 8s; }
@keyframes waveMove { to { transform: translateX(-1440px); } }

/* —— 鲁迅 · 三味书屋 —— */
.sc-desk {
  position: absolute; left: 8vw; bottom: 9vh;
  width: min(30vw, 280px); height: clamp(80px, 14vh, 130px);
  background: linear-gradient(180deg, rgba(74,54,36,.92), rgba(48,34,22,.94));
  border-radius: 12px 12px 8px 8px;
  box-shadow: 0 14px 34px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,225,170,.18);
}
.sc-desk::before {
  content: ""; position: absolute; inset: 10% 8%;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 2px, transparent 2px 14px);
  border-radius: 6px;
}
.sc-zao {
  position: absolute; right: 12%; top: 50%; transform: translateY(-50%) rotate(-4deg);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: clamp(34px, 4.6vw, 64px);
  color: #f2d9a0; text-shadow: 0 0 18px rgba(242,217,160,.55);
  animation: zaoGlow 3.6s ease-in-out infinite;
}
@keyframes zaoGlow { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
.sc-inkstone {
  position: absolute; left: calc(8vw + min(30vw, 280px) + 2vw); bottom: 8vh;
  width: clamp(44px, 5vw, 70px); height: clamp(18px, 2.6vh, 30px);
  border-radius: 50% 50% 40% 40%;
  background: radial-gradient(circle at 40% 32%, #3a3f4c, #14161f 72%);
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
}
.sc-inkstone::after {
  content: ""; position: absolute; inset: 22% 26% 34%;
  border-radius: 50%; background: #0a0c12;
  box-shadow: inset 0 2px 6px rgba(255,255,255,.08);
}
.sc-papers .paper {
  position: absolute; top: -6vh; left: var(--l);
  width: 26px; height: 34px;
  background: linear-gradient(150deg, #f4ecd6, #d8cba8);
  border-radius: 2px 8px 2px 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  opacity: 0;
  animation: paperFall var(--dur, 8s) linear infinite;
  animation-delay: var(--d, 0s);
}
.sc-papers .paper::after {
  content: ""; position: absolute; inset: 6px 4px;
  background: repeating-linear-gradient(0deg, rgba(90,70,40,.4) 0 1.5px, transparent 1.5px 7px);
}
@keyframes paperFall {
  0% { transform: translate(0, -6vh) rotate(0deg); opacity: 0; }
  8% { opacity: .9; }
  100% { transform: translate(-7vw, 108vh) rotate(420deg); opacity: .5; }
}

/* —— 张衡 · 地动仪 —— */
.sc-seismo { position: absolute; right: 7vw; top: 0; bottom: 0; margin-block: auto; height: auto; width: clamp(190px, 23vw, 300px); opacity: .9; }
.seis-ball { animation: ballFall 3.6s cubic-bezier(.55, 0, .8, .6) infinite; transform-box: fill-box; }
@keyframes ballFall {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  55% { transform: translateY(32px); }
  61% { transform: translateY(28px); }
  68% { transform: translateY(32px); opacity: 1; }
  82% { transform: translateY(32px); opacity: 0; }
  100% { transform: translateY(32px); opacity: 0; }
}
.seis-ripple { animation: seisRipple 3.6s ease-out infinite; transform-box: fill-box; transform-origin: center; opacity: 0; }
@keyframes seisRipple {
  0%, 50% { transform: scale(.4); opacity: 0; }
  62% { opacity: .9; }
  100% { transform: scale(2.6); opacity: 0; }
}
.sc-shake {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 88%, rgba(111, 208, 176, .13), transparent 58%);
  animation: shakeGlow 3.6s ease-in-out infinite;
}
@keyframes shakeGlow { 0%, 100% { opacity: .35; } 55% { opacity: 1; } }

/* —— 祖冲之 · 割圆术 —— */
.sc-circle {
  position: absolute; right: 9vw; top: 0; bottom: 0; margin-block: auto;
  width: clamp(220px, 30vw, 400px); aspect-ratio: 1;
  animation: slowSpin 70s linear infinite;
}
.sc-digits span {
  position: absolute; bottom: -5vh; left: var(--l);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 1.9vw, 25px); color: #fff;
  opacity: 0;
  animation: digitRise 9s linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes digitRise {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: .85; }
  80% { opacity: .4; }
  100% { transform: translateY(-96vh); opacity: 0; }
}
.sc-ratio {
  position: absolute; left: 8vw; bottom: 11vh;
  font-size: clamp(14px, 1.6vw, 20px);
  color: rgba(201, 184, 242, .92); letter-spacing: .16em;
  animation: fFloat 5s ease-in-out infinite;
}

/* —— 阿基米德 · 浴缸与尤里卡 —— */
.sc-tub { position: absolute; right: 9vw; top: 16vh; width: clamp(220px, 26vw, 360px); opacity: .95; }
.sc-water { animation: waterSway 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes waterSway { 0%, 100% { transform: translateX(0) scaleX(1); } 50% { transform: translateX(5px) scaleX(1.02); } }
.sc-ripple2 { animation: scDash 3s linear infinite; stroke-dasharray: 10 12; }
@keyframes scDash { to { stroke-dashoffset: -88; } }
.sc-bubbles i {
  position: absolute; bottom: 6vh; left: var(--l);
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.6px solid rgba(190,230,255,.75);
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.8), rgba(190,230,255,.1) 60%);
  opacity: 0;
  animation: bubbleUp var(--dur, 4s) ease-in infinite;
  animation-delay: var(--d, 0s);
}
@keyframes bubbleUp {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  18% { opacity: .9; }
  100% { transform: translateY(-58vh) scale(1.25); opacity: 0; }
}
.sc-lever { position: absolute; left: 8vw; top: 20vh; width: clamp(180px, 20vw, 280px); opacity: .8; animation: fFloat 6s ease-in-out infinite; }
.sc-eureka {
  position: absolute; right: 10vw; bottom: 12vh;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: clamp(26px, 3.4vw, 46px);
  color: #ffe9a8; text-shadow: 0 0 26px rgba(255,208,112,.75);
  animation: eurekaPop 3.2s ease-in-out infinite;
}
@keyframes eurekaPop { 0%, 100% { transform: scale(.96) rotate(-2deg); opacity: .75; } 50% { transform: scale(1.08) rotate(1deg); opacity: 1; } }

/* —— 居里夫人 · 镭的荧光 —— */
.sc-dark { position: absolute; inset: 0; background: radial-gradient(ellipse at 68% 38%, transparent 28%, rgba(2, 9, 8, .6) 78%); }
.sc-apparatus { position: absolute; right: 8vw; bottom: 2vh; width: clamp(170px, 19vw, 260px); }
.flask.glow { animation: curieGlow 3.2s ease-in-out infinite; animation-delay: var(--fd, 0s); }
@keyframes curieGlow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(140, 245, 180, .45)); }
  50% { filter: drop-shadow(0 0 22px rgba(140, 245, 180, .95)); }
}

/* —— 牛顿 · 苹果与棱镜 —— */
.sc-branch { position: absolute; top: 0; left: 0; width: clamp(250px, 30vw, 450px); opacity: .95; }
.sc-apple {
  position: absolute; left: clamp(14px, 3vw, 60px); top: 15vh;
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ff8f8f, #e05555 58%, #b83a3a);
  opacity: 0;
  animation: appleFall 3.6s cubic-bezier(.5, 0, .8, .55) infinite;
}
.sc-apple::before { content: ""; position: absolute; top: -7px; left: 16px; width: 3px; height: 9px; background: #5a7a3a; border-radius: 2px; }
.sc-apple::after { content: ""; position: absolute; top: -6px; left: 20px; width: 12px; height: 7px; background: #6a9a4a; border-radius: 60% 0 60% 0; }
@keyframes appleFall {
  0% { transform: translateY(-9vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  52% { transform: translateY(56vh) rotate(18deg); }
  58% { transform: translateY(52vh) rotate(14deg); }
  66% { transform: translateY(56vh) rotate(18deg); }
  71% { transform: translateY(54.5vh) rotate(17deg); }
  75% { transform: translateY(56vh) rotate(18deg); opacity: 1; }
  88% { opacity: 0; }
  100% { transform: translateY(56vh); opacity: 0; }
}
.sc-prism { position: absolute; right: 5vw; top: 2vh; width: clamp(200px, 24vw, 330px); }
.beam-in { stroke-dasharray: 14 10; animation: dashFlow 1.2s linear infinite; }
.rb-fan polygon { animation: rbShimmer 3s ease-in-out infinite; animation-delay: var(--bd, 0s); }
@keyframes rbShimmer { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

/* —— 爱因斯坦 · 时空弯曲 —— */
.sc-grid {
  position: absolute; right: 6vw; top: 0; bottom: 0; margin-block: auto;
  width: clamp(280px, 38vw, 560px); aspect-ratio: 1;
  animation: slowSpin 90s linear infinite;
}
.sc-mass {
  position: absolute; top: 50%;
  right: calc(6vw + clamp(280px, 38vw, 560px) / 2 - 25px);
  transform: translateY(-50%);
  width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ffe9a8, #ffd070 55%, #c99040);
  box-shadow: 0 0 30px 8px rgba(255, 208, 112, .4);
  animation: massGlow 4s ease-in-out infinite;
}
@keyframes massGlow { 0%, 100% { box-shadow: 0 0 26px 6px rgba(255, 208, 112, .35); } 50% { box-shadow: 0 0 44px 14px rgba(255, 208, 112, .6); } }
.sc-emc2 {
  position: absolute; left: 9vw; top: 11vh;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 52px); color: #ffe9a8;
  text-shadow: 0 0 26px rgba(255, 208, 112, .8);
  animation: emc2Pop 3.4s ease-in-out infinite;
}
@keyframes emc2Pop { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.07); opacity: 1; } }

/* —— 伽利略 · 比萨斜塔与两个铁球 —— */
.sc-tower { position: absolute; right: 8vw; top: 4vh; width: clamp(170px, 21vw, 300px); opacity: .95; }
.sc-ball {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #9aa2b2, #4a5060 58%, #2c3140);
  box-shadow: inset -3px -4px 8px rgba(0,0,0,.4), inset 2px 3px 5px rgba(255,255,255,.3);
  opacity: 0;
  animation: ballDrop 3.4s cubic-bezier(.45, 0, .82, .5) infinite;
}
.sc-ball.b1 { left: calc(8vw + clamp(60px, 8vw, 110px)); top: 12vh; animation-delay: 0s; }
.sc-ball.b2 { left: calc(8vw + clamp(120px, 15vw, 200px)); top: 9vh; animation-delay: 0s; }
@keyframes ballDrop {
  0% { transform: translateY(0); opacity: 0; }
  8% { opacity: 1; }
  55% { transform: translateY(58vh); }
  62% { transform: translateY(54vh); }
  69% { transform: translateY(58vh); opacity: 1; }
  80% { transform: translateY(58vh); opacity: 0; }
  100% { transform: translateY(58vh); opacity: 0; }
}
.sc-impact i {
  position: absolute; left: calc(8vw + clamp(70px, 9vw, 125px)); bottom: 18vh;
  width: 70px; height: 18px; border: 2px solid rgba(232,184,120,.7); border-radius: 50%;
  opacity: 0; animation: impactRipple 3.4s ease-out infinite;
}
.sc-impact i:nth-child(2) { transform: scale(1.5); animation-delay: .12s; }
@keyframes impactRipple {
  0%, 60% { transform: scale(.2); opacity: 0; }
  68% { opacity: .95; }
  100% { transform: scale(1.9); opacity: 0; }
}
.sc-stars { position: absolute; left: 7vw; top: 8vh; width: clamp(120px, 14vw, 200px); opacity: .9; }

/* —— 霍金 · 黑洞 —— */
.sc-blackhole {
  position: absolute; right: 9vw; top: 50%;
  transform: translateY(-50%);
  width: min(46vmin, 430px); aspect-ratio: 1;
}
.bh-disk {
  position: absolute; inset: 7%; border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0 8%, rgba(255, 190, 110, .16) 14%,
    rgba(255, 205, 130, .85) 24%, #fff3dd 31%,
    rgba(255, 205, 130, .85) 40%, rgba(255, 190, 110, .12) 52%,
    transparent 70% 100%);
  -webkit-mask: radial-gradient(circle, transparent 32%, #000 35.5%, #000 52%, transparent 56%);
  mask: radial-gradient(circle, transparent 32%, #000 35.5%, #000 52%, transparent 56%);
  animation: diskSpin 6.5s linear infinite;
}
.bh-disk.front { clip-path: inset(55% 0 0 0); z-index: 3; }
@keyframes diskSpin {
  from { transform: rotateX(74deg) rotate(0deg); }
  to { transform: rotateX(74deg) rotate(360deg); }
}
.bh-core {
  position: absolute; inset: 33%; border-radius: 50%;
  background: #000; z-index: 2;
  box-shadow: 0 0 34px 6px rgba(255, 214, 150, .7), 0 0 90px 24px rgba(200, 140, 80, .32);
}
.bh-ring {
  position: absolute; inset: 31%; border-radius: 50%; z-index: 4;
  border: 2px solid rgba(255, 230, 180, .9);
  box-shadow: 0 0 16px rgba(255, 220, 160, .75);
}
.bh-streaks {
  position: absolute; right: 7vw; top: 0; bottom: 0; margin-block: auto;
  width: min(52vmin, 500px); aspect-ratio: 1;
  animation: slowSpin 44s linear infinite;
}
.streak { animation: streakFlow 3s linear infinite; animation-delay: var(--sd, 0s); }
@keyframes streakFlow { to { stroke-dashoffset: -120; } }

/* —— 全局：意境场景入场 + 缓慢漂移（更有生命感） —— */
.scene.open .scene-bg { animation: bgIn .9s ease both, bgFloat 18s ease-in-out 1.2s infinite alternate; }
@keyframes bgIn { from { opacity: 0; transform: translateY(26px) scale(1.02); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes bgFloat { from { transform: translateY(0); } to { transform: translateY(-12px); } }

/* 文字卡片的星形角饰 */
.scene-text { position: relative; }
.scene-text::before, .scene-text::after {
  content: "✦"; position: absolute; color: var(--accent, #ffd98a); font-size: 13px;
}
.scene-text::before { top: 12px; left: 16px; opacity: .8; }
.scene-text::after { bottom: 12px; right: 16px; opacity: .45; }

/* 场景元素贴边排布（卡片居中后，两侧留出 ~18vw 通道） */
.sc-slips, .sc-ptable, .sc-types, .sc-coil, .sc-kite, .sc-heliocentric,
.sc-tower, .sc-apparatus, .sc-seismo, .sc-circle { right: 1.5vw; max-width: 17vw; }
.sc-tortoise, .sc-herbs, .sc-grassfire, .sc-reeds, .sc-orchid,
.sc-wine, .sc-branchleaf, .sc-hut, .sc-branch { left: 1.5vw; max-width: 17vw; }
.sc-slips, .sc-tortoise, .sc-herbs { top: 10vh; }
.sc-ptable, .sc-types, .sc-coil, .sc-kite, .sc-heliocentric { top: 6vh; }
.sc-moon { right: 2vw; }
.sc-prism { right: 1.5vw; top: 1.5vh; max-width: 17vw; }

/* —— 白居易 · 野火烧不尽 —— */
.sc-grassfire { position: absolute; left: 8vw; bottom: 6vh; width: clamp(220px, 26vw, 360px); }
.blade { transform-box: fill-box; transform-origin: bottom center; animation: bladeSway 3.8s ease-in-out infinite; animation-delay: var(--gd, 0s); }
@keyframes bladeSway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(6deg); } }
.sc-flame { position: absolute; left: calc(8vw + clamp(120px, 13vw, 180px)); bottom: calc(6vh + clamp(60px, 7vh, 100px)); width: 46px; height: 60px; }
.sc-flame i {
  position: absolute; bottom: 0; left: 50%;
  border-radius: 50% 50% 42% 42%;
  transform-origin: bottom center;
  animation: flameFlick 1.4s ease-in-out infinite;
}
.sc-flame i:nth-child(1) { width: 30px; height: 46px; margin-left: -15px; background: radial-gradient(circle at 50% 78%, #ffd870, #ff9d40 60%, rgba(255,120,40,.25) 88%, transparent); opacity: .85; }
.sc-flame i:nth-child(2) { width: 18px; height: 32px; margin-left: -9px; background: radial-gradient(circle at 50% 80%, #fff2c0, #ffc05a 70%, transparent); animation-delay: .18s; }
.sc-flame i:nth-child(3) { width: 40px; height: 22px; margin-left: -20px; background: radial-gradient(ellipse at 50% 70%, rgba(255,150,60,.5), transparent 75%); animation-delay: .3s; filter: blur(3px); }
@keyframes flameFlick { 0%, 100% { transform: scaleY(1) skewX(-3deg); } 50% { transform: scaleY(1.16) skewX(4deg); } }

/* —— 李清照 · 藕花深处 —— */
.sc-pond {
  position: absolute; left: -12vw; right: -12vw; bottom: -8vh; height: 30vh;
  background: radial-gradient(ellipse at 50% 0%, rgba(120, 180, 200, .2), rgba(26, 56, 86, .34) 62%, transparent 100%);
  border-top: 1px solid rgba(170, 210, 235, .18);
  border-radius: 50% 50% 0 0 / 26% 26% 0 0;
}
.sc-ripples i {
  position: absolute; width: 9vw; height: 2.6vh; min-width: 70px;
  border: 1.5px solid rgba(190, 220, 240, .4); border-radius: 50%;
  opacity: 0;
  animation: rippleGrow 4.4s ease-out infinite;
}
.sc-ripples i:nth-child(1) { left: 26vw; bottom: 11vh; }
.sc-ripples i:nth-child(2) { left: 56vw; bottom: 8vh; animation-delay: 1.4s; }
.sc-ripples i:nth-child(3) { left: 42vw; bottom: 15vh; animation-delay: 2.8s; }
@keyframes rippleGrow { 0% { transform: scale(.3); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
.sc-lotus { position: absolute; }
.sc-lotus.l1 { left: 13vw; bottom: 13vh; width: clamp(70px, 8vw, 110px); animation: lotusSway 5s ease-in-out infinite; }
.sc-lotus.l2 { right: 20vw; bottom: 9vh; width: clamp(70px, 8vw, 100px); animation: lotusSway 6s ease-in-out infinite 1.2s; }
@keyframes lotusSway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2.5deg); } }

/* —— 屈原 · 汨罗江 —— */
.sc-river { position: absolute; left: 0; bottom: 0; width: 100%; height: clamp(160px, 30vh, 300px); }
.sc-orchid { position: absolute; right: 9vw; bottom: 14vh; width: clamp(90px, 10vw, 150px); animation: lotusSway 6s ease-in-out infinite; }

/* —— 孔子 · 竹简 —— */
.sc-slips { position: absolute; right: 8vw; top: 12vh; width: clamp(220px, 26vw, 380px); }
.slip, .slip-line { opacity: 0; animation: slipDrop .7s ease both; animation-delay: var(--sd, 0s); }
.slip-line { stroke: rgba(92,67,34,.55); stroke-width: 1.4; stroke-dasharray: 3 8; }
@keyframes slipDrop { from { transform: translateY(-26px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* —— 李时珍 · 药圃与本草 —— */
.sc-herbs { position: absolute; left: 9vw; bottom: 14vh; width: clamp(180px, 20vw, 280px); animation: lotusSway 7s ease-in-out infinite; }
.sc-bencao { position: absolute; right: 9vw; bottom: 10vh; width: clamp(180px, 19vw, 260px); filter: drop-shadow(0 10px 22px rgba(0,0,0,.4)); }

/* —— 毕昇 · 活字盘 —— */
.sc-types { position: absolute; right: 9vw; top: 14vh; width: clamp(220px, 25vw, 340px); }
.type-block { opacity: 0; animation: blockIn .6s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: var(--td, 0s); }
@keyframes blockIn { from { transform: translateY(-30px) scale(.8); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.sc-inkstamp {
  position: absolute; left: 10vw; bottom: 16vh;
  width: clamp(56px, 6vw, 84px); aspect-ratio: 1;
  display: grid; place-items: center;
  font-family: "Kaiti SC", "STKaiti", serif; font-size: clamp(30px, 3.6vw, 52px);
  color: #f2e2c0; background: rgba(200,152,104,.24);
  border: 2px solid rgba(200,152,104,.7); border-radius: 12px;
  animation: stampPress 3.2s ease-in-out infinite;
}
@keyframes stampPress {
  0%, 100% { transform: scale(1) rotate(-4deg); opacity: .75; }
  50% { transform: scale(.92) rotate(2deg); opacity: 1; }
}

/* —— 达尔文 · 巨龟 —— */
.sc-tortoise { position: absolute; left: 8vw; bottom: 8vh; width: clamp(200px, 24vw, 330px); animation: tortoiseWalk 14s ease-in-out infinite alternate; }
@keyframes tortoiseWalk { from { transform: translateX(0); } to { transform: translateX(9vw); } }
.sc-branchleaf { position: absolute; right: 8vw; top: 10vh; width: clamp(160px, 18vw, 260px); }
.sc-leaves2 i {
  position: absolute; top: -4vh; left: var(--l, 70%);
  width: 12px; height: 18px; border-radius: 0 60% 0 60%;
  background: linear-gradient(135deg, #8ac878, #5a8a3c);
  opacity: 0;
  animation: leafFall var(--dur, 8s) linear infinite;
  animation-delay: var(--d, 0s);
}
.sc-leaves2 i:nth-child(1) { --l: 72%; --d: 0s; --dur: 9s; }
.sc-leaves2 i:nth-child(2) { --l: 82%; --d: 3s; --dur: 11s; }
.sc-leaves2 i:nth-child(3) { --l: 64%; --d: 6s; --dur: 10s; }

/* —— 门捷列夫 · 元素周期表 —— */
.sc-ptable { position: absolute; right: 8vw; top: 12vh; width: clamp(240px, 28vw, 400px); }
.el-tile { opacity: 0; animation: elLight .6s ease both; animation-delay: var(--ed, 0s); }
@keyframes elLight { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.sc-unknown {
  position: absolute; right: calc(8vw + 40px); top: calc(12vh + clamp(180px, 20vw, 290px));
  width: clamp(44px, 4.6vw, 62px); aspect-ratio: 1;
  display: grid; place-items: center;
  border: 2px dashed rgba(122,200,255,.85); border-radius: 8px;
  font-family: Georgia, serif; font-size: clamp(20px, 2.2vw, 30px); color: #dff0ff;
  animation: unknownPulse 2.6s ease-in-out infinite;
}
@keyframes unknownPulse { 0%, 100% { opacity: .5; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.06); } }

/* —— 哥白尼 · 日心说 —— */
.sc-heliocentric { position: absolute; right: 8vw; top: 8vh; width: clamp(240px, 30vw, 440px); }
.orbit { transform-origin: 200px 200px; }
.orbit1 { animation: slowSpin 9s linear infinite; }
.orbit2 { animation: slowSpin 16s linear infinite; }
.orbit3 { animation: slowSpin 26s linear infinite; }

/* —— 帕斯卡 · 苇草 —— */
.sc-reeds { position: absolute; left: 8vw; bottom: 6vh; width: clamp(220px, 26vw, 380px); }
.reed { transform-box: fill-box; transform-origin: bottom center; animation: reedSway 4.6s ease-in-out infinite; animation-delay: var(--rd, 0s); }
@keyframes reedSway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(5deg); } }
.sc-fireflies i {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #ffe9a8; box-shadow: 0 0 10px #ffe9a8;
  left: var(--l, 60%); top: var(--t, 50%);
  animation: firefly 5.5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  opacity: 0;
}
.sc-fireflies i:nth-child(1) { --l: 24%; --t: 42%; --d: 0s; }
.sc-fireflies i:nth-child(2) { --l: 58%; --t: 58%; --d: 1.4s; }
.sc-fireflies i:nth-child(3) { --l: 40%; --t: 70%; --d: 2.8s; }
.sc-fireflies i:nth-child(4) { --l: 70%; --t: 36%; --d: 4s; }
@keyframes firefly {
  0%, 100% { opacity: 0; transform: translate(0, 0); }
  25% { opacity: 1; }
  50% { opacity: .4; transform: translate(26px, -30px); }
  75% { opacity: .9; }
}

/* —— 富兰克林 · 风筝与雷电 —— */
.sc-kite { position: absolute; right: 9vw; top: 6vh; width: clamp(200px, 24vw, 340px); }
.kite-body { animation: kiteSway 5s ease-in-out infinite; transform-origin: 150px 190px; }
@keyframes kiteSway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }
.bolt { opacity: 0; animation: boltFlash 4.2s ease-out infinite; filter: drop-shadow(0 0 12px rgba(255,240,170,.8)); }
@keyframes boltFlash {
  0%, 55%, 62%, 100% { opacity: 0; }
  57% { opacity: 1; }
  59% { opacity: .3; }
  61% { opacity: .9; }
}
.sc-rain i {
  position: absolute; top: -4vh; left: var(--l, 60%);
  width: 2px; height: 16px;
  background: linear-gradient(rgba(160,200,255,0), rgba(160,200,255,.7));
  animation: rainFall var(--dur, 1.6s) linear infinite;
  animation-delay: var(--d, 0s);
  opacity: 0;
}
.sc-rain i:nth-child(1) { --l: 12%; --d: 0s; --dur: 1.5s; }
.sc-rain i:nth-child(2) { --l: 30%; --d: .5s; --dur: 1.8s; }
.sc-rain i:nth-child(3) { --l: 52%; --d: .9s; --dur: 1.4s; }
.sc-rain i:nth-child(4) { --l: 68%; --d: .2s; --dur: 1.7s; }
.sc-rain i:nth-child(5) { --l: 84%; --d: .7s; --dur: 1.5s; }
.sc-rain i:nth-child(6) { --l: 94%; --d: 1.1s; --dur: 1.9s; }
@keyframes rainFall { 0% { transform: translateY(-6vh); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(96vh); opacity: .15; } }

/* —— 法拉第 · 电磁感应 —— */
.sc-coil { position: absolute; right: 9vw; top: 16vh; width: clamp(240px, 26vw, 380px); }
.needle-line { transform-box: fill-box; transform-origin: 100% 100%; animation: needleSwing 2.6s ease-in-out infinite; }
@keyframes needleSwing { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(-38deg); } 60% { transform: rotate(22deg); } }

/* —— 王维 · 诗中有画 —— */
.sc-shanshui { position: absolute; right: 1.5vw; top: 4vh; width: clamp(200px, 24vw, 380px); opacity: .9; }
.sc-mist { animation: mistDrift 9s ease-in-out infinite alternate; }
@keyframes mistDrift { from { transform: translateX(-16px); opacity: .7; } to { transform: translateX(16px); opacity: 1; } }

/* —— 陶渊明 · 东篱菊 —— */
.sc-tao { position: absolute; left: 1.5vw; top: 8vh; width: clamp(180px, 22vw, 320px); }
.tao-flower { transform-box: fill-box; transform-origin: center; animation: flowerSway 6s ease-in-out infinite; }
@keyframes flowerSway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

/* —— 华罗庚 · 黄金螺旋 —— */
.sc-spiral { position: absolute; right: 1.5vw; top: 8vh; width: clamp(200px, 23vw, 320px); }
.gr { opacity: 0; animation: grIn .6s ease both; animation-delay: var(--gd, 0s); }
@keyframes grIn { from { opacity: 0; } to { opacity: 1; } }
.sc-goldspiral { stroke-dasharray: 620; stroke-dashoffset: 620; animation: spiralDraw 3s ease-out 1.4s both; }
@keyframes spiralDraw { to { stroke-dashoffset: 0; } }

/* —— 墨子 · 小孔成像 —— */
.sc-pinhole { position: absolute; left: 1.5vw; bottom: 10vh; width: clamp(280px, 32vw, 460px); }
.sc-rays { animation: raysPulse 3.2s ease-in-out infinite; }
@keyframes raysPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.flame-src { animation: flameFlick 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
.flame-img { animation: flameFlick 1.4s ease-in-out infinite reverse; transform-box: fill-box; transform-origin: top center; }

/* —— 刘徽 · 算筹与九章 —— */
.sc-rods { position: absolute; right: 1.5vw; top: 6vh; width: clamp(220px, 26vw, 360px); opacity: .95; }

/* —— 高斯 · 数列求和 —— */
.sc-gauss { position: absolute; left: 1.5vw; top: 10vh; width: clamp(190px, 22vw, 300px); }
.gs-num, .gs-sum, .gs-arc, .gs-eq { opacity: 0; animation: gsIn .7s ease both; animation-delay: var(--nd, var(--pd, 0s)); }
.gs-arc { animation-name: gsArc; }
@keyframes gsIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gsArc { from { opacity: 0; stroke-dashoffset: 160; } to { opacity: 1; stroke-dashoffset: 0; } }
.gs-arc { stroke-dasharray: 160; }

/* —— 陈省身 · 数学好玩 —— */
.sc-playful { position: absolute; right: 1.5vw; top: 10vh; width: clamp(220px, 26vw, 360px); }
.gp { transform-box: fill-box; transform-origin: center; animation: gpFloat 5s ease-in-out infinite both, grIn .6s ease both; animation-delay: var(--fd, 0s), var(--pd, 0s); }
@keyframes gpFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-14px) rotate(6deg); } }

/* —— 笛卡尔 · 坐标系与心形线 —— */
.sc-coord { position: absolute; right: 1.5vw; bottom: 8vh; width: clamp(220px, 26vw, 380px); }
.sc-heartline { stroke-dasharray: 900; stroke-dashoffset: 900; animation: heartDraw 2.8s ease-out .8s both; }
@keyframes heartDraw { to { stroke-dashoffset: 0; } }

.footer-credit { font-size: 9.5px; letter-spacing: .06em; color: rgba(190, 203, 240, .42); margin-top: 2px; }


/* ============================================================
 * 现代科学场景模板（tp-* 系列）
 * ============================================================ */
.tp-svg { position: absolute; opacity: .92; }
.tp-rocket-svg { right: 3vw; top: 2vh; width: clamp(180px, 38vw, 300px); }
.tpl-rocket { animation: tplFloat 4s ease-in-out infinite; }
.tpl-flame { animation: flameFlick 1.2s ease-in-out infinite; transform-origin: top center; }
@keyframes tplFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.tp-atom-svg { right: 4vw; top: 4vh; width: clamp(220px, 52vw, 360px); }
.tpl-orbit { transform-box: fill-box; transform-origin: center; }
.tpl-orbit.o1 { animation: slowSpin 12s linear infinite; }
.tpl-orbit.o2 { animation: slowSpin 18s linear infinite reverse; }
.tpl-orbit.o3 { animation: slowSpin 26s linear infinite; }

.tp-rice-svg { left: 8vw; bottom: 8vh; width: clamp(200px, 48vw, 340px); }
.tpl-stalk { transform-box: fill-box; transform-origin: bottom center; }
.tpl-stalk.s1 { animation: bladeSway 3.8s ease-in-out infinite; }
.tpl-stalk.s2 { animation: bladeSway 4.4s ease-in-out infinite 0.8s; }

.tp-herb-svg { left: 10vw; top: 4vh; width: clamp(200px, 48vw, 320px); }
.tpl-herb { animation: bladeSway 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
.tp-molecule i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: rgba(138,200,160,.5); animation: scFloatUp 6s linear infinite; }
.tp-molecule i:nth-child(1) { left: 30%; animation-delay: 0s; }
.tp-molecule i:nth-child(2) { left: 55%; animation-delay: 1.8s; }
.tp-molecule i:nth-child(3) { left: 75%; animation-delay: 3.5s; }
.tp-molecule i:nth-child(4) { left: 45%; animation-delay: 5s; }

.tp-rock-svg { left: 50%; transform: translateX(-50%); bottom: 6vh; width: clamp(220px, 62vw, 400px); }
.tpl-fossil { animation: fFloat 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.tp-rock-hammer { display: none; }

.tp-weather-svg { right: 3vw; top: 4vh; width: clamp(200px, 48vw, 320px); }
.tpl-cloud { animation: cloudDrift 26s ease-in-out infinite alternate; transform-box: fill-box; }
.tpl-rain line { animation: rainDrop 1.8s linear infinite; }
.tpl-rain line:nth-child(2) { animation-delay: .5s; }
.tpl-rain line:nth-child(3) { animation-delay: 1s; }
@keyframes rainDrop { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: .7; } 100% { opacity: 0; transform: translateY(24px); } }
.tpl-wind { animation: windMove 8s ease-in-out infinite alternate; }
@keyframes windMove { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -32; } }
.tp-windlines i { position: absolute; height: 1.6px; background: linear-gradient(90deg, transparent, rgba(160,200,240,.35), transparent); animation: windSweep 4s ease-in-out infinite; }
.tp-windlines i:nth-child(1) { top: 30%; left: -20%; width: 60%; animation-delay: 0s; }
.tp-windlines i:nth-child(2) { top: 50%; left: 40%; width: 70%; animation-delay: 1.4s; }
.tp-windlines i:nth-child(3) { top: 70%; left: -10%; width: 50%; animation-delay: 2.8s; }
@keyframes windSweep { 0% { transform: translateX(-100%); opacity: 0; } 50% { opacity: .6; } 100% { transform: translateX(200%); opacity: 0; } }

.tp-formula-svg { right: 3vw; top: 4vh; width: clamp(220px, 52vw, 360px); }
.tpl-chalk { animation: chalkSway 3s ease-in-out infinite alternate; }
@keyframes chalkSway { from { transform: translateX(0); } to { transform: translateX(6px); } }

.tp-bridge-svg { right: 3vw; bottom: 14vh; width: clamp(220px, 52vw, 360px); }

.tp-train-svg { left: 4vw; bottom: 8vh; width: clamp(240px, 60vw, 420px); }
.tpl-smoke circle { animation: smokeRise 3.5s ease-out infinite; transform-box: fill-box; }
.tpl-smoke circle:nth-child(2) { animation-delay: .7s; }
.tpl-smoke circle:nth-child(3) { animation-delay: 1.4s; }
@keyframes smokeRise { 0% { opacity: 0; transform: translateY(0) scale(.5); } 30% { opacity: .5; } 100% { opacity: 0; transform: translateY(-30px) scale(1.3); } }

.tp-micro-svg { right: 4vw; bottom: 14vh; width: clamp(180px, 40vw, 280px); }
.tpl-cells circle { animation: fFloat 4s ease-in-out infinite; }
.tp-cells2 i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: rgba(150,220,180,.4); animation: scFloatUp 7s linear infinite; }
.tp-cells2 i:nth-child(1) { left: 20%; animation-delay: 0s; }
.tp-cells2 i:nth-child(2) { left: 50%; animation-delay: 2.2s; }
.tp-cells2 i:nth-child(3) { left: 80%; animation-delay: 4.4s; }

.tp-code-svg { right: 4vw; top: 4vh; width: clamp(200px, 48vw, 320px); }

.tp-bulb-svg { right: 5vw; top: 6vh; width: clamp(180px, 42vw, 300px); }
.tpl-bulb-glow circle { animation: bulbPulse 2.6s ease-in-out infinite; }
@keyframes bulbPulse { 0%,100% { opacity: .4; } 50% { opacity: .8; } }
.tp-rays i { position: absolute; width: 2px; height: 14px; background: rgba(255,220,120,.35); border-radius: 1px; animation: rayPulse 2.4s ease-in-out infinite; }
.tp-rays i:nth-child(1) { top: 20%; left: 48%; transform: rotate(0deg); animation-delay: 0s; }
.tp-rays i:nth-child(2) { top: 16%; left: 56%; transform: rotate(30deg); animation-delay: .4s; }
.tp-rays i:nth-child(3) { top: 18%; left: 64%; transform: rotate(60deg); animation-delay: .8s; }
.tp-rays i:nth-child(4) { top: 30%; left: 70%; transform: rotate(90deg); animation-delay: 1.2s; }
.tp-rays i:nth-child(5) { top: 42%; left: 68%; transform: rotate(120deg); animation-delay: 1.6s; }
.tp-rays i:nth-child(6) { top: 48%; left: 62%; transform: rotate(150deg); animation-delay: 2s; }
@keyframes rayPulse { 0%,100% { opacity: .2; } 50% { opacity: .7; } }

.tp-tele-svg { right: 4vw; top: 6vh; width: clamp(220px, 52vw, 340px); }
.tpl-tele { animation: fFloat 5.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.tpl-galaxy { animation: slowSpin 14s linear infinite; transform-box: fill-box; transform-origin: center; }

.tp-flask-svg { left: 4vw; top: 6vh; width: clamp(200px, 46vw, 320px); }
.tpl-bubble { animation: bubbleUp 4s ease-in infinite; animation-delay: var(--bd, 0s); }
@keyframes bubbleUp { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: .7; } 100% { opacity: 0; transform: translateY(-50px); } }
.tpl-flask-glass { animation: fFloat 5s ease-in-out infinite; transform-box: fill-box; }

.tp-plane-svg { right: 3vw; top: 6vh; width: clamp(220px, 52vw, 360px); }
.tpl-plane { animation: planeFly 5s ease-in-out infinite; }
@keyframes planeFly { 0%,100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-14px) rotate(1.5deg); } 70% { transform: translateY(4px) rotate(-1deg); } }
.tpl-trail { animation: trailFade 3s ease-in-out infinite; }
@keyframes trailFade { 0%,100% { opacity: .1; } 50% { opacity: .4; } }
.tpl-clouds ellipse { animation: cloudDrift 28s ease-in-out infinite alternate; }

/* ============================================================
 * 响应式（竖屏 / 窄屏）
 * ============================================================ */

@media (orientation: portrait) {
  /* 卡片沉到下方，上半屏完整展示意境场景（构图更接近电脑端） */
  .scene-content {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center; align-items: end; text-align: left;
    padding: 36vh 4vw 96px;
    overflow-y: auto;
  }
  .scene-text { width: 100%; }
  .scene-quote { font-size: clamp(19px, 5.4vw, 27px); }
  .scene-facts { align-items: stretch; text-align: left; }
  .scene-intro { border-left: none; padding: 0; }
  .scene-nav { top: auto; bottom: 24px; transform: none; width: 44px; height: 44px; font-size: 22px; }
  .scene-prev { left: 14px; }
  .scene-next { right: 14px; }

  /* 上半屏：意境场景放大、提亮 */
  .sc-moon { right: 6vw; top: 3vh; }
  .sc-wine { display: none; }
  .sc-tower { right: 4vw; top: 1vh; width: clamp(150px, 42vw, 230px); opacity: 1; }
  .sc-ball.b1 { left: 12vw; }
  .sc-ball.b2 { left: 30vw; }
  .sc-impact i { left: 14vw; }
  .sc-tub { left: 50%; transform: translateX(-50%); top: 1vh; width: min(74vw, 300px); opacity: 1; }
  .sc-lever { display: none; }
  .sc-eureka { left: 50%; transform: translateX(-50%); top: 24vh; bottom: auto; right: auto; }
  .sc-desk { left: 50%; transform: translateX(-50%); top: 1vh; bottom: auto; width: min(70vw, 280px); }
  .sc-inkstone { display: none; }
  .sc-slips { right: 50%; transform: translateX(50%); top: 2vh; width: min(74vw, 280px); opacity: 1; }
  .sc-ptable { right: 50%; transform: translateX(50%); top: 3vh; width: min(76vw, 300px); opacity: 1; }
  .sc-unknown { display: none; }
  .sc-types { right: 50%; transform: translateX(50%); top: 2vh; width: min(70vw, 260px); opacity: 1; }
  .sc-kite { right: 8vw; top: 2vh; width: min(56vw, 240px); opacity: 1; }
  .sc-heliocentric { right: 50%; transform: translateX(50%); top: 2vh; width: min(68vw, 270px); opacity: 1; }
  .sc-coil { right: 50%; transform: translateX(50%); top: 3vh; width: min(76vw, 300px); opacity: 1; }
  .sc-tortoise { left: 50%; transform: translateX(-50%); top: 6vh; bottom: auto; width: min(64vw, 260px); opacity: 1; animation: none; }
  .sc-branchleaf { left: 4vw; top: 4vh; right: auto; }
  .sc-grassfire { left: 50%; transform: translateX(-50%); top: 4vh; width: min(74vw, 300px); }
  .sc-flame { left: 50%; transform: translateX(-50%); top: 2vh; bottom: auto; }
  .sc-bencao { right: 6vw; top: 3vh; display: block; width: min(44vw, 190px); opacity: .9; }
  .sc-herbs { left: 6vw; top: 4vh; width: min(44vw, 190px); opacity: 1; }
  .sc-orchid { right: 8vw; top: 6vh; display: block; width: min(36vw, 150px); opacity: .9; }
  .sc-shanshui { right: 50%; transform: translateX(50%); top: 2vh; width: min(72vw, 300px); opacity: 1; }
  .sc-tao { left: 50%; transform: translateX(-50%); top: 3vh; width: min(62vw, 250px); opacity: 1; }
  .sc-spiral { right: 50%; transform: translateX(50%); top: 3vh; width: min(66vw, 260px); opacity: 1; }
  .sc-pinhole { left: 50%; transform: translateX(-50%); bottom: auto; top: 3vh; width: min(86vw, 360px); opacity: 1; }
  .sc-rods { right: 50%; transform: translateX(50%); top: 2vh; width: min(74vw, 300px); opacity: 1; }
  .sc-gauss { left: 50%; transform: translateX(-50%); top: 3vh; width: min(70vw, 270px); opacity: 1; }
  .sc-playful { right: 50%; transform: translateX(50%); top: 3vh; width: min(70vw, 280px); opacity: 1; }
  .sc-coord { right: 50%; transform: translateX(50%); bottom: auto; top: 3vh; width: min(66vw, 270px); opacity: 1; }
  .sc-reeds { left: 50%; transform: translateX(-50%); top: 4vh; bottom: auto; width: min(78vw, 320px); opacity: 1; }
  .sc-blackhole { right: auto; left: 50%; top: 3vh; transform: translateX(-50%); width: min(64vw, 260px); opacity: .85; }
  .bh-streaks { right: auto; left: 50%; top: 3vh; bottom: auto; margin: 0; transform: translateX(-50%); width: min(76vw, 310px); opacity: .6; }
  .sc-apparatus { right: 50%; transform: translateX(-50%); left: auto; top: 2vh; bottom: auto; opacity: 1; }
  .sc-apple { left: 8vw; }
  .sc-prism { right: 2vw; top: 1vh; width: clamp(170px, 48vw, 260px); }
  .sc-seismo { right: 4vw; top: 2vh; max-width: 32vw; }
  .sc-hut { top: 3vh; bottom: auto; left: 4vw; width: min(56vw, 240px); }
  .music-btn { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 15px; }
}

@media (max-width: 700px) {
  .sc-moon { right: 6vw; top: 4vh; }
  .sc-seismo { right: 4vw; width: 160px; }
  .sc-grid { display: none; }
  .sc-mass { display: none; }
}

/* 无障碍：减少动态 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
