/* ============================================================
   CampusLink H5 设计系统 · 植物手帐 Botanical Journal（融合：手账纸质 × 亲自然有机）
   Canvas:  米纸画布（横线纹 fixed；深色=暗夜苔藓对等）
   Surface: 暖白便签卡 + 有机四角圆径（26/18/24/20）+ 自然软坠影
   Palette: 深林绿 #2F7A4F 主强调 · 现品牌绿 #6FAE9E 转辅助 · 陶土 #C67B5C 暖点缀
   Type:    楷体（标题/引语，--font-hand）+ Nunito/Inter（正文数字）
   Motion:  3D 折叠入场/萤火虫/视差/按压 100% 保留；新增卡片微旋 ±0.8°（rotate 属性，与 transform 动画互不冲突）；
            Splash 开场（#cl-splash，boot 每会话注入）+ 页间「绿弧幕上掠」View Transitions 转场 +
            暗色动态背景「星野操场」（#cl-nightsky：星野/地球/草地/人影/流星彩蛋/鼠标星尘拖尾，仅暗色）+
            浅色动态背景「晴空纸鸢」（#cl-dayside：云缓漂/纸飞机巡航/花朵轻摆，仅浅色）
   对等:    浅色默认；深色「暗夜苔藓」由 [data-theme="dark"] 提供（theme-boot.js 管理）
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  /* 品牌：深林绿主强调（现品牌绿转辅助） */
  --brand: #2F7A4F;
  --brand-deep: #245E3C;
  --brand-soft: #4E9E6B;
  --accent: #C67B5C;
  --accent-deep: #A85B3E;
  --btn-fg: #F7F4E8;
  --danger: #C4523F;
  --like: #C75B6E;

  /* 表面（植物手帐：米纸画布 + 暖白便签卡） */
  --bg: #F7F4E8;
  --bg-card: #FFFDF5;
  --surface: #FBF8EE;
  --surface-2: #F1EDDC;
  --surface-3: #FFFDF5;
  --border: rgba(47, 122, 79, .14);
  --border-strong: rgba(47, 122, 79, .26);

  /* 文本（墨绿黑 on 米纸 ≈ 10:1） */
  --text: #2E3A2E;
  --text-2: #4A5548;
  --text-3: #8A937F;

  /* 自然软坠影（取代双影） */
  --out: 0 8px 24px rgba(47, 122, 79, .12);
  --out-sm: 0 4px 14px rgba(47, 122, 79, .10);
  --in: inset 0 2px 6px rgba(47, 122, 79, .10);
  --in-sm: inset 0 1px 4px rgba(47, 122, 79, .08);

  /* 效果 */
  --blur: 14px;
  --ease: cubic-bezier(.645, .045, .355, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);   /* 弹性：点赞 pop / FAB 入场 / 页签滑块 */
  --dur-fast: 150ms;   /* 反馈类：按压/色变/焦点 */
  --dur-base: 250ms;   /* 容器类：卡片 hover/页签 */
  --dur: 400ms;        /* 页面级：sheet 弹层 */
  --glow: 0 8px 26px rgba(47, 122, 79, .30);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-organic: 26px 18px 24px 20px;           /* 有机四角（Biophilic 核心） */
  --tape-green: rgba(168, 216, 168, .55);
  --tape-yellow: rgba(232, 197, 106, .50);

  /* 字体 */
  --font-display: "Nunito", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-body: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-hand: "Kaiti SC", "KaiTi", "STKaiti", "Noto Serif SC", serif;   /* 手写标题（Android 回退衬线） */

  color-scheme: light;
}

/* ---------- 深色对等：暗夜苔藓 ----------
   由 common/theme-boot.js 管理 data-theme：用户手动选择存 localStorage(cl_theme)，
   未手动选择时跟随系统 prefers-color-scheme。 */
