@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Noto+Sans+SC:wght@300;400;700&family=Noto+Serif+SC:wght@300;400;700&family=Dela+Gothic+One&family=DotGothic16&family=LXGW+WenKai&family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&family=Liu+Jian+Mao+Cao&family=Long+Cang&family=Zhi+Mang+Xing&family=VT323&family=Silkscreen:wght@400;700&family=Press+Start+2P&family=Share+Tech+Mono&family=IBM+Plex+Mono:wght@300;400&display=swap');

/*
  字体列表：

  【中文】
  Noto Sans SC      — 思源黑体，干净
  Noto Serif SC     — 思源宋体，优雅
  Dela Gothic One   — 粗厚哥特黑体
  DotGothic16       — 日式像素点阵体（支持中文！）
  LXGW WenKai       — 霞鹜文楷，手写楷体
  Ma Shan Zheng     — 楷书端正
  ZCOOL XiaoWei     — 站酷小薇，清秀文艺
  Liu Jian Mao Cao  — 毛笔草书
  Long Cang         — 龙藏体，自然手写
  Zhi Mang Xing     — 行书豪放

  【像素/终端】
  VT323             — 经典终端像素体（英文）
  Silkscreen        — 丝网像素体（英文）
  Press Start 2P    — 游戏机像素体（英文）
  Share Tech Mono   — 科技等宽终端体（英文）
  IBM Plex Mono     — IBM终端等宽体（英文）
*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== 白色清新主题（默认） ===== */
:root, [data-theme="light"] {
  --bg-deep: #e8ecf1;
  --aurora-1: rgba(180, 210, 240, 0.5);
  --aurora-2: rgba(200, 190, 230, 0.4);
  --aurora-3: rgba(220, 230, 240, 0.5);
  --accent: rgba(140, 160, 200, 1);
  --accent-dim: rgba(140, 160, 200, 0.35);
  --text-primary: rgba(60, 70, 90, 0.9);
  --text-secondary: rgba(80, 90, 110, 0.55);
  --text-ghost: rgba(100, 110, 130, 0.3);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-blur: 24px;
  --bubble-color: rgba(60, 75, 110, 0.6);
  --bubble-xl: rgba(50, 60, 90, 0.75);
  --bubble-lg: rgba(60, 70, 100, 0.6);
  --bubble-md: rgba(70, 85, 120, 0.5);
  --bubble-sm: rgba(90, 100, 140, 0.35);
  --bubble-hover: rgba(100, 130, 190, 1);
  --bubble-glow: rgba(140, 160, 200, 0.4);
  --tag-bg: rgba(255, 255, 255, 0.5);
  --tag-border: rgba(140, 160, 200, 0.25);
  --particle-color: rgba(140, 170, 220, 0.7);
}

/* ===== 暗色深夜主题（星雾静蓝） ===== */
/* #050606 深渊黑  #04345a 天渊蓝  #06588c 天际蓝  #626979 钢雾灰  #c8c6c6 雾银 */
[data-theme="dark"] {
  --bg-deep: #050606;
  --aurora-1: rgba(4, 52, 90, 0.4);        /* 天渊蓝 #04345a */
  --aurora-2: rgba(6, 88, 140, 0.2);       /* 天际蓝 #06588c */
  --aurora-3: rgba(4, 52, 90, 0.3);        /* 天渊蓝淡 */
  --accent: rgba(200, 198, 198, 1);         /* 雾银 #c8c6c6 */
  --accent-dim: rgba(200, 198, 198, 0.25);
  --text-primary: rgba(200, 198, 198, 0.9); /* 雾银 */
  --text-secondary: rgba(98, 105, 121, 0.7); /* 钢雾灰 #626979 */
  --text-ghost: rgba(98, 105, 121, 0.35);
  --glass-bg: rgba(4, 52, 90, 0.2);
  --glass-border: rgba(200, 198, 198, 0.06);
  --glass-blur: 20px;
  --bubble-color: rgba(200, 198, 198, 0.45);
  --bubble-xl: rgba(200, 198, 198, 0.8);
  --bubble-lg: rgba(6, 88, 140, 0.7);      /* 天际蓝 */
  --bubble-md: rgba(98, 105, 121, 0.55);   /* 钢雾灰 */
  --bubble-sm: rgba(98, 105, 121, 0.28);
  --bubble-hover: rgba(200, 198, 198, 1);
  --bubble-glow: rgba(6, 88, 140, 0.4);
  --tag-bg: rgba(4, 52, 90, 0.3);
  --tag-border: rgba(200, 198, 198, 0.1);
  --particle-color: rgba(200, 198, 198, 0.5);
}

