/* ========== 前端导航 - 聊天框风格 ========== */
:root {
  --bg: #f0f0f0;
  --bubble-bg: #ffffff;
  --bubble-shadow: 0 1px 2px rgba(0,0,0,0.06);
  --text: #333333;
  --text-secondary: #666666;
  --link: #1677ff;
  --link-hover: #4096ff;
  --header-bg: #ffffff;
  --radius: 18px;
  --radius-sm: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ========== 聊天容器 ========== */
.chat-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

/* ========== 顶部导航栏 ========== */
.chat-header {
  background: var(--header-bg);
  padding: 12px 16px;
  border-bottom: 1px solid #e8e8e8;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.chat-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--link);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-header-info h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.online-status {
  font-size: 12px;
  color: #52c41a;
  display: block;
}

.online-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #52c41a;
  border-radius: 50%;
  margin-right: 4px;
}

/* ========== 聊天内容区 ========== */
.chat-body {
  flex: 1;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 时间分割线 */
.chat-time-divider {
  text-align: center;
  margin: 8px 0;
}

.chat-time-divider span {
  font-size: 11px;
  color: #999;
  background: #e8e8e8;
  padding: 2px 12px;
  border-radius: 10px;
}

/* ========== 聊天气泡 ========== */
.chat-bubble {
  background: var(--bubble-bg);
  border-radius: var(--radius) var(--radius) var(--radius) 4px;
  padding: 12px 16px;
  box-shadow: var(--bubble-shadow);
  max-width: 85%;
  align-self: flex-start;
  word-break: break-word;
  transition: transform 0.15s;
  animation: bubbleIn 0.3s ease;
}

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

/* 系统消息气泡 */
.chat-bubble.system-bubble {
  background: #f7f7f7;
  color: var(--text-secondary);
  font-size: 13px;
}

/* 文字气泡 */
.chat-bubble.text-bubble {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

/* 图片气泡 */
.chat-bubble.image-bubble {
  padding: 8px;
  background: #fff;
}

.chat-bubble.image-bubble img {
  border-radius: 12px;
  display: block;
  max-width: 100%;
  height: auto;
}

/* ========== 链接样式 ========== */
.bubble-link {
  color: var(--link);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  display: inline-block;
  width: 100%;
}

.bubble-link:hover {
  color: var(--link-hover);
}

.bubble-link:active {
  opacity: 0.8;
}

/* 图片气泡中的链接 */
.image-bubble .bubble-link {
  display: block;
  line-height: 0;
}

/* ========== 底部 ========== */
.chat-footer {
  text-align: center;
  padding: 12px 16px 24px;
}

.chat-footer-text {
  font-size: 11px;
  color: #bbb;
}

/* ========== 视频卡片 ========== */
.chat-bubble.video-bubble {
  padding: 6px;
  background: transparent;
  box-shadow: none;
}

.video-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.video-card:hover { transform: scale(1.02); }

.video-card:active { transform: scale(0.98); }

.video-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  pointer-events: none;
  transition: background 0.2s;
}

.video-card:hover .video-play-btn {
  background: rgba(0, 0, 0, 0.7);
}

/* ========== 视频弹窗 ========== */
.video-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.video-modal-overlay.show {
  display: flex;
}

.video-modal {
  position: relative;
  width: 320px;
  max-width: 90vw;
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal-bg {
  position: absolute;
  top: -20px; left: -20px; right: -20px; bottom: -20px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(20px);
  z-index: 0;
}

.video-modal-body {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.video-modal-text {
  font-size: 15px;
  color: #fff;
  font-weight: 500;
  line-height: 1.8;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.video-modal-btn {
  background: #fff;
  color: #333;
  border: none;
  padding: 12px 36px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.video-modal-btn:hover { transform: scale(1.05); }
.video-modal-btn:active { transform: scale(0.97); }

/* ========== 浏览器打开提示遮罩 ========== */
.browser-prompt-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

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

.browser-prompt-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 28px 24px;
  width: 300px;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.browser-prompt-icon {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  background: #e6f4ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #1677ff;
}

.browser-prompt-title {
  font-size: 17px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.browser-prompt-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.8;
  margin-bottom: 6px;
}

.browser-prompt-sub {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.browser-prompt-steps {
  margin: 12px 0;
  font-size: 28px;
  color: #1677ff;
  letter-spacing: 6px;
}

.browser-prompt-close {
  margin-top: 18px;
  background: none;
  border: 1px solid #d9d9d9;
  color: #999;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.browser-prompt-close:hover {
  border-color: #1677ff;
  color: #1677ff;
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  .chat-wrapper { max-width: 100%; }
  .chat-bubble { max-width: 88%; }
  .chat-body { padding: 12px 12px 20px; }
}

/* ========== 气泡入场延迟动画 ========== */
.chat-body .chat-bubble:nth-child(2) { animation-delay: 0.05s; }
.chat-body .chat-bubble:nth-child(3) { animation-delay: 0.1s; }
.chat-body .chat-bubble:nth-child(4) { animation-delay: 0.15s; }
.chat-body .chat-bubble:nth-child(5) { animation-delay: 0.2s; }
.chat-body .chat-bubble:nth-child(6) { animation-delay: 0.25s; }
.chat-body .chat-bubble:nth-child(7) { animation-delay: 0.3s; }
.chat-body .chat-bubble:nth-child(8) { animation-delay: 0.35s; }
.chat-body .chat-bubble:nth-child(9) { animation-delay: 0.4s; }
.chat-body .chat-bubble:nth-child(10) { animation-delay: 0.45s; }
