/**
 * 证照回执套壳系统 - 前端样式
 */

/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== 头部 ==================== */
.header {
  text-align: center;
  padding: 30px 20px;
  color: white;
}

.header h1 {
  font-size: 28px;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header .subtitle {
  opacity: 0.9;
  font-size: 14px;
}

/* ==================== 主内容区 ==================== */
.main-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  padding: 30px;
  flex: 1;
}

/* ==================== 步骤指示器 ==================== */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  gap: 5px;
}

.step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 20px;
  background: #f0f0f0;
  color: #999;
  font-size: 13px;
  transition: all 0.3s;
}

.step.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.step.completed {
  background: #4caf50;
  color: white;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.step-arrow {
  color: #ccc;
  font-size: 18px;
  margin: 0 5px;
}

/* ==================== 表单样式 ==================== */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 500;
  font-size: 14px;
  color: #555;
}

.form-group label.required::before {
  content: '*';
  color: #f44336;
  margin-right: 4px;
}

.form-group.optional label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  color: #666;
}

select, input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.3s;
  outline: none;
  background: #fafafa;
}

select:focus, input:focus {
  border-color: #667eea;
  background: white;
}

.region-selects {
  display: flex;
  gap: 10px;
}

.region-selects select {
  flex: 1;
}

/* ==================== 照片上传区域 ==================== */
.photo-upload-area {
  position: relative;
  width: 100%;
  min-height: 200px;
  border: 2px dashed #d0d0d0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.photo-upload-area:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.upload-placeholder {
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
}

.upload-icon {
  font-size: 48px;
  color: #ddd;
  margin-bottom: 10px;
}

.upload-placeholder p {
  font-size: 14px;
}

.upload-placeholder .hint {
  font-size: 12px;
  color: #bbb;
  margin-top: 5px;
}

.photo-preview {
  position: relative;
  height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

.photo-preview img {
  max-height: 220px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.btn-change {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 6px 16px;
  background: rgba(102, 126, 234, 0.9);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.3s;
}

.btn-change:hover {
  background: #5a6fd6;
}

/* ==================== 按钮样式 ==================== */
.btn-primary {
  padding: 14px 24px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-large {
  width: 100%;
  font-size: 18px;
  padding: 16px;
}

.btn-secondary {
  padding: 12px 24px;
  background: #f0f0f0;
  color: #666;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-pay {
  width: 100%;
  font-size: 16px;
  padding: 14px;
}

/* ==================== 弹窗样式 ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content h3 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 20px;
  color: #333;
}

.modal-hint {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-bottom: 20px;
}

/* 验证码相关 */
.captcha-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.captcha-img {
  height: 60px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
}

.btn-refresh {
  padding: 8px 16px;
  background: #f0f0f0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.3s;
}

.btn-refresh:hover {
  background: #e0e0e0;
}

.captcha-input {
  width: 100%;
  text-align: center;
  letter-spacing: 4px;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}

/* 支付弹窗 */
.payment-modal {
  max-width: 450px;
}

.order-summary {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: #555;
}

.order-item.total {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  border-top: 1px solid #e0e0e0;
  margin-top: 8px;
  padding-top: 12px;
}

.order-item .success {
  color: #4caf50;
}

.order-item .price {
  color: #f44336;
  font-size: 22px;
}

.payment-methods {
  margin-bottom: 20px;
}

.payment-methods p {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
}

.method-options {
  display: flex;
  gap: 12px;
}

.method-option {
  flex: 1;
  cursor: pointer;
}

.method-option input {
  display: none;
}

.method-icon {
  display: block;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  text-align: center;
  font-size: 14px;
  transition: all 0.3s;
}

.method-option input:checked + .method-icon {
  border-color: #667eea;
  background: #f8f9ff;
}

.qrcode-area {
  text-align: center;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 10px;
  margin-bottom: 20px;
}

.qrcode-area p {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

#qrCodeContainer {
  display: inline-block;
  padding: 10px;
  background: white;
  border-radius: 8px;
}

.qrcode-area canvas, .qrcode-area img {
  display: block !important;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
}

/* ==================== 加载遮罩 ==================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e0e0e0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

#loadingText {
  color: #666;
  font-size: 14px;
}

/* ==================== Toast提示 ==================== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: #333;
  color: white;
  border-radius: 8px;
  font-size: 14px;
  z-index: 3000;
  animation: toastIn 0.3s ease-out;
  max-width: 80%;
  text-align: center;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.toast.success {
  background: #4caf50;
}

.toast.error {
  background: #f44336;
}

/* ==================== 页脚 ==================== */
.footer {
  text-align: center;
  padding: 20px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  .header h1 {
    font-size: 22px;
  }
  
  .main-content {
    padding: 20px;
    border-radius: 12px;
  }
  
  .steps {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .step-arrow {
    display: none;
  }
  
  .step {
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .region-selects {
    flex-direction: column;
  }
}
