/* ========== 微信风格聊天界面 ========== */

/* ========== 全局设计变量（P2 配色/动效统一） ========== */
:root {
  /* 反诈品牌色 */
  --brand-blue: #00A0E9;
  --brand-cyan: #00d4ff;
  --brand-green: #07C160;
  --brand-green-deep: #05a34f;
  /* 微信拟真色（聊天区保持不动） */
  --wx-bubble-out: #95EC69;
  /* 场景背景白罩透明度（越低场景图越清晰，聊天文字可读性靠深色旁白胶囊保障） */
  --scene-overlay: rgba(255, 255, 255, 0.28);
  /* 功能色 */
  --danger: #FF3B30;
  --warning: #FF9500;
  --gold: #FFB800;
  /* 文字灰阶 */
  --text-sub: #888;
  --text-faint: #999;
  /* 动效 */
  --dur-fast: 0.15s;
  --dur: 0.25s;
  --ease-out: cubic-bezier(0.2, 0.9, 0.3, 1);
  /* 字体层级 */
  --fs-hero: 22px;
  --fs-lg: 17px;
  --fs-md: 15px;
  --fs-sm: 13px;
  --fs-xs: 11px;
}

/* ========== 布局兜底（不依赖 Tailwind CDN） ==========
   index.html 的 body 居中/背景依赖 jsdelivr 的 Tailwind。
   微信内浏览器或白名单网络下 CDN 被拦时，preflight（box-sizing）
   与 body 工具类会全部失效，导致手机壳 383px 宽、无居中、横向溢出。
   这里提供等价兜底：Tailwind 正常加载时其类选择器（.flex 等）优先级更高，
   加载失败时由元素规则接管。 */
*, ::before, ::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #111827;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 手机壳容器 */
.phone-container {
  width: 375px;
  height: 667px;
  background: #EDEDED;
  border-radius: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  border: 4px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 手机全屏适配：≤480px 的窄屏（主流手机竖屏）去掉手机壳边框，
   让游戏铺满整个屏幕，避免 360px 宽手机横向溢出、按钮跑到屏幕外 */
@media (max-width: 480px) {
  .phone-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border-width: 0;
    box-shadow: none;
  }
}


/* ========== 微信顶部导航栏 ========== */
.wechat-header {
  background: #EDEDED;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #D6D6D6;
  flex-shrink: 0;
  height: 44px;
}

.wechat-header-back {
  font-size: 20px;
  color: #000;
  cursor: pointer;
}

.wechat-header-title {
  font-size: var(--fs-lg);
  font-weight: 500;
  color: #000;
  flex: 1;
  text-align: center;
}

.wechat-header-more {
  font-size: 20px;
  color: #000;
  cursor: pointer;
}

/* 线索本按钮 */
.wechat-header-clue {
  font-size: 15px;
  color: #000;
  cursor: pointer;
  position: relative;
  padding: 2px 4px;
}

.clue-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #FF3B30;
  color: #FFF;
  font-size: 10px;
  line-height: 14px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  text-align: center;
  padding: 0 3px;
}

/* 线索本抽屉 */
.clue-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 48px;
  z-index: 90;
  background: #F7F7F7;
  display: flex;
  flex-direction: column;
  animation: drawerUp 0.25s ease-out;
}

.clue-drawer.hidden {
  display: none;
}

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

.clue-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-blue);
  background: #FFF;
  border-bottom: 1px solid #E5E5E5;
}

.clue-close {
  border: none;
  background: #EFEFF4;
  color: #555;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.clue-close:hover {
  background: #E3F3FF;
  color: var(--brand-blue);
}

.clue-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}

.clue-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFF;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.clue-icon {
  font-size: 20px;
  line-height: 22px;
}

.clue-text {
  font-size: var(--fs-sm);
  color: #333;
  line-height: 1.55;
}

.clue-empty {
  color: #999;
  font-size: 13px;
  text-align: center;
  padding: 40px 20px;
  line-height: 1.7;
}

.clue-drawer-tip {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--brand-blue);
  background: #EAF7FF;
  border-top: 1px solid #E5E5E5;
}

