/* ============================================================
   梦境记录仪 H5 · V2 方案A「暗夜紫金」
   依据：DESIGN.md（workspace/projects/dream-recorder/ui-v2）+
   Figma V2 · DS 方案A + shared-skills/design-excellence
   纪律：色值只走 Token；字号阶梯 22/17/15/14/12；间距 8pt 网格；
   触控≥44；按下 −20% 透明度；动效只动 transform/opacity；
   字体只用系统栈（外部字体=黑屏 1 分钟的坑，不踩）。
   ============================================================ */

:root {
  color-scheme: dark;
  /* 语义色 Token —— 方案A 暗夜紫金 */
  --bg: #12101E;          /* surface-base 深夜紫底 */
  --panel: #1D1930;       /* surface-raised 卡片 */
  --panel-2: #272142;     /* surface-overlay 二级卡/浮层 */
  --text: #F5F1E8;        /* text-primary 暖米白 */
  --muted: #B0A8CC;       /* text-secondary 紫灰（暗底 7.2:1） */
  --faint: #7E7699;       /* text-tertiary 仅 caption/装饰 */
  --line: #322B4D;        /* hairline 分割线/描边 */
  --accent: #F0C35C;      /* brand-accent 唯一强调金 */
  --accent-soft: #D9A83C; /* 金色渐变深端 */
  --accent-ink: #1E1830;  /* 金底上的文字 */
  --gold-bg: #2E2616;     /* 金色淡底（选中/标签） */
  --good: #7BD9A9;        /* success */
  --good-bg: #182D24;
  --danger: #F27D7D;      /* 仅错误 */
  --danger-bg: #2E1B26;
  --track: #262040;       /* 进度轨道 */
  --accent-bright: #F6D38B; /* 金色渐变亮端 */
  --night-violet: #3A2E5C;  /* 详情头图紫夜深端 */
  --shell-a: #241F3A;       /* 桌面手机壳渐变亮端 */
  --shell-b: #0B0912;       /* 桌面手机壳渐变深端 */
  --notch: #0A0810;         /* 刘海 */
  --backdrop: #0C0A14;      /* 桌面画布底色 */
  /* 圆角档位 */
  --r-card: 16px;
  --r-btn: 14px;
  --r-sm: 12px;
  /* 动效档位（微反馈 120ms / 常规 240ms，标准曲线） */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 120ms;
  --t-mid: 240ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 8%, rgba(240, 195, 92, 0.10), transparent 26rem),
    radial-gradient(circle at 85% 15%, rgba(87, 66, 140, 0.22), transparent 24rem),
    var(--backdrop);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }

/* ---------- 桌面端手机外壳 ---------- */
.desktop-frame {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.phone-frame {
  position: relative;
  width: min(390px, calc(100vw - 24px));
  height: min(844px, calc(100vh - 24px));
  height: min(844px, calc(100dvh - 24px));
  min-height: 620px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 42px;
  background: linear-gradient(145deg, var(--shell-a), var(--shell-b));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.phone-notch {
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 20;
  width: 118px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 0 0 18px 18px;
  background: var(--notch);
}

.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 32px;
  background: var(--bg);
}

.phone-home-indicator {
  position: absolute;
  bottom: 18px;
  left: 50%;
  width: 120px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: rgba(245, 241, 232, 0.5);
}

.status-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 26px;
  color: var(--text);
  font-size: 12px; /* caption 档 */
  pointer-events: none;
}

.status-icons { display: flex; gap: 7px; align-items: center; }

/* ---------- 页面基座 ---------- */
.page {
  position: absolute;
  inset: 0;
  display: none;
  overflow: auto;
  padding: 58px 16px 96px; /* 左右 16 统一边距 */
  background: var(--bg);
}

.page.active {
  display: block;
  animation: pageIn var(--t-mid) var(--ease);
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-header, .edit-header, .profile-header, .record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- 首页 ---------- */
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }

.logo-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-soft));
}

.avatar, .profile-avatar {
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-soft));
}

.avatar { width: 40px; height: 40px; border-radius: 50%; font-weight: 700; }

.home-greeting { margin: 24px 0 16px; }

.greeting-title {
  margin: 0 0 8px;
  font-size: 22px; /* Display 档 */
  font-weight: 700;
}

.greeting-sub { margin: 0; color: var(--muted); font-size: 14px; }
.greeting-sub strong { color: var(--accent); }

.timeline { display: grid; gap: 16px; }

.dream-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: opacity var(--t-fast) var(--ease);
}

.dream-card:active { opacity: 0.8; } /* 按下 −20% */

.dream-image-card {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-2);
}

.dream-image, .dream-cover, .dream-image-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dream-image { object-fit: cover; }

.dream-cover {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(240, 195, 92, 0.20), transparent 6rem),
    radial-gradient(circle at 78% 28%, rgba(126, 118, 153, 0.28), transparent 7rem),
    radial-gradient(circle at 42% 92%, rgba(240, 195, 92, 0.12), transparent 8rem),
    linear-gradient(135deg, var(--cover-a), var(--cover-b));
}