:root[data-theme="dark"] {
  --bg: #1C231C;
  --bg-card: #263026;
  --surface: #222B22;
  --surface-2: #2A342A;
  --surface-3: #2E382C;
  --border: rgba(168, 216, 196, .12);
  --border-strong: rgba(168, 216, 196, .22);

  --text: #E2E8DC;
  --text-2: #A7B4A0;
  --text-3: #76856F;

  --brand: #A8D8C4;
  --brand-deep: #7FB8A4;
  --brand-soft: #7FB8A4;
  --accent: #D8A87E;
  --accent-deep: #C67B5C;
  --btn-fg: #1C231C;
  --danger: #E8837A;
  --like: #E8839A;

  --out: 0 8px 24px rgba(0, 0, 0, .40);
  --out-sm: 0 4px 14px rgba(0, 0, 0, .32);
  --in: inset 0 2px 6px rgba(0, 0, 0, .28);
  --in-sm: inset 0 1px 4px rgba(0, 0, 0, .22);
  --glow: 0 8px 26px rgba(168, 216, 196, .20);
  --tape-green: rgba(168, 216, 168, .28);
  --tape-yellow: rgba(232, 197, 106, .26);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 400 15px/1.6 var(--font-body);
  color: var(--text);
  /* 米纸画布：横线纹 + 纸色渐变（fixed，滚动时手帐页不动）；深色=暗夜苔藓 */
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(47, 122, 79, .045) 25px 26px) fixed,
    linear-gradient(165deg, #F7F4E8 0%, #F2EFE0 100%) fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] body, :root[data-theme="dark"] body {
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(168, 216, 196, .05) 25px 26px) fixed,
    linear-gradient(165deg, #1C231C 0%, #202A20 100%) fixed;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ---------- 桌面端应用壳：限制为手机宽度居中列 ---------- */
@media (min-width: 760px) {
  body {
    max-width: 680px;
    margin: 0 auto;
    border-inline: 1px solid var(--border);
    box-shadow: 0 0 60px rgba(166, 180, 200, .35);
  }
}

a { color: var(--brand-soft); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--brand); }

::selection { background: rgba(111, 174, 158, .35); color: #2F4F47; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 便签卡（沿用 .glass 类名，各页面零改动） ---------- */
.glass {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-organic);
  box-shadow: var(--out);
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.glass.glow:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(47, 122, 79, .18), 0 3px 8px rgba(47, 122, 79, .08);
}
:root[data-theme="dark"] .glass.glow:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, .42), 0 3px 8px rgba(0, 0, 0, .18);
}
/* 3D 按压：按下时轻微前倾缩小，软触感「按进纸面」；仅 transform，阴影不参与 */
.glass.glow:active { transform: perspective(900px) rotateX(2deg) scale(.98); }
/* 胶带贴纸：ui.js 为列表前 N 张佩戴（.tape / .tape.alt 双色轮换） */
.glass .tape { position: absolute; top: -8px; left: 26px; width: 66px; height: 15px; transform: rotate(-3deg);
  background: var(--tape-green); box-shadow: 0 1px 2px rgba(47, 122, 79, .15); pointer-events: none; }
.glass .tape.alt { transform: rotate(2.5deg); background: var(--tape-yellow); }

/* ---------- 顶栏 / 工具条（米纸粘性条） ---------- */
.bar-glass {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 245, .92);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(47, 122, 79, .10);
}
:root[data-theme="dark"] .bar-glass { background: rgba(38, 48, 38, .92); box-shadow: 0 6px 16px rgba(0, 0, 0, .32); }

/* ---------- 按钮 ---------- */
button, .btn {
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: box-shadow var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}

.btn-primary {
  border: none;
  background: linear-gradient(165deg, var(--brand) 0%, var(--brand-soft) 100%);
  color: var(--btn-fg);
  box-shadow: 0 5px 16px rgba(47, 122, 79, .35);
}
:root[data-theme="dark"] .btn-primary { background: linear-gradient(165deg, #2F5D3E 0%, #2F7A4F 100%); color: #E2E8DC; box-shadow: 0 5px 16px rgba(0, 0, 0, .35); }
.btn-primary:hover:not(:disabled) { box-shadow: var(--glow); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); box-shadow: var(--in-sm); }
.btn-primary:disabled { background: var(--surface-2); color: var(--text-3); box-shadow: none; transform: none; cursor: not-allowed; }

/* ---------- 表单（纸面填写栏） ---------- */
input, select, textarea {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--in-sm);
  transition: box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(47, 122, 79, .45);
  box-shadow: var(--in-sm), 0 0 0 3px rgba(47, 122, 79, .22);
}
select { box-shadow: var(--out-xs, var(--in-sm)); }

