/* ============================================
   梦境记录仪 - H5 Demo
   主色: #6B5BFF 梦幻紫
   点缀: #FF6B9D 梦境粉
   背景: #1A1A2E 深空
============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #6B5BFF;
  --primary-light: #8B7DFF;
  --primary-dark: #4A3FCC;
  --accent: #FF6B9D;
  --accent-light: #FF8FB3;
  --bg: #1A1A2E;
  --bg-2: #16162A;
  --bg-3: #232342;
  --text: #FFFFFF;
  --text-2: #B8B8D4;
  --text-3: #6B6B8C;
  --tag-blue: #4FC3F7;
  --tag-orange: #FFB74D;
  --tag-green: #81C784;
  --tag-purple: #BA68C8;
  --tag-pink: #F06292;
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-tag: 8px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #0A0A1E;
  color: var(--text);
  overflow: hidden;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  outline: none;
}

textarea {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
  resize: none;
}

/* ============================================
   桌面端：手机外壳预览
============================================ */
.desktop-frame {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1F1F3D 0%, #0A0A1E 100%);
  padding: 20px;
}

.phone-frame {
  position: relative;
  width: 393px;
  height: 852px;
  background: #000;
  border-radius: 50px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #2A2A40,
    0 0 0 8px #1A1A2E,
    0 30px 80px rgba(107, 91, 255, 0.3),
    0 0 120px rgba(255, 107, 157, 0.1);
}

.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #000;
  border-radius: 0 0 18px 18px;
  z-index: 100;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 38px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-home-indicator {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  z-index: 100;
}

/* 当屏幕宽度小于 433px 时，去掉手机外壳，全屏展示 */
@media (max-width: 433px) {
  .desktop-frame {
    padding: 0;
    background: var(--bg);
  }
  .phone-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .phone-notch {
    display: none;
  }
  .phone-screen {
    border-radius: 0;
  }
  .phone-home-indicator {
    display: none;
  }
}

/* ============================================
   状态栏
============================================ */
.status-bar {
  height: 44px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.status-icons {
  display: flex;
  gap: 4px;
  font-size: 12px;
}

.status-icons .battery {
  color: var(--text);
}

/* ============================================
   页面通用
============================================ */
.page {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  overflow: hidden;
}

.page.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text);
  border-radius: 50%;
  transition: background 0.2s;
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

.text-btn {
  font-size: 15px;
  color: var(--primary-light);
  font-weight: 500;
  padding: 6px 12px;
}

/* ============================================
   页面 1: 首页
============================================ */
.page-home {
  padding-bottom: 80px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
}

.logo-icon {
  font-size: 22px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 2px;
  cursor: pointer;
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.home-greeting {
  padding: 0 20px 16px;
}

.greeting-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}

.greeting-sub {
  font-size: 14px;
  color: var(--text-2);
}

.greeting-sub strong {
  color: var(--primary-light);
  font-weight: 600;
}

.timeline {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
  scrollbar-width: none;
}

.timeline::-webkit-scrollbar {
  display: none;
}

.dream-card {
  background: var(--bg-2);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid rgba(107, 91, 255, 0.1);
}

.dream-card:active {
  transform: scale(0.98);
}

.dream-thumb {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.dream-thumb-bg {
  position: absolute;
  inset: 0;
}

.dream-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
}

.dream-thumb-date {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.dream-thumb-mood {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 18px;
}

.dream-thumb-title {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.dream-card-body {
  padding: 12px 14px 14px;
}

.dream-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.dream-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-tag);
  background: rgba(107, 91, 255, 0.15);
  color: var(--primary-light);
}

.dream-tag.t-pink { background: rgba(255, 107, 157, 0.15); color: var(--accent-light); }
.dream-tag.t-blue { background: rgba(79, 195, 247, 0.15); color: var(--tag-blue); }
.dream-tag.t-orange { background: rgba(255, 183, 77, 0.15); color: var(--tag-orange); }
.dream-tag.t-green { background: rgba(129, 199, 132, 0.15); color: var(--tag-green); }

.dream-preview {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   底部 Tab
============================================ */
.tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(107, 91, 255, 0.15);
  display: flex;
  padding-bottom: 16px;
  z-index: 10;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  transition: color 0.2s;
  cursor: pointer;
}

.tab-item.active {
  color: var(--primary-light);
}

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

.tab-icon-record {
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  box-shadow: 0 4px 16px rgba(107, 91, 255, 0.4);
}

.tab-label {
  font-size: 10px;
  margin-top: 2px;
}

/* ============================================
   页面 2: 录音页
============================================ */
.page-record {
  background: #0F0A2E;
}

.record-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(107, 91, 255, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(255, 107, 157, 0.3) 0%, transparent 50%),
    linear-gradient(180deg, #1A0F3E 0%, #0F0A2E 100%);
}

