/* ============================================
   拾光计划 - 主样式表
   设计风格：风之旅人 (Journey)
   色彩：暗金色调、星空蓝、暖光橙
   ============================================ */

/* === 基础重置 === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg-deep: #0a0a1a;
  --color-bg-dark: #0f1029;
  --color-bg-mid: #1a1a3e;
  --color-gold: #e8c170;
  --color-gold-light: #f5dea3;
  --color-gold-dark: #c4943d;
  --color-warm: #ff9654;
  --color-warm-soft: #ffb88c;
  --color-star: #ffffff;
  --color-star-blue: #7eb8da;
  --color-star-purple: #b48edd;
  --color-text: #e8dcc8;
  --color-text-dim: #8a8299;
  --color-text-bright: #ffffff;
  --color-accent: #ff6b6b;
  --color-glow: rgba(232, 193, 112, 0.3);
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Noto Serif SC', 'ZCOOL XiaoWei', 'STSong', 'SimSun', serif;
  --font-transition: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', cursive;
  --font-ui: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--color-bg-deep);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === 通用画布 === */
canvas {
  display: block;
}

.particle-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* === 场景容器 === */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow: hidden;
  z-index: 1;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* === 音频按钮 === */
.audio-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(232, 193, 112, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  color: var(--color-gold);
  transition: all 0.3s ease;
}

.audio-btn:hover {
  background: rgba(232, 193, 112, 0.2);
  transform: scale(1.1);
}

.audio-btn.muted {
  opacity: 0.5;
}

/* === 加载页面 === */
#loading-screen {
  background: var(--color-bg-deep);
  z-index: 100;
}

#loading-canvas {
  opacity: 0.4;
}

.loading-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
}

.loading-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.loading-title h1 {
  font-family: var(--font-body);
  font-size: 42px;
  font-weight: 500;
  color: var(--color-gold);
  text-shadow: 0 0 40px rgba(232, 193, 112, 0.5), 0 0 80px rgba(232, 193, 112, 0.2);
  letter-spacing: 12px;
}

.loading-title .glyph {
  font-size: 24px;
  color: var(--color-gold);
  animation: glyphPulse 2s ease-in-out infinite;
}

.loading-subtitle {
  font-size: 15px;
  color: var(--color-text-dim);
  letter-spacing: 6px;
  margin-bottom: 40px;
}

.loading-bar-container {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  margin: 0 auto 16px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold), var(--color-gold-light));
  border-radius: 1px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--color-gold);
}

.loading-hint {
  font-size: 12px;
  color: var(--color-text-dim);
  letter-spacing: 2px;
  opacity: 0.6;
}

/* === 第一幕：时光穿梭入口 === */
#scene-intro {
  background: var(--color-bg-deep);
}

.intro-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
  width: 100%;
  max-width: 600px;
}

.intro-text-wrapper {
  margin-bottom: 60px;
}

.intro-line {
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 8px;
  line-height: 2.8;
  opacity: 0;
  transform: translateY(20px);
}

.intro-line.visible {
  animation: fadeInUp 1.5s var(--transition-smooth) forwards;
}

.intro-cta {
  opacity: 0;
}

.intro-cta.visible {
  animation: fadeInUp 1s var(--transition-smooth) forwards;
}

/* === 旅程按钮 === */
.btn-journey {
  position: relative;
  padding: 16px 48px;
  background: transparent;
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  font-family: var(--font-body);
  font-size: 18px;
  letter-spacing: 6px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.6s var(--transition-smooth);
}

.btn-journey:hover {
  background: rgba(232, 193, 112, 0.1);
  box-shadow: 0 0 30px rgba(232, 193, 112, 0.3), inset 0 0 30px rgba(232, 193, 112, 0.1);
  transform: translateY(-2px);
}

.btn-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(232, 193, 112, 0.15) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: btnGlow 3s ease-in-out infinite;
}