/* ---------- 头像 ---------- */
.avatar-ring {
  border-radius: 50%;
  background: var(--surface-2) center/cover no-repeat;
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: var(--out-sm);
  flex-shrink: 0;
}
:root[data-theme="dark"] .avatar-ring { border-color: rgba(255, 255, 255, .12); }

/* ---------- 滚动条 / 分隔线 ---------- */
hr, .divider { border: none; border-top: 1px solid var(--border); }

/* ---------- 弹层（头像选择等） ---------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(68, 83, 107, .40);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: sheet-fade var(--dur) var(--ease);
}
.sheet {
  width: 100%; max-width: 480px;
  background: var(--bg-card);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -14px 34px rgba(46, 58, 46, .35);
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  animation: sheet-up var(--dur) var(--ease);
}
.sheet-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-bottom: 14px; }

@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 深浅色切换按钮（由 theme-boot.js 注入） ---------- */
.theme-toggle-btn {
  width: 34px; height: 34px; padding: 0; margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: var(--bg); color: var(--brand-soft);
  box-shadow: var(--out-sm);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.theme-toggle-btn:active { box-shadow: var(--in-sm); transform: scale(.94); }
.theme-toggle-btn svg { width: 18px; height: 18px; display: block; }
.theme-toggle-btn .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle-btn .ic-sun { display: block; }
[data-theme="dark"] .theme-toggle-btn .ic-moon { display: none; }
/* 无顶栏页面的兜底：左下浮动，抬升避开 detail/result 的底部操作条 */
.theme-toggle-btn.floating {
  position: fixed; left: 16px; z-index: 80;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  width: 44px; height: 44px;
}
@media (min-width: 760px) { .theme-toggle-btn.floating { left: calc(50% - 320px); } }

/* ---------- 页面动效（动效方案落地：全程仅 transform/opacity，reduced-motion 自动关闭） ---------- */
/* 3D 折叠入场：带 perspective 的轻微翻转，卡片像「立起来」而非平移到位（角度克制在 6-10°） */
@keyframes fade-up { from { opacity: 0; transform: perspective(700px) rotateX(6deg) translateY(14px); } to { opacity: 1; transform: perspective(700px) rotateX(0deg) translateY(0px); } }
@keyframes fade-up-left { from { opacity: 0; transform: perspective(700px) rotateY(-10deg) translateX(-16px); } to { opacity: 1; transform: perspective(700px) rotateY(0deg) translateX(0px); } }
@keyframes fade-up-right { from { opacity: 0; transform: perspective(700px) rotateY(10deg) translateX(16px); } to { opacity: 1; transform: perspective(700px) rotateY(0deg) translateX(0px); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes idle-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes heart-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes cnt-pulse { 0% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(-4px); opacity: .4; } 100% { transform: translateY(0); opacity: 1; } }

/* 卡片入场：fade-up + 逐张 animationDelay（ui.js 按批次赋值）；页签方向感由 .enter-left/right 切换 */
.fade-up { animation: fade-up var(--dur-base) cubic-bezier(.22, .61, .36, 1) backwards; }
.enter-left .fade-up { animation-name: fade-up-left; }
.enter-right .fade-up { animation-name: fade-up-right; }

/* 配图淡入：img onload 加 .loaded（已缓存 complete 同步加，无闪烁） */
img.img-fade { opacity: 0; transition: opacity 200ms var(--ease); }
img.img-fade.loaded { opacity: 1; }

/* 配图 hover 3D 浮起：卡片悬停时图片朝视点弹出（每图自带 perspective，无需 preserve-3d）；
   transition 合并了 opacity，避免压掉上面的 img-fade 淡入 */
.glass.glow img { transition: opacity 200ms var(--ease), transform var(--dur-base) var(--ease); }
.glass.glow:hover img { transform: perspective(500px) translateZ(14px); }
@media (prefers-reduced-motion: reduce) { .glass.glow:hover img { transform: none; } }

/* 骨架屏：形状预告 + shimmer，替代文字 loading */
.sk { border-radius: 8px; background: var(--surface-2); overflow: hidden; position: relative; display: inline-block; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: shimmer 1.2s infinite; }
[data-theme="dark"] .sk::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent); }

