/* 背景遮罩 */
.feedback-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  animation: fadeIn 0.3s ease-in-out;
}

.feedback-overlay.show {
  display: flex;
}

/* 弹窗容器 */
.feedback-modal {
  position: relative;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  padding: 24px;
  animation: slideUp 0.4s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

/* 关闭按钮 */
.feedback-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #ccc;
  transition: all 0.3s ease;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  line-height: 1;
}

.feedback-close:hover {
  color: #333;
  background-color: #f5f5f5;
  border-radius: 50%;
}

.feedback-close:active {
  transform: scale(0.95);
}

/* 标题 */
.feedback-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 18px;
  text-align: center;
  padding-right: 40px;
}

/* 表单容器 */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 表单组 */
.feedback-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 标签 */
.feedback-label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.feedback-label.required::after {
  content: " *";
  color: #e74c3c;
}

/* 输入框 */
.feedback-input,
.feedback-textarea {
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  min-height: 44px;
}

.feedback-input:focus,
.feedback-textarea:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.feedback-textarea {
  resize: vertical;
  min-height: 100px;
  max-height: 200px;
}

/* 错误提示 */
.feedback-error {
  font-size: 12px;
  color: #e74c3c;
  display: none;
  margin-top: 4px;
}

.feedback-form-group.error .feedback-input,
.feedback-form-group.error .feedback-textarea {
  border-color: #e74c3c;
}

.feedback-form-group.error .feedback-error {
  display: block;
}

/* 提交按钮 */
.feedback-submit {
  padding: 14px 24px;
  background-color: #4a90e2;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-submit:hover:not(:disabled) {
  background-color: #357abd;
}

.feedback-submit:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* 加载状态 */
.feedback-submit.loading {
  position: relative;
  color: transparent;
}

.feedback-submit.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* 成功提示 */
.feedback-success {
  display: none;
  text-align: center;
  padding: 30px 20px;
  animation: slideUp 0.4s ease-out;
}

.feedback-success.show {
  display: block;
}

.feedback-success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background-color: #27ae60;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.feedback-success-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.feedback-success-message {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.feedback-close-btn {
  padding: 12px 28px;
  background-color: #4a90e2;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feedback-close-btn:hover {
  background-color: #357abd;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 响应式设计 - 平板设备 */
@media (max-width: 768px) {
  .feedback-modal {
    width: 95%;
    padding: 20px;
    border-radius: 12px;
  }

  .feedback-title {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .feedback-form {
    gap: 14px;
  }

  .feedback-label {
    font-size: 13px;
  }

  .feedback-input,
  .feedback-textarea {
    font-size: 16px;
    padding: 11px 12px;
  }

  .feedback-textarea {
    min-height: 90px;
  }

  .feedback-submit {
    padding: 13px 20px;
    font-size: 15px;
    min-height: 46px;
    margin-top: 10px;
  }

  .feedback-close-btn {
    padding: 11px 24px;
    font-size: 15px;
    min-height: 46px;
  }
}

/* 响应式设计 - 手机设备 */
@media (max-width: 480px) {
  .feedback-overlay {
    padding: 16px;
  }

  .feedback-modal {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    max-height: calc(100vh - 32px);
  }

  .feedback-close {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .feedback-title {
    font-size: 16px;
    margin-bottom: 14px;
    padding-right: 36px;
  }

  .feedback-form {
    gap: 12px;
  }

  .feedback-form-group {
    gap: 6px;
  }

  .feedback-label {
    font-size: 13px;
    font-weight: 500;
  }

  .feedback-input,
  .feedback-textarea {
    font-size: 16px;
    padding: 11px 12px;
    border-radius: 6px;
    min-height: 44px;
  }

  .feedback-textarea {
    min-height: 80px;
    max-height: 150px;
  }

  .feedback-error {
    font-size: 11px;
  }

  .feedback-submit {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    min-height: 44px;
    margin-top: 8px;
    border-radius: 6px;
  }

  .feedback-success-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    font-size: 32px;
  }

  .feedback-success-title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .feedback-success-message {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .feedback-success {
    padding: 24px 16px;
  }

  .feedback-close-btn {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 44px;
    width: 100%;
  }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
  .feedback-modal {
    padding: 14px;
  }

  .feedback-title {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .feedback-input,
  .feedback-textarea {
    font-size: 16px;
    padding: 10px 11px;
  }

  .feedback-textarea {
    min-height: 75px;
  }
}
