/* 全局可用字体定义 */
@font-face {
  font-family: "SanJiHuaChaoTi-Cu-2";
  src: url("/static/fonts/SanJiHuaChaoTi-Cu-2.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "SanJiHuaChaoTi-Cu-2", system-ui, sans-serif;
  font-size: 20px;
  background: #f1f2f3 url("/static/img/aaa.png") center/cover fixed no-repeat;
}

/* 玻璃背景（不会影响透明度重叠）*/
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}

/* 面板样式 */
.panel {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  transition: all .25s ease-in-out;
}
#panelBody { font-size: 16px; }

#playVideo:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ════════════════════════════════
 输入框优化：防止字体撑爆布局
════════════════════════════════ */
input {
  font-size: 1rem;         /* 固定字号防止因字体加载后膨胀 */
  max-width: 100%;         /* 防止被撑出容器 */
  min-width: 0;            /* 防止 flex 布局挤压 */
}
@media (max-width: 600px) {
  input {
    font-size: 14px;       /* 移动端字体适配 */
  }
}

/* ════════════════════════════════
 Toast 全局提示适配
════════════════════════════════ */
.toast {
  font-size: 24px;
  padding: 18px 26px;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 0.85;
}
@media (max-width: 600px) {
  .toast {
    font-size: 15px;
    padding: 10px 14px;
    border-radius: 10px;
  }
}

/* 入场/退场动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.92); }
}
.animate-fade-in {
  animation: fadeIn 0.25s ease-out;
}
.animate-fade-out {
  animation: fadeOut 0.4s ease-in forwards;
}

/* ════════════════════════════════
 聊天消息布局增强
════════════════════════════════ */
.chat-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  max-width: 100%;
}

.chat-item.other {
  align-items: flex-start;
}
.chat-item.self {
  align-items: flex-end;
}

/* 昵称独立一行 */
.chat-sender-line {
  font-size: 15px;
  font-weight: bold;
  color: #004d80;
  margin-bottom: 2px;
  padding: 0 4px;
  white-space: nowrap;
}
.chat-sender-line.self-name {
  align-self: flex-end;
  margin-right: 6px;
}

/* 气泡内容 */
.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 19px;
  line-height: 1.5;
  background: #e8f4ff;
  border: 1px solid #c8e6ff;
  color: #333;
  max-width: 90vw;
  word-wrap: break-word;
}

/* 自己的消息色彩 */
.chat-item.self .chat-bubble {
  background: #cce5ff;
  border-color: #99d1ff;
  color: #0a3d62;
}

/* 透明聊天框 */
.glass-chat {
  background: rgba(255, 255, 255, 0) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #000;
}

/* 聊天内容在手机端自动缩小 */
@media (max-width: 600px) {
  .chat-bubble {
    font-size: 16px;
    padding: 8px 10px;
  }
  .chat-sender-line {
    font-size: 13px;
  }
}


/* ════════════════════════════════
 视频控制按钮布局移动端优化
════════════════════════════════ */
@media (max-width: 600px) {
  .btn-group {
    flex-direction: column !important;
  }
#tosModal {
  animation: fadeIn 0.25s ease-out;
}

#tosContent {
  background: #f9fafb;
  border-radius: 8px;
}

@media (max-width: 600px) {
  #tosModal .text-2xl { font-size: 20px; }
  #tosModal button { font-size: 14px; padding: 6px 12px; }
}
}
@keyframes fadeIn { from {opacity:.0; transform: translateY(-6px) scale(.98)} to {opacity:1; transform: translateY(0) scale(1)} }

