/* ===================================
   弹窗样式优化 - 橙色温暖主题
   =================================== */

/* 遮罩层 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

/* 弹窗容器 */
.modal-container {
  background: linear-gradient(135deg, #fff9f5 0%, #fff 100%);
  border-radius: 20px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(255, 140, 0, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

/* 弹窗头部 */
.modal-header {
  background: linear-gradient(135deg, #FF8C00 0%, #FFA500 100%);
  color: white;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 20px 20px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  flex: 1;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* 弹窗内容 */
.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 140px);
}

/* 弹窗底部 */
.modal-footer {
  padding: 20px 24px;
  background: #fafafa;
  border-top: 1px solid #FFE4CC;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* 弹窗按钮 */
.modal-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.modal-btn-primary {
  background: linear-gradient(135deg, #FF8C00 0%, #FFA500 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

.modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 140, 0, 0.4);
}

.modal-btn-secondary {
  background: #f5f5f5;
  color: #666;
}

.modal-btn-secondary:hover {
  background: #e8e8e8;
}

.modal-btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 底部弹窗 (移动端风格) */
.modal-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #fff9f5 0%, #fff 100%);
  border-radius: 20px 20px 0 0;
  padding: 0;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 -10px 40px rgba(255, 140, 0, 0.2);
  animation: slideUpBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpBottom {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* 列表项样式 */
.modal-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}

.modal-list-item:hover {
  background: #FFF5EB;
}

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

.modal-list-item-text {
  flex: 1;
  font-size: 15px;
  color: #333;
}

.modal-list-item-amount {
  font-size: 16px;
  font-weight: 600;
  color: #FF8C00;
}

/* 卡片样式 */
.modal-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.1);
  border: 1px solid #FFE4CC;
}

.modal-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-card-icon {
  font-size: 20px;
}

/* 表单样式 */
.modal-form-group {
  margin-bottom: 20px;
}

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

.modal-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #FFE4CC;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.3s;
  box-sizing: border-box;
}

.modal-form-input:focus {
  outline: none;
  border-color: #FF8C00;
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

/* 标签样式 */
.modal-tag {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, #FFF0E0 0%, #FFE4CC 100%);
  color: #FF8C00;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-right: 8px;
  margin-bottom: 8px;
}

/* 成功提示 */
.modal-success {
  text-align: center;
  padding: 40px 20px;
}

.modal-success-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: bounce 0.6s;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-20px); }
  60% { transform: translateY(-10px); }
}

.modal-success-title {
  font-size: 22px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.modal-success-text {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
}

/* 加载动画 */
.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.modal-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #FFE4CC;
  border-top-color: #FF8C00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.modal-loading-text {
  margin-top: 20px;
  font-size: 15px;
  color: #666;
}

/* 空状态 */
.modal-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.modal-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.modal-empty-text {
  font-size: 16px;
  line-height: 1.6;
}

/* 响应式 */
@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-header {
    padding: 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-footer {
    padding: 16px 20px;
    flex-direction: column-reverse;
  }
  
  .modal-btn {
    width: 100%;
  }
}