.record-header {
  position: relative;
  padding: 8px 16px;
  display: flex;
  justify-content: flex-start;
  z-index: 5;
}

.record-close {
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
}

.record-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
  z-index: 5;
}

.record-title {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-top: 24px;
  margin-bottom: 8px;
}

.record-subtitle {
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 32px;
}

.keyword-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 48px;
}

.keyword-chip {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(107, 91, 255, 0.3);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.2s;
}

.keyword-chip:active {
  background: rgba(107, 91, 255, 0.2);
  border-color: var(--primary);
  color: var(--text);
}

.record-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.wave-rings {
  position: absolute;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.wave-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(107, 91, 255, 0.5);
  opacity: 0;
  transition: opacity 0.3s;
}

.wave-ring-1 { animation: wave-pulse 2s infinite; }
.wave-ring-2 { animation: wave-pulse 2s infinite 0.4s; }
.wave-ring-3 { animation: wave-pulse 2s infinite 0.8s; }

@keyframes wave-pulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.wave-rings.active .wave-ring {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent);
}

.record-btn {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow:
    0 0 40px rgba(107, 91, 255, 0.6),
    0 0 80px rgba(255, 107, 157, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.2s;
}

.record-btn:active {
  transform: scale(0.95);
}

.record-btn-inner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
}

.record-btn.recording {
  animation: record-pulse 1.5s infinite;
}

.record-btn.recording .record-btn-inner {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

@keyframes record-pulse {
  0%, 100% { box-shadow: 0 0 40px rgba(255, 107, 157, 0.6), 0 0 80px rgba(255, 107, 157, 0.3); }
  50% { box-shadow: 0 0 60px rgba(255, 107, 157, 0.9), 0 0 120px rgba(255, 107, 157, 0.5); }
}

.record-hint {
  margin-top: 32px;
  font-size: 14px;
  color: var(--text-2);
  z-index: 5;
}

.record-timer {
  margin-top: 8px;
  font-size: 32px;
  font-weight: 200;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  z-index: 5;
  display: none;
}

.record-timer.show {
  display: block;
}

.record-footer {
  position: relative;
  padding: 24px 24px 32px;
  display: flex;
  justify-content: center;
  z-index: 5;
}

.cancel-btn {
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  font-size: 15px;
  color: var(--text-2);
  transition: all 0.2s;
}

.cancel-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   页面 3: 文字编辑页
============================================ */
.page-edit {
  background: var(--bg);
}

.edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.edit-title {
  font-size: 17px;
  font-weight: 600;
}

.edit-meta {
  display: flex;
  gap: 12px;
  padding: 16px 20px 8px;
}

.edit-meta-item {
  font-size: 12px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 6px;
}

.edit-editor {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.edit-textarea {
  flex: 1;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: transparent;
  width: 100%;
  min-height: 200px;
}

.edit-helper {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-3);
}

.edit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 16px;
}

.edit-tag {
  padding: 4px 10px;
  background: rgba(107, 91, 255, 0.15);
  color: var(--primary-light);
  border-radius: var(--radius-tag);
  font-size: 13px;
}

.edit-toolbar {
  display: flex;
  justify-content: space-around;
  padding: 16px 20px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--bg-2);
}

.toolbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  transition: color 0.2s;
}

.toolbar-btn:active {
  color: var(--primary-light);
}

.toolbar-icon {
  font-size: 22px;
}

.toolbar-label {
  font-size: 11px;
}

/* ============================================
   页面 4: 视频生成等待页
============================================ */
.page-generating {
  background: #0A0A1E;
}

.generating-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(107, 91, 255, 0.3) 0%, transparent 60%),
    radial-gradient(circle at 30% 70%, rgba(255, 107, 157, 0.2) 0%, transparent 50%),
    linear-gradient(180deg, #0F0A2E 0%, #1A0F3E 100%);
}

.generating-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, white, transparent),
    radial-gradient(1px 1px at 40% 70%, white, transparent),
    radial-gradient(1px 1px at 60% 20%, white, transparent),
    radial-gradient(1px 1px at 80% 60%, white, transparent),
    radial-gradient(1px 1px at 30% 80%, white, transparent),
    radial-gradient(1px 1px at 70% 40%, white, transparent),
    radial-gradient(2px 2px at 15% 50%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 85% 30%, rgba(255, 255, 255, 0.8), transparent);
  background-size: 200% 200%;
  animation: stars-drift 20s linear infinite;
  opacity: 0.6;
}

@keyframes stars-drift {
  0% { background-position: 0 0; }
  100% { background-position: 200% 200%; }
}

.generating-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  z-index: 5;
  text-align: center;
}

.nebula {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 40px;
}