.btn-text {
  position: relative;
  z-index: 1;
}

/* === 通用按钮 === */
.btn-primary {
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold));
  border: none;
  color: var(--color-bg-deep);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 3px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(232, 193, 112, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(232, 193, 112, 0.5);
}

.btn-secondary {
  padding: 12px 32px;
  background: transparent;
  border: 1px solid rgba(232, 193, 112, 0.4);
  color: var(--color-gold);
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 3px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(232, 193, 112, 0.1);
  border-color: var(--color-gold);
}

/* === 时代导航 === */
.eras-container {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.era-transition {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.era-transition.active {
  opacity: 1;
  pointer-events: all;
}

.soul-assembly-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.transition-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-transition);
  font-size: 26px;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 8px;
  text-align: center;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.6), 0 0 60px rgba(232, 193, 112, 0.3);
  line-height: 2.2;
  padding: 20px;
}

.era-nav {
  position: relative;
  width: 90%;
  max-width: 500px;
  margin-bottom: 30px;
  display: none;
}

.era-nav.visible {
  display: block;
  animation: fadeInUp 0.8s ease forwards;
}

.era-timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 20px 0;
}

.era-line {
  position: absolute;
  top: 50%;
  left: 5%;
  width: 90%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 193, 112, 0.3), transparent);
  transform: translateY(-50%);
}

.era-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(232, 193, 112, 0.2);
  border: 1px solid rgba(232, 193, 112, 0.4);
  cursor: pointer;
  transition: all 0.5s ease;
  z-index: 2;
}

.era-dot.active {
  background: var(--color-gold);
  box-shadow: 0 0 20px var(--color-gold), 0 0 40px rgba(232, 193, 112, 0.3);
  transform: scale(1.3);
}

.era-dot.completed {
  background: var(--color-gold);
  box-shadow: 0 0 10px rgba(232, 193, 112, 0.5);
}