body {
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Noto Serif SC', serif;
  overflow: hidden;
  position: relative;
}

/* ===== 极光背景 ===== */
.aurora {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  filter: blur(80px) saturate(1.4);
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.6;
}

.aurora-blob:nth-child(1) {
  width: 50vmax;
  height: 50vmax;
  background: var(--aurora-1);
  animation: auroraMove1 20s ease-in-out infinite, auroraHue 15s linear infinite;
}

.aurora-blob:nth-child(2) {
  width: 45vmax;
  height: 45vmax;
  background: var(--aurora-2);
  animation: auroraMove2 25s ease-in-out infinite, auroraHue 20s linear infinite;
}

.aurora-blob:nth-child(3) {
  width: 40vmax;
  height: 40vmax;
  background: var(--aurora-3);
  animation: auroraMove3 18s ease-in-out infinite, auroraHue 12s linear infinite;
}

/* 暗色主题关掉色相旋转 保持纯蓝 */
[data-theme="dark"] .aurora-blob:nth-child(1) {
  animation: auroraMove1 20s ease-in-out infinite;
}
[data-theme="dark"] .aurora-blob:nth-child(2) {
  animation: auroraMove2 25s ease-in-out infinite;
}
[data-theme="dark"] .aurora-blob:nth-child(3) {
  animation: auroraMove3 18s ease-in-out infinite;
}

@keyframes auroraMove1 {
  0%   { top: -20%; left: 30%; }
  25%  { top: 10%; left: -10%; }
  50%  { top: 60%; left: 20%; }
  75%  { top: 30%; left: 70%; }
  100% { top: -20%; left: 30%; }
}

@keyframes auroraMove2 {
  0%   { top: 50%; left: 60%; }
  25%  { top: -10%; left: 80%; }
  50%  { top: 20%; left: -5%; }
  75%  { top: 70%; left: 40%; }
  100% { top: 50%; left: 60%; }
}

@keyframes auroraMove3 {
  0%   { top: 80%; left: 10%; }
  25%  { top: 40%; left: 60%; }
  50%  { top: -10%; left: 40%; }
  75%  { top: 60%; left: -10%; }
  100% { top: 80%; left: 10%; }
}

@keyframes auroraHue {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* 微粒噪点层 */
/* 星光 canvas */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

[data-theme="dark"] #starfield {
  opacity: 1;
}

.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== 屏幕容器 ===== */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===== 欢迎屏 ===== */
.welcome-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: var(--text-primary);
  text-shadow: 0 0 60px var(--accent-dim), 0 0 120px rgba(120, 60, 190, 0.2);
  margin-bottom: 0.5rem;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-subtitle {
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 3rem;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
  letter-spacing: 0.3em;
}

/* 主题选择器 */
.theme-picker {
  display: flex;
  gap: 12px;
  margin-top: 2.5rem;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.9s both;
}

.contact-toggle {
  margin-top: 2rem;
  font-size: 0.7rem;
  color: var(--text-ghost);
  cursor: pointer;
  letter-spacing: 0.15em;
  transition: color 0.3s;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) 1.1s both;
}
.contact-toggle:hover {
  color: var(--text-secondary);
}
.contact-popup {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 0.8rem;
  padding: 12px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(var(--glass-blur));
  animation: fadeInUp 0.3s ease both;
}
.contact-popup.show {
  display: flex;
}
.contact-item {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.contact-item:hover {
  color: var(--text-primary);
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 18px;
  height: 18px;
  background: none;
  border: 1.5px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-btn:hover {
  transform: scale(1.15);
  border-color: var(--accent-dim);
}

.theme-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-dim);
}

.theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.theme-dot-light {
  background: linear-gradient(135deg, #d4dce8, #e0d8ec);
}

.theme-dot-dark {
  background: linear-gradient(135deg, #1a0a3a, #0a1a2e);
}

.btn-glow {
  padding: 14px 48px;
  background: linear-gradient(135deg, var(--glass-bg), rgba(255,255,255,0.08));
  border: 1px solid var(--accent-dim);
  color: var(--text-primary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  border-radius: 30px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-glow:hover {
  background: linear-gradient(135deg, var(--accent-dim), rgba(255,255,255,0.06));
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-dim), inset 0 1px 0 rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.btn-glow:active {
  transform: scale(0.97) translateY(0);
  box-shadow: 0 1px 8px var(--accent-dim);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ===== 气泡屏 ===== */
#screen-bubbles {
  padding: 20px;
}

.bubble-header {
  position: absolute;
  top: 30px;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 10;
}

#round-indicator {
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
}

.bubble-hint {
  font-size: 0.8rem;
  color: var(--text-ghost);
  margin-top: 6px;
}

#bubble-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 词云文字 */
.bubble {
  position: absolute;
  padding: 4px 8px;
  background: none;
  border: none;
  font-family: 'Noto Serif SC', serif;
  color: var(--bubble-color);
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  filter: blur(4px);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.3s ease,
              text-shadow 0.3s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.bubble.float-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.bubble:hover {
  color: var(--bubble-hover);
  text-shadow: 0 0 20px var(--bubble-glow), 0 0 40px rgba(140, 160, 200, 0.15);
  transform: translateY(-2px) scale(1.06);
}

.bubble.popping {
  animation: wordPop 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.bubble.fade-out {
  opacity: 0;
  transform: translateY(-8px) scale(0.8);
  filter: blur(4px);
}

/* 词云大小等级 */
.bubble.size-xl {
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  font-weight: 700;
  color: var(--bubble-xl);
}
.bubble.size-lg {
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  font-weight: 700;
  color: var(--bubble-lg);
}
.bubble.size-md {
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  font-weight: 400;
  color: var(--bubble-md);
}
.bubble.size-sm {
  font-size: clamp(0.8rem, 2.5vw, 1.1rem);
  font-weight: 300;
  color: var(--bubble-sm);
}

@keyframes wordPop {
  0% { transform: scale(1); opacity: 1; filter: blur(0); }
  25% { transform: scale(1.5); color: var(--accent); text-shadow: 0 0 40px var(--accent-dim), 0 0 80px rgba(233, 69, 96, 0.3); filter: blur(0); }
  100% { transform: scale(2.2); opacity: 0; filter: blur(12px); text-shadow: 0 0 80px transparent; }
}

/* 粒子 */
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--particle-color);
  border-radius: 50%;
  pointer-events: none;
  animation: scatter 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  box-shadow: 0 0 6px var(--accent-dim);
}

@keyframes scatter {
  0% { transform: translate(0, 0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

/* 已选词条 */
.selected-area {
  position: absolute;
  bottom: 100px;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 10;
}

#selected-words {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 20px;
}

.selected-tag {
  padding: 6px 16px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  cursor: pointer;
  border-radius: 20px;
  font-size: 0.85rem;
  color: rgba(60, 75, 110, 0.8);
  opacity: 0;
  transform: scale(0.8) translateY(8px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.selected-tag:hover {
  border-color: var(--accent-dim);
  transform: scale(1) translateY(-1px);
}

.selected-tag.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.selected-tag.removing {
  opacity: 0;
  transform: scale(0.6) translateY(-10px);
}

/* 返回首页按钮 */
.btn-back {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.05));
  border: 1px solid transparent;
  color: var(--text-ghost);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Noto Serif SC', serif;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-back:hover {
  color: var(--text-secondary);
  border-color: var(--glass-border);
  background: var(--glass-bg);
}

/* 底部按钮 */
.bubble-actions {
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}

.btn-ghost {
  padding: 10px 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.06));
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), inset 0 1px 0 rgba(255,255,255,0.06);
}

.btn-ghost:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.1));
  box-shadow: 0 2px 12px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.btn-ghost:active {
  transform: scale(0.97);
}

/* ===== 倾诉屏 ===== */
#screen-message {
  padding: 30px;
}

.message-box {
  width: 100%;
  max-width: 500px;
  text-align: center;
}