/* 互动微动效：JS 播放（移除类 → 回流 → 重加） */
.pop-anim { animation: heart-pop var(--dur-base) var(--ease-back); }
.cnt-anim { display: inline-block; animation: cnt-pulse var(--dur-base) var(--ease); }

/* 空状态插画 idle 浮动（ui.js emptyBox 渲染） */
.empty-ill { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--bg);
  box-shadow: var(--out); position: relative; animation: idle-float 3.2s var(--ease) infinite; }
.empty-ill::after { content: ""; position: absolute; inset: 17px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(111, 174, 158, .60), rgba(131, 119, 196, .50)); }

/* ---------- 主页氛围层：萤火虫光尘（自主氛围）+ 滚动视差 + 桌面追光 ----------
   替代极光背景。绿/紫/黄三色光点；铁律：幅度小、频率慢、reduced-motion 全静（光尘冻结为 .35 微光）。
   D3 视差：.ff-track 高 200vh 装两套相同光点（B 套 = A 套 +100vh），
   JS 滚动时 translateY(-(scrollY*0.3 % 100vh))——无限信息流不断层。 */
.fireflies { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.fireflies .ff-track { position: absolute; top: 0; left: 0; right: 0; height: 200vh; will-change: transform; }
.fireflies .ff { position: absolute; width: 9px; height: 9px; border-radius: 50%; opacity: .35; will-change: transform, opacity;
  background: radial-gradient(circle, rgba(111, 174, 158, .95), rgba(111, 174, 158, 0) 70%);
  animation: ffly-1 17s var(--ease) infinite, ftwinkle 5.2s ease-in-out infinite; }
.fireflies .ff.p { background: radial-gradient(circle, rgba(131, 119, 196, .95), rgba(131, 119, 196, 0) 70%); }
.fireflies .ff.y { background: radial-gradient(circle, rgba(240, 200, 100, .95), rgba(240, 200, 100, 0) 70%); }
.fireflies .ff.big { width: 13px; height: 13px; }
.fireflies .ff.f2 { animation-name: ffly-2, ftwinkle; animation-duration: 21s, 6.4s; }
.fireflies .ff.f3 { animation-name: ffly-3, ftwinkle; animation-duration: 14s, 4.6s; }
.fireflies .ff.rev { animation-direction: reverse, normal; animation-duration: 23s, 7s; }
@keyframes ffly-1 { 0% { transform: translate(0, 0); } 33% { transform: translate(180px, -46px); } 66% { transform: translate(60px, 40px); } 100% { transform: translate(0, 0); } }
@keyframes ffly-2 { 0% { transform: translate(0, 0); } 40% { transform: translate(-140px, 60px); } 75% { transform: translate(-40px, -70px); } 100% { transform: translate(0, 0); } }
@keyframes ffly-3 { 0% { transform: translate(0, 0); } 50% { transform: translate(120px, 80px); } 100% { transform: translate(0, 0); } }
@keyframes ftwinkle { 0%, 100% { opacity: .12; } 50% { opacity: .85; } }

/* D4 桌面追光：柔光缓动跟随指针（index.html JS 配合，hover+fine 且非 reduced-motion 才显示） */
.ptr-glow { position: fixed; z-index: -1; left: 0; top: 0; width: 280px; height: 280px; margin: -140px 0 0 -140px;
  pointer-events: none; opacity: 0; transition: opacity var(--dur) var(--ease); will-change: transform;
  background: radial-gradient(circle, rgba(111, 174, 158, .30), rgba(111, 174, 158, .10) 45%, transparent 70%); }

/* ---------- 底部标签栏（二期导航框架：笔记/发现/写一页/信箱/我的） ----------
   仅根页面挂载（index / search / messages / mine），二级页保持返回条无标签。
   active：森林绿 + 叶圆点底；中央「写一页」CTA 继承 FAB 呼吸光晕（D6，滚动 .calm 暂停）。 */
.tabbar { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 680px; z-index: 50;
  display: flex; align-items: flex-end;
  background: var(--bg-card); border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 22px rgba(46, 58, 46, .10); }
:root[data-theme="dark"] .tabbar { box-shadow: 0 -8px 22px rgba(0, 0, 0, .38); }
.tabbar a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 0 3px; color: var(--text-3); font-size: 11px; border-radius: 14px;
  transition: color var(--dur-fast) var(--ease); }