.era-dot span {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  color: var(--color-text-dim);
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.era-dot.active span {
  color: var(--color-gold);
}

/* === 游戏点亮 === */
.illuminate-container {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 60px 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.illuminate-header {
  text-align: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.illuminate-title {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 8px;
  margin-bottom: 8px;
  text-shadow: 0 0 30px rgba(232, 193, 112, 0.3);
}

.illuminate-hint {
  font-size: 14px;
  color: var(--color-text-dim);
  letter-spacing: 3px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 10px;
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  align-content: start;
  overflow-y: auto;
}

/* === 游戏卡片 === */
.game-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.6s var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  text-align: center;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(232, 193, 112, 0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.game-card:hover::before {
  opacity: 1;
}

.game-card:hover {
  border-color: rgba(232, 193, 112, 0.2);
  transform: translateY(-4px) scale(1.02);
}

.game-card.illuminated {
  background: rgba(232, 193, 112, 0.08);
  border-color: rgba(232, 193, 112, 0.4);
  box-shadow: 0 0 30px rgba(232, 193, 112, 0.15), inset 0 0 30px rgba(232, 193, 112, 0.05);
}

.game-card.illuminated .game-icon {
  filter: none;
  opacity: 1;
}

.game-card.illuminated .game-glow {
  opacity: 1;
}

.game-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: 8px;
  filter: grayscale(0.7) brightness(0.5);
  opacity: 0.5;
  transition: all 0.8s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.game-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.game-name {
  font-size: 13px;
  color: var(--color-text-dim);
  letter-spacing: 1px;
  transition: color 0.5s ease;
  line-height: 1.3;
  font-weight: 400;
}

.game-card.illuminated .game-name {
  color: var(--color-gold-light);
}

.game-glow {
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, rgba(232, 193, 112, 0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.illuminate-actions {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 20px 0;
}

/* === 弹窗 === */
.game-modal, .image-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
}

.game-modal.active, .image-preview-modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  background: linear-gradient(180deg, #1a1a3e 0%, #0f1029 100%);
  border: 1px solid rgba(232, 193, 112, 0.2);
  border-radius: 20px;
  padding: 32px 24px;
  overflow-y: auto;
  animation: modalIn 0.5s var(--transition-smooth);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--color-gold);
}

.modal-game-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(232, 193, 112, 0.2);
}

.modal-game-icon img,
.modal-game-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.modal-game-name {
  text-align: center;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.modal-game-quote {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-dim);
  font-style: italic;
  margin-bottom: 24px;
  line-height: 1.8;
  letter-spacing: 1px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-field label {
  display: block;
  font-size: 12px;
  color: var(--color-text-dim);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.modal-field textarea,
.modal-field input {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(232, 193, 112, 0.2);
  border-radius: 10px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  resize: none;
  transition: border-color 0.3s ease;
}

.modal-field textarea {
  height: 80px;
}

.modal-field textarea:focus,
.modal-field input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 20px rgba(232, 193, 112, 0.1);
}

.modal-events {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: all 0.3s ease;
}

.event-chip:hover {
  border-color: rgba(232, 193, 112, 0.3);
}

.event-chip.active {
  background: rgba(232, 193, 112, 0.15);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.btn-save-memory {
  margin-top: 8px;
  width: 100%;
}

/* === 银河展示 === */
#scene-galaxy {
  background: var(--color-bg-deep);
}

.galaxy-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 60px 20px;
}

.galaxy-scroll-content {
  min-height: 100vh;
  position: relative;
}

.galaxy-node {
  display: flex;
  align-items: flex-start;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--transition-smooth);
}

.galaxy-node.visible {
  opacity: 1;
  transform: translateY(0);
}

.galaxy-node.left {
  flex-direction: row;
  padding-right: 50%;
}

.galaxy-node.right {
  flex-direction: row-reverse;
  padding-left: 50%;
}

.galaxy-star {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-gold) 0%, rgba(232, 193, 112, 0.3) 60%, transparent 100%);
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--color-gold), 0 0 40px rgba(232, 193, 112, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: starTwinkle 3s ease-in-out infinite;
}

.galaxy-star img,
.galaxy-star svg {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
}

.galaxy-node-info {
  padding: 0 16px;
}

.galaxy-node-name {
  font-size: 15px;
  color: var(--color-gold-light);
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.galaxy-node-memory {
  font-size: 12px;
  color: var(--color-text-dim);
  line-height: 1.6;
  font-style: italic;
}

/* 用户自己写的回忆 */
.galaxy-node-memory.user-written {
  color: var(--color-warm-soft);
  border-left: 2px solid rgba(255, 150, 84, 0.4);
  padding-left: 8px;
  font-style: italic;
}

/* 系统自动生成的温暖叙述 */
.galaxy-node-memory.auto-gen {
  color: var(--color-text-dim);
  opacity: 0.75;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.galaxy-poem {
  text-align: center;
  padding: 60px 20px;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.galaxy-poem.visible {
  opacity: 1;
}

.poem-line {
  font-family: var(--font-transition);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 6px;
  line-height: 2.8;
  opacity: 0;
  transform: translateY(20px);
}

.poem-line.visible {
  animation: fadeInUp 1.2s var(--transition-smooth) forwards;
}

.galaxy-cta {
  text-align: center;
  padding: 40px 0;
  opacity: 0;
  transition: opacity 1s ease 0.5s;
}

.galaxy-cta.visible {
  opacity: 1;
}

/* === 我的游戏灵魂 === */
.life-container {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 40px 20px;
}

.life-header {
  text-align: center;
  margin-bottom: 20px;
}

.life-title {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 10px;
  margin-bottom: 12px;
  text-shadow: 0 0 40px rgba(232, 193, 112, 0.4);
}

/* === 灵魂形象区 === */
.soul-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
  animation: fadeInUp 1s ease forwards;
}

.soul-label {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 6px;
  text-shadow: 0 0 30px rgba(232, 193, 112, 0.5), 0 0 60px rgba(232, 193, 112, 0.2);
  animation: spiritGlow 3s ease-in-out infinite alternate;
  margin-bottom: 24px;
  text-align: center;
  padding: 12px 28px;
  background: linear-gradient(180deg, rgba(232, 193, 112, 0.06) 0%, transparent 100%);
  border-radius: 30px;
  border: 1px solid rgba(232, 193, 112, 0.15);
}

.soul-avatar-canvas {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin-bottom: 16px;
  box-shadow: 0 0 40px rgba(232, 193, 112, 0.2), 0 0 80px rgba(232, 193, 112, 0.08);
}

.soul-rarity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(232, 193, 112, 0.15);
}

.rarity-badge {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 2px;
}

.rarity-text {
  font-size: 12px;
  color: var(--color-text-dim);
  letter-spacing: 1px;
}

/* === 游戏封面墙 === */
.soul-game-wall {
  max-width: 500px;
  margin: 0 auto 40px;
  width: 100%;
}

.wall-era-section {
  margin-bottom: 28px;
  animation: fadeInUp 0.8s ease forwards;
}

.wall-era-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(232, 193, 112, 0.1);
}