.nebula-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107, 91, 255, 0.8) 0%, transparent 70%);
  filter: blur(20px);
  animation: nebula-pulse 3s ease-in-out infinite;
}

.nebula-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid;
  opacity: 0.4;
}

.nebula-ring-1 {
  width: 140px;
  height: 140px;
  border-color: var(--primary);
  animation: ring-rotate 8s linear infinite;
}

.nebula-ring-2 {
  width: 180px;
  height: 180px;
  border-color: var(--accent);
  animation: ring-rotate 12s linear infinite reverse;
  border-style: dashed;
}

.nebula-ring-3 {
  width: 220px;
  height: 220px;
  border-color: rgba(107, 91, 255, 0.5);
  animation: ring-rotate 16s linear infinite;
}

@keyframes nebula-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

@keyframes ring-rotate {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.generating-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.generating-stage {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 32px;
}

.progress-track {
  width: 240px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 12px var(--primary);
}

.progress-percent {
  font-size: 24px;
  font-weight: 300;
  color: var(--primary-light);
  margin-bottom: 32px;
  font-variant-numeric: tabular-nums;
}

.generating-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  max-width: 280px;
}

.gen-tag {
  padding: 4px 12px;
  background: rgba(107, 91, 255, 0.15);
  border: 1px solid rgba(107, 91, 255, 0.3);
  color: var(--primary-light);
  border-radius: 20px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(10px);
  animation: tag-pop 0.4s forwards;
}

.gen-tag:nth-child(1) { animation-delay: 0.5s; }
.gen-tag:nth-child(2) { animation-delay: 0.8s; }
.gen-tag:nth-child(3) { animation-delay: 1.1s; }
.gen-tag:nth-child(4) { animation-delay: 1.4s; }
.gen-tag:nth-child(5) { animation-delay: 1.7s; }

@keyframes tag-pop {
  to { opacity: 1; transform: translateY(0); }
}

.generating-tip {
  font-size: 13px;
  color: var(--text-3);
}

/* ============================================
   页面 5: 详情页
============================================ */
.page-detail {
  background: var(--bg);
}

.detail-video {
  position: relative;
  height: 280px;
  background: #000;
  overflow: hidden;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(107, 91, 255, 0.6) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(255, 107, 157, 0.5) 0%, transparent 50%),
    linear-gradient(135deg, #2A1B5C 0%, #1A0F3E 50%, #2D0E2A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, white, transparent),
    radial-gradient(1px 1px at 30% 60%, white, transparent),
    radial-gradient(1px 1px at 50% 30%, white, transparent),
    radial-gradient(1px 1px at 70% 80%, white, transparent),
    radial-gradient(1px 1px at 90% 40%, white, transparent),
    radial-gradient(2px 2px at 25% 75%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(2px 2px at 75% 15%, rgba(255, 255, 255, 0.9), transparent);
  background-size: 200% 200%;
  animation: stars-drift 30s linear infinite;
  opacity: 0.7;
}

.video-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  filter: blur(30px);
  animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
}

.video-play {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 24px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  z-index: 5;
  transition: transform 0.2s;
}

.video-play:active {
  transform: scale(0.95);
}

.detail-back {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 32px;
  scrollbar-width: none;
}

.detail-body::-webkit-scrollbar {
  display: none;
}

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

.detail-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}

.detail-date {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 16px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.d-tag {
  padding: 5px 12px;
  border-radius: var(--radius-tag);
  font-size: 12px;
  font-weight: 500;
}

.d-tag-purple { background: rgba(186, 104, 200, 0.2); color: var(--tag-purple); }
.d-tag-pink   { background: rgba(240, 98, 146, 0.2); color: var(--tag-pink); }
.d-tag-blue   { background: rgba(79, 195, 247, 0.2); color: var(--tag-blue); }
.d-tag-orange { background: rgba(255, 183, 77, 0.2); color: var(--tag-orange); }
.d-tag-green  { background: rgba(129, 199, 132, 0.2); color: var(--tag-green); }

.detail-actions {
  display: flex;
  justify-content: space-around;
  background: var(--bg-2);
  border-radius: var(--radius-card);
  padding: 14px 8px;
  margin-bottom: 24px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  flex: 1;
  transition: color 0.2s;
}

.action-btn:active {
  color: var(--primary-light);
}

.action-icon {
  font-size: 20px;
}

.action-label {
  font-size: 11px;
}

.detail-content, .detail-ai {
  margin-bottom: 20px;
}

.content-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.content-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.ai-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(107, 91, 255, 0.1) 0%, rgba(255, 107, 157, 0.08) 100%);
  border: 1px solid rgba(107, 91, 255, 0.2);
  border-radius: var(--radius-card);
}