.tabbar a:hover { color: var(--text-2); }
.tabbar a > * { position: relative; z-index: 1; }
.tabbar a svg { width: 22px; height: 22px; }
/* active 叶圆点底（Biophilic 叶影圆） */
.tabbar a.active { color: var(--brand); font-weight: 700; }
.tabbar a.active::before { content: ""; position: absolute; top: 3px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 36px; border-radius: 50%; background: rgba(168, 216, 196, .45); }
:root[data-theme="dark"] .tabbar a.active::before { background: rgba(168, 216, 196, .22); }
/* 中央「写一页」CTA：抬升圆钮 + D6 呼吸光晕（合成层安全，只动 transform/opacity） */
.tabbar-cta { flex: 1; display: flex; justify-content: center; }
.tabbar-cta .cta-btn { position: relative; width: 52px; height: 52px; margin-top: -22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; border: none; padding: 0; cursor: pointer;
  background: linear-gradient(165deg, var(--brand), var(--brand-soft)); color: var(--btn-fg);
  box-shadow: 0 6px 18px rgba(47, 122, 79, .35);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.tabbar-cta .cta-btn svg { width: 24px; height: 24px; }
.tabbar-cta .cta-btn:hover { box-shadow: var(--glow); transform: translateY(-2px); }
.tabbar-cta .cta-btn:active { transform: scale(.94); box-shadow: var(--in-sm); }
.tabbar-cta .cta-btn::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, transparent 50%, rgba(47, 122, 79, .40) 64%, transparent 74%);
  opacity: .35; animation: fab-breathe 3s var(--ease) infinite; }
.tabbar-cta.calm .cta-btn::after { animation-play-state: paused; opacity: .2; }
@keyframes fab-breathe { 0%, 100% { transform: scale(.82); opacity: .35; } 50% { transform: scale(1.18); opacity: .9; } }

/* ---------- Splash 开场「手帐翻开」（theme-boot.js 每会话注入一次 #cl-splash） ----------
   分镜：光尘汇聚 → 叶片描边生长 → wordmark 逐字浮现 → 纸页上掀揭开。
   全程 transform/opacity/stroke-dashoffset；点击任意处跳过；reduced-motion 由 boot 直接不注入。 */
#cl-splash { position: fixed; inset: 0; z-index: 999; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(47, 122, 79, .045) 25px 26px) fixed,
    linear-gradient(165deg, #F7F4E8 0%, #F2EFE0 100%) fixed;
  animation: splash-in 200ms var(--ease) both; }
:root[data-theme="dark"] #cl-splash {
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(168, 216, 196, .05) 25px 26px) fixed,
    linear-gradient(165deg, #1C231C 0%, #202A20 100%) fixed; }
#cl-splash.out { animation: splash-up 300ms cubic-bezier(.5, 0, .8, .4) forwards;
  border-radius: 0 0 46% 38% / 0 0 70px 90px;
  box-shadow: 0 12px 34px rgba(46, 58, 46, .28); }