.wall-era-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wall-era-name {
  font-size: 15px;
  color: var(--color-gold-light);
  letter-spacing: 3px;
  font-weight: 400;
}

.wall-era-count {
  font-size: 11px;
  color: var(--color-text-dim);
  margin-left: auto;
  letter-spacing: 1px;
}

.wall-games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.wall-game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease forwards;
}

.wall-game-card:hover {
  background: rgba(232, 193, 112, 0.06);
  border-color: rgba(232, 193, 112, 0.2);
  transform: translateY(-2px);
}

.wall-game-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: 0 0 12px rgba(232, 193, 112, 0.15);
}

.wall-game-icon img,
.wall-game-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.wall-game-name {
  font-size: 11px;
  color: var(--color-text-dim);
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 连接线：从灵魂形象延伸到封面墙 */
.soul-game-wall::before {
  content: '';
  display: block;
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, rgba(232, 193, 112, 0.4), rgba(232, 193, 112, 0.05));
  margin: 0 auto 20px;
}

.life-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 40px 0;
  flex-wrap: wrap;
}

/* === 长图预览 === */
.image-preview-content {
  position: relative;
  width: 90%;
  max-width: 400px;
  max-height: 85vh;
  background: var(--color-bg-dark);
  border: 1px solid rgba(232, 193, 112, 0.2);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: modalIn 0.5s var(--transition-smooth);
}

.image-preview-scroll {
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
  border-radius: 10px;
  margin-bottom: 16px;
}

.image-preview-scroll canvas {
  width: 100%;
  height: auto;
}

.image-preview-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.qr-code-area {
  text-align: center;
}

.qr-code-area canvas {
  width: 100px;
  height: 100px;
  margin-bottom: 8px;
}

.qr-code-area p {
  font-size: 11px;
  color: var(--color-text-dim);
  letter-spacing: 1px;
}

/* === 滚动条美化 === */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(232, 193, 112, 0.2);
  border-radius: 2px;
}

