/* css/iframe.css */

/* 核心变量定义：现代赛博暗黑霓虹色系 */
:root {
  --bg-color: #0b061a;
  --bg-card: rgba(22, 21, 38, 0.6);
  --bg-input: rgba(255, 255, 255, 0.1);
  --border-color: rgba(124, 58, 237, 0.2);
  --border-hover: rgba(168, 85, 247, 0.6);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --neon-purple: #a855f7;
  --neon-pink: #ec4899;
  --neon-cyan: #06b6d4;
  --neon-green: #10b981;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --glow-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

/* 全局重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 通用隐藏工具类 */
.hidden {
  display: none !important;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  overflow: hidden;
  height: 100vh;
  padding: 0px 0px;
}

/* 双栏弹性大布局 */
.app-layout {
  display: flex;
  gap: 0px;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* 左侧控制生成面板 */
.control-panel {
  flex: 1135;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  position: relative;
  /* 👈 为分割线定位提供锚点 */
}

/* Figma 垂直分割线：从 top 60px 开始，宽度 1px */
.control-panel::after {
  content: "";
  position: absolute;
  top: 0px;
  right: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
  /* 👈 分割线颜色 */
  z-index: 10;
}

/* 控制区内部的独立滚动区域 */
.control-scroll-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 6px;
  margin: 0 20px 0 50px;
}

/* 右侧实时预览面板 (确保最小宽度，防止被左侧挤成0宽度) */
.preview-panel {
  flex: 785;
  min-width: 270px;
  /* 👈 移除左边框，与控制区分割线重合 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 1920px) {
  .control-panel {
    flex: 0 0 1135px;
    width: 1135px;
  }

  .preview-panel {
    flex: 0 0 785px;
    width: 785px;
  }
}

.preview-header {
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  gap: 12px;
  /* 标题与按钮组的间距，使其左对齐靠在一起 */
}



.preview-header span {
  font-family: Source Han Sans CN;
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  line-height: 100%;
  letter-spacing: 0%;
  text-align: center;
  vertical-align: middle;
}

.preview-header .play-icon {
  width: 16px;
  height: 18px;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 16px;
  /* 👈 向左回退 16px，保留呼吸感 */
  /* 两个圆形按钮之间的间距 */
}

.action-circle-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  /* 👈 清除背景，由 SVG 自带背景色渲染 */
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  padding: 0;
}

.action-circle-btn:hover {
  transform: scale(1.05);
}

.action-circle-btn:hover rect {
  fill-opacity: 0.2;
  /* 👈 hover 时使 SVG 内部背景变亮 */
}

.action-circle-btn:active {
  transform: scale(0.92);
}

.refresh-icon,
.fullscreen-icon,
.rotate-icon {
  width: 36px;
  height: 36px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-circle-btn:hover .refresh-icon {
  transform: rotate(360deg);
  /* 顺时针旋转一圈 */
}

.action-circle-btn:hover .rotate-icon {
  transform: rotate(-180deg);
  /* 逆时针旋转 180 度 */
}

.action-circle-btn:hover .fullscreen-icon {
  transform: scale(1.15);
  /* 斜向外扩张的微小动态反馈 */
}

.phone-frame-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px;
  overflow: hidden !important;
  position: relative;
}

/* 缩放整体外包裹容器 */
.phone-scale-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  flex-shrink: 0;
}

/* 仅在初始化计算完成后启用缩放过渡，避免首屏加载时产生不必要的缩放过渡动画 */
.phone-scale-container.transition-enabled {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}



/* 手机极简发光线框预览幕 */
.phone-frame {
  width: 414px;
  height: 736px;
  background: #000;
  border: 1.5px solid rgba(168, 85, 247, 0.6);
  border-radius: 36px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(168, 85, 247, 0.25);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}



/* 呼吸流光特效 */
.phone-frame.glowing {
  border-color: var(--neon-pink);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 25px var(--neon-pink);
}

/* 横屏模式下，宽高尺寸翻转 */
.phone-frame.landscape {
  width: 736px;
  height: 414px;
  border-radius: 28px;
}

.phone-earpiece {
  display: none;
  /* 隐藏物理听筒 */
}

.phone-screen {
  flex: 1;
  margin: 0;
  /* 全面屏无缩进，完全贴合外框 */
  background: #000;
  border-radius: inherit;
  /* 继承 36px 大圆角 */
  overflow: hidden;
  position: relative;
}

.phone-home-button {
  display: none;
  /* 隐藏 Home 键 */
}

/* 预览占位 */
.screen-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px;
  text-align: center;
  color: var(--text-secondary);
}

.placeholder-icon {
  width: 40px;
  height: 40px;
  color: #7a7e85;
  margin-bottom: 10px;
}

.placeholder-text {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.placeholder-subtext {
  font-size: 10px;
  line-height: 1.3;
  color: #7a7e85;
}

/* 游戏 iframe */
.game-play-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  overflow: hidden !important;
}

.game-play-iframe::-webkit-scrollbar,
.phone-screen::-webkit-scrollbar,
.fullscreen-game-iframe::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.game-play-iframe.hidden {
  display: none;
}

/* 隐藏滚动条但保留滚动能力 */
::-webkit-scrollbar {
  height: 5px;
  width: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.6);
}

/* 头部样式 */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 左右两端对齐 */
  padding: 0 20px 0 30px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  height: 60px;
  box-sizing: border-box;
}

/* 顶部操作按钮 (会话记录 & 新对话) */
.history-list-btn {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  color: var(--text-secondary);
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  height: 28px;
  box-sizing: border-box;
  user-select: none;
}

.history-list-btn:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: var(--neon-purple);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.15);
}

.history-list-btn:active {
  transform: scale(0.96);
}

.history-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-list-btn:hover .history-icon {
  transform: rotate(-30deg);
  /* 逆时针微调旋转 */
}

