/* ===== Modal弹窗样式 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  max-width: 520px;
  width: 90%;
  position: relative;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Modal头部 ===== */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #E2E8F0;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--primary-dark);
}

/* ===== Modal内容区 ===== */
.modal-body {
  padding: 24px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Form表单样式 ===== */
.form-group {
  margin-bottom: 12px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 2px solid #E8EDF5;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: inherit;
  background: #F7FAFC;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-tech);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 111, 229, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.required {
  color: #EF4444;
  margin-left: 4px;
  font-weight: 600;
}

.form-submit {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #1e3a8a 0%, #1F6FFF 50%, #2978FF 100%);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(31, 111, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.form-submit:hover {
  background: linear-gradient(135deg, #0f286e 0%, #1e3a8a 50%, #1F6FFF 100%);
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 52, 110, 0.5);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Form错误状态 ===== */
.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-color: #EF4444;
}

.form-group input:focus:invalid,
.form-group textarea:focus:invalid {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ===== Toast通知样式 ===== */
.toast {
  position: fixed;
  top: 100px;
  right: 20px;
  background: #10B981;
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.error {
  background: #EF4444;
}

.toast i {
  font-size: 20px;
}

/* ===== 移动端响应式 ===== */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: none;
  }

  .modal-header,
  .modal-body {
    padding: 20px;
  }

  .toast {
    right: 10px;
    left: 10px;
    top: 80px;
  }
}