.message-title {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-hint {
  font-size: 0.85rem;
  color: var(--text-ghost);
  margin-bottom: 24px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

#words-preview {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.word-chip {
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(140, 160, 200, 0.2);
  border-radius: 16px;
  font-size: 0.8rem;
  color: rgba(60, 75, 110, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#user-message {
  width: 100%;
  min-height: 120px;
  padding: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  color: var(--text-primary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.95rem;
  line-height: 1.8;
  resize: none;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

#user-message::placeholder {
  color: var(--text-ghost);
}

#user-message:focus {
  border-color: rgba(233, 69, 96, 0.25);
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.05);
}

.message-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* ===== 加载屏 ===== */
.loading-content {
  text-align: center;
}

.envelope {
  width: 80px;
  height: 60px;
  margin: 0 auto 30px;
  position: relative;
  animation: envelopeFloat 3s ease-in-out infinite;
}

.envelope-body {
  width: 100%;
  height: 100%;
  background: rgba(140, 160, 200, 0.12);
  border: 1.5px solid rgba(140, 160, 200, 0.3);
  border-radius: 6px;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: rgba(140, 160, 200, 0.15);
  border: 1.5px solid rgba(140, 160, 200, 0.25);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  animation: flapOpen 3s ease infinite;
}

@keyframes envelopeFloat {
  0%, 100% { transform: translateY(-6px); }
  50% { transform: translateY(6px); }
}

@keyframes flapOpen {
  0%, 40% { transform: rotateX(0); }
  60%, 100% { transform: rotateX(180deg); }
}

.loading-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.3em;
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ===== 信件屏 ===== */
#screen-letter {
  padding: 20px;
  overflow-y: auto;
  padding-bottom: 120px;
}

/* 毛玻璃信纸 */
.letter-paper {
  width: 100%;
  max-width: 560px;
  min-height: 400px;
  padding: 50px 44px;
  border-radius: 16px;
  position: relative;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(30px) saturate(1.3);
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
  font-family: 'DotGothic16', 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: 1.1rem;
  line-height: 2.2;
  animation: letterReveal 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 信纸内发光边缘 */
.letter-paper::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 17px;
  background: linear-gradient(135deg,
    rgba(180, 210, 240, 0.15) 0%,
    transparent 40%,
    transparent 60%,
    rgba(200, 190, 230, 0.12) 100%);
  z-index: -1;
  pointer-events: none;
}

@keyframes letterReveal {
  from {
    opacity: 0;
    transform: translateY(40px) scaleY(0.8);
    filter: blur(8px);
  }
  60% {
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    filter: blur(0);
  }
}

/* ===== 信纸风格 ===== */

/* 暗夜毛玻璃 — 深色半透明 */
.template-dark-glass {
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif !important;
  font-size: 1.05rem !important;
  line-height: 2.2 !important;
  background: rgba(10, 20, 30, 0.55) !important;
  color: rgba(200, 198, 198, 0.88) !important;
  border: 1px solid rgba(200, 198, 198, 0.06) !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(30px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.2) !important;
}

/* 手写文艺风 — LXGW WenKai / Long Cang */
.template-handwrite {
  font-family: 'LXGW WenKai', 'Long Cang', cursive !important;
  font-size: 1.1rem !important;
  line-height: 2.4 !important;
  background: rgba(255, 252, 248, 0.65) !important;
  color: rgba(70, 60, 50, 0.85) !important;
  border: 1px solid rgba(200, 185, 160, 0.4) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05) !important;
}

.template-handwrite::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 38px,
    rgba(160, 140, 120, 0.08) 38px,
    rgba(160, 140, 120, 0.08) 39px
  );
  pointer-events: none;
  border-radius: 16px;
}

/* 宋体古典风 — Noto Serif SC */
.template-serif {
  font-family: 'Noto Serif SC', serif !important;
  font-size: 1rem !important;
  line-height: 2.2 !important;
  background: rgba(255, 255, 255, 0.55) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-left: 3px solid rgba(140, 160, 200, 0.2) !important;
}

/* 暗夜宋体 — 深色底配思源宋体 */
.template-dark-serif {
  font-family: 'Noto Serif SC', serif !important;
  font-size: 1rem !important;
  font-weight: 300 !important;
  line-height: 2.3 !important;
  background: rgba(8, 15, 22, 0.6) !important;
  color: rgba(200, 198, 198, 0.85) !important;
  border: 1px solid rgba(200, 198, 198, 0.05) !important;
  border-left: 2px solid rgba(6, 88, 140, 0.2) !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25) !important;
  backdrop-filter: blur(25px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(25px) saturate(1.15) !important;
}

