/* 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
  background: #f5f6fa; 
  overflow-x: hidden; 
  line-height: 1.6;
}

/* 聊天容器 */
.chat-container {
  max-width: 800px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* 聊天头部 */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chat-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.chat-actions {
  display: flex;
  gap: 8px;
}

.chat-action-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #f8f9fa;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-action-btn:hover {
  background: #2a5caa;
  color: white;
  transform: translateY(-1px);
}

.chat-action-btn:active {
  transform: translateY(0);
}

.chat-action-btn i {
  font-size: 14px;
}

/* 清除缓存按钮特殊样式 */
#clear-cache {
  position: relative;
}

#clear-cache:hover {
  background: #ff6b6b;
  color: white;
}

#clear-cache:active {
  background: #ff5252;
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: #2a5caa;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(42, 92, 170, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top:hover {
  background: #1e488a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(42, 92, 170, 0.4);
}

.back-to-top:active {
  transform: translateY(0);
}

.back-to-top.show {
  display: flex;
}

.back-to-top i {
  font-size: 18px;
}

/* 消息列表 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
}

/* 自定义滚动条 */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 消息基础样式 */
.message {
  display: flex;
  max-width: 85%;
  align-items: flex-start;
  animation: messageSlideIn 0.3s ease-out;
}

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

/* 消息内容容器 */
.message-content {
  position: relative;
  line-height: 1.4;
  word-wrap: break-word;
  word-break: break-word;
}

/* 头像样式 */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin: 0 8px;
  border: 2px solid #f0f0f0;
}

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

/* 用户消息 */
.message.user {
  margin-left: auto;
  flex-direction: row;
}
.message.user .bubble {
  background: linear-gradient(135deg, #2a5caa, #1e488a);
  color: white;
  border-radius: 18px 0 18px 18px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(42, 92, 170, 0.2);
  position: relative;
  border: none;
}
.message.user .avatar {
  order: 2;
}
.message.user .message-content {
  order: 1;
}

/* AI消息 */
.message.ai {
  margin-right: auto;
  flex-direction: row;
}
.message.ai .bubble {
  background: white;
  color: #333;
  border-radius: 0 18px 18px 18px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #f0f0f0;
}

/* 统一所有消息类型的最大宽度 */
.markdown,
.card-message,
.music-message,
.message-image,
.video-message,
.button-card-message,
.bubble {
  max-width: 380px;
}

/* 纯文本消息气泡 */
.bubble {
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #f0f0f0;
  background: white;
  color: #333;
  word-wrap: break-word;
  word-break: break-word;
}

/* Markdown样式 */
.markdown {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: white;
  border-radius: 18px;
  padding: 16px;
  margin: 5px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #f0f0f0;
  overflow-x: auto;
}
.markdown h1, .markdown h2, .markdown h3 {
  margin: 16px 0 8px 0;
  color: #2a5caa;
  font-weight: 600;
}
.markdown h1 { font-size: 1.5em; }
.markdown h2 { font-size: 1.3em; }
.markdown h3 { font-size: 1.1em; }
.markdown p {
  margin-bottom: 12px;
}
.markdown a {
  color: #2a5caa;
  text-decoration: none;
  border-bottom: 1px solid rgba(42, 92, 170, 0.3);
  transition: all 0.2s;
  padding-bottom: 1px;
}
.markdown a:hover {
  border-bottom-color: #2a5caa;
  color: #1e488a;
}
.markdown pre {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  overflow-x: auto;
  border: 1px solid #e9ecef;
  font-size: 0.9em;
}
.markdown code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: #e83e8c;
}
.markdown pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.markdown blockquote {
  border-left: 4px solid #2a5caa;
  padding-left: 16px;
  margin: 16px 0;
  color: #666;
  font-style: italic;
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}
.markdown ul, .markdown ol {
  margin: 12px 0 12px 20px;
  padding-left: 0;
}
.markdown li {
  margin-bottom: 4px;
}
.markdown table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 0.9em;
}
.markdown th, .markdown td {
  border: 1px solid #ddd;
  padding: 8px 12px;
  text-align: left;
}
.markdown th {
  background: #f8f9fa;
  font-weight: 600;
}