.dream-cover::before, .dream-cover::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.dream-cover::before {
  left: 26px; right: 26px; bottom: 32px;
  height: 34px;
  background: rgba(245, 241, 232, 0.10);
  filter: blur(14px);
}

.dream-cover::after {
  width: 150px; height: 150px;
  border: 1px solid rgba(240, 195, 92, 0.22);
  transform: rotate(-18deg);
}

.dream-cover-mood {
  position: relative;
  z-index: 1;
  font-size: 48px; /* emoji 装饰，非文本阶梯 */
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.28));
}

.dream-image-shade {
  background: linear-gradient(180deg, rgba(18, 16, 30, 0.04), rgba(18, 16, 30, 0.58));
}

.dream-play {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  color: var(--accent-ink);
  background: rgba(240, 195, 92, 0.92);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.dream-image-label {
  position: absolute;
  left: 12px; bottom: 12px;
  z-index: 2;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 16, 30, 0.66);
  color: var(--text);
  font-size: 12px;
  backdrop-filter: blur(10px);
}

.dream-main { min-width: 0; padding: 2px 2px 4px; }

.dream-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dream-row h3 {
  margin: 0;
  overflow: hidden;
  font-size: 15px; /* Body-Em 档 */
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dream-row time, .detail-date, .edit-helper, .record-subtitle,
.generating-stage, .generating-tip, .login-sub, .login-hint, .profile-bio {
  color: var(--muted);
  font-size: 12px; /* caption 档 */
}

.dream-main p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 14px; /* Body 档 */
  line-height: 1.6;
}

.dream-tags, .detail-tags, .edit-tags, .generating-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 标签胶囊：一屏一强调，标签统一弱金调（一致性法则） */
.dream-tags span, .edit-tag, .gen-tag, .d-tag {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--accent);
  font-size: 12px;
}

/* ---------- Tab 栏（浮岛胶囊，挂手机屏层级，滚动不跟随） ---------- */
.tab-bar {
  position: absolute;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 10;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(29, 25, 48, 0.94);
  backdrop-filter: blur(16px);
}

.tab-bar.visible { display: grid; }

.tab-item {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 48px; /* 触控 ≥44 */
  border-radius: var(--r-btn);
  color: var(--faint);
  text-decoration: none;
  transition: opacity var(--t-fast) var(--ease);
}

.tab-item:active { opacity: 0.8; }

.tab-item.active { color: var(--accent); background: var(--gold-bg); }

.tab-icon { font-size: 17px; line-height: 1; }

.tab-icon-record {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent);
}

.tab-label { font-size: 12px; }

/* ---------- 通用按钮 ---------- */
.icon-btn, .text-btn, .cancel-btn, .toolbar-btn, .action-btn,
.share-cancel, .login-code-btn, .login-submit {
  min-height: 44px; /* 触控 ≥44 */
  border-radius: var(--r-sm);
  color: var(--text);
  background: var(--panel-2);
  transition: opacity var(--t-fast) var(--ease);
}

.icon-btn:active, .text-btn:active, .cancel-btn:active, .toolbar-btn:active,
.action-btn:active, .share-cancel:active, .login-code-btn:active, .login-submit:active {
  opacity: 0.8;
}

button[disabled], button.is-disabled { opacity: 0.4; cursor: not-allowed; }

.icon-btn { display: grid; place-items: center; width: 44px; font-size: 22px; }

/* 主 CTA：唯一强调金 */
.text-btn, .login-submit {
  padding: 0 16px;
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-soft));
  color: var(--accent-ink);
}

.cancel-btn { width: 100%; background: var(--panel-2); color: var(--text); }

/* ---------- 录音页 ---------- */
.page-record, .page-generating, .page-login {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 26%, rgba(240, 195, 92, 0.14), transparent 12rem),
    radial-gradient(circle at 50% 78%, rgba(87, 66, 140, 0.20), transparent 12rem),
    var(--bg);
}

.record-content, .generating-content, .login-wrap {
  display: grid;
  justify-items: center;
  text-align: center;
}

.record-content { padding-top: 48px; }

.record-title {
  margin: 0 0 8px;
  font-size: 22px; /* Display 档 */
  font-weight: 700;
}

.keyword-chips { display: flex; gap: 8px; margin: 24px 0 48px; }

.keyword-chip {
  padding: 8px 12px; /* 触控高度补足 */
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.record-stage { position: relative; display: grid; justify-items: center; }

/* 录音 orb：金色圆环 + 柔金核（Figma V2 同款签名元素） */
.wave-rings { position: absolute; inset: -45px; pointer-events: none; }

.wave-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(240, 195, 92, 0.3);
  border-radius: 50%;
  animation: pulse 2.8s ease-in-out infinite;
}

.wave-ring-2 { animation-delay: 0.45s; }
.wave-ring-3 { animation-delay: 0.9s; }

.record-btn {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 136px; height: 136px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-soft));
  box-shadow: 0 18px 60px rgba(240, 195, 92, 0.26);
  transition: opacity var(--t-fast) var(--ease);
}