/* 毛玻璃默认 — 保底 */
.template-glass {
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif !important;
  background: rgba(255, 255, 255, 0.55) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

/* 旧模板兼容 */
.template-parchment { composes: template-handwrite; }
.template-washi { composes: template-serif; }
.template-modern { composes: template-glass; }
.template-vintage { composes: template-handwrite; }

.template-parchment::before,
.template-vintage::after {
  display: none;
}

/* 信件内容 */
#letter-body {
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#letter-body.reveal {
  opacity: 1;
}

#letter-body p {
  margin-bottom: 1.2em;
  animation: paragraphFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

#letter-body p:nth-child(1) { animation-delay: 0.1s; }
#letter-body p:nth-child(2) { animation-delay: 0.4s; }
#letter-body p:nth-child(3) { animation-delay: 0.7s; }
#letter-body p:nth-child(4) { animation-delay: 1.0s; }
#letter-body p:nth-child(5) { animation-delay: 1.3s; }
#letter-body p:nth-child(6) { animation-delay: 1.6s; }

@keyframes paragraphFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

#letter-closing {
  display: none;
}

/* 再来一次 */
.letter-footer {
  margin-top: 40px;
  text-align: center;
}

#btn-restart {
  padding: 10px 32px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.06));
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), inset 0 1px 0 rgba(255,255,255,0.06);
}

#btn-restart:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
  box-shadow: 0 2px 12px var(--accent-dim), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

/* ===== 答案之书 ===== */

/* 欢迎屏双按钮 */
.welcome-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.btn-answer {
  animation-delay: 0.8s !important;
}

/* 提问屏 */
#screen-answer-input {
  padding: 30px;
}

.answer-input-box {
  width: 100%;
  max-width: 460px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.answer-input-title {
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: 0.15em;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.answer-input-hint {
  font-size: 0.85rem;
  color: var(--text-ghost);
  margin-bottom: 30px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

#answer-question {
  width: 100%;
  min-height: 100px;
  padding: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  color: var(--text-primary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.95rem;
  line-height: 1.8;
  resize: none;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  margin-bottom: 24px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

#answer-question::placeholder {
  color: var(--text-ghost);
}

#answer-question:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 30px rgba(140, 160, 200, 0.08);
}

#btn-flip-answer {
  margin-bottom: 16px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.45s both !important;
}

.answer-back-btn {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.55s both;
}

/* 翻书动画屏 */
.answer-flip-container {
  text-align: center;
}

.answer-book {
  width: 120px;
  height: 160px;
  margin: 0 auto 30px;
  position: relative;
  perspective: 800px;
}

.answer-book-page {
  position: absolute;
  width: 50%;
  height: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.answer-page-left {
  left: 0;
  border-radius: 8px 0 0 8px;
  transform-origin: right center;
}

.answer-page-right {
  right: 0;
  border-radius: 0 8px 8px 0;
  transform-origin: left center;
}

.answer-page-flipping {
  animation: pageFlip 1.8s ease-in-out infinite;
}

@keyframes pageFlip {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(-160deg); }
}

.answer-loading-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.3em;
  animation: breathe 2s ease-in-out infinite;
}

/* 结果展示屏 */
#screen-answer-result {
  padding: 30px;
  gap: 0;
}