/* === 操作工具栏 === */
.illuminate-toolbar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(232, 193, 112, 0.2);
  border-radius: 20px;
  color: var(--color-text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toolbar-btn:hover {
  background: rgba(232, 193, 112, 0.1);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.toolbar-btn.skip-btn {
  border-color: rgba(138, 130, 153, 0.3);
}

.toolbar-btn.skip-btn:hover {
  border-color: rgba(138, 130, 153, 0.6);
  color: var(--color-text);
}

.toolbar-btn.spinning svg {
  animation: spin 0.6s ease;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === 自动生成游戏卡片 === */
.auto-games-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.auto-game-card {
  aspect-ratio: auto;
  flex-direction: row;
  justify-content: flex-start;
  padding: 12px;
  gap: 10px;
  text-align: left;
}

.auto-game-card .game-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.auto-rank {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 11px;
  color: var(--color-gold);
  font-family: var(--font-ui);
  opacity: 0.7;
}

.auto-playtime {
  font-size: 10px;
  color: var(--color-text-dim);
  opacity: 0.7;
  margin-top: 2px;
}

/* === 配乐按钮 === */
.modal-bgm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin: 0 0 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(232, 193, 112, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-bgm:hover {
  background: rgba(232, 193, 112, 0.08);
  border-color: rgba(232, 193, 112, 0.3);
}

.bgm-icon {
  color: var(--color-gold);
  display: flex;
  align-items: center;
}

.bgm-name {
  font-size: 12px;
  color: var(--color-text-dim);
  letter-spacing: 1px;
  flex: 1;
}

.bgm-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.bgm-bars span {
  width: 3px;
  height: 4px;
  background: var(--color-gold);
  border-radius: 1px;
  opacity: 0.3;
  transition: all 0.3s ease;
}

.modal-bgm.playing .bgm-bars span:nth-child(1) {
  animation: barBounce 0.6s ease infinite 0s;
  opacity: 1;
}
.modal-bgm.playing .bgm-bars span:nth-child(2) {
  animation: barBounce 0.6s ease infinite 0.15s;
  opacity: 1;
}
.modal-bgm.playing .bgm-bars span:nth-child(3) {
  animation: barBounce 0.6s ease infinite 0.3s;
  opacity: 1;
}
.modal-bgm.playing .bgm-bars span:nth-child(4) {
  animation: barBounce 0.6s ease infinite 0.45s;
  opacity: 1;
}

@keyframes barBounce {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

/* === 关键时刻选择 === */
.modal-moments {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.moment-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.moment-chip:hover {
  border-color: rgba(232, 193, 112, 0.3);
  background: rgba(232, 193, 112, 0.05);
}

.moment-chip.active {
  background: rgba(232, 193, 112, 0.12);
  border-color: var(--color-gold);
}

.moment-event {
  font-size: 13px;
  color: var(--color-text);
  letter-spacing: 1px;
}

.moment-chip.active .moment-event {
  color: var(--color-gold-light);
}

.moment-time {
  font-size: 11px;
  color: var(--color-text-dim);
  letter-spacing: 0.5px;
}

/* === 进阶操作区域（直接展开） === */
.modal-advanced {
  margin-top: 8px;
}

.advanced-content {
  max-height: none;
  overflow: visible;
}

/* === 添加游戏弹窗 === */
.add-game-content {
  text-align: center;
}



/* === 截图展示 === */
.modal-screenshots {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 16px;
  -webkit-overflow-scrolling: touch;
}

.modal-screenshots::-webkit-scrollbar {
  height: 3px;
}

.modal-screenshots img {
  width: 200px;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.modal-screenshots img:hover {
  transform: scale(1.05);
  border-color: rgba(232, 193, 112, 0.4);
}

/* === 近期游戏步骤指示器 === */
.modern-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.step-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--color-text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s ease;
}

.step-dot span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: var(--color-text-dim);
}

.step-dot.active {
  color: var(--color-gold);
  background: rgba(232, 193, 112, 0.1);
  border-color: rgba(232, 193, 112, 0.3);
}

.step-dot.active span {
  background: var(--color-gold);
  color: var(--color-bg-deep);
}

.step-dot.completed {
  color: var(--color-gold);
  opacity: 0.7;
}

.step-line {
  width: 30px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

.step-line.active {
  background: linear-gradient(90deg, var(--color-gold), rgba(232, 193, 112, 0.3));
}

/* === 近期游戏故事选择 === */
.modern-moments-grid {
  display: flex !important;
  flex-direction: column;
  gap: 20px;
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: 10px;
}

.moment-game-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  transition: border-color 0.3s ease;
}

.moment-game-section:hover {
  border-color: rgba(232, 193, 112, 0.15);
}

.moment-game-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.moment-game-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.moment-game-icon img,
.moment-game-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.moment-game-name {
  font-size: 15px;
  color: var(--color-gold-light);
  letter-spacing: 2px;
}

.moments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.moment-custom-input {
  margin-top: 8px;
}

.moment-custom-text {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 1px;
  transition: border-color 0.3s ease;
}

.moment-custom-text:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 15px rgba(232, 193, 112, 0.1);
}

.moment-custom-text::placeholder {
  color: var(--color-text-dim);
  opacity: 0.6;
}

/* === 大图标卡片样式 === */
.games-grid-large {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 560px;
}

.game-card-large {
  aspect-ratio: auto;
  padding: 14px 8px 10px;
  border-radius: 16px;
  min-height: 120px;
}

.game-icon-large {
  width: 72px !important;
  height: 72px !important;
  border-radius: 14px;
  margin-bottom: 8px;
}

.game-icon-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.game-card-large .game-name {
  font-size: 13px;
  letter-spacing: 1.5px;
  line-height: 1.4;
  font-weight: 400;
}

/* === 进阶卡片 === */
.advanced-grid .game-card-large {
  position: relative;
}

.advanced-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  letter-spacing: 0.5px;
  background: rgba(232, 193, 112, 0.2);
  color: var(--color-gold);
  border: 1px solid rgba(232, 193, 112, 0.3);
}

.advanced-badge.empty-badge {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-dim);
  border-color: rgba(255, 255, 255, 0.1);
}

.empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-dim);
  font-size: 14px;
  padding: 40px 0;
  letter-spacing: 2px;
}