.ai-icon {
  font-size: 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

.ai-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.ai-card strong {
  color: var(--text);
  font-weight: 600;
}

/* ============================================
   页面 6: 分享弹窗
============================================ */
.page-share {
  background: transparent;
  pointer-events: none;
}

.page-share.active {
  pointer-events: auto;
}

.share-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}

.page-share.active .share-overlay {
  opacity: 1;
}

.share-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-2);
  border-radius: 20px 20px 0 0;
  padding: 12px 24px 32px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.page-share.active .share-sheet {
  transform: translateY(0);
}

.share-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.share-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 20px;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 8px;
  margin-bottom: 20px;
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-radius: 12px;
  transition: transform 0.2s;
}

.share-item:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.05);
}

.share-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-name {
  font-size: 12px;
  color: var(--text-2);
}

.share-cancel {
  width: 100%;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.2s;
}

.share-cancel:active {
  background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   页面 7: 个人主页
============================================ */
.page-profile {
  background: var(--bg);
  padding-bottom: 80px;
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 8px;
}

.profile-title {
  font-size: 17px;
  font-weight: 600;
}

.profile-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px 24px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(107, 91, 255, 0.4);
}

.profile-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-bio {
  font-size: 13px;
  color: var(--text-2);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 20px 24px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid rgba(107, 91, 255, 0.1);
  border-radius: var(--radius-card);
  padding: 16px 8px;
  text-align: center;
  transition: transform 0.2s;
}

.stat-card:active {
  transform: scale(0.97);
}

.stat-num {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-3);
}

.profile-menu {
  margin: 0 20px;
  background: var(--bg-2);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid rgba(107, 91, 255, 0.1);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition: background 0.2s;
  cursor: pointer;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:active {
  background: rgba(107, 91, 255, 0.1);
}

.menu-icon {
  font-size: 18px;
  width: 32px;
  color: var(--primary-light);
}

.menu-label {
  flex: 1;
  font-size: 15px;
}

.menu-arrow {
  font-size: 20px;
  color: var(--text-3);
}

/* ============================================
   全局 Toast
============================================ */
.toast {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  border: 1px solid rgba(107, 91, 255, 0.3);
}

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


/* ===== 登录页 ===== */
.page-login {
  z-index: 99; background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  display: flex !important; align-items: center; justify-content: center;
}
.page-login:not(.active) { display: none !important; }
.login-wrap { text-align: center; padding: 40px 32px; width: 100%; }
.login-logo { font-size: 64px; margin-bottom: 12px; }
.login-brand { font-size: 28px; font-weight: 700; color: #fff; margin: 0 0 6px; }
.login-sub { font-size: 13px; color: rgba(255,255,255,0.4); margin-bottom: 40px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-input {
  width: 100%; padding: 14px 16px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  color: #fff; font-size: 15px; outline: none; box-sizing: border-box;
  transition: border-color 0.2s;
}
.login-input:focus { border-color: rgba(180,160,255,0.5); }
.login-code-row { display: flex; gap: 8px; }
.login-code-row .login-input { flex: 1; }
.login-code-btn {
  white-space: nowrap; padding: 0 16px; background: rgba(180,160,255,0.2);
  border: 1px solid rgba(180,160,255,0.3); border-radius: 12px;
  color: #fff; font-size: 13px; cursor: pointer;
}
.login-code-btn:disabled { opacity: 0.4; }
.login-submit {
  width: 100%; padding: 16px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #b4a0ff 0%, #8b7ad8 100%);
  color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
  margin-top: 4px;
}
.login-submit:active { transform: scale(0.98); }
.login-hint { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 16px; }


/* ===== 视频降级封面(failed/pending/processing) ===== */
.video-fallback {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  border-radius: 0;
}
.video-fallback-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #6B5BFF 100%);
  background-size: 200% 200%;
  animation: fallbackShift 8s ease-in-out infinite;
}
@keyframes fallbackShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.video-fallback-content {
  position: relative; z-index: 1; text-align: center;
  padding: 32px 24px; color: #fff;
}
.video-fallback-mood {
  font-size: 56px; margin-bottom: 16px; filter: drop-shadow(0 0 16px rgba(255,255,255,0.4));
}
.video-fallback-quote {
  font-size: 14px; line-height: 1.6; opacity: 0.92;
  font-style: italic; margin-bottom: 20px;
  padding: 0 12px; max-width: 280px; margin-left: auto; margin-right: auto;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-fallback-status {
  font-size: 13px; padding: 6px 14px;
  background: rgba(0,0,0,0.35); border-radius: 16px;
  display: inline-block; backdrop-filter: blur(8px);
  margin-bottom: 12px;
}
.video-fallback-hint {
  font-size: 11px; opacity: 0.5; margin-top: 4px;
}