.record-btn:active { opacity: 0.8; }

.record-btn-inner {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent-ink);
}

.record-btn.recording .record-btn-inner {
  border-radius: var(--r-sm);
  background: var(--danger);
}

.record-hint, .record-timer { margin: 16px 0 0; }

.record-hint { font-size: 15px; color: var(--text); }

.record-timer {
  color: var(--accent);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.record-footer { position: absolute; left: 16px; right: 16px; bottom: 28px; }

/* 记录页文字录入入口 */
.record-text-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--panel-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  transition: opacity var(--t-fast) var(--ease);
}

.record-text-btn:active { opacity: 0.8; }

/* ---------- 文字编辑页 ---------- */
.edit-title, .profile-title { margin: 0; font-size: 17px; font-weight: 500; } /* Title 档 */

.edit-meta { display: flex; gap: 8px; margin: 16px 0; }

.edit-meta-item {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.edit-editor { display: grid; gap: 8px; }

.edit-textarea {
  width: 100%;
  min-height: 250px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  padding: 16px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.edit-textarea:focus { border-color: var(--accent); }

.edit-tags { margin: 16px 0; }

.edit-toolbar, .detail-actions, .share-grid, .profile-stats {
  display: grid;
  gap: 8px;
}

.edit-toolbar, .detail-actions { grid-template-columns: repeat(4, 1fr); }

.toolbar-btn, .action-btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.toolbar-icon, .action-icon { font-size: 17px; }
.toolbar-label, .action-label { font-size: 12px; color: var(--muted); }

/* ---------- 生成等待页 ---------- */
.generating-content { padding-top: 80px; }

.nebula {
  position: relative;
  width: 166px; height: 166px;
  margin-bottom: 32px;
}

.nebula-core, .nebula-ring { position: absolute; inset: 0; border-radius: 50%; }

.nebula-core {
  inset: 44px;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-soft));
  filter: blur(1px);
}

.nebula-ring {
  border: 1px solid rgba(240, 195, 92, 0.25);
  animation: spin 8s linear infinite; /* 旋转 spinner 用 linear 属标准做法 */
}

.nebula-ring-2 { inset: 18px; animation-duration: 6s; }
.nebula-ring-3 { inset: 34px; animation-duration: 4s; }

.generating-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; }

.progress-track {
  width: 100%;
  height: 8px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transition: width 0.12s ease;
}

.progress-percent { margin: 10px 0 20px; color: var(--accent); font-size: 15px; }

/* ---------- 详情页 ---------- */
.page-detail { padding: 0 0 96px; }

.detail-image {
  position: relative;
  height: 270px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--panel), var(--panel-2) 48%, var(--night-violet));
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

/* 星点装饰（CSS 绘制，不增加 DOM） */
.image-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(240, 195, 92, 0.85) 1.5px, transparent 1.6px),
    radial-gradient(circle, rgba(240, 195, 92, 0.5) 1px, transparent 1.1px),
    radial-gradient(circle, rgba(245, 241, 232, 0.4) 1px, transparent 1.1px);
  background-size: 140px 140px, 90px 90px, 60px 60px;
  background-position: 20% 15%, 70% 40%, 40% 70%;
}

.image-glow {
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(240, 195, 92, 0.22);
  filter: blur(18px);
}

.detail-back { position: absolute; top: 54px; left: 16px; }

.detail-body { padding: 16px; }

.detail-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-title {
  margin: 0;
  font-size: 22px; /* Display 档 */
  font-weight: 700;
}

.detail-tags, .detail-actions { margin: 16px 0; }

/* 标签统一弱金调；保留 4 个变体类名兼容 JS，视觉收敛为同族 */
.d-tag-purple, .d-tag-pink, .d-tag-blue, .d-tag-orange {
  background: var(--gold-bg);
  color: var(--accent);
}

.content-title { margin: 24px 0 10px; font-size: 15px; font-weight: 500; }

.content-text, .ai-card {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.ai-card {
  display: flex;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent); /* 金色左缘 = 本屏强调点 */
  border-radius: var(--r-sm);
  background: var(--panel);
}

.ai-card p { margin: 0; }
.ai-icon { color: var(--accent); }

/* ---------- 分享弹窗 ---------- */
.page-share { z-index: 15; padding: 0; background: transparent; }

.share-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 16, 0.56);
}

.share-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px 26px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--panel);
  animation: sheetIn 280ms var(--ease);
}

@keyframes sheetIn {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.share-handle {
  width: 42px; height: 4px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: var(--line);
}

.share-title { margin: 0 0 16px; text-align: center; font-size: 17px; font-weight: 500; }

.share-grid { grid-template-columns: repeat(3, 1fr); }

.share-item {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-sm);
  color: var(--text);
  background: var(--panel-2);
  transition: opacity var(--t-fast) var(--ease);
}

.share-item:active { opacity: 0.8; }

.share-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 15px;
}

.share-name { font-size: 12px; }

.share-cancel { width: 100%; margin-top: 16px; }