/* === 步骤指示器（统一版） === */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 16px;
  flex-shrink: 0;
}

/* === 点亮短语提示（固定定位，出现在卡片正上方） === */
.card-phrase-floating {
  position: fixed;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-gold-light);
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(232, 193, 112, 0.6), 0 2px 8px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 8000;
  opacity: 0;
  animation: phraseRiseUp 2.8s ease-out forwards;
  /* JS 会设置 top 和 left */
}

@keyframes phraseRiseUp {
  0% { opacity: 0; transform: translate(-50%, 0); }
  12% { opacity: 1; transform: translate(-50%, -4px); }
  70% { opacity: 1; transform: translate(-50%, -18px); }
  100% { opacity: 0; transform: translate(-50%, -36px); }
}

/* === 记录感想和故事环节 === */
#scene-stories {
  background: var(--color-bg-deep);
}

#scene-stories canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.stories-container {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 60px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stories-header {
  text-align: center;
  margin-bottom: 32px;
}

.stories-title {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 8px;
  margin-bottom: 8px;
  text-shadow: 0 0 30px rgba(232, 193, 112, 0.3);
}

.stories-subtitle {
  font-size: 13px;
  color: var(--color-text-dim);
  letter-spacing: 3px;
}

.stories-overall {
  width: 100%;
  max-width: 500px;
  margin-bottom: 32px;
}

.stories-label {
  display: block;
  font-size: 14px;
  color: var(--color-gold-light);
  letter-spacing: 2px;
  margin-bottom: 12px;
  font-weight: 400;
}

.stories-textarea {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 193, 112, 0.2);
  border-radius: 14px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 1px;
  resize: vertical;
  transition: border-color 0.3s ease;
}

.stories-textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 20px rgba(232, 193, 112, 0.1);
}

.stories-games-section {
  width: 100%;
  max-width: 500px;
  margin-bottom: 32px;
}

.stories-games-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.story-game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.story-game-card:hover {
  background: rgba(232, 193, 112, 0.06);
  border-color: rgba(232, 193, 112, 0.2);
  transform: translateX(4px);
}

