/* ============================================================================
   意见反馈弹窗样式
   ============================================================================ */

/* 反馈弹窗容器 */
#feedbackModal {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  background: white;
  /* 居中显示 */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

#feedbackModal::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

/* 反馈弹窗头部 */
.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #E5E7EB;
}

.feedback-title {
  font-size: 20px;
  font-weight: 600;
  color: #1F2937;
  margin: 0;
}

.feedback-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #9CA3AF;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.feedback-close:hover {
  background: #F3F4F6;
  color: #6B7280;
}

/* 反馈弹窗主体 */
.feedback-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

/* 引导语 */
.feedback-intro {
  font-size: 14px;
  color: #6B7280;
  margin-bottom: 24px;
}

/* 评分区域 */
.feedback-rating-section {
  margin-bottom: 24px;
}

.rating-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #F3F4F6;
}

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

.rating-label {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.rating-stars {
  display: flex;
  gap: 8px;
  align-items: center;
}

.star {
  font-size: 28px;
  cursor: pointer;
  color: #D1D5DB;
  transition: all 0.2s;
  user-select: none;
}

.star:hover,
.star.active {
  color: #EF4444;
  transform: scale(1.1);
}

.rating-text {
  font-size: 13px;
  color: #9CA3AF;
  margin-left: 8px;
  min-width: 70px;
}

/* 表单组 */
.feedback-form-group {
  margin-bottom: 20px;
}

.feedback-form-label {
  display: block;
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
  font-weight: 500;
}

.feedback-form-label .optional {
  color: #9CA3AF;
  font-weight: 400;
  font-size: 13px;
}

.feedback-input,
.feedback-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 14px;
  color: #1F2937;
  transition: all 0.2s;
  font-family: inherit;
}

.feedback-input:focus,
.feedback-textarea:focus {
  outline: none;
  border-color: #4998FF;
  box-shadow: 0 0 0 3px rgba(73, 152, 255, 0.1);
}

.feedback-textarea {
  resize: vertical;
  min-height: 80px;
}

.feedback-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6B7280;
  margin-top: 6px;
}

.feedback-hint.privacy {
  color: #10B981;
}

/* 图片上传区域 */
.feedback-upload-area {
  border: 2px dashed #D1D5DB;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #F9FAFB;
}

.feedback-upload-area:hover {
  border-color: #4998FF;
  background: #EFF6FF;
}

.feedback-upload-icon {
  font-size: 40px;
  color: #9CA3AF;
  margin-bottom: 8px;
}

.feedback-upload-text {
  font-size: 14px;
  color: #6B7280;
}

.feedback-upload-limit {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 4px;
}

.feedback-upload-input {
  display: none;
}

/* 已上传图片预览 */
.feedback-image-preview {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #E5E7EB;
}

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

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.preview-remove:hover {
  background: rgba(239, 68, 68, 0.9);
}

/* 反馈弹窗底部 */
.feedback-footer {
  padding: 16px 24px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.feedback-btn {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.feedback-btn-cancel {
  background: #F3F4F6;
  color: #6B7280;
}

.feedback-btn-cancel:hover {
  background: #E5E7EB;
}

.feedback-btn-submit {
  background: #4998FF;
  color: white;
}

.feedback-btn-submit:hover {
  background: #3B82F6;
}

.feedback-btn-submit:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
}

/* 加载状态 */
.feedback-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.feedback-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 错误提示 */
.feedback-error {
  background: #FEE2E2;
  color: #DC2626;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.feedback-error.show {
  display: block;
}

/* 响应式 */
@media (max-width: 640px) {
  #feedbackModal {
    width: 95%;
    max-width: none;
  }
  
  .feedback-body {
    max-height: 60vh;
  }
  
  .rating-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .star {
    font-size: 24px;
  }
}

/* ============================================================================
   需求6：设置面板内的反馈按钮样式
   ============================================================================ */

.settings-feedback-buttons {
  position: fixed; /* 改为fixed，不随滚动变化 */
  bottom: 80px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000; /* 提高z-index确保在最上层 */
}

/* 当设置面板隐藏时，也隐藏反馈按钮 */
#app.settings-panel-hidden .settings-feedback-buttons {
  display: none;
}

.settings-feedback-btn,
.settings-contact-btn {
  width: 60px; /* 缩小圆圈 */
  height: 60px;
  border-radius: 50%;
  border: 1px solid #E5E7EB;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px; /* 减小两行之间的间距 */
  font-size: 12px; /* 稍微减小字体 */
  font-weight: 500;
  color: #6B7280;
  padding: 12px 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* 文字行容器 */
.btn-text-row {
  display: flex;
  gap: 4px; /* 减小两个字之间的间距 */
  line-height: 1;
}

.btn-text-row span {
  display: inline-block;
}

.settings-feedback-btn:hover {
  background: #EFF6FF;
  color: #4998FF;
  border-color: #4998FF;
  box-shadow: 0 4px 12px rgba(73, 152, 255, 0.25);
  transform: scale(1.05);
}

.settings-contact-btn:hover {
  background: #F0FDF4;
  color: #10B981;
  border-color: #10B981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transform: scale(1.05);
}

.settings-feedback-btn:active,
.settings-contact-btn:active {
  transform: scale(0.98);
}

/* 响应式 */
@media (max-width: 1023px) {
  .settings-feedback-buttons {
    bottom: 60px;
    right: 8px;
  }
  
  .settings-feedback-btn,
  .settings-contact-btn {
    width: 60px;
    height: 60px;
    font-size: 12px;
    padding: 12px 8px;
    gap: 3px;
  }
  
  .btn-text-row {
    gap: 5px;
  }
}

/* ============================================================================
   Toast 提示样式
   ============================================================================ */

.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  font-size: 14px;
  font-weight: 500;
  min-width: 200px;
  max-width: 400px;
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.info {
  background: #4998FF;
  color: white;
}

.toast.warning {
  background: #FFA500;
  color: white;
}

.toast.error {
  background: #FF4444;
  color: white;
}

.toast.success {
  background: #10B981;
  color: white;
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.hiding {
  animation: slideOutRight 0.3s ease forwards;
}

@media (max-width: 640px) {
  .toast {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}