/* ---------- 个人主页 ---------- */
.profile-user { display: grid; justify-items: center; margin: 24px 0 20px; }

.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 24px;
  font-size: 22px;
  font-weight: 700;
}

.profile-name { margin: 12px 0 4px; font-size: 17px; font-weight: 500; }

.profile-stats { grid-template-columns: repeat(3, 1fr); }

.stat-card {
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  text-align: center;
  background: var(--panel);
}

.stat-num {
  color: var(--accent);
  font-size: 22px; /* 阶梯内 */
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-label { margin-top: 4px; color: var(--muted); font-size: 12px; }

.profile-menu { display: grid; gap: 8px; margin-top: 20px; }

.menu-item {
  display: grid;
  grid-template-columns: 30px 1fr 20px;
  align-items: center;
  min-height: 48px; /* 触控 ≥44 */
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
  font-size: 14px;
  transition: opacity var(--t-fast) var(--ease);
}

.menu-item:active { opacity: 0.8; }

.menu-icon { color: var(--accent); }
.menu-arrow { color: var(--faint); text-align: right; }

/* ---------- 登录页 ---------- */
.login-wrap { padding-top: 64px; }
.login-logo { font-size: 48px; } /* emoji 装饰 */
.login-brand { margin: 10px 0 4px; font-size: 22px; font-weight: 700; color: var(--accent); }

.login-form {
  display: grid;
  gap: 10px;
  width: min(100%, 300px);
  min-width: 0;
  margin-top: 32px;
}

.login-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.login-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  padding: 0 16px;
  color: var(--text);
  background: var(--panel);
  font-size: 14px;
}

.login-input:focus { border-color: var(--accent); }

.login-submit { min-height: 48px; }

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 40;
  max-width: calc(100% - 48px);
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: rgba(245, 241, 232, 0.94);
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 动效 ---------- */
@keyframes pulse {
  0% { opacity: 0.8; transform: scale(0.72); }
  70%, 100% { opacity: 0; transform: scale(1.18); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 移动端去壳 ---------- */
@media (max-width: 520px) {
  .desktop-frame { padding: 0; }
  .phone-frame {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    border: 0;
    border-radius: 0;
  }
  .phone-screen { border-radius: 0; }
  .phone-notch, .phone-home-indicator { display: none; }
}

/* ---------- 服务/审核状态、空态 ---------- */
.service-status, .audit-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
}

.service-status::before, .audit-status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.service-status[data-state="online"]::before, .audit-status:not(:empty)::before {
  background: var(--good);
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 220px;
  place-content: center;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--r-card);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty-state::before {
  content: "☾";
  color: var(--accent);
  font-size: 22px;
}

.empty-state strong { color: var(--text); font-size: 17px; font-weight: 500; }

.detail-image.has-image { background-position: center; background-size: cover; }
.detail-image.has-image .image-placeholder {
  background: linear-gradient(180deg, transparent 45%, rgba(12, 10, 20, 0.48));
}

/* ---------- 焦点可见性 ---------- */
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid rgba(240, 195, 92, 0.55);
  outline-offset: 2px;
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


/* ===== v3 UI 打磨（基于线上版重做，2026-10-19） ===== */
/* SVG 图标体系 */
.ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.22em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-fill { fill: currentColor; stroke: none; }
.tab-icon .ic { width: 20px; height: 20px; }
.action-icon .ic, .menu-icon .ic, .toolbar-icon .ic { width: 19px; height: 19px; vertical-align: 0; }
.icon-btn { font-size: 0; }
.icon-btn .ic { width: 20px; height: 20px; }
.tab-icon-record .ic { width: 16px; height: 16px; }

/* 星空层 */
.stars { position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 16%, rgba(255,255,255,.75), transparent),
    radial-gradient(1.1px 1.1px at 26% 58%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.8px 1.8px at 38% 10%, rgba(255,255,255,.65), transparent),
    radial-gradient(1px 1px at 52% 34%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.4px 1.4px at 64% 14%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.1px 1.1px at 74% 46%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.7px 1.7px at 84% 22%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 92% 60%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.3px 1.3px at 45% 76%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.5px 1.5px at 8% 74%, rgba(255,255,255,.55), transparent),
    radial-gradient(1.2px 1.2px at 68% 84%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.4px 1.4px at 33% 88%, rgba(255,255,255,.5), transparent);
  animation: starsTw 5.2s ease-in-out infinite; }