/* 纯图片消息 */
.message-image {
  max-width: 280px;
  max-height: 320px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  height: auto;
  object-fit: cover;
}
.message-image:hover { 
  transform: scale(1.02); 
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* 视频消息 */
.video-message {
  position: relative;
  max-width: 280px;
  max-height: 320px;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.video-message:hover { 
  transform: scale(1.02); 
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.message-video {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
}

.video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.video-overlay i {
  color: white;
  font-size: 24px;
}

.video-message:hover .video-overlay {
  background: rgba(0, 0, 0, 0.8);
  transform: translate(-50%, -50%) scale(1.1);
}

/* 图文按钮卡片消息 */
.button-card-message {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e5e9;
  max-width: 400px;
  margin: 8px 0;
}

.button-card-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

.button-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.button-card-title {
  font-weight: 600;
  font-size: 16px;
  color: #333;
  margin-bottom: 4px;
}

.button-card-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
  margin-bottom: 12px;
}

.button-card-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button-card-btn {
  flex: 1;
  min-width: calc(50% - 4px);
  max-width: calc(50% - 4px);
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: white;
  background: #2a5caa;
  box-shadow: 0 2px 4px rgba(42, 92, 170, 0.2);
}

/* 单个按钮时占满整行 - 提高优先级 */
.button-card-btn:only-child {
  min-width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

/* 当按钮容器中只有一个按钮时，让按钮占满整行 */
.button-card-buttons:has(.button-card-btn:only-child) .button-card-btn {
  min-width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

/* 兼容不支持:has()的浏览器 */
.button-card-buttons.single-button .button-card-btn {
  min-width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

/* 单数按钮时，最后一个按钮占满整行 */
.button-card-btn:last-child:nth-child(odd) {
  min-width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

/* 兼容不支持:has()的浏览器 - 单数按钮布局 */
.button-card-buttons.odd-buttons .button-card-btn:last-child {
  min-width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

.button-card-btn:hover {
  background: #1e488a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(42, 92, 170, 0.3);
}

.button-card-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(42, 92, 170, 0.2);
}

.button-card-btn.secondary {
  background: #f8f9fa;
  color: #2a5caa;
  border: 1px solid #e1e5e9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button-card-btn.secondary:hover {
  background: #e9ecef;
  border-color: #2a5caa;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.button-card-btn.secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button-card-btn i {
  font-size: 14px;
  flex-shrink: 0;
}

.button-card-btn img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .chat-container {
    margin: 0;
    height: 100vh;
  }
  
  .message {
    max-width: 90%;
  }
  
  .markdown {
    font-size: 14px;
  }
  
  .card-message,
  .music-message,
  .button-card-message {
    max-width: 320px;
  }
  
  /* 移动端按钮布局优化 */
  .button-card-buttons {
    gap: 6px;
  }
  
  .button-card-btn {
    min-width: calc(50% - 3px);
    max-width: calc(50% - 3px);
    padding: 8px 10px;
    font-size: 13px;
  }
  
  /* 移动端单按钮占满整行 - 提高优先级 */
  .button-card-btn:only-child,
  .button-card-buttons.single-button .button-card-btn {
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
  
  /* 移动端单数按钮时，最后一个按钮占满整行 */
  .button-card-btn:last-child:nth-child(odd),
  .button-card-buttons.odd-buttons .button-card-btn:last-child {
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
  
  .input-area {
    padding: 12px;
  }
  
  #message-input {
    font-size: 16px;
  }
  
  #send-button {
    padding: 12px 16px;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #e0e0e0;
  }
  
  .chat-container {
    background: #2d2d2d;
  }
  
  .message.ai .bubble,
  .card-message,
  .music-message,
  .button-card-message {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #4a4a4a;
  }
  
  .input-area {
    background: #2d2d2d;
    border-top-color: #4a4a4a;
  }
  
  #message-input {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #4a4a4a;
  }
  
  #message-input:focus {
    border-color: #2a5caa;
    box-shadow: 0 0 0 3px rgba(42, 92, 170, 0.2);
  }
}

/* 输入区域 */
.input-area {
  display: flex;
  padding: 16px;
  border-top: 1px solid #eee;
  background: white;
  position: relative;
  z-index: 20;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

#message-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 24px;
  outline: none;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  background: #f8f9fa;
}

#message-input:focus {
  border-color: #2a5caa;
  box-shadow: 0 0 0 3px rgba(42, 92, 170, 0.1);
  background: white;
}

#message-input:disabled {
  background: #f8f9fa;
  cursor: not-allowed;
  opacity: 0.6;
}

#send-button {
  margin-left: 12px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #2a5caa, #1e488a);
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 14px;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#send-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e488a, #153a6b);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 92, 170, 0.3);
}