/* 新手引导 */
.tutorial-overlay {
  position: absolute;
  inset: 0;
  z-index: 96;
  background: rgba(10, 12, 26, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tutorial-overlay.hidden {
  display: none;
}

.tutorial-box {
  background: #FFF;
  border-radius: 16px;
  padding: 26px 22px 22px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.tutorial-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-blue);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.tutorial-list {
  text-align: left;
  margin-bottom: 18px;
}

.tutorial-item {
  font-size: var(--fs-sm);
  color: #444;
  line-height: 1.65;
  padding: 6px 0;
  border-bottom: 1px dashed #EEE;
}

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

.tutorial-btn {
  width: 100%;
  background: linear-gradient(135deg, #00d68f 0%, var(--brand-green) 58%, var(--brand-green-deep) 100%);
  color: #FFF;
  border: none;
  border-radius: 22px;
  padding: 11px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(7, 193, 96, 0.35);
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.tutorial-btn:active {
  transform: scale(0.98);
}

/* 结算页：结局标题 + 个性化点评 + 线索汇总 */
.verdict-title {
  font-size: 17px;
  font-weight: 700;
  color: #F5F5F7;
  margin-bottom: 6px;
}

.verdict-tips {
  font-size: 12px;
  color: #9aa7c7;
  line-height: 1.7;
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.clue-summary {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}

.clue-summary-title {
  font-size: 13px;
  font-weight: 600;
  color: #F5F5F7;
  margin-bottom: 8px;
}

.clue-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #C7CFE0;
  line-height: 1.55;
  padding: 4px 0;
}

.clue-summary-empty {
  font-size: 12px;
  color: #8A94AD;
  line-height: 1.6;
}

/* ========== 真实头像（图片 + emoji 兜底） ========== */
.msg-avatar,
.video-call-avatar {
  position: relative;
  overflow: hidden;
}

.avatar-emoji {
  line-height: 1;
}

.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-avatar .avatar-img {
  border-radius: inherit;
}

.video-call-avatar .avatar-img {
  border-radius: 50%;
}

/* ========== 聊天图片消息 ========== */
.chat-image-bubble {
  padding: 6px !important;
  max-width: 220px;
  overflow: hidden;
  cursor: zoom-in;
}

.chat-image-bubble .chat-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 4px;
  background: #F0F0F0;
}

.chat-image-caption {
  font-size: 12px;
  color: #888;
  padding: 6px 2px 2px;
  text-align: center;
}

.chat-image-bubble.img-missing {
  min-width: 150px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #F2F2F2;
}

.chat-image-bubble.img-missing .chat-image-caption {
  color: #999;
  font-weight: 500;
}

/* 图片放大查看 */
.image-zoom {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: zoomFade 0.2s ease-out;
}

.image-zoom img {
  max-width: 94%;
  max-height: 94%;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

@keyframes zoomFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== 场景真实背景（白色罩层 + 图片 + 渐变兜底） ========== */
.phone-container.scene-campus .message-area {
  background-color: #dceaf7;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/campus.webp'),
    radial-gradient(circle at 15% 20%, rgba(10, 132, 255, 0.12) 0, transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(52, 199, 89, 0.12) 0, transparent 40%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-dorm .message-area {
  background-color: #f3e7d3;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/dorm.webp'),
    radial-gradient(circle at 80% 15%, rgba(255, 159, 10, 0.14) 0, transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 60%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-classroom .message-area {
  background-color: #e2ecf6;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/classroom.webp'),
    linear-gradient(180deg, rgba(10, 132, 255, 0.08), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(10, 132, 255, 0.04) 3px 4px);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-shuadan .message-area {
  background-color: #e8dcd6;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/shuadan.webp'),
    radial-gradient(circle at 20% 80%, rgba(255, 59, 48, 0.16) 0, transparent 40%),
    linear-gradient(160deg, rgba(120, 20, 20, 0.10), transparent 55%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-call .message-area {
  background-color: #d8e6ee;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/call.webp'),
    radial-gradient(circle at 80% 20%, rgba(48, 176, 199, 0.14) 0, transparent 40%),
    linear-gradient(180deg, rgba(0, 150, 180, 0.08), transparent 55%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-romance .message-area {
  background-color: #f3dfe4;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/romance.webp'),
    radial-gradient(circle at 75% 25%, rgba(255, 55, 95, 0.14) 0, transparent 40%),
    radial-gradient(circle at 20% 85%, rgba(191, 90, 242, 0.10) 0, transparent 35%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-cafe .message-area {
  background-color: #f5ead9;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/cafe.webp'),
    radial-gradient(circle at 75% 25%, rgba(255, 159, 10, 0.14) 0, transparent 40%),
    radial-gradient(circle at 20% 85%, rgba(191, 90, 242, 0.08) 0, transparent 35%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-loan .message-area {
  background-color: #eee0c9;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/loan.webp'),
    radial-gradient(circle at 25% 20%, rgba(255, 149, 0, 0.18) 0, transparent 40%),
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(200, 90, 0, 0.05) 8px 9px);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-refund .message-area {
  background-color: #e4ecf3;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/refund.webp'),
    radial-gradient(circle at 80% 20%, rgba(10, 132, 255, 0.13) 0, transparent 40%),
    linear-gradient(180deg, rgba(10, 132, 255, 0.06), transparent 55%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-bank .message-area {
  background-color: #e6d5d0;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/bank.webp'),
    radial-gradient(circle at 50% 30%, rgba(255, 59, 48, 0.18) 0, transparent 45%),
    linear-gradient(180deg, rgba(150, 20, 20, 0.10), transparent 60%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}

.phone-container.scene-ghost .message-area {
  background-color: #d9d7e2;
  background-image:
    linear-gradient(var(--scene-overlay), var(--scene-overlay)),
    url('../assets/scenes/ghost.webp'),
    radial-gradient(circle at 70% 30%, rgba(94, 92, 230, 0.16) 0, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(40, 30, 90, 0.14) 0, transparent 35%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, 0 0, 0 0;
}


/* ========== 状态栏（游戏内） ========== */
.status-bar {
  background: #F7F7F7;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #888;
  flex-shrink: 0;
  border-bottom: 1px solid #E5E5E5;
}

.status-bar span {
  display: flex;
  align-items: center;
  gap: 4px;
}

#day-display {
  color: var(--brand-blue);
  font-weight: 600;
}

#money-display {
  color: var(--gold);
  font-weight: 600;
}

#health-display {
  color: var(--brand-green);
  font-weight: 600;
}


/* ========== 聊天背景 ========== */
.message-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #EDEDED;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}


/* ========== 消息气泡 ========== */
/* ========== 场景化聊天背景 ========== */
.phone-container .message-area {
  transition: background-color 0.8s ease;
}

/* 场景标签（地点+时间） */
.scene-tag {
  background: rgba(0, 0, 0, 0.06);
  color: #666;
  font-size: var(--fs-xs);
  text-align: center;
  padding: 3px 0;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.scene-tag.hidden {
  display: none;
}

.msg-animate {
  animation: msgIn 0.3s ease-out;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
}

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

/* 头像 */
.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #CCC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.msg-avatar.system {
  background: transparent;
  font-size: 14px;
}

/* 消息内容容器 */
.msg-content {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.msg-content.left {
  align-items: flex-start;
}

.msg-content.right {
  align-items: flex-end;
}

.msg-content.center {
  align-items: center;
  max-width: 90%;
}

/* 说话人名称 */
.msg-speaker {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
  margin-left: 4px;
}

/* 消息气泡 */
.msg-bubble {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: var(--fs-md);
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 对方消息 - 白色气泡 */
.msg-bubble.left {
  background: #FFF;
  color: #000;
  border-top-left-radius: 2px;
}

.msg-bubble.left::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #FFF;
}

/* 自己消息 - 绿色气泡 */
.msg-bubble.right {
  background: #95EC69;
  color: #000;
  border-top-right-radius: 2px;
}

.msg-bubble.right::before {
  content: '';
  position: absolute;
  right: -6px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid #95EC69;
}

/* 系统消息 */
.msg-bubble.system {
  background: rgba(15, 20, 35, 0.42);
  color: #FFF;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  padding: 5px 12px;
  border-radius: 10px;
}


/* ========== 选项按钮（微信风格） ========== */
.choice-area {
  background: #F7F7F7;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
  flex-shrink: 0;
  border-top: 1px solid #E5E5E5;
}

.choice-btn {
  width: 100%;
  padding: 12px 16px;
  background: #FFF;
  border: 1px solid #E5E5E5;
  border-radius: 6px;
  color: #333;
  font-size: var(--fs-md);
  text-align: left;
  cursor: pointer;
  transition: all var(--dur-fast) ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.choice-btn:hover {
  background: #F5F5F5;
  border-color: rgba(0, 160, 233, 0.45);
}

.choice-btn:active {
  background: #E8E8E8;
  transform: scale(0.98);
}


/* ========== 开始画面 ========== */
.start-screen {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  z-index: 100;
  overflow: hidden;
}

.start-screen.hidden {
  display: none;
}

/* 场景底图：模糊压暗 + 缓慢缩放 */
.start-screen::before {
  content: '';
  position: absolute;
  inset: -6%;
  /* 封面方案 B：用户即梦生成的封面插画（assets/cover.webp，768×1365） */
  background: url('../assets/cover.webp') center / cover no-repeat;
  filter: blur(1.5px) brightness(0.55) saturate(0.85);
  animation: coverZoom 18s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes coverZoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* 蓝绿氛围光晕 + 上下压暗 */
.start-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 12%, rgba(0, 212, 255, 0.20), transparent 55%),
    radial-gradient(120% 90% at 50% 88%, rgba(7, 193, 96, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(4, 9, 22, 0.78), rgba(4, 9, 22, 0.28) 42%, rgba(4, 9, 22, 0.86));
  z-index: 1;
}

.cover-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 18px;
}

.start-screen h1 {
  font-size: 42px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: 5px;
  background: linear-gradient(180deg, #FFFFFF 18%, #8FE8FF 62%, #00d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(0, 212, 255, 0.45)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
  animation: coverTitleIn 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes coverTitleIn {
  from { opacity: 0; transform: translateY(-18px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cover-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 2px;
  margin-bottom: 20px;
  animation: coverFadeIn 0.8s ease-out 0.15s both;
}

.cover-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 30px;
  animation: coverFadeIn 0.8s ease-out 0.3s both;
}

.cover-badge {
  font-size: 11px;
  color: #BFF3FF;
  background: rgba(0, 212, 255, 0.10);
  border: 1px solid rgba(0, 212, 255, 0.38);
  border-radius: 999px;
  padding: 4px 11px;
  letter-spacing: 1px;
  white-space: nowrap;
}

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

.start-btn {
  background: linear-gradient(135deg, #00d68f 0%, #07C160 58%, #05a34f 100%);
  color: #FFF;
  border: none;
  border-radius: 12px;
  padding: 15px 54px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 3px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(7, 193, 96, 0.4);
  animation: coverBtnIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.42s both, btnBreath 2.4s ease-in-out 1.2s infinite;
}

.start-btn:hover {
  background: #06AD56;
}

.start-btn:active {
  background: #059A4C;
  transform: scale(0.97);
}

@keyframes coverBtnIn {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes btnBreath {
  0%, 100% { box-shadow: 0 6px 22px rgba(7, 193, 96, 0.35); }
  50% { box-shadow: 0 8px 36px rgba(7, 193, 96, 0.68); }
}

/* 氛围气泡 */
.cover-ambient {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.cover-bubble {
  position: absolute;
  max-width: 66%;
  background: rgba(255, 255, 255, 0.94);
  color: #333;
  font-size: 12px;
  line-height: 1.5;
  padding: 9px 13px;
  border-radius: 10px 10px 10px 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  opacity: 0;
  animation: bubbleRise 7.5s ease-in-out infinite;
}

.cover-bubble.b1 { left: 9%; bottom: 20%; animation-delay: 1.2s; }
.cover-bubble.b2 { right: 9%; bottom: 13%; animation-delay: 3.2s; border-radius: 10px 10px 2px 10px; display: flex; gap: 4px; padding: 12px 14px; }
.cover-bubble.b3 { left: 12%; bottom: 6%; animation-delay: 5s; }

@keyframes bubbleRise {
  0% { opacity: 0; transform: translateY(26px) scale(0.94); }
  8% { opacity: 1; transform: translateY(0) scale(1); }
  76% { opacity: 1; }
  90% { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 0; transform: translateY(-12px); }
}

/* 底部小字：版本号 + 调试入口 */
.cover-version {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 1px;
  z-index: 3;
}

.cover-debug {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  letter-spacing: 1px;
  z-index: 3;
}

.cover-debug:hover {
  color: rgba(255, 255, 255, 0.9);
}


/* ========== 红包样式 ========== */
.red-packet {
  cursor: pointer;
  position: relative;
  min-width: 220px;
  max-width: 260px;
  margin: 0 auto;
  text-align: center;
  animation: packetBounce 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.16), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 8px),
    linear-gradient(135deg, #F54B4B 0%, #E03232 45%, #C42323 100%);
  border-radius: 12px;
  padding: 18px 22px 16px;
  color: #FFF;
  border: 1px solid rgba(255, 214, 102, 0.35);
  box-shadow: 0 4px 16px rgba(196, 35, 35, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.red-packet .rp-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #FFD54F;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

@keyframes packetBounce {
  from {
    transform: scale(0.7) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.red-packet .rp-open {
  display: none;
}

.red-packet.closed .rp-amount {
  display: none;
}

.red-packet.closed .rp-open {
  display: inline-block;
  margin: 10px auto 6px;
  width: 52px;
  height: 52px;
  line-height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #FFF3C4, #F6C244 60%, #D99A1F);
  color: #C5231F;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.7);
  border: 2px solid #FCE4A1;
}

.red-packet.opened {
  animation: packetOpen 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes packetOpen {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.red-packet .rp-amount {
  font-size: 34px;
  font-weight: 700;
  margin: 10px 0 4px;
  color: #FFE9B0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.red-packet .rp-label {
  font-size: 12px;
  opacity: 0.88;
}

.red-packet .rp-foot {
  margin-top: 8px;
  font-size: 11px;
  color: #FFE9B0;
  opacity: 0.9;
  border-top: 1px dashed rgba(255, 255, 255, 0.35);
  padding-top: 8px;
}

.red-packet.opened .rp-open,
.red-packet.opened .rp-foot {
  display: none;
}


/* ========== 转账样式 ========== */
.transfer-event {
  background: #FFF;
  border-radius: 12px;
  padding: 14px 24px 12px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  max-width: 260px;
  margin: 0 auto;
  animation: transferIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes transferIn {
  from {
    transform: translateY(-16px) scale(0.92);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.te-title {
  font-size: 13px;
  color: #8E8E93;
}

.transfer-event .te-amount {
  font-size: 30px;
  font-weight: 700;
  margin: 6px 0;
}

.transfer-event .te-amount.negative {
  color: #FF3B30;
}

.transfer-event .te-amount.positive {
  color: #000;
}

.te-note {
  font-size: 12px;
  color: #999;
}

.te-btn {
  display: block;
  width: 100%;
  margin: 12px 0 4px;
  padding: 9px 0;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  background: #07C160;
  color: #FFF;
  cursor: pointer;
}

.transfer-event.out .te-btn {
  background: #F2F3F5;
  color: #B0B0B0;
  cursor: default;
}

.te-btn.done {
  background: #07C160;
}

.te-line {
  font-size: 11px;
  color: #C7C7CC;
  border-top: 1px dashed #E5E5E5;
  padding-top: 8px;
  margin-top: 6px;
}


/* ========== 状态变更提示（toast） ========== */
.stat-toasts {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  width: 100%;
}

.stat-toast {
  background: rgba(15, 20, 40, 0.92);
  color: #FFF;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 1.5s forwards;
  white-space: nowrap;
}

.stat-toast.neg {
  border: 1px solid rgba(255, 59, 48, 0.6);
}

.stat-toast.pos {
  border: 1px solid rgba(52, 199, 89, 0.6);
}

.stat-toast.gold {
  border: 1px solid rgba(255, 214, 10, 0.7);
  color: #FFD60A;
}

@keyframes toastIn {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateY(-8px);
    opacity: 0;
  }
}


/* ========== 视频通话面板 ========== */
.video-call-panel {
  position: sticky;
  top: 0;
  z-index: 20;
  /* 修复：message-area 是纵向 flex 容器，面板带 overflow:hidden 时
     自动最小高度为 0，消息一多会被 flex-shrink 压成一条（画面被裁）。
     禁止压缩，让面板始终保持完整高度，滚动时靠 sticky 吸顶。 */
  flex-shrink: 0;
  background: linear-gradient(165deg, #0d1424 0%, #17243d 55%, #0e1a2c 100%);
  border-radius: 14px;
  border: 1px solid rgba(0, 212, 255, 0.4);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  padding: 10px 12px 12px;
  color: #FFF;
  margin-bottom: 12px;
  animation: callIn 0.35s ease-out;
  overflow: hidden;
}

@keyframes callIn {
  from {
    transform: translateY(-14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.video-call-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.video-call-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}

.video-call-status {
  font-size: 11px;
  color: #8ED1FF;
  display: flex;
  align-items: center;
  gap: 5px;
}

.vc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF453A;
  animation: vcPulse 1s ease-in-out infinite;
}

.vc-status-dot.connected {
  background: #30D158;
  animation: none;
}

@keyframes vcPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.video-call-timer {
  font-variant-numeric: tabular-nums;
  color: #FFF;
}

/* 通话画面 */
.video-call-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #101c30;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.video-call-feed {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.video-call-feed .avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 特效层默认隐藏 */
.video-call-screen .vc-scanlines,
.video-call-screen .vc-grid,
.video-call-screen .vc-noise,
.video-call-screen .vc-slices,
.video-call-screen .vc-rgb,
.video-call-screen .vc-signal,
.video-call-screen .vc-hint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

/* —— 轻微 AI 档（露馅前）：扫描线 + 淡网格 + 偶尔信号弱 —— */
.video-call-tier-ai .vc-scanlines {
  opacity: 0.35;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.14) 3px 4px);
}

.video-call-tier-ai .vc-grid {
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(0, 255, 210, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 210, 0.3) 1px, transparent 1px);
  background-size: 34px 34px;
  animation: gridPulse 2.4s ease-in-out infinite;
}

.video-call-tier-ai .vc-signal {
  animation: signalBlink 7s ease-in-out infinite;
}

.video-call-tier-ai.vc-intense .vc-scanlines { opacity: 0.5; }
.video-call-tier-ai.vc-intense .vc-slices { opacity: 0.5; }
.video-call-tier-ai.vc-intense .vc-rgb { opacity: 0.45; }

/* —— 强烈故障档（露馅后）：抖动 + 噪点 + 撕裂 + RGB 偏移 + 常驻信号条 —— */
.video-call-tier-glitch .video-call-screen {
  animation: glitchShake 0.22s steps(2) infinite;
}

.video-call-tier-glitch .vc-scanlines {
  opacity: 0.55;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
}

.video-call-tier-glitch .vc-grid {
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(0, 255, 210, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 59, 48, 0.3) 1px, transparent 1px);
  background-size: 26px 26px;
  animation: gridPulse 0.8s steps(2) infinite;
}

.video-call-tier-glitch .vc-noise {
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  animation: noiseJitter 0.15s steps(2) infinite;
}

.video-call-tier-glitch .vc-slices {
  opacity: 0.6;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 7px,
    rgba(0, 255, 200, 0.10) 7px 10px,
    rgba(255, 59, 48, 0.08) 10px 14px,
    transparent 14px 21px
  );
  animation: sliceJitter 0.18s steps(2) infinite;
}

.video-call-tier-glitch .vc-rgb {
  opacity: 0.65;
  background:
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(0, 255, 255, 0.18) 72%, transparent 82%),
    radial-gradient(circle at 32% 42%, rgba(255, 0, 80, 0.10), transparent 40%),
    radial-gradient(circle at 68% 60%, rgba(0, 255, 200, 0.10), transparent 40%);
  animation: rgbJitter 0.25s steps(2) infinite;
}

.video-call-tier-glitch .vc-signal {
  opacity: 1;
}

.video-call-tier-glitch .video-call-feed .avatar-img {
  filter: contrast(1.5) saturate(1.6) hue-rotate(-8deg);
}

/* 信号提示条 */
.vc-signal {
  inset: auto 8px 8px 8px !important;
  top: auto !important;
  text-align: center;
  font-size: 11px;
  color: #FFD60A;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 0;
  border-radius: 6px;
}

@keyframes signalBlink {
  0%, 86%, 100% { opacity: 0; }
  88%, 95% { opacity: 1; }
}

/* 画面内的观察提示（AI换脸破绽） */
.vc-hint {
  inset: auto auto 10px 10px !important;
  top: auto !important;
  right: auto !important;
  width: max-content;
  max-width: 78%;
  font-size: 11px;
  color: #E6F7FF;
  background: rgba(8, 16, 32, 0.72);
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 8px;
  padding: 4px 9px;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
}

.vc-hint.show {
  opacity: 1 !important;
  transform: translateY(0);
}

/* 通话控制条 */
.video-call-controls {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 10px;
}

.video-call-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  color: #FFF;
  transition: transform 0.12s ease, background 0.12s ease;
}

.video-call-btn:active {
  transform: scale(0.92);
}

.video-call-btn.active {
  background: rgba(0, 212, 255, 0.25);
}

.video-call-btn.end {
  background: #FF3B30;
  border-color: #FF3B30;
}

/* 故障动画关键帧 */
@keyframes gridPulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.32; }
}

@keyframes noiseJitter {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-1px, 1px); }
  100% { transform: translate(1px, -1px); }
}

@keyframes sliceJitter {
  0% { transform: translateX(0); }
  25% { transform: translateX(2px); }
  50% { transform: translateX(-2px); }
  75% { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

@keyframes rgbJitter {
  0% { transform: translate(0, 0); }
  50% { transform: translate(1px, 0); }
  100% { transform: translate(-1px, 0); }
}

@keyframes glitchShake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, -1px); }
  100% { transform: translate(0, 0); }
}


/* ========== 章节转场页 ========== */
.chapter-transition {
  position: absolute;
  inset: 0;
  z-index: 95;
  background:
    radial-gradient(circle at 50% 35%, rgba(0, 212, 255, 0.22), transparent 55%),
    linear-gradient(160deg, #070b1a 0%, #0e1630 55%, #070b1a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #FFF;
  overflow: hidden;
  animation: transitionIn 0.45s ease-out;
  cursor: pointer;
}

.chapter-transition::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 212, 255, 0.05) 2px 4px);
  animation: scanMove 2.4s linear infinite;
}

@keyframes scanMove {
  from { transform: translateY(-100%); }
  to { transform: translateY(100%); }
}

.chapter-transition .ct-day {
  font-size: 58px;
  font-weight: 900;
  color: #00d4ff;
  text-shadow: 0 0 24px rgba(0, 212, 255, 0.7);
  letter-spacing: 6px;
}

.chapter-transition .ct-title {
  font-size: 22px;
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: 3px;
}

.chapter-transition .ct-desc {
  font-size: 13px;
  color: #9aa7c7;
  margin-top: 12px;
  max-width: 80%;
  line-height: 1.7;
}

.chapter-transition .ct-hint {
  position: absolute;
  bottom: 36px;
  font-size: 12px;
  color: #556;
  letter-spacing: 2px;
  animation: hintBlink 1.2s ease-in-out infinite alternate;
}

@keyframes hintBlink {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.chapter-transition.fade-out {
  animation: transitionOut 0.4s ease-in forwards;
}

@keyframes transitionOut {
  to {
    transform: scale(1.05);
    opacity: 0;
  }
}


/* ========== 屏幕反馈闪光 ========== */
.screen-flash {
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
}

.screen-flash.flash-red {
  background: radial-gradient(circle at 50% 50%, rgba(255, 59, 48, 0.55), transparent 70%);
  animation: flashRed 0.55s ease-out;
}

@keyframes flashRed {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

.screen-flash.flash-green {
  background: radial-gradient(circle at 50% 50%, rgba(52, 199, 89, 0.5), transparent 70%);
  animation: flashRed 0.55s ease-out;
}

.screen-flash.flash-gold {
  background: radial-gradient(circle at 50% 50%, rgba(255, 214, 10, 0.5), transparent 70%);
  animation: flashRed 0.55s ease-out;
}


/* ========== 倒计时条（屏幕共享/转账拦截关卡） ========== */
.countdown-bar {
  background: #101018;
  padding: 8px 12px;
  flex-shrink: 0;
  border-top: 2px solid rgba(255, 59, 48, 0.35);
  position: relative;
  z-index: 5;
}

.countdown-bar.hidden {
  display: none;
}

.countdown-label {
  font-size: 12px;
  color: #ff3b30;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.countdown-num {
  font-size: 22px;
  font-weight: 800;
  color: #ff3b30;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
}

.countdown-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.countdown-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00d4ff 0%, #07C160 100%);
  border-radius: 4px;
}

.countdown-bar.danger {
  animation: countdownPulse 0.5s ease-in-out infinite alternate;
}

.countdown-bar.danger .countdown-fill {
  background: linear-gradient(90deg, #ff9f0a 0%, #ff3b30 100%);
}

@keyframes countdownPulse {
  from {
    background: rgba(255, 59, 48, 0.10);
  }
  to {
    background: rgba(255, 59, 48, 0.28);
  }
}


/* ========== 结算页 ========== */
.settlement-screen {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 22, 0.95);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}

.settlement-content {
  background: linear-gradient(160deg, #1a1f3a 0%, #0f1428 100%);
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.25);
  padding: 24px 20px;
  max-width: 360px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  color: #eee;
  text-align: center;
}

.settlement-title {
  color: #00d4ff;
  font-size: var(--fs-hero);
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 16px;
}

.radar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.radar-container canvas {
  max-width: 100%;
  animation: radarIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes radarIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 4px;
}

.stat-label {
  display: block;
  font-size: var(--fs-xs);
  color: #888;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #00d4ff;
}

.stat-value.positive {
  color: #34C759;
}

.stat-value.negative {
  color: #ff3b30;
}

.verdict-box {
  background: rgba(0, 212, 255, 0.08);
  border: 1px dashed rgba(0, 212, 255, 0.4);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.verdict-grade {
  font-size: 32px;
  font-weight: 800;
  color: #ffd60a;
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(255, 214, 10, 0.5);
}

.verdict-text {
  font-size: 13px;
  line-height: 1.7;
  color: #ccc;
}

.settlement-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.settle-btn {
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.settle-btn:active {
  transform: scale(0.98);
}

.settle-btn.primary {
  background: linear-gradient(135deg, #00d4ff 0%, #0090ff 100%);
  color: #fff;
}

.settle-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #eee;
}

.settle-btn.link {
  background: transparent;
  color: #888;
}



/* ========== 复盘回放 ========== */
.replay-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 22, 0.95);
  z-index: 998;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.replay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #1a1f3a;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 10px 10px 0 0;
}

.replay-title {
  color: #00d4ff;
  font-size: 16px;
  font-weight: 700;
}

.replay-speed {
  color: #ffd60a;
  font-size: 14px;
  font-weight: 700;
}

.replay-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 15px;
}

.replay-content {
  flex: 1;
  overflow-y: auto;
  background: #12162b;
  border-left: 1px solid rgba(0, 212, 255, 0.25);
  border-right: 1px solid rgba(0, 212, 255, 0.25);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.replay-event {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
}

.replay-event.error {
  border-color: rgba(255, 59, 48, 0.6);
  background: rgba(255, 59, 48, 0.1);
}

.replay-node {
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}

.replay-choice {
  font-size: 15px;
  color: #eee;
  margin-bottom: 4px;
}

.replay-error-mark {
  display: inline-block;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 4px;
}

.replay-time {
  font-size: 11px;
  color: #666;
}

.replay-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(0, 212, 255, 0.25);
  border-right: 1px solid rgba(0, 212, 255, 0.25);
}

.replay-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #00d4ff, #07C160);
  transition: width 0.3s ease;
}

.replay-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: #1a1f3a;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 0 0 10px 10px;
}

.replay-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 44px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
}

.replay-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.replay-complete {
  text-align: center;
  padding: 30px 0;
  color: #ccc;
}

.complete-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.complete-text {
  font-size: 18px;
  font-weight: 700;
  color: #00d4ff;
  margin-bottom: 8px;
}

.complete-stats {
  font-size: 13px;
  color: #888;
  line-height: 1.8;
}


/* ========== 海报预览 ========== */
.poster-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 22, 0.95);
  z-index: 997;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}

.poster-content {
  background: #14182e;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 12px;
  padding: 14px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.poster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #00d4ff;
  font-size: 15px;
  font-weight: 700;
  padding: 4px 0 10px;
}

.poster-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 15px;
}

.poster-canvas-container {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.poster-canvas-container canvas {
  width: 100%;
  max-width: 340px;
  height: auto;
}

.poster-tips {
  font-size: 12px;
  color: #888;
  margin: 10px 0;
}

.poster-save-btn {
  width: 100%;
  background: linear-gradient(135deg, #00d4ff 0%, #0090ff 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}


/* ========== 滚动条美化 ========== */
.message-area::-webkit-scrollbar {
  width: 4px;
}

.message-area::-webkit-scrollbar-track {
  background: transparent;
}

.message-area::-webkit-scrollbar-thumb {
  background: #CCC;
  border-radius: 2px;
}

.message-area::-webkit-scrollbar-thumb:hover {
  background: #999;
}


/* ========== P1 微信拟真细节 ========== */

/* 消息时间分隔线 */
.msg-time-divider {
  align-self: center;
  font-size: 11px;
  color: #FFF;
  background: rgba(0, 0, 0, 0.28);
  padding: 2px 10px;
  border-radius: 9px;
  margin: 0 auto;
  flex-shrink: 0;
}

/* 已读 / 未读 */
.msg-read {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.35);
  vertical-align: 1px;
  user-select: none;
  -webkit-user-select: none;
}

.msg-read.read {
  color: rgba(0, 0, 0, 0.5);
}

/* 图片气泡内的已读状态：右下角半透明小标 */
.chat-image-bubble .msg-read {
  position: absolute;
  right: 10px;
  bottom: 8px;
  margin-left: 0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
}

/* 长按防选中 / 防双击缩放 */
.msg-bubble {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* “对方正在输入…” */
.typing-row {
  gap: 8px;
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 54px;
  padding: 13px 14px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #B0B0B0;
  animation: typingBlink 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBlink {
  0%, 60%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* 图片缩略图九宫格 */
.chat-image-grid {
  display: grid;
  gap: 3px;
  width: 100%;
}

.chat-image-grid[data-count="1"] {
  grid-template-columns: 1fr;
  max-width: 170px;
}

.chat-image-grid[data-count="2"],
.chat-image-grid[data-count="3"] {
  grid-template-columns: repeat(3, 1fr);
  max-width: 220px;
}

.chat-image-grid[data-count="4"] {
  grid-template-columns: repeat(2, 1fr);
  max-width: 190px;
}

.chat-image-grid[data-count="5"],
.chat-image-grid[data-count="6"],
.chat-image-grid[data-count="7"],
.chat-image-grid[data-count="8"],
.chat-image-grid[data-count="9"] {
  grid-template-columns: repeat(3, 1fr);
  max-width: 220px;
}

.chat-image-cell {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: #F0F0F0;
  cursor: zoom-in;
}

.chat-image-cell .chat-image {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
}

.chat-image-cell.img-missing {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-image-cell.img-missing::after {
  content: '图片加载中';
  font-size: 11px;
  color: #999;
}

/* 单图缩略气泡更贴近微信的“缩略图”观感 */
.chat-image-bubble .chat-image {
  max-height: 200px;
}

/* 收藏标记 */
.fav-mark {
  position: absolute;
  top: 3px;
  right: 8px;
  color: #FFB300;
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 撤回提示 */
.recall-line {
  font-size: 12px;
  color: #FFF;
}

/* 长按菜单 */
.msg-menu-mask {
  position: absolute;
  inset: 0;
  z-index: 125;
  background: transparent;
}

.msg-menu-mask.hidden {
  display: none;
}

.msg-menu {
  position: absolute;
  z-index: 130;
  min-width: 168px;
  background: #FFF;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  padding: 4px 0;
  overflow: hidden;
  animation: menuPop 0.15s ease-out;
}

.msg-menu.hidden {
  display: none;
}

@keyframes menuPop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.msg-menu-item {
  padding: 11px 22px;
  font-size: 14px;
  color: #111;
  cursor: pointer;
  border-bottom: 1px solid #F0F0F0;
  white-space: nowrap;
  text-align: center;
}

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

.msg-menu-item:active {
  background: #F2F3F5;
}

.msg-menu-item.msg-menu-danger {
  color: #FA5151;
}

/* 通用提示浮标 */
.ui-toast {
  position: absolute;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: rgba(15, 20, 40, 0.92);
  color: #FFF;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  animation: toastIn 0.25s ease-out;
  max-width: 80%;
  text-align: center;
}

.ui-toast.hidden {
  display: none;
}