/* 新增定制化“创建新作品”胶囊按钮样式（完美还原Figma设计稿） */
.new-chat-btn {
  /* 使用 background-clip 技巧，使圆角 (border-radius) 完美兼容渐变边框 (border-image-source) */
  background:
    linear-gradient(#3D1A72, #220A46) padding-box,
    linear-gradient(90deg, #7A4DBD 0%, #D88BFF 25%, #E5B2FF 50.2%, #D88BFF 87.5%, #7A4DBD 100%) border-box;
  border: 1px solid transparent;
  border-radius: 20px;
  /* 完美还原 Figma 20px 圆角 */
  width: 160px;
  /* 完美还原 Figma 宽度 160px */
  height: 40px;
  /* 完美还原 Figma 高度 40px */
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-sizing: border-box;
  user-select: none;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.new-chat-btn:hover {
  background:
    linear-gradient(#4d2391, #2c0e5a) padding-box,
    linear-gradient(90deg, #8b5acc 0%, #e19eff 25%, #ecc5ff 50.2%, #e19eff 87.5%, #8b5acc 100%) border-box;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4), 0 4px 12px rgba(124, 58, 237, 0.2);
  transform: translateY(-1px);
}

.new-chat-btn:active {
  transform: translateY(0) scale(0.97);
  /* 缩放回弹物理效果 */
  background:
    linear-gradient(#2c0e5a, #1b073b) padding-box,
    linear-gradient(90deg, #643e9c 0%, #bf78e7 25%, #ce9eff 50.2%, #bf78e7 87.5%, #643e9c 100%) border-box;
}

.new-chat-btn .plus-icon {
  font-size: 15px;
  /* 加号字符稍大 */
  font-weight: 600;
  /* 加号字符加粗 */
  margin-right: 2px;
  line-height: 1;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 30px;
}

.header-icon {
  width: 20px;
  height: 20px;
  color: var(--neon-pink);
  filter: drop-shadow(0 0 6px var(--neon-pink));
}

@keyframes floatIcon {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

.app-header .title {
  font-family: FZLanTingHeiS-R-GB, var(--font-family);
  font-weight: 400;
  font-size: 16px;
  color: white;
}

.app-header .subtitle {
  font-family: FZLanTingHeiS-R-GB, var(--font-family);
  font-weight: 400;
  font-size: 12px;
  line-height: 24px;
  color: #8A8695;
  margin-left: 8px;
  /* 适当补一点左间距，使其看起来与标题有优雅的呼吸空间 */
}

/* AI 对话引导区域 */
.ai-chat-section {
  width: 100%;
}

.chat-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* 头像与发光 */
.avatar-wrapper {
  position: relative;
  width: 36px;
  /* 完美还原 Figma 头像背景宽度 36px */
  height: 36px;
  /* 完美还原 Figma 头像背景高度 36px */
  flex-shrink: 0;
  border-radius: 50%;
  /* 圆形底盘 */
  background: linear-gradient(270deg, #FC4CC6 0%, #882CF1 100%);
  /* 完美还原 Figma 渐变背景 */
  display: flex;
  align-items: center;
  justify-content: center;
  /* 保证内部 26x24 的白色机器人完美居中 */
  box-shadow: 0 4px 10px rgba(136, 44, 241, 0.3);
  /* 配合渐变增加轻微微阴影 */
}

.cat-avatar {
  width: 26px;
  /* 完美还原 Figma 机器人宽度 26px */
  height: 24px;
  /* 完美还原 Figma 机器人高度 24px */
  display: block;
  flex-shrink: 0;
}

.avatar-glow {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-purple);
  opacity: 0.6;
  animation: pulseGlow 2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.chat-bubble {
  /* 使用符合 Figma 的半透明暗色背景 */
  background: linear-gradient(0deg, rgba(101, 70, 255, 0.03) 6.25%, rgba(101, 70, 255, 0.18) 100%);
  border: none;
  /* 移除透明 border，改用 ::after 伪元素独立绘制渐变边框 */
  border-radius: 20px;
  /* 完美还原 Figma 20px 圆角 */
  padding: 6px 24px;
  position: relative;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  width: 600px;
  /* 完美还原 Figma 宽度 600px */
  max-width: 100%;
  /* 响应式安全限制 */
  min-width: 0;
  /* 防止 flex 父容器被长内容撑破 */
  min-height: 48px;
  /* 降低最小高度，使气泡厚度自适应收缩 */
  display: flex;
  align-items: center;
  /* 垂直居中文字 */
  box-sizing: border-box;
  overflow: hidden;
  /* 防止子内容外溢 */
}

/* bubble-and-meta 是 flex 容器的弹性子项，必须加 min-width:0 才能正确收缩 */
.bubble-and-meta {
  min-width: 0;
  max-width: 100%;
}

/* 使用 CSS Mask 复合排除技术，独立绘制 1px 渐变边框，绝不污染半透明背景色 */
.chat-bubble::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  /* 边框粗细为 1px */
  background: linear-gradient(180deg, #C6BAFF 0%, #947EFF 22.6%, rgba(83, 68, 155, 0.31) 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}


.chat-text {
  font-family: FZLanTingHeiS-R-GB, var(--font-family);
  font-weight: 400;
  font-size: 14px;
  /* 完美还原 Figma 14px */
  line-height: 24px;
  /* 完美还原 Figma 24px 行高 */
  letter-spacing: 0;
  color: #ffffff;
  /* Figma 文字色 */
}

/* 灵感模板标签 */
.inspiration-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 10px;
  /* 👈 行距 12px，列距 10px */
  max-width: 1000px;
  margin: 5px 20px 16px 50px;
  /* 👈 滚动区已有 50px 左边距，此处归 0 以对齐气泡 */
  justify-content: flex-start;
  /* 👈 靠左对齐流入 */
  width: calc(100% - 70px);
  /* 👈 动态扣除左右外边距总和 (50px + 20px)，防止标签超出屏幕右边缘 */
  box-sizing: border-box;
}

.tag-btn {
  background: #201243;

  /* 👈 精致半透明深紫背景 */
  border: 1px solid #331F64;
  /* 👈 精细柔和描边 */
  border-radius: 20px;

  /* 标签内文本样式 */
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 12px;
  /* 👈 字号调整为 12px 增强清晰度 */
  line-height: 24px;
  color: rgba(255, 255, 255, 0.85);
  /* 👈 呼吸亮白色 */
  vertical-align: middle;

  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  height: 30px;
  /* 👈 适度提高按钮至 34px 更显质感 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 10px;
  /* 👈 左右扩充至 18px */
  max-width: 480px;
  /* 👈 拓宽最大长度限制以防长字折叠 */

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-btn:hover {
  background: rgba(43, 25, 89, 0.8);
  border-color: rgba(168, 85, 247, 0.5);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
  transform: translateY(-1px);
}

.tag-btn:active {
  transform: translateY(0);
}

/* 热门模板区 */
.popular-templates-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 30px 0 0 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  margin-left: 50px;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.fire-icon {
  width: 14px;
  height: 14px;
}

.templates-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1085px;
  margin: 0 32px 0 auto;
  width: 100%;
}

/* 横向滚动列表 */
.templates-slider {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 2px 2px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  -ms-overflow-style: none;
  /* 隐藏 Edge/IE 滚动条 */
  scrollbar-width: none;
  /* 隐藏 Firefox 滚动条 */
}

/* 彻底隐藏 Chrome/Safari 滚动条 */
.templates-slider::-webkit-scrollbar {
  display: none;
}

.templates-slider:active {
  cursor: grabbing;
}

/* 固定查看全部卡片 */
.view-all-card {
  width: 140px;
  height: 160px;
  flex-shrink: 0;
  background: var(--bg-input);
  border: 1px dashed rgba(199, 182, 182, 0.35);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.view-all-card:hover {
  background: rgba(168, 85, 247, 0.08);
  border-color: var(--neon-pink);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.2);
  transform: translateY(-2px);
}

.view-all-card:active {
  transform: translateY(0) scale(0.97);
}

.view-all-icon {
  width: 28px;
  height: 28px;
  color: #8A8695;
  /* 对齐设计稿，默认使用 #8A8695 色彩 */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-all-card:hover .view-all-icon {
  transform: rotate(90deg) scale(1.1);
  /* 旋转加微缩放，极具质感 */
  color: #ffffff;
  /* 悬停时图标同文本一起点亮 */
}

.view-all-text {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* 模板卡片 */
.template-card {
  width: 140px;
  /* 微调还原：在双栏布局下自适应精致比例，宽 140px */
  height: 160px;
  /* 微调还原：在双栏布局下自适应精致比例，高 160px */
  flex-shrink: 0;

  /* 默认未选中状态 */
  background: #201243;
  border: 1px solid #331F64;
  border-radius: 20px;
  /* 完美还原 Figma 20px 圆角 */
  box-shadow: none;
  /* 默认未选中时不发光，避免视觉嘈杂 */

  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  display: flex;
  flex-direction: column;
  /* 纵向排布图片和文字底座 */
}

/* 悬停 (hover) 状态，展示渐变边框与发光阴影，并向上漂移 4px */
.template-card:hover {
  transform: translateY(-4px);
  background:
    linear-gradient(#201243, #201243) padding-box,
    linear-gradient(140.21deg, rgba(251, 76, 198, 0.5) 1.5%, #673FCA 100%) border-box;
  border: 1px solid transparent;
  box-shadow: 0px 0px 10px 2px rgba(242, 21, 201, 0.25);
  /* 完美还原 Figma 阴影 #F215C940 */
}

/* 选中激活 (.active) 状态，展示渐变边框与发光阴影，但保持原位不上浮 */
.template-card.active {
  background:
    linear-gradient(#201243, #201243) padding-box,
    linear-gradient(140.21deg, rgba(251, 76, 198, 0.5) 1.5%, #673FCA 100%) border-box;
  border: 1px solid transparent;
  box-shadow: 0px 0px 10px 2px rgba(242, 21, 201, 0.25);
  transform: none;
  /* 明确取消漂移，保持原位平齐 */
}

/* 激活后且悬停时，稍微提亮卡片底盘以作为微动反馈，同样不上浮 */
.template-card.active:hover {
  background:
    linear-gradient(#271654, #271654) padding-box,
    linear-gradient(140.21deg, rgba(251, 76, 198, 0.8) 1.5%, #8356f5 100%) border-box;
  box-shadow: 0px 0px 18px 4px rgba(242, 21, 201, 0.45), 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: none;
}

.card-image-wrapper {
  position: relative;
  height: 115px;
  flex-shrink: 0;
  /* 锁定图片高度，绝不参与压缩 */
  overflow: hidden;
}

.card-bg-gradient {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.5s ease;
}

.template-card:hover .card-bg-gradient {
  transform: scale(1.08);
}

.grad-runner {
  background: linear-gradient(135deg, #1e1b4b 0%, #701a75 100%);
}

.grad-match3 {
  background: linear-gradient(135deg, #1e1b4b 0%, #1e3a8a 100%);
}

.grad-space {
  background: linear-gradient(135deg, #1e1b4b 0%, #311042 100%);
}

.grad-ramen {
  background: linear-gradient(135deg, #4c0519 0%, #1e1b4b 100%);
}

.grad-race {
  background: linear-gradient(135deg, #064e3b 0%, #1e1b4b 100%);
}

.card-vector {
  width: 100%;
  height: 100%;
}

.card-info-area {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 10px 5px 10px;
  /* 紧凑化的上下间距，彻底消除文字重叠 */
  flex: 1;
  /* 弹性拉伸，吸收剩下所有高度（40px） */
  box-sizing: border-box;
}

.card-title {
  font-family: FZLanTingHeiS-R-GB, var(--font-family);
  font-size: 11px;
  /* 稍缩减至 11px 留出完美空白间距 */
  font-weight: 500;
  color: #ffffff;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 长标题防撑开 */
  line-height: 1.1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  height: auto;
  background: transparent;
}

.hot-count {
  font-size: 10px;
  color: #8A8695;
  /* 灰色字 */
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-heart {
  font-style: normal;
  font-size: 15px;
  color: #8A8695;
  margin-right: 1px;
}

.price-badge {
  font-size: 10px;
  font-weight: 500;
  color: #8A8695;
  /* 灰色字，与爱心颜色相同 */
  border: 1px solid #8A8695;
  /* 细边框 */
  background: rgba(255, 255, 255, 0.02);
  padding: 0px 8px;
  /* 胶囊填充 */
  border-radius: 12px;
  /* 胶囊圆角 */
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: none;
  /* 去掉发光阴影 */
  line-height: 1;
}

/* 当卡片被选中激活时，积分胶囊应用粉紫渐变且无边框，文字与闪电自动变白 */
.template-card.active .price-badge {
  background: linear-gradient(90deg, #7728F8 0%, #FA4CC7 100%);
  border: none;
  color: #ffffff;
  /* 渐变色背景下文字与图标自适应呈纯白色 */
  padding: 1px 9px;
  /* 补偿移除 border 带来的 1px 边距，防止高度抖动 */
}

.icon-flash {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: inherit;
  /* 继承父容器的灰色 */
  fill: currentColor;
}

.generation-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 1085px;
  margin: 0 20px 25px auto;
  width: 100%;
  position: relative;
  /* 给 templatePanel 绝对定位提供锚点 */
}

/* ── 模板定制浮层面板 ── */
.template-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  /* 浮在 input-panel 正上方 8px 处 */
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(135deg, rgba(28, 10, 60, 0.97) 0%, rgba(20, 8, 45, 0.97) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(120, 39, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: templatePanelIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes templatePanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tpl-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tpl-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cancel-tpl-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-family: var(--font-family);
  padding: 3px 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cancel-tpl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.tpl-slots-area {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  /* 隐藏滚动条但保留能力 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tpl-slots-area::-webkit-scrollbar {
  display: none;
}

/* slot 分组容器 */
.slot-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.slot-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  padding-left: 2px;
}

/* slot 下拉胶囊按钮 */
.slot-capsule {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 3px 10px 3px 10px;
  font-size: 12px;
  font-family: var(--font-family);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}

.slot-capsule:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.slot-capsule.open,
.slot-capsule:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}

.slot-capsule svg {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease;
}

.slot-name {
  color: #BF43F0;
  font-size: 11px;
}

.slot-name::after {
  content: '\00a0';
}

.slot-capsule .slot-value {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.slot-capsule.open svg {
  transform: rotate(180deg);
  color: rgba(255, 255, 255, 0.9);
}

/* slot 下拉菜单 */
.slot-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: rgba(18, 8, 42, 0.97);
  border: 1px solid rgba(120, 39, 246, 0.5);
  border-radius: 10px;
  padding: 4px;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(120, 39, 246, 0.2);
  animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slot-dropdown-item {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.slot-dropdown-item:hover {
  background: rgba(120, 39, 246, 0.2);
  color: #fff;
}

.slot-dropdown-item.selected {
  background: rgba(120, 39, 246, 0.3);
  color: #fff;
  font-weight: 500;
}

/* Prompt 预览区域 */
.tpl-prompt-preview {
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 6px;
  word-break: break-all;
}

.input-panel {
  background: #190c3b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  height: 200px;
  box-sizing: border-box;
  margin: 0 10px 24px 30px;
  /* 👈 与上方内容保持 30px 齐平对齐 */
}

.input-panel:focus-within {
  border-color: var(--border-hover);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
}

#promptInput {
  width: 100%;
  flex: 1;
  background: transparent;
  border: none;
  resize: none;
  outline: none;
  color: var(--font-family);
  font-family: var(--font-family);
  font-size: 13px;
  line-height: 1.4;
  margin-top: 6px;
}

#promptInput::placeholder {
  color: #8A8695;
}

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.balance-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #8A8695;
  font-family: FZLanTingHeiS-R-GB, var(--font-family);
  font-weight: 400;
}

.flash-icon {
  width: 12px;
  height: 12px;
  color: #8A8695;
}

.cost-value {
  color: #8A8695;
  font-weight: 400;
}

.divider {
  color: var(--bg-input);
  margin: 0 2px;
}

.generate-btn {
  background: linear-gradient(270deg, #F249C9 0%, #7827F7 100%);
  border: none;
  border-radius: 50%;
  color: #fff;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(236, 72, 153, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  flex-shrink: 0;
  padding: 0;
}

.generate-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.5), 0 0 8px rgba(168, 85, 247, 0.3);
}

.generate-btn:active {
  transform: translateY(0);
}

.generate-btn:disabled {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.3) 0%, rgba(90, 90, 104, 0.5) 100%) !important;
  color: var(--text-secondary) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  opacity: 0.75;
}

.btn-arrow-icon {
  width: 16px;
  height: 16px;
  stroke: #fff;
}

.btn-loading-icon {
  width: 16px;
  height: 16px;
  stroke: #fff;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* 模拟生成中蒙版 - 已废弃，完全由聊天流终端替代 */
.generating-overlay {
  display: none !important;
}


.generating-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 350px;
  padding: 24px;
}

.cyber-spinner {
  position: relative;
  width: 80px;
  height: 80px;
}

.spinner-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

.ring-1 {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-top-color: var(--neon-purple);
  animation: spinClockwise 1.5s linear infinite;
}

.ring-2 {
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border-right-color: var(--neon-pink);
  animation: spinCounterClockwise 1.2s linear infinite;
}

.ring-3 {
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border-bottom-color: var(--neon-cyan);
  animation: spinClockwise 0.8s linear infinite;
}

.center-icon {
  position: absolute;
  top: 25px;
  left: 25px;
  width: 30px;
  height: 30px;
  color: #fff;
  filter: drop-shadow(0 0 5px #fff);
  animation: pulseScale 1s ease-in-out infinite alternate;
}

@keyframes spinClockwise {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinCounterClockwise {
  100% {
    transform: rotate(-360deg);
  }
}

@keyframes pulseScale {
  0% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1.1);
  }
}

.loader-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #00f0ff, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.loader-status {
  font-size: 12.5px;
  color: var(--text-secondary);
  height: 20px;
  transition: all 0.3s ease;
}

/* 进度条 */
.progress-bar-wrapper {
  width: 220px;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink));
  box-shadow: 0 0 8px var(--neon-pink);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 科技流光 */
.cyber-data-stream {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: monospace;
  font-size: 9px;
  color: #4b5563;
}

.stream-line {
  white-space: nowrap;
  overflow: hidden;
  border-right: 1px solid transparent;
}

/* Toast */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.88);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(18, 14, 35, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 85, 247, 0.7);
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.2),
    0 0 30px rgba(168, 85, 247, 0.4),
    0 0 60px rgba(168, 85, 247, 0.15),
    0 16px 40px rgba(0, 0, 0, 0.6);
  padding: 16px 28px;
  border-radius: 14px;
  color: #f3f4f6;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 1.5;
  z-index: 2000;
  max-width: 300px;
  text-align: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast:not(.hidden) {
  animation: toastSlideIn 0.2s ease-out forwards;
}

.toast.hidden {
  opacity: 0;
  animation: none;
  transform: translate(-50%, -50%) scale(0.92);
  pointer-events: none;
}

/* JWT 状态卡片样式 */
.jwt-status-card {
  margin: 10px 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.3s ease;
}

.jwt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.jwt-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jwt-status-indicator .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b7280;
  display: inline-block;
  box-shadow: 0 0 4px #6b7280;
}

.jwt-status-indicator .status-text {
  font-weight: 500;
  color: var(--text-secondary);
}

.jwt-timer {
  color: var(--text-secondary);
  font-size: 10.5px;
}

.jwt-timer.hidden {
  display: none !important;
}

.jwt-timer span {
  font-family: monospace;
  font-weight: bold;
}

.jwt-card-body {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-secondary);
}

.jwt-card-body .divider {
  color: rgba(255, 255, 255, 0.15);
}

.jwt-card-body span span {
  font-family: monospace;
  color: #fff;
}

/* 状态修饰类 */
/* 有效状态 (Valid) */
.jwt-status-card.valid {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.02);
}

.jwt-status-card.valid .status-dot {
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: pulseGreen 1.5s infinite alternate;
}

.jwt-status-card.valid .status-text {
  color: var(--neon-green);
}

.jwt-status-card.valid .jwt-timer {
  color: var(--neon-green);
}

/* 即将过期状态 (Expiring) */
.jwt-status-card.expiring {
  background: rgba(245, 158, 11, 0.04);
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.02);
}

.jwt-status-card.expiring .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulseOrange 0.8s infinite alternate;
}

.jwt-status-card.expiring .status-text {
  color: #f59e0b;
}

.jwt-status-card.expiring .jwt-timer {
  color: #f59e0b;
}

/* 已过期状态 (Expired) */
.jwt-status-card.expired {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.25);
}

.jwt-status-card.expired .status-dot {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.jwt-status-card.expired .status-text {
  color: #ef4444;
}

/* 动效 */
@keyframes pulseGreen {
  0% {
    opacity: 0.6;
    box-shadow: 0 0 2px var(--neon-green);
  }

  100% {
    opacity: 1;
    box-shadow: 0 0 8px var(--neon-green);
  }
}

@keyframes pulseOrange {
  0% {
    opacity: 0.6;
    box-shadow: 0 0 2px #f59e0b;
  }

  100% {
    opacity: 1;
    box-shadow: 0 0 10px #f59e0b;
  }
}

/* ═══════════════════════════════════════════════
   模板定制面板
═══════════════════════════════════════════════ */

.template-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 14px;
  backdrop-filter: blur(8px);
  animation: tplFadeIn 0.2s ease-out;
}

@keyframes tplFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 面板头部 */
.tpl-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tpl-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #8A8695;
  flex: 1;
  min-width: 0;
}

.tpl-header-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 取消模板按钮 */
.cancel-tpl-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-family: var(--font-family);
  padding: 2px 8px 2px 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.cancel-tpl-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* 槽位标签区 */
.tpl-slots-area {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 单个槽位标签 */
.tpl-slot-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 20px;
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.tpl-slot-tag:hover,
.tpl-slot-tag.open {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
}

.slot-label {
  color: var(--text-secondary);
  font-size: 10.5px;
}

.slot-value {
  color: var(--neon-purple);
  font-weight: 500;
}

.slot-chevron {
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.tpl-slot-tag.open .slot-chevron {
  transform: rotate(180deg);
}

/* 下拉菜单 */
.tpl-dropdown {
  background: rgba(18, 15, 35, 0.98);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(168, 85, 247, 0.15);
  padding: 4px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  animation: dropdownIn 0.15s ease-out;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tpl-dropdown-item {
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.tpl-dropdown-item:hover {
  background: rgba(168, 85, 247, 0.15);
  color: var(--text-primary);
}

.tpl-dropdown-item.active {
  color: var(--neon-purple);
  background: rgba(168, 85, 247, 0.12);
  font-weight: 500;
}

/* 构建后的 prompt 预览 */
.tpl-prompt-preview {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  word-break: break-all;
}

/* ═══════════════════════════════════════════════
   动态对话聊天区与模板卡片
═══════════════════════════════════════════════ */

/* 用户对话行，靠右排列 */
.chat-row.user-row {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  width: 100%;
  animation: userBubbleIn 0.25s ease-out;
}

.chat-row.user-row .bubble-and-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: calc(100% - 54px);
}

@keyframes userBubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble.user-bubble {
  /* 继承通用 .chat-bubble 的背景与 ::after 渐变发光边框 */
  width: auto;
  max-width: 100%;
  border-radius: 20px;
  padding: 8px 20px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

.chat-bubble.user-bubble .chat-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.chat-bubble.user-bubble::after {
  border-radius: 20px;
}

/* 模板总结卡片气泡 */
.chat-row.ai-template-card-row {
  margin-top: 14px;
  animation: templateCardIn 0.3s ease-out;
}

@keyframes templateCardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble.template-summary-bubble {
  max-width: 550px;
  padding: 14px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px rgba(168, 85, 247, 0.2);
  border-radius: 20px;
  /* 统一大圆角 */
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.chat-bubble.template-summary-bubble::after {
  border-radius: 20px;
}


.template-summary-header {
  display: flex;
  align-items: center;
  font-size: 12.5px;
  color: var(--neon-cyan);
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.template-summary-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.template-slots-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.summary-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  transition: border-color 0.15s, background 0.15s;
}

.summary-slot-badge:hover {
  background: rgba(168, 85, 247, 0.06);
  border-color: rgba(168, 85, 247, 0.25);
}

.slot-badge-label {
  color: var(--text-secondary);
}

.slot-badge-value {
  color: var(--neon-cyan);
  font-weight: 500;
}

/* 局部进度条与终端样式 */
.log-progress-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 10px 0;
}

.log-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
  width: 5%;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--neon-cyan);
}

.log-stream-terminal {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px;
  max-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  /* 防止超长日志文字横向撑破气泡 */
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: #a1a1aa;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  /* 确保终端容器撑满气泡宽度，不超出 */
  box-sizing: border-box;
}

.log-stream-line {
  line-height: 1.4;
  word-break: break-all;
}

.log-stream-line.success {
  color: var(--neon-green);
}

.log-stream-line.error {
  color: var(--neon-pink);
}

.log-stream-line.info {
  color: #a1a1aa;
}

.status-dot.pulsing {
  width: 7px;
  height: 7px;
  background: var(--neon-purple);
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  animation: pulseDot 1.6s infinite ease-in-out;
  box-shadow: 0 0 8px var(--neon-purple);
  vertical-align: middle;
}

.status-text-val {
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.status-text-val.generating {
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(6, 182, 212, 0.3);
}

.status-text-val.success {
  color: var(--neon-green);
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}

.status-text-val.failed {
  color: var(--neon-pink);
  text-shadow: 0 0 6px rgba(236, 72, 153, 0.3);
}


@keyframes pulseDot {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* 用户头像容器与发光效果 */
.user-avatar-wrapper {
  margin-left: 12px;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.user-avatar-glow {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-cyan);
  opacity: 0.6;
  animation: pulseUserGlow 2.5s infinite ease-in-out;
  pointer-events: none;
}

@keyframes pulseUserGlow {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  box-sizing: border-box;
}

/* 游戏生成成功后弹出的发布与草稿按钮组 */
.preview-publish-actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 414px;
  /* 设为 414px 物理宽度，在 scale 缩小后自动与缩小手机宽度（~315px）对齐！ */
  margin-top: 32px;
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.preview-publish-actions.hidden {
  display: none !important;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.publish-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 60px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.35);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
}

.publish-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5), 0 0 10px rgba(236, 72, 153, 0.4);
}

.publish-btn:active {
  transform: translateY(0);
}

.draft-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
}

.draft-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.draft-btn:active {
  background: rgba(255, 255, 255, 0.03);
}

.publish-icon,
.draft-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}



/* 会话历史侧边抽屉 */
.history-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  transition: all 0.35s ease;
}

.history-drawer.hidden {
  opacity: 0;
  pointer-events: none;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.drawer-content {
  position: relative;
  width: 320px;
  height: 100%;
  background: rgba(15, 12, 25, 0.88);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(168, 85, 247, 0.25);
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-drawer:not(.hidden) .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.drawer-close-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #71717a;
}

.drawer-empty-state svg {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.15);
}

.drawer-empty-state p {
  font-size: 13px;
}

/* 会话记录项 */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.history-item:hover {
  background: rgba(168, 85, 247, 0.06);
  border-color: rgba(168, 85, 247, 0.25);
  transform: translateY(-2px);
}

.history-item.active {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.1);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.item-game-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c084fc;
  flex-shrink: 0;
}

.item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.item-title {
  font-size: 13px;
  font-weight: 500;
  color: #e4e4e7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-time {
  font-size: 11px;
  color: #71717a;
  margin-top: 2px;
}

.item-delete-btn {
  background: none;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
}

.item-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.item-delete-btn svg {
  width: 14px;
  height: 14px;
}

/* 对话气泡用户名样式 (还原自 Figma) */
.chat-name {
  color: #8A8695;
  font-family: FZLanTingHeiS-R-GB, var(--font-family);
  font-weight: 400;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  vertical-align: middle;
  opacity: 1;
}

.footer-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 横竖屏胶囊单选切换 */
.orientation-switch {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2px;
  user-select: none;
  box-sizing: border-box;
}

.switch-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: FZLanTingHeiS-R-GB, var(--font-family);
  font-weight: 400;
  font-size: 11px;
  color: #8A8695;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  height: 24px;
  border: 1px solid transparent;
  /* 防抖透明边框 */
}

.switch-item:hover {
  color: #ffffff;
}

.orient-icon {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  display: inline-block;
  vertical-align: middle;
}

/* 激活状态 */
.switch-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(120, 39, 247, 0.4) 0%, rgba(242, 73, 201, 0.15) 100%);
  border: 1px solid rgba(136, 44, 241, 0.6);
  box-shadow: 0 0 8px rgba(136, 44, 241, 0.3);
}

/* ========================================== */
/*           NEWBIE GUIDE SYSTEM              */
/* ========================================== */

.guide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: rgba(8, 4, 20, 0.7);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.guide-modal {
  width: 780px;
  height: 619px;
  box-sizing: border-box;
  background: url('../assets/di.png') no-repeat center center;
  background-size: 100% 100%;
  border: none;
  box-shadow: none;
  padding: 20px 20px 20px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 3D 机械猫大头定位 */
.cat-deco-container {
  position: absolute;
  top: -1px;
  left: 550px;
  width: 200px;
  height: 190px;
  z-index: 100;
  pointer-events: none;
}

.cat-deco-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

.guide-header {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.guide-tag {
  background: linear-gradient(90deg, #a855f7 0%, #ec4899 100%);
  color: #ffffff;
  font-family: 'Source Han Sans CN', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  width: 90px;
  height: 24px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0px;
}

.guide-title {
  font-size: 32px;
  font-weight: 500;
  color: #ffffff;
  font-family: 'Source Han Sans CN', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  letter-spacing: 0px;
  line-height: 1.25;
  width: 416px;
  min-height: 40px;
  height: auto;
  margin: 22px 0 14px 0;
  white-space: nowrap;
  text-align: left;
  overflow: visible;
  padding: 2px 0;
}

.guide-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: white;
  font-family: 'Source Han Sans CN', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  letter-spacing: 0px;
  line-height: 1;
  width: 260px;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 0px;
  margin: 0;
  white-space: nowrap;
}

.guide-subtitle svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.highlight-credit {
  color: #f472b6;
  font-weight: 700;
  margin: 0 2px;
}

/* 步骤指示器 */
.guide-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;

  position: relative;
  z-index: 2;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.45;
  transition: all 0.3s ease;
}

.step-item.active {
  opacity: 1;
}

.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #FFFFFF1A;

  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 500;
  font-family: 'Source Han Sans CN', 'Outfit', sans-serif;
  line-height: 1;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.step-item.active .step-num {
  background: linear-gradient(142.73deg, #7226F9 14.68%, #FF4DC6 83.43%);
  color: #ffffff;
}

.step-label {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Source Han Sans CN', sans-serif;
}

.step-item.active .step-label {
  color: #ffffff;
}

.step-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 16px;
  position: relative;
}

.step-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink));
  transition: width 0.4s ease;
}

.step-line.completed::after {
  width: 100%;
}

.guide-content-panel {
  width: 740px;
  height: 304px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.4) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-sizing: border-box;
  padding: 16px 20px;
  position: relative;
  z-index: 2;
}