@keyframes splash-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-up { to { transform: translateY(-103%); } }

/* 光尘：与 D1 萤火虫同语言，向中心汇聚后散去 */
.cl-sp-dust { position: absolute; inset: 0; pointer-events: none; }
.cl-sp-dust i { position: absolute; width: 9px; height: 9px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(111, 174, 158, .95), rgba(111, 174, 158, 0) 70%);
  animation: splash-dust 1.05s var(--ease) both; }
.cl-sp-dust i.p { background: radial-gradient(circle, rgba(131, 119, 196, .95), rgba(131, 119, 196, 0) 70%); }
.cl-sp-dust i.y { background: radial-gradient(circle, rgba(240, 200, 100, .95), rgba(240, 200, 100, 0) 70%); }
@keyframes splash-dust {
  0% { opacity: 0; transform: translate(0, 0) scale(1); }
  40% { opacity: .9; transform: translate(var(--dx), var(--dy)) scale(.55); }
  70% { opacity: .45; transform: translate(calc(var(--dx) * .35), calc(var(--dy) * .35)) scale(1.3); }
  100% { opacity: 0; transform: translate(0, 0) scale(.4); }
}

/* 叶片描边生长 */
.cl-sp-leaf { width: 58px; height: 58px; fill: none; stroke: var(--brand);
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cl-sp-leaf .lo { stroke-dasharray: 132; stroke-dashoffset: 132; animation: splash-draw .55s 150ms var(--ease) both; }
.cl-sp-leaf .lv { stroke-dasharray: 64; stroke-dashoffset: 64; animation: splash-draw .3s 560ms var(--ease) both; }
@keyframes splash-draw { to { stroke-dashoffset: 0; } }

/* wordmark 逐字浮现（楷体）+ 标语 */
.cl-sp-brand { font-family: var(--font-hand); font-size: 27px; font-weight: 700; color: var(--brand);
  letter-spacing: .04em; margin-top: 14px; }
.cl-sp-brand i { display: inline-block; font-style: normal; opacity: 0;
  animation: splash-char 260ms var(--ease-back) both; }
@keyframes splash-char { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.cl-sp-slogan { font-family: var(--font-hand); font-size: 13px; color: var(--text-3);
  opacity: 0; animation: splash-slogan 450ms 760ms var(--ease) both; }
@keyframes splash-slogan { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 页间转场「绿弧幕上掠」（View Transitions API 跨文档） ----------
   站内导航时：森林绿弧幕自下而上掠过 320ms（呼应首页顶栏有机下缘）。
   旧页前半程淡出、新页后半程浮现；group::after 为弧幕层（旧引擎不支持时退化为快速交叉淡入）。
   Firefox/无 @view-transition 支持 → 静默降级为页面自身 fade-up 入场。 */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-old-dim 160ms var(--ease) both; }
  ::view-transition-new(root) { animation: vt-new-show 160ms 160ms var(--ease) both; }
  ::view-transition-group(root)::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(165deg, #2F7A4F 0%, #4E9E6B 62%, #6FAE9E 100%);
    border-radius: 0 0 46% 38% / 0 0 90px 110px;
    box-shadow: 0 -10px 30px rgba(47, 122, 79, .35);
    animation: vt-arc-sweep 320ms cubic-bezier(.45, .05, .55, .95) both;
  }
  @keyframes vt-arc-sweep { from { transform: translateY(106%); } to { transform: translateY(-108%); } }
  @keyframes vt-old-dim { to { opacity: 0; } }
  @keyframes vt-new-show { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- 转场加载：顶部细进度条（theme-boot.js 模板②驱动） ----------
   出发段（旧页）：.run-out 点击后约 190ms 推进至 40% 即跳转；
   加载段（新页）：cl_nav_pending 接续，JS transition 慢爬 55%→85%，load 后收尾至 100% 淡出。
   z-index 998：低于 splash(999)、高于弹层/标签栏；reduced-motion 由 boot 不注入。 */
.cl-pbar { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 998;
  background: linear-gradient(90deg, var(--brand), var(--brand-soft), #6FAE9E);
  box-shadow: 0 0 8px rgba(47, 122, 79, .35);
  transform-origin: left center; transform: scaleX(0);
  pointer-events: none; will-change: transform, opacity; }
.cl-pbar.run-out { animation: cl-pbar-out .19s var(--ease) forwards; }
@keyframes cl-pbar-out { from { transform: scaleX(0); } to { transform: scaleX(.4); } }
.cl-pbar.fade { opacity: 0; transition: opacity 220ms var(--ease); }

/* ---------- 暗色动态背景「星野操场」（theme-boot.js 注入 #cl-nightsky，仅暗色主题） ----------
   意象：深夜校园操场——苔藓绿黑夜空 + 像素星错相位闪烁 + 青绿大气像素地球 60s 漂移 +
   发光草地 8s 呼吸（D6 语言）+ 人影剪影；流星彩蛋 6-11s 随机一颗。
   浅色主题整层 display:none（米纸横线纹不受影响）；reduced-motion 由全局降级规则定格静态夜景。
   .ns-sky 上下出血供 0.15x 视差（星空）/ 0.06x（星球）不露底；全程 transform/opacity。 */
#cl-nightsky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
:root:not([data-theme="dark"]) #cl-nightsky { display: none; }
#cl-nightsky .ns-sky { position: absolute; inset: -80px 0 -400px 0; will-change: transform;
  background: linear-gradient(180deg, #101820 0%, #14201A 58%, #1C231C 100%); }
#cl-nightsky .sk-star { position: absolute; width: 2px; height: 2px; background: #DDE8DC; opacity: .2;
  animation: ns-tw linear infinite; }
#cl-nightsky .sk-star.g { background: #A8D8C4; }
#cl-nightsky .sk-star.big { width: 3px; height: 3px; }
@keyframes ns-tw { 0%, 100% { opacity: .12; } 50% { opacity: .92; } }
#cl-nightsky .ns-planet { position: absolute; inset: 0; will-change: transform; }
#cl-nightsky .ns-earth { position: absolute; right: -74px; top: 8px; width: 196px; height: 196px; border-radius: 50%;
  background: radial-gradient(circle at 34% 38%, #3E6E8C 0%, #2C5470 45%, #1E3A50 78%);
  box-shadow: 0 0 0 3px rgba(111, 174, 158, .55), 0 0 28px rgba(111, 174, 158, .32);
  animation: ns-drift 60s linear infinite alternate; }
#cl-nightsky .ns-earth i { position: absolute; border-radius: 2px; background: rgba(235, 242, 240, .72); }
@keyframes ns-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-14px, 6px, 0); } }
#cl-nightsky .ns-ground { position: absolute; inset: 0; }
#cl-nightsky .ns-grass { position: absolute; left: 0; right: 0; bottom: 0; height: 36px;
  background: linear-gradient(180deg, rgba(76, 140, 92, .60), rgba(47, 122, 79, .16));
  box-shadow: 0 -4px 20px rgba(76, 140, 92, .42);
  animation: ns-breathe 8s var(--ease) infinite; }
