/* 视频评论面板样式 */

/* 面板容器 - 全屏覆盖 */
.video-comment-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.video-comment-panel.show {
  display: flex;
  align-items: flex-end;
}

/* 背景遮罩 */
.comment-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

/* 评论容器 - 从底部弹出 */
.comment-container {
  position: relative;
  width: 100%;
  max-height: 75vh;
  min-height: 60vh;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateY(0);
}

/* 动画效果 */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 评论头部 */
.comment-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}

.comment-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.close-btn {
  width: 32px;
  height: 32px;
  background: #f8f8f8;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  font-size: 14px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #e8e8e8;
  color: #333;
}

.close-btn:active {
  transform: scale(0.95);
}

/* 评论列表 */
.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px;
  margin: 8px 0;
  scroll-behavior: smooth;
}

/* 评论列表滚动条样式 */
.comment-list::-webkit-scrollbar {
  width: 4px;
}

.comment-list::-webkit-scrollbar-track {
  background: transparent;
}

.comment-list::-webkit-scrollbar-thumb {
  background: #e0e0e0;
  border-radius: 2px;
}

.comment-list::-webkit-scrollbar-thumb:hover {
  background: #d0d0d0;
}

/* 评论项 */
.comment-item {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  animation: fadeInUp 0.3s ease;
}

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

/* 头像 */
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
}

/* 评论内容 */
.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.comment-time {
  font-size: 12px;
  color: #999;
}

.comment-text {
  font-size: 15px;
  line-height: 1.4;
  color: #333;
  word-wrap: break-word;
  margin-bottom: 8px;
}

/* @回复样式 */
.reply-to {
  color: #007AFF;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.reply-to:hover {
  text-decoration: underline;
}

/* 评论操作按钮 */
.comment-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.like-btn,
.reply-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 4px 8px;
  border-radius: 12px;
}

.like-btn:hover,
.reply-btn:hover {
  background: #f8f8f8;
  color: #333;
}

.like-btn.liked {
  color: #FF3B30;
}

.like-btn.liked i {
  color: #FF3B30;
}

/* 输入区域 */
.comment-input-area {
  padding: 16px 20px 20px;
  border-top: 1px solid #f0f0f0;
  background: #ffffff;
  flex-shrink: 0;
  position: relative;
}

.input-wrapper {
  position: relative; /* 🔧 添加相对定位，使emoji选择器能正确定位 */
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 24px;
  padding: 0 16px;
  margin-bottom: 8px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: #007AFF;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.input-wrapper input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  padding: 12px 0;
  font-size: 15px;
  color: #333;
  placeholder-color: #999;
}

.input-wrapper input::placeholder {
  color: #999;
}

.emoji-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s ease;
  margin-left: 8px;
}

.emoji-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.send-btn {
  background: #007AFF;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
  display: block;
  min-width: 60px;
}

.send-btn:hover {
  background: #0056CC;
  transform: translateY(-1px);
}

.send-btn:active {
  transform: translateY(0);
  background: #004499;
}

/* 回复提示 */
.reply-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: #E3F2FD;
  border-radius: 12px;
  font-size: 14px;
  color: #1976D2;
}

.reply-tip button {
  background: none;
  border: none;
  color: #1976D2;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.reply-tip button:hover {
  background: rgba(25, 118, 210, 0.1);
}

/* Emoji选择器 */
.emoji-picker {
  position: absolute;
  bottom: 100%;
  right: 20px;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid #e0e0e0;
  max-width: 280px;
  z-index: 100;
  transform: translateY(-8px);
  margin-bottom: 8px;
}

.emoji-picker.hidden {
  display: none;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.emoji-item {
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.emoji-item:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

/* 状态样式 */
.loading,
.empty-state,
.error-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 15px;
}

.empty-state {
  color: #666;
}

.error-state {
  color: #FF3B30;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .comment-container {
    max-height: 85vh;
    min-height: 70vh;
    border-radius: 16px 16px 0 0;
  }
  
  .comment-header {
    padding: 12px 16px;
  }
  
  .comment-list {
    padding: 0 16px;
  }
  
  .comment-input-area {
    padding: 12px 16px 16px;
  }
  
  .comment-item {
    margin-bottom: 16px;
  }
  
  .comment-avatar {
    width: 32px;
    height: 32px;
  }
  
  .emoji-picker {
    right: 16px;
    max-width: calc(100vw - 32px);
  }
  
  .emoji-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 480px) {
  .comment-container {
    border-radius: 12px 12px 0 0;
  }
  
  .emoji-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .comment-actions {
    gap: 12px;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .comment-container {
    background: #1c1c1e;
    color: #ffffff;
  }
  
  .comment-header {
    background: #1c1c1e;
    border-bottom-color: #2c2c2e;
  }
  
  .comment-title {
    color: #ffffff;
  }
  
  .close-btn {
    background: #2c2c2e;
    color: #ffffff;
  }
  
  .close-btn:hover {
    background: #3c3c3e;
  }
  
  .comment-text {
    color: #ffffff;
  }
  
  .comment-author {
    color: #ffffff;
  }
  
  .comment-time {
    color: #8e8e93;
  }
  
  .input-wrapper {
    background: #2c2c2e;
    border-color: #3c3c3e;
  }
  
  .input-wrapper:focus-within {
    background: #1c1c1e;
    border-color: #007AFF;
  }
  
  .input-wrapper input {
    color: #ffffff;
  }
  
  .input-wrapper input::placeholder {
    color: #8e8e93;
  }
  
  .comment-input-area {
    background: #1c1c1e;
    border-top-color: #2c2c2e;
  }
  
  .emoji-picker {
    background: #2c2c2e;
    border-color: #3c3c3e;
  }
  
  .emoji-item:hover {
    background: #3c3c3e;
  }
  
  .reply-tip {
    background: #1a2332;
    color: #64b5f6;
  }
}