.step-content {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.step-content.active {
  display: flex;
  animation: slideFade 0.3s ease-out;
}

@keyframes slideFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-section-title {
  font-family: 'Source Han Sans CN', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 1);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 5px;
  margin-bottom: 0px;
}

.panel-section-title::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 180px;
  height: 0;
  border-bottom: 1px solid;
  border-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.6) 100%) 1;
}

.panel-section-title::after {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 180px;
  height: 0;
  border-bottom: 1px solid;
  border-image: linear-gradient(90deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 100%) 1;
}

/* 双行横向滑动布局 */
.game-options-grid {
  margin-top: 8px;
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: minmax(175px, 220px);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 10px 4px;
  width: 100%;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.game-options-grid .option-card {
  min-width: 0;
  width: 100%;
}

.style-options-grid {
  margin-top: -5px;
  display: grid;
  grid-template-rows: repeat(2, 105px);
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 10px 4px;
  width: 100%;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.game-options-grid::-webkit-scrollbar,
.style-options-grid::-webkit-scrollbar {
  display: none;
}

/* 画面风格卡片垂直布局对齐 */
.style-options-grid .option-card {
  height: 105px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10px 8px;
  gap: 6px;
}

.style-options-grid .option-card .card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.style-options-grid .option-card .card-name {
  text-align: center;
  font-size: 14px;
}

.style-options-grid .option-card .card-desc {
  text-align: center;
  font-size: 11px;
}

.option-card {
  width: 220px;
  height: 90px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.option-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-2px);
}

.option-card.active {
  border: none;
  background: radial-gradient(circle at 60% 0%, rgba(208, 69, 255, 0.35) 0%, #4F0A8433 100%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 4px 20px rgba(144, 77, 189, 0.25);
  position: relative;
}

.option-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(90deg, #904DBD 0%, #E88BFF 25%, #F9B2FF 50%, #E88BFF 75%, #904DBD 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

.style-icon {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-card.active .style-icon {
  transform: scale(1.15) translateY(-2px);
}

.card-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.25s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

/* 3D 渐变徽章背景渲染 */
.bg-rail {
  background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.4) 0%, rgba(76, 29, 149, 0.6) 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(139, 92, 246, 0.3);
}

.bg-ball {
  background: radial-gradient(circle at 30% 30%, rgba(249, 115, 22, 0.4) 0%, rgba(194, 65, 12, 0.6) 100%);
  border: 1px solid rgba(249, 115, 22, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(249, 115, 22, 0.3);
}

.bg-runner {
  background: radial-gradient(circle at 30% 30%, rgba(6, 182, 212, 0.4) 0%, rgba(8, 145, 178, 0.6) 100%);
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(6, 182, 212, 0.3);
}

.bg-maze {
  background: radial-gradient(circle at 30% 30%, rgba(16, 185, 129, 0.4) 0%, rgba(4, 120, 87, 0.6) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(16, 185, 129, 0.3);
}

.bg-earth {
  background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.4) 0%, rgba(29, 78, 216, 0.6) 100%);
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(59, 130, 246, 0.3);
}

.bg-chess {
  background: radial-gradient(circle at 30% 30%, rgba(156, 163, 175, 0.4) 0%, rgba(75, 85, 99, 0.6) 100%);
  border: 1px solid rgba(156, 163, 175, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(156, 163, 175, 0.3);
}

.bg-cyber {
  background: radial-gradient(circle at 30% 30%, rgba(168, 85, 247, 0.4) 0%, rgba(107, 33, 168, 0.6) 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(168, 85, 247, 0.3);
}

.bg-pixel {
  background: radial-gradient(circle at 30% 30%, rgba(236, 72, 153, 0.4) 0%, rgba(157, 23, 77, 0.6) 100%);
  border: 1px solid rgba(236, 72, 153, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(236, 72, 153, 0.3);
}

.bg-cartoon {
  background: radial-gradient(circle at 30% 30%, rgba(34, 197, 94, 0.4) 0%, rgba(21, 128, 61, 0.6) 100%);
  border: 1px solid rgba(34, 197, 94, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(34, 197, 94, 0.3);
}

.bg-waste {
  background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.4) 0%, rgba(153, 27, 27, 0.6) 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(239, 68, 68, 0.3);
}

.bg-magic {
  background: radial-gradient(circle at 30% 30%, rgba(245, 158, 11, 0.4) 0%, rgba(180, 83, 9, 0.6) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(245, 158, 11, 0.3);
}

.bg-future {
  background: radial-gradient(circle at 30% 30%, rgba(6, 182, 212, 0.4) 0%, rgba(9, 133, 160, 0.6) 100%);
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 10px rgba(6, 182, 212, 0.3);
}

.option-card.active .card-badge {
  transform: scale(1.08) rotate(-4deg);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-name {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
}

.card-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.35;
}

/* 难度选择列表 */
.difficulty-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diff-card {
  width: 700px;
  height: 70px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.diff-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateX(3px);
}

.diff-card.active {
  border: none;
  background: radial-gradient(circle at 60% 0%, rgba(208, 69, 255, 0.35) 0%, #4F0A8433 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 20px rgba(144, 77, 189, 0.25);
  position: relative;
}

.diff-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(270deg, #904DBD 0%, #E88BFF 25%, #F9B2FF 50.2%, #E88BFF 87.5%, #904DBD 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

.diff-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.diff-card.active .diff-icon {
  transform: scale(1.15);
}

.diff-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.diff-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.diff-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Radio 圆环 */
.diff-radio {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.diff-card:hover .diff-radio {
  border-color: rgba(168, 85, 247, 0.6);
}

.diff-card.active .diff-radio {
  border-color: #FF67D8;
  background: rgba(79, 10, 132, 0.4);
}

.radio-inner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FF67D8;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px rgba(255, 103, 216, 0.8);
}

.diff-card.active .radio-inner {
  transform: scale(1);
}

.guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.btn-skip-guide {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: 'Source Han Sans CN', sans-serif;
  font-weight: 500;
}

.btn-skip-guide:hover {
  color: #ffffff;
}

.footer-nav-btns {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-guide-nav {
  width: 220px;
  height: 48px;
  border-radius: 30px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-family: 'Source Han Sans CN', sans-serif;
  line-height: 1;
  box-sizing: border-box;
}

.btn-guide-nav.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.btn-guide-nav.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-guide-nav.primary {
  background: linear-gradient(90deg, var(--neon-purple) 0%, var(--neon-pink) 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.4);
}

.btn-guide-nav.primary:hover {
  box-shadow: 0 4px 24px rgba(168, 85, 247, 0.6);
  transform: translateY(-2px);
}

.btn-guide-nav svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* 全屏游戏预览遮罩层 (维持宽高比) */
.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 11, 20, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fullscreen-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 全屏顶部控制条 */
.fullscreen-header {
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  z-index: 10;
}

.fullscreen-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fs-live-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

.fs-title-text {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.3px;
}

.fullscreen-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fs-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fs-control-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-1px);
}

.fs-control-btn.exit-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.3) 100%);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.fs-control-btn.exit-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(220, 38, 38, 0.5) 100%);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.6);
}

.fs-icon {
  width: 16px;
  height: 16px;
}

/* 全屏主体视图与维持宽高比关键 */
.fullscreen-body {
  flex: 1;
  width: 100%;
  height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.fullscreen-viewport-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 维持 9:16 或 16:9 宽高比的核心容器 */
.fullscreen-aspect-stage {
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(121, 39, 246, 0.3);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 竖屏模式：维持 9:16 宽高比 */
.fullscreen-aspect-stage.portrait {
  width: min(calc(100vw - 40px), calc((100vh - 100px) * 9 / 16));
  height: min(calc(100vh - 100px), calc((100vw - 40px) * 16 / 9));
  aspect-ratio: 9 / 16;
}

/* 横屏模式：维持 16:9 宽高比 */
.fullscreen-aspect-stage.landscape {
  width: min(calc(100vw - 40px), calc((100vh - 100px) * 16 / 9));
  height: min(calc(100vh - 100px), calc((100vw - 40px) * 9 / 16));
  aspect-ratio: 16 / 9;
}

.fullscreen-game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  display: block;
}