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

:root {
  --primary: #4A90D9;
  --primary-dark: #357ABD;
  --secondary: #6B7C93;
  --success: #27AE60;
  --danger: #E74C3C;
  --warning: #F39C12;
  --background: #F5F7FA;
  --white: #FFFFFF;
  --text: #2C3E50;
  --text-light: #7F8C8D;
  --border: #E1E8ED;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* 容器 */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* 顶部导航 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.lang-switch {
  display: flex;
  gap: 8px;
}

.lang-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* 卡片 */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-success:hover {
  background: #219653;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* 输入框 */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
}

.input-group label .required {
  color: var(--danger);
}

.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: var(--white);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.input-group textarea {
  min-height: 100px;
  resize: vertical;
}

.input-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* 场景选择 */
.scenarios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.scenario-item {
  text-align: center;
  padding: 16px 8px;
  background: var(--background);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.scenario-item:hover {
  border-color: var(--primary);
  background: rgba(74, 144, 217, 0.05);
}

.scenario-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.scenario-label {
  font-size: 12px;
  color: var(--text-light);
}

/* 价格显示 */
.price-display {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  color: var(--white);
  margin: 20px 0;
}

.price-amount {
  font-size: 36px;
  font-weight: 700;
}

.price-label {
  font-size: 14px;
  opacity: 0.9;
}

/* 二维码展示 */
.qr-display {
  text-align: center;
  padding: 32px;
}

.qr-image {
  max-width: 280px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 扫码者页面 */
.scan-profile {
  text-align: center;
}

.scan-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.scan-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.scan-contact {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 20px;
  word-break: break-all;
}

.scan-actions {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

.scan-description {
  text-align: left;
  padding: 16px;
  background: var(--background);
  border-radius: 8px;
  margin-top: 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.scan-description strong {
  font-weight: 600;
}

.scan-description em {
  font-style: italic;
}

.scan-description a {
  color: var(--primary);
  text-decoration: underline;
}

.scan-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-size: 14px;
}

/* 加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  color: var(--white);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 提示消息 */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  transition: transform 0.3s;
  z-index: 1001;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

/* 管理后台 */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.admin-tab {
  padding: 10px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.admin-tab.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-light);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--background);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-light);
}

.data-table tr:hover {
  background: rgba(74, 144, 217, 0.05);
}

/* 表单 */
.form-section {
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 文件上传 */
.file-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload:hover {
  border-color: var(--primary);
  background: rgba(74, 144, 217, 0.05);
}

.file-upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.file-upload-preview {
  max-width: 150px;
  max-height: 150px;
  border-radius: 8px;
  margin-top: 12px;
}

/* 响应式 */
@media (max-width: 480px) {
  .container {
    padding: 12px;
  }
  
  .header {
    padding: 12px;
  }
  
  .scenarios {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .admin-stats {
    grid-template-columns: 1fr;
  }
}

/* 步骤指示 */
.steps {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.step {
  display: flex;
  align-items: center;
  color: var(--text-light);
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
}

.step.active .step-number {
  background: var(--primary);
  color: var(--white);
}

.step.completed .step-number {
  background: var(--success);
  color: var(--white);
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
}

.step.completed + .step-line,
.step.active + .step-line {
  background: var(--primary);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}