@keyframes starsTw { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes twinkle { 0%,100% { opacity: .15; } 50% { opacity: .75; } }

/* 品牌 logo：金月 */
.logo-icon { color: #241a06; background: linear-gradient(135deg, #f7d89a, #f2c572); box-shadow: 0 4px 14px rgba(242,197,114,.3); }
.logo-icon .ic { width: 18px; height: 18px; }

/* 真手机：隐藏假状态栏 + 动态视口 + tab 安全区 */
@media (max-width: 520px) {
  .status-bar { display: none; }
  .phone-frame { height: 100dvh; min-height: 100dvh; }
  .page { padding: calc(16px + env(safe-area-inset-top)) 18px 120px; }
  .tab-bar { bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* 页面过渡 */
.page.active { animation: pageIn .26s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 服务状态降噪 */
.service-status { border: none; background: transparent; padding: 4px 0; }
.service-status::before { background: var(--gold, #f2c572); animation: twinkle 1.8s ease-in-out infinite; }
.service-status[data-state="online"]::before { background: #7ee2a8; animation: none; }

/* 空状态 2.0：弯月插画 */
.empty-v2 { display: grid; justify-items: center; gap: 10px; padding: 48px 20px 30px; text-align: center; }
.empty-moon { position: relative; width: 76px; height: 76px; margin-bottom: 8px; }
.empty-moon::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #ffe9bd, #f2c572 58%, #cf9540);
  box-shadow: 0 0 36px rgba(242,197,114,.38); }
.empty-moon::after { content: ""; position: absolute; top: -6px; right: -8px; width: 34px; height: 34px; border-radius: 50%; background: var(--bg); }
.empty-moon i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; animation: twinkle 3s ease-in-out infinite; }
.empty-moon i:nth-child(1) { top: 4px; left: -18px; }
.empty-moon i:nth-child(2) { top: -12px; right: 16px; animation-delay: 1s; }
.empty-moon i:nth-child(3) { bottom: 0; right: -22px; animation-delay: 2s; }
.empty-v2 strong { font-size: 17px; color: var(--text); }
.empty-v2 span { color: var(--muted); font-size: 13px; line-height: 1.7; }

/* 登录页：弯月 + 星空 + 垂直居中 */
.page-login.active { display: flex; flex-direction: column; }
.page-login .login-wrap { margin: auto; padding-top: 0; }
.login-logo { display: grid; place-items: center; }
.moon-mark { position: relative; display: inline-block; width: 66px; height: 66px; border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #ffe9bd, #f2c572 58%, #cf9540);
  box-shadow: 0 0 46px rgba(242,197,114,.45); }
.moon-mark::after { content: ""; position: absolute; top: -5px; right: -7px; width: 30px; height: 30px; border-radius: 50%; background: #101014; }

/* 记录页：麦克风入瞳 + 呼吸光 */
.record-btn-inner { display: grid; place-items: center; color: #fff; }
.record-btn-inner .ic { width: 24px; height: 24px; }
.record-btn.recording .record-btn-inner .ic { display: none; }
.record-btn { animation: btnGlow 3.4s ease-in-out infinite; }
@keyframes btnGlow { 0%,100% { box-shadow: 0 18px 60px rgba(122,165,255,.24); } 50% { box-shadow: 0 18px 72px rgba(180,133,255,.45); } }
.record-content { padding-bottom: 24px; }
.page-record .record-content { margin-top: 12px; }

/* 详情页：3 列操作 + 占位星空 */
.detail-actions { grid-template-columns: repeat(3, 1fr); }
.image-placeholder { background-image:
    radial-gradient(1.5px 1.5px at 18% 26%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.1px 1.1px at 72% 20%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.3px 1.3px at 55% 62%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 86% 54%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.2px 1.2px at 34% 74%, rgba(255,255,255,.4), transparent); }

/* 个人主页 */
.header-spacer { display: inline-block; width: 38px; height: 38px; visibility: hidden; }
.menu-icon { color: var(--accent, #a78bfa); }

/* 生成页：进度条可见性 */
.progress-track { background: rgba(255,255,255,.16); box-shadow: inset 0 1px 3px rgba(0,0,0,.45); }
.progress-bar { box-shadow: 0 0 14px rgba(180,133,255,.65); }
.generating-stars { position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 15% 20%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.2px 1.2px at 80% 18%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.3px 1.3px at 30% 66%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.5px 1.5px at 66% 72%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 48% 40%, rgba(255,255,255,.4), transparent);
  animation: starsTw 4.6s ease-in-out infinite; }

/* ===== PC 桌面适配（≥900px） ===== */
.side-nav { display: none; }
@media (min-width: 900px) {
  .desktop-frame { display: block; padding: 0; }
  .phone-frame { width: 100%; height: 100vh; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .phone-screen { border-radius: 0; }
  .phone-notch, .phone-home-indicator, .status-bar { display: none; }
  .tab-bar { display: none !important; }

  .side-nav { position: absolute; left: 0; top: 0; bottom: 0; z-index: 20; display: flex; flex-direction: column; gap: 4px;
    width: 248px; padding: 26px 16px; border-right: 1px solid var(--line); background: rgba(255,255,255,.03); }
  .side-logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; font-weight: 750; font-size: 16px; }
  .side-tabs { display: grid; gap: 4px; }
  .side-tab { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; color: var(--muted); cursor: pointer; text-decoration: none; }
  .side-tab:hover { background: rgba(255,255,255,.06); color: var(--text); }
  .side-tab.active { background: rgba(167,139,250,.14); color: #cdd9ff; }
  .side-tab .ic { width: 19px; height: 19px; }
  .side-record { margin: 12px 0; justify-content: center; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #5b8def, #9a6bff); box-shadow: 0 10px 26px rgba(122,109,255,.28); }
  .side-record:hover { background: linear-gradient(135deg, #6a99f2, #a777ff); color: #fff; }
  .side-foot { margin-top: auto; padding: 0 10px; color: var(--faint, #756f8c); font-size: 12px; }

  .page { left: 248px; padding: 32px max(40px, calc(50% - 540px)) 48px; }
  .page-record, .page-generating, .page-login { left: 248px; }
  .page-detail { padding: 0 0 48px; }
  .detail-image { height: 320px; margin: 24px 24px 0; border-radius: 24px; }
  .detail-back { top: 40px; left: 40px; }
  .detail-body { padding: 24px max(24px, calc(50% - 430px)); }
  .edit-textarea { min-height: 320px; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .empty-v2 { grid-column: 1 / -1; }
  .share-sheet { left: 50%; right: auto; bottom: 24px; width: min(520px, calc(100% - 48px)); transform: translateX(-50%); border-radius: 24px; }

  /* 桌面 hover */
  .action-btn:hover, .toolbar-btn:hover { background: rgba(255,255,255,.14); }
  .menu-item:hover { background: rgba(255,255,255,.1); }
  .dream-card:hover { transform: translateY(-2px); box-shadow: 0 22px 54px rgba(0,0,0,.34); }
  .icon-btn:hover { background: rgba(255,255,255,.16); }
  .side-tab:hover { cursor: pointer; }
}

/* ===== v3 付费墙 ===== */
.paywall { display: grid; gap: 14px; }
.paywall-teaser { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.paywall-locked { display: grid; justify-items: center; gap: 10px; padding: 26px 18px; border: 1px dashed rgba(242,197,114,.4); border-radius: 16px; background: rgba(242,197,114,.06); text-align: center; }
.paywall-lock-ic { width: 30px; height: 30px; stroke: var(--gold); fill: none; stroke-width: 1.8; }
.paywall-locked strong { font-size: 15px; }
.paywall-locked span { color: var(--muted); font-size: 13px; }
.paywall-cta { margin-top: 4px; padding: 12px 30px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #f2c572, #e8a94f); color: #231303; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(242,197,114,.25); }
.paywall-cta:active { transform: scale(.97); }

.page-pay { display: none; position: fixed; inset: 0; z-index: 60; }
.page-pay.active { display: block; }
.pay-overlay { position: absolute; inset: 0; background: rgba(4,7,16,.7); backdrop-filter: blur(4px); }
.pay-sheet { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(430px, 100%); padding: 12px 22px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--panel, #131829); border: 1px solid rgba(255,255,255,.08); }
.pay-sub { margin: 2px 0 16px; text-align: center; color: var(--muted); font-size: 13px; }
.pay-channel { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 18px; margin-bottom: 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: inherit; font-size: 15px; cursor: pointer; }
.pay-channel:active { transform: scale(.98); }
.pay-channel-price { color: var(--gold); font-weight: 700; font-size: 17px; }
.pay-note { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.pay-qr { display: block; width: 220px; height: 220px; margin: 10px auto; background: #fff; border-radius: 12px; padding: 8px; }
.pay-back { display: block; margin: 14px auto 4px; padding: 10px 24px; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); background: transparent; color: inherit; font-size: 13px; cursor: pointer; }
@media (min-width: 900px) { .pay-sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 24px; } }

/* 未解锁详情大图锁定浮层 */
.detail-lock { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 8px; border: 0; background: rgba(6,9,20,.55); backdrop-filter: blur(6px); color: #fff; cursor: pointer; padding: 20px; text-align: center; }
.detail-lock .ic { width: 34px; height: 34px; stroke: var(--gold); fill: none; stroke-width: 1.8; }
.detail-lock strong { font-size: 16px; }
.detail-lock span { color: var(--gold); font-size: 14px; font-weight: 600; }

/* v3 付费墙令牌修正 */
:root { --gold: #f2c572; }

/* ===== 全端去手机壳（最终版）：任何视口都不再显示仿真手机框 ===== */
.desktop-frame { display: block; padding: 0; min-height: 100dvh; }
.phone-frame { width: 100%; max-width: none; height: 100vh; height: 100dvh; min-height: 100dvh; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.phone-screen { border-radius: 0; }
.phone-notch, .phone-home-indicator, .status-bar { display: none !important; }

/* ===== v4 重构：我的页 + 详情页 + 分享面板 ===== */
/* 详情页：右上角分享图标、返回键背景保护 */
.detail-share-top { background: rgba(10, 13, 25, .45); backdrop-filter: blur(8px); border-radius: 12px; }
.detail-back { background: rgba(10, 13, 25, .45) !important; backdrop-filter: blur(8px); }
/* 审核状态降级为底部小字 */
.detail-audit-line { margin: 22px 0 8px; text-align: center; color: var(--muted); font-size: 11px; opacity: .65; }
/* 旧审核胶囊不再使用 */
.audit-status { display: none; }

/* 分享面板：真实功能 */
.share-preview { display: flex; gap: 12px; align-items: center; margin: 14px 0 16px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.04); }
.share-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #0d1020; }
.share-preview-text { display: grid; gap: 4px; min-width: 0; }
.share-preview-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-preview-text span { color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.share-actions { display: grid; gap: 10px; }
.share-real-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: inherit; font-size: 14px; cursor: pointer; }
.share-real-btn .ic { width: 18px; height: 18px; color: var(--gold); }
.share-real-btn:active { transform: scale(.98); }
.share-cancel { margin-top: 14px; }

/* 我的页：头像月亮图标 + 版本行 */
.profile-avatar { display: grid; place-items: center; }
.profile-avatar .ic { width: 30px; height: 30px; color: #241a06; }
.profile-version { margin: 26px 0 0; text-align: center; color: var(--muted); font-size: 11px; opacity: .6; }
.profile-header { justify-content: center; }

/* 付费墙摘要渐隐提示（暗示下方还有内容） */
.paywall-teaser { -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }

/* ===== v4b 详情页返回键全局可见 + PC 双栏详情 ===== */
.detail-back { z-index: 40; }
@media (min-width: 900px) {
  .page-detail.active { display: flex; gap: 36px; align-items: flex-start; padding: 36px 44px 48px; }
  .page-detail .detail-image { flex: 0 0 440px; height: min(600px, calc(100vh - 90px)); margin: 0; border-radius: 22px; position: sticky; top: 36px; }
  .page-detail .detail-back { top: 16px; left: 16px; }
  .page-detail .detail-body { flex: 1; max-width: 640px; padding: 2px 0 0; }
  .page-detail .detail-lock { display: none; } /* PC 只保留 AI 卡一处付费墙 */
  .page-detail .detail-title { font-size: 28px; }
}

/* ===== v5 神秘感动效层（拾己同款活夜空，transform/opacity only） ===== */
/* 页面背景让位给夜空层 */
.phone-screen { background: var(--bg); }
.page { background: transparent; }

.dream-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.page { z-index: 1; }
.tab-bar, .side-nav { z-index: 20; }

/* 闪烁星 */
.sky-star { position: absolute; border-radius: 50%; background: rgba(255, 244, 214, .9);
  box-shadow: 0 0 6px 1px rgba(242, 197, 114, .55);
  animation: skyTwinkle var(--d, 3s) ease-in-out var(--dl, 0s) infinite; }
@keyframes skyTwinkle { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: .95; transform: scale(1.15); } }

/* 金色浮尘（缓慢上升漂移） */
.sky-dust { position: absolute; border-radius: 50%; background: rgba(242, 197, 114, .5);
  box-shadow: 0 0 8px 2px rgba(242, 197, 114, .3);
  animation: skyDrift var(--d, 14s) linear var(--dl, 0s) infinite; }
@keyframes skyDrift { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: .7; } 88% { opacity: .5; } 100% { transform: translateY(-46px); opacity: 0; } }

/* 极光带（缓慢流动） */
.sky-aurora { position: absolute; left: -20%; right: -20%; top: 12%; height: 34%;
  background: linear-gradient(100deg, transparent 8%, rgba(242, 197, 114, .10) 32%, rgba(112, 132, 205, .08) 55%, rgba(242, 197, 114, .09) 80%, transparent 96%);
  filter: blur(28px); animation: auroraFlow 16s ease-in-out infinite alternate; }
@keyframes auroraFlow { 0% { transform: translateX(-6%) skewY(-2deg); opacity: .5; } 100% { transform: translateX(6%) skewY(2deg); opacity: 1; } }

/* 流星（PC 端偶尔划过） */
.sky-shooting { position: absolute; top: 14%; left: -10%; width: 150px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 252, 240, .9));
  animation: shootingStar 11s linear 3s infinite; opacity: 0; }
@keyframes shootingStar { 0% { transform: translate(0, 0) rotate(12deg); opacity: 0; }
  3% { opacity: 1; } 9% { transform: translate(120vw, 14vh) rotate(12deg); opacity: 0; } 100% { opacity: 0; } }

/* 月亮 logo 浮动 */
.logo-icon, .profile-avatar { animation: moonFloat 4.8s ease-in-out infinite; }
@keyframes moonFloat { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(2deg); } }

/* 梦境卡片入场（依次浮现） */
.dream-card { animation: cardIn .55s cubic-bezier(.22, .8, .32, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* 卡片封面光晕呼吸 */
.dream-image-card { position: relative; }
.dream-image-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 45% at 50% 12%, rgba(242, 197, 114, .14), transparent 70%);
  animation: coverBreath 5.4s ease-in-out infinite; }
@keyframes coverBreath { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

/* 解锁 CTA 金色呼吸 */
.paywall-cta { animation: ctaPulse 2.6s ease-in-out infinite; }
@keyframes ctaPulse { 0%, 100% { box-shadow: 0 8px 24px rgba(242, 197, 114, .22); } 50% { box-shadow: 0 8px 34px rgba(242, 197, 114, .5); } }

/* 生成页进度条流光 */
.progress-bar { position: relative; overflow: hidden; }
.progress-bar::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  animation: progressShine 1.6s linear infinite; }
@keyframes progressShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* reduced-motion 全静态（拾己规范） */
@media (prefers-reduced-motion: reduce) {
  .sky-star, .sky-dust, .sky-aurora, .sky-shooting, .logo-icon, .profile-avatar,
  .dream-card, .dream-image-card::after, .paywall-cta, .progress-bar::after { animation: none !important; }
}

/* ===== v5b Lottie 动效素材 ===== */
.greeting-moon { position: absolute; right: 20px; top: 14px; width: 64px; height: 64px; opacity: .9; pointer-events: none; }
.home-greeting { position: relative; }
.profile-avatar lottie-player { width: 40px; height: 40px; }
.gen-sparkles { width: 90px; height: 90px; margin: 0 auto 6px; display: block; }
.empty-lottie { width: 130px; height: 130px; margin-bottom: 4px; }
.profile-avatar { animation: none; } /* lottie 自带动效，不再叠加浮动 */
@media (prefers-reduced-motion: reduce) { .greeting-moon, .gen-sparkles, .empty-lottie, .profile-avatar lottie-player { display: none; } }

/* ===== v5c 全局交互动效 ===== */
/* 1) 页面跳转：更顺滑的入场（fade + 上浮 + 微缩放） */
@keyframes pageInV5 { from { opacity: 0; transform: translateY(14px) scale(.992); } to { opacity: 1; transform: none; } }
.page.active { animation: pageInV5 .34s cubic-bezier(.22, .8, .32, 1); }

/* 2) 全局按压反馈（transform only） */
.action-btn:active, .menu-item:active, .tab-item:active, .side-tab:active, .pay-channel:active,
.share-real-btn:active, .paywall-cta:active, .pay-back:active, .share-cancel:active,
.primary-btn:active, .record-text-btn:active, .text-btn:active, .icon-btn:active, .dream-card:active {
  transform: scale(.955); transition: transform .12s ease; }
.dream-card { transition: transform .18s ease, box-shadow .25s ease; }

/* 3) Tab 选中弹跳 + 标签淡入 */
.tab-item.active .tab-icon { animation: tabPop .32s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes tabPop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.tab-item { transition: background .25s ease, color .25s ease; }
.tab-item .tab-label { transition: opacity .25s ease; }

/* 4) 详情页入场：大图缩放浮现 + 内容依次上浮 */
.page-detail.active .detail-image { animation: imgReveal .55s cubic-bezier(.22, .8, .32, 1) both; }
@keyframes imgReveal { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: scale(1); } }
.page-detail.active .detail-body > * { animation: riseIn .45s cubic-bezier(.22, .8, .32, 1) both; }
.page-detail.active .detail-body > *:nth-child(1) { animation-delay: .06s; }
.page-detail.active .detail-body > *:nth-child(2) { animation-delay: .12s; }
.page-detail.active .detail-body > *:nth-child(3) { animation-delay: .18s; }
.page-detail.active .detail-body > *:nth-child(4) { animation-delay: .24s; }
.page-detail.active .detail-body > *:nth-child(5) { animation-delay: .30s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 5) 底部弹窗：弹簧感滑入 + 遮罩淡入 */
.page-pay.active .pay-sheet, .page-share.active .share-sheet { animation: sheetUp .38s cubic-bezier(.2, .9, .25, 1.12) both; }
@keyframes sheetUp { from { transform: translate(-50%, 60%); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.page-share.active .share-sheet { animation-name: sheetUpMobile; }
@keyframes sheetUpMobile { from { transform: translateY(60%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 900px) {
  .page-share.active .share-sheet { animation-name: sheetUp; }
}
.page-pay.active .pay-overlay, .page-share.active .share-overlay { animation: fadeIn .3s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 6) 支付渠道/菜单 选中态微光 */
.pay-channel:hover, .share-real-btn:hover, .menu-item:hover { border-color: rgba(242, 197, 114, .35); }

/* 7) Toast 已有 slide；加强弹簧感 */
.toast { transition: opacity .28s ease, transform .34s cubic-bezier(.2, .9, .3, 1.15); }

/* 8) 标签/标签页选择反馈 */
.d-tag { transition: transform .15s ease, background .2s ease; }
.d-tag:active { transform: scale(.93); }

/* 9) 首页问候区淡入 */
.page-home.active .home-greeting { animation: riseIn .5s cubic-bezier(.22, .8, .32, 1) both; }

/* reduced-motion：全静态 */
@media (prefers-reduced-motion: reduce) {
  .page.active, .page-detail.active .detail-image, .page-detail.active .detail-body > *,
  .page-pay.active .pay-sheet, .page-share.active .share-sheet,
  .page-pay.active .pay-overlay, .page-share.active .share-overlay,
  .tab-item.active .tab-icon, .page-home.active .home-greeting { animation: none !important; }
}