.story-game-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.story-game-icon img,
.story-game-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 12px;
}

.story-game-info {
  flex: 1;
  min-width: 0;
}

.story-game-name {
  font-size: 16px;
  color: var(--color-gold-light);
  letter-spacing: 2px;
  margin-bottom: 2px;
  font-weight: 500;
}

.story-game-era {
  font-size: 12px;
  color: var(--color-text-dim);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.story-game-msg {
  font-size: 13px;
  color: var(--color-text);
  opacity: 0.7;
  font-style: italic;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-game-hint {
  font-size: 13px;
  color: var(--color-text-dim);
  opacity: 0.5;
  letter-spacing: 1px;
}

.stories-actions {
  padding: 20px 0;
}

/* === 游戏回忆弹窗 === */
.story-modal-content {
  max-width: 450px;
}

.story-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.story-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.story-modal-icon img,
.story-modal-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 14px;
}

.story-modal-info {
  flex: 1;
}

.story-modal-name {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.story-modal-quote {
  font-size: 13px;
  color: var(--color-text-dim);
  font-style: italic;
  line-height: 1.6;
  letter-spacing: 0.5px;
}

/* === 大截图展示（回忆桥梁） === */
.story-screenshots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.story-screenshots img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.story-screenshots img:hover {
  transform: scale(1.03);
  border-color: rgba(232, 193, 112, 0.4);
}

.story-screenshots img:first-child:last-child,
.story-screenshots img:nth-child(odd):last-child {
  grid-column: 1 / -1;
}

/* === 留言区 === */
.story-message-field {
  margin-bottom: 16px;
}

.story-message-field label {
  display: block;
  font-size: 14px;
  color: var(--color-gold-light);
  letter-spacing: 2px;
  margin-bottom: 8px;
  font-weight: 400;
}

.story-message-field textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(232, 193, 112, 0.2);
  border-radius: 10px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  transition: border-color 0.3s ease;
}

.story-message-field textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 20px rgba(232, 193, 112, 0.1);
}



@keyframes spiritGlow {
  0% {
    text-shadow: 0 0 40px rgba(232, 193, 112, 0.5), 0 0 80px rgba(232, 193, 112, 0.2);
  }
  100% {
    text-shadow: 0 0 60px rgba(232, 193, 112, 0.8), 0 0 120px rgba(232, 193, 112, 0.4), 0 0 180px rgba(232, 193, 112, 0.1);
  }
}



/* === 响应式 === */
@media (max-width: 375px) {
  .loading-title h1 {
    font-size: 32px;
    letter-spacing: 6px;
  }
  
  .intro-line {
    font-size: 16px;
    letter-spacing: 5px;
  }
  
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  
  .games-grid-large {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .game-card-large {
    min-height: 100px;
    padding: 10px 6px 8px;
  }
  
  .game-icon-large {
    width: 56px !important;
    height: 56px !important;
  }
  
  .auto-games-grid {
    grid-template-columns: 1fr;
  }
  
  .game-icon {
    width: 40px;
    height: 40px;
  }

  .transition-text {
    font-size: 20px;
    letter-spacing: 5px;
    color: #ffffff;
  }

  .illuminate-title {
    font-size: 22px;
    letter-spacing: 5px;
  }

  .toolbar-btn span {
    display: none;
  }
  
  .toolbar-btn {
    padding: 8px 12px;
  }
  
  .stories-title {
    font-size: 22px;
    letter-spacing: 5px;
  }
  
  .soul-label {
    font-size: 22px;
    letter-spacing: 4px;
  }
  
  .soul-avatar-canvas {
    width: 160px;
    height: 160px;
  }
  
  .wall-games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .story-screenshots {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .games-grid-large {
    grid-template-columns: repeat(4, 1fr);
    max-width: 700px;
  }
  
  .auto-games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .story-screenshots {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .story-modal-content {
    max-width: 520px;
  }
}