@keyframes ns-breathe { 0%, 100% { box-shadow: 0 -4px 14px rgba(76, 140, 92, .30); } 50% { box-shadow: 0 -4px 24px rgba(76, 140, 92, .55); } }
#cl-nightsky .ns-man { position: absolute; bottom: 36px; left: 58%; width: 3px; height: 15px; background: #0C120E; border-radius: 1px; }
#cl-nightsky .ns-man::before { content: ""; position: absolute; top: -4px; left: -2px; width: 7px; height: 6px; border-radius: 50%; background: #0C120E; }
#cl-nightsky .ns-man::after { content: ""; position: absolute; top: 13px; left: -6px; width: 15px; height: 2px; background: rgba(12, 18, 14, .45); transform: skewX(-32deg); }
#cl-nightsky .ns-meteor { position: absolute; width: 90px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(207, 234, 223, .95), rgba(207, 234, 223, 0));
  transform: rotate(-32deg); opacity: 0; animation: ns-shoot .9s ease-out forwards; }
@keyframes ns-shoot {
  0% { opacity: 0; transform: rotate(-32deg) translateX(0); }
  12% { opacity: .95; }
  100% { opacity: 0; transform: rotate(-32deg) translateX(-190px); } }

/* 鼠标跟随星尘拖尾（theme-boot 仅桌面 fine pointer + 暗色 + 非减动效启用）：
   pointermove 距离阈值撒尘，粒子沿随机向量漂移渐隐（仅 transform/opacity），并发上限 50 自清理 */