.answer-result-card {
  width: 100%;
  max-width: 480px;
  padding: 60px 40px;
  border-radius: 16px;
  text-align: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(30px) saturate(1.3);
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: letterReveal 1s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .answer-result-card {
  background: rgba(10, 20, 30, 0.55);
  border: 1px solid rgba(200, 198, 198, 0.06);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* 答案大字 */
.answer-word {
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: clamp(2rem, 7vw, 3rem);
  color: var(--text-primary);
  letter-spacing: 0.2em;
  margin-bottom: 32px;
  opacity: 0;
  filter: blur(8px);
  animation: answerWordReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

@keyframes answerWordReveal {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

/* 回应文字 */
.answer-response {
  font-family: 'Noto Serif SC', serif;
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 2;
  color: var(--text-secondary);
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1s forwards;
}

/* 底部按钮 */
.answer-footer {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  justify-content: center;
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.4s forwards;
}

/* ===== 语言之间 ===== */

.btn-between {
  animation-delay: 1s !important;
}

/* 光球容器（覆盖整个屏幕，在卡牌后面） */
.orb-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* 光球 — 纯装饰，无文字，圆形发光体 */
.orb {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: none;
}

[data-theme="dark"] .orb {
  background: radial-gradient(circle, rgba(6, 88, 140, 0.6), transparent 70%);
}

.orb.float-in {
  opacity: 0.5;
}

/* 光球浮动 */
@keyframes orbDrift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(var(--dx1), var(--dy1)); }
  50% { transform: translate(var(--dx2), var(--dy2)); }
  75% { transform: translate(var(--dx3), var(--dy3)); }
  100% { transform: translate(0, 0); }
}

/* 洗牌加速旋转 — 光球绕中心飞 */
.orb.swirling {
  opacity: 0.7 !important;
  animation: orbSwirl var(--swirl-dur) linear infinite !important;
  box-shadow: 0 0 8px var(--accent-dim);
}

[data-theme="dark"] .orb.swirling {
  box-shadow: 0 0 8px rgba(6, 88, 140, 0.4);
}

@keyframes orbSwirl {
  0% { transform: rotate(0deg) translateX(var(--swirl-r)) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(var(--swirl-r)) rotate(-360deg); }
}

/* 光球飞入卡牌 */
.orb.fly-to-card {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
  opacity: 0.9 !important;
  box-shadow: 0 0 20px var(--accent-dim) !important;
}

/* 卡牌收到光球时的闪光 */
.flip-card.glow-pulse {
  animation: cardGlow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardGlow {
  0% { box-shadow: none; }
  50% { box-shadow: 0 0 40px var(--accent-dim), 0 0 80px rgba(140, 160, 200, 0.15); }
  100% { box-shadow: none; }
}

/* 其余光球散开消失 */
.orb.scatter-away {
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important;
  opacity: 0 !important;
  transform: scale(0.3) !important;
  filter: blur(6px);
}

/* 抽牌按钮 */
.btn-draw {
  margin-top: 8px;
  margin-bottom: 16px;
  padding: 12px 52px !important;
  font-size: 1.05rem !important;
  letter-spacing: 0.3em !important;
  z-index: 5;
}

.btn-draw.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: all 0.4s ease;
}

.between-stage {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
  padding: 0 20px;
}

.between-title {
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--text-primary);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.between-hint {
  font-size: 0.85rem;
  color: var(--text-ghost);
  margin-bottom: 40px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

/* 卡牌行 */
.cards-row {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-bottom: 32px;
}

.card-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.card-label {
  font-size: 0.8rem;
  color: var(--text-ghost);
  letter-spacing: 0.3em;
}

/* 翻牌卡片 */
.flip-card {
  width: 155px;
  height: 215px;
  perspective: 800px;
  cursor: default;
}

.flip-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 卡片背面 */
.flip-card-back {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .flip-card-back {
  background: rgba(10, 20, 30, 0.5);
  border: 1px solid rgba(200, 198, 198, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.card-back-mark {
  font-family: 'Dancing Script', cursive;
  font-size: 2.5rem;
  color: var(--text-ghost);
  animation: breathe 2.5s ease-in-out infinite;
}

/* 卡片正面 */
.flip-card-front {
  transform: rotateY(180deg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: var(--text-primary);
  letter-spacing: 0.1em;
  padding: 16px;
  word-break: break-word;
}

[data-theme="dark"] .flip-card-front {
  background: rgba(10, 20, 30, 0.6);
  border: 1px solid rgba(200, 198, 198, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* 倒计时 */
.between-countdown {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.5rem, 8vw, 4rem);
  color: var(--text-primary);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  opacity: 0;
}

.between-countdown.active {
  opacity: 1;
  animation: countPulse 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes countPulse {
  0% { transform: scale(1.6); opacity: 0; filter: blur(4px); }
  40% { transform: scale(1); opacity: 1; filter: blur(0); }
  100% { transform: scale(0.95); opacity: 0.6; }
}

/* AI 评论 */
.between-comment {
  font-family: 'Noto Serif SC', serif;
  font-weight: 300;
  font-size: 0.92rem;
  line-height: 2;
  color: var(--text-secondary);
  max-width: 400px;
  min-height: 24px;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.between-comment.show {
  opacity: 1;
}

/* 底部按钮 */
.between-footer {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.between-footer.show {
  opacity: 1;
}

/* ===== 塔罗 ===== */

.btn-tarot {
  animation-delay: 1.2s !important;
}

/* 提问屏 */
.tarot-input-box {
  text-align: center;
  width: 100%;
  max-width: 420px;
  padding: 0 24px;
}

.tarot-input-title {
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--text-primary);
  letter-spacing: 0.3em;
  margin-bottom: 12px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tarot-input-hint {
  font-size: 0.85rem;
  color: var(--text-ghost);
  margin-bottom: 36px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

#tarot-question {
  width: 100%;
  min-height: 90px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 18px;
  font-size: 0.95rem;
  color: var(--text-primary);
  resize: none;
  outline: none;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  margin-bottom: 24px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

/* 抽牌动画屏 */
.tarot-loading-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.tarot-card-spinning {
  width: 140px;
  height: 220px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: tarotSpin 1.8s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .tarot-card-spinning {
  background: rgba(10, 20, 30, 0.5);
  border-color: rgba(200, 198, 198, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tarot-card-back-display {
  font-family: 'Dancing Script', cursive;
  font-size: 3rem;
  color: var(--text-ghost);
}

@keyframes tarotSpin {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(180deg) scale(0.95); }
  100% { transform: rotateY(360deg) scale(1); }
}

.tarot-loading-text {
  font-family: 'Noto Serif SC', serif;
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--text-ghost);
  letter-spacing: 0.4em;
  animation: breathe 2s ease-in-out infinite;
}

/* 结果屏 */
.tarot-result-stage {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tarot-card-img {
  width: 240px;
  height: auto;
  border-radius: 12px;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.08);
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .tarot-card-img {
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.25);
}

.tarot-card-info {
  margin-top: 24px;
  text-align: center;
}

.tarot-name {
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  color: var(--text-primary);
  letter-spacing: 0.3em;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

.tarot-name-en {
  font-family: 'Dancing Script', cursive;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 4px;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.45s both;
}

.tarot-keywords {
  font-size: 0.75rem;
  color: var(--text-ghost);
  letter-spacing: 0.15em;
  margin-top: 8px;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}

/* AI 心情 */
.tarot-mood {
  font-family: 'Noto Serif SC', serif;
  font-weight: 300;
  font-size: 0.92rem;
  line-height: 2;
  color: var(--text-secondary);
  margin-top: 36px;
  max-width: 320px;
  min-height: 24px;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tarot-mood.show {
  opacity: 1;
}

/* 底部 */
.tarot-footer {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.tarot-footer.show {
  opacity: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .letter-paper {
    padding: 32px 24px;
    margin: 0 8px;
    font-size: 0.92rem !important;
    line-height: 2;
    min-height: auto;
    border-radius: 12px;
  }

  .letter-footer {
    margin-top: 24px;
    padding-bottom: 40px;
  }

  #btn-restart {
    padding: 14px 40px;
    font-size: 1rem;
  }

  .bubble.size-xl { font-size: 2rem; }
  .bubble.size-lg { font-size: 1.4rem; }

  #user-message {
    min-height: 100px;
    padding: 16px;
  }

  .welcome-title {
    text-shadow: 0 0 40px var(--accent-dim);
  }

  .answer-result-card {
    padding: 40px 24px;
    border-radius: 12px;
    margin: 0 8px;
  }

  #answer-question {
    min-height: 80px;
    padding: 16px;
  }

  .answer-footer {
    margin-top: 24px;
  }

  .flip-card {
    width: 135px;
    height: 185px;
  }

  .cards-row {
    gap: 20px;
  }

  .between-footer {
    margin-top: 20px;
  }

  .orb {
    width: 8px;
    height: 8px;
  }

  .tarot-card-img {
    width: 200px;
  }

  #tarot-question {
    min-height: 70px;
    padding: 16px;
  }

  .tarot-footer {
    margin-top: 20px;
  }
}