#send-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(42, 92, 170, 0.3);
}

#send-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 音乐卡片消息 */
.music-message {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e5e9;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.music-message:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.music-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2a5caa, #1e488a);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.music-message:hover::before {
  transform: scaleX(1);
}

.music-info { 
  display: flex; 
  align-items: center; 
  flex: 1;
}

.music-cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #2a5caa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.music-cover-fallback {
  width: 48px;
  height: 48px;
  background: #2a5caa;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 20px;
}

.music-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.music-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333;
  transition: color 0.2s;
  margin-bottom: 4px;
  width: 100%;
}

.music-artist {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.music-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: #2a5caa;
  margin-left: 12px;
  transition: all 0.3s ease;
  transform: scale(0.9);
  box-shadow: 0 2px 8px rgba(42, 92, 170, 0.2);
  flex-shrink: 0;
}

.music-message:hover .music-icon {
  transform: scale(1);
  box-shadow: 0 4px 12px rgba(42, 92, 170, 0.3);
}

.music-message.playing .music-icon {
  background: #2a5caa;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(42, 92, 170, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(42, 92, 170, 0); }
  100% { box-shadow: 0 0 0 0 rgba(42, 92, 170, 0); }
}

.music-message.playing .music-icon i {
  content: "\f04c";
}

.music-message.playing .music-title {
  color: #2a5caa;
  font-weight: 700;
}

.music-message.playing .music-cover {
  box-shadow: 0 0 0 3px #2a5caa;
}

/* 普通卡片消息 */
.card-message {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e5e9;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  max-width: 400px;
}

.card-message:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2a5caa, #1e488a);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card-message:hover::before {
  transform: scaleX(1);
}

.card-content { 
  flex: 1; 
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card-title { 
  font-weight: 600; 
  font-size: 16px; 
  color: #333; 
  margin-bottom: 8px; 
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.card-desc { 
  font-size: 14px; 
  color: #666; 
  line-height: 1.5; 
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

.card-icon { 
  width: 40px; 
  height: 40px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #2a5caa; 
  margin-left: 12px;
  background: #f8f9fa;
  border-radius: 50%;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}

.card-icon i {
  font-size: 16px;
}

.card-message:hover .card-icon {
  background: #2a5caa;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(42, 92, 170, 0.3);
}

/* 聊天状态提示 */
.chat-status {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-status.show {
  transform: translateX(0);
}

.chat-status-success {
  background: #28a745;
}

.chat-status-error {
  background: #dc3545;
}

.chat-status-info {
  background: #17a2b8;
}

.chat-status-warning {
  background: #ffc107;
  color: #333;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2a5caa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 快捷消息按钮 */
.quick-messages {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.quick-messages-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.quick-messages-scroll::-webkit-scrollbar {
  height: 4px;
}

.quick-messages-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.quick-messages-scroll::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 2px;
}

.quick-messages-scroll::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.quick-message-btn {
  padding: 8px 16px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-message-btn:hover {
  background: #2a5caa;
  color: white;
  border-color: #2a5caa;
  transform: translateY(-1px);
}

.quick-message-btn:active {
  transform: translateY(0);
}

.quick-message-btn i {
  font-size: 12px;
}

/* 图片查看器 */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.image-viewer-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#fullsize-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.3s ease;
  cursor: zoom-in;
}

#fullsize-image.zoomed {
  cursor: zoom-out;
}

.image-viewer-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
}

.viewer-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.viewer-btn:active {
  transform: scale(1);
}

.viewer-btn i {
  font-size: 16px;
}

/* 视频查看器 */
.video-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.video-viewer-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.video-viewer-content video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.video-viewer-controls {
  position: absolute;
  top: 20px;
  right: 20px;
}

/* 新增音乐卡片进度条样式 */
.music-progress-bar {
  width: 100%;
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.music-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2a5caa, #1e488a);
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s linear;
}
.music-message.playing .music-progress-fill {
  background: linear-gradient(90deg, #1e488a, #2a5caa);
}