#cl-nightsky .ns-dust { position: absolute; inset: 0; }
#cl-nightsky .ns-dust-i { position: absolute; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #E8F2EC, rgba(232, 242, 236, 0) 70%);
  box-shadow: 0 0 6px rgba(168, 216, 196, .55);
  animation: ns-dust-fly ease-out forwards; }
#cl-nightsky .ns-dust-i.g { background: radial-gradient(circle, #A8D8C4, rgba(168, 216, 196, 0) 70%); }
#cl-nightsky .ns-dust-i.y { background: radial-gradient(circle, #F0C864, rgba(240, 200, 100, 0) 70%);
  box-shadow: 0 0 6px rgba(240, 200, 100, .50); }
@keyframes ns-dust-fly {
  0% { opacity: .95; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: 0; transform: translate3d(var(--dx, 8px), var(--dy, 10px), 0) scale(.35); } }

/* ---------- 浅色动态背景「晴空纸鸢」（theme-boot.js 注入 #cl-dayside，仅浅色主题） ----------
   意象：手帐天空涂鸦——淡蓝天幕 + 手绘云缓漂（80/120/76s）+ 纸飞机 34s 巡航 + 花朵轻摆。
   与暗色「星野操场」互斥显示；reduced-motion 由全局降级规则定格；全程 transform/opacity。 */
#cl-dayside { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
:root[data-theme="dark"] #cl-dayside { display: none; }
#cl-dayside .ds-wash { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(150, 205, 235, .5), rgba(150, 205, 235, 0) 55%); }
#cl-dayside .ds-cloud { position: absolute; animation: ds-drift linear infinite alternate; }
#cl-dayside .c1 { left: 8%; top: 9%; animation-duration: 90s; }
#cl-dayside .c2 { right: 6%; top: 22%; animation-duration: 120s; animation-direction: alternate-reverse; }
#cl-dayside .c3 { left: 40%; top: 5%; animation-duration: 76s; }
@keyframes ds-drift { from { transform: translateX(-16px); } to { transform: translateX(16px); } }
#cl-dayside .ds-plane { position: absolute; left: 8%; top: 16%; animation: ds-plane 34s var(--ease) infinite; }
@keyframes ds-plane {
  0% { transform: translate(0, 0) rotate(8deg); }
  30% { transform: translate(90px, 34px) rotate(-4deg); }
  55% { transform: translate(180px, 10px) rotate(6deg); }
  80% { transform: translate(240px, 44px) rotate(-6deg); }
  100% { transform: translate(0, 0) rotate(8deg); } }
#cl-dayside .ds-flowers { position: absolute; left: 0; right: 0; bottom: 96px; display: flex; gap: 22px;
  justify-content: flex-end; padding-right: 26px; }
#cl-dayside .ds-flowers i { position: relative; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, #F7D774 32%, #E8A0B4 40%); transform-origin: bottom center;
  animation: ds-sway 6s var(--ease) infinite; }
#cl-dayside .ds-flowers i:nth-child(2) { animation-delay: -2s; }
#cl-dayside .ds-flowers i:nth-child(3) { animation-delay: -4s; }
#cl-dayside .ds-flowers i::before { content: ""; position: absolute; top: 7px; left: 3px; width: 2px; height: 14px;
  background: #6FA25A; border-radius: 1px; }
@keyframes ds-sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* ---------- 动效降级：尊重 prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
