/* ==================== 全局基础样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #1e88e5;
  --primary-dark: #1565c0;
  --primary-light: #42a5f5;
  --accent: #ff9800;
  --accent-dark: #e65100;
  --success: #4caf50;
  --danger: #f44336;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --border: #e9ecef;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==================== 头部 ==================== */
.header {
  background: linear-gradient(135deg, #1a237e, #1565c0);
  color: white;
  padding: 20px 16px 60px;
  position: relative;
  overflow: hidden;
}
.header::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.header h1 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.header p {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.header-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

/* ==================== 步骤指示器 ==================== */
.steps-bar {
  margin: -30px 16px 0;
  position: relative;
  z-index: 10;
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow);
}
.step-dot {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 10px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  position: relative;
}
.step-dot .step-icon {
  font-size: 16px;
}
.step-dot.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}
.step-dot.done {
  color: var(--success);
}
.step-dot.done::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 10px;
}

/* ==================== 内容区域 ==================== */
.content {
  padding: 16px;
  padding-bottom: 120px;
}

/* ==================== 卡片 ==================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.card-title .icon { font-size: 18px; }
.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: -10px 0 14px;
}

/* ==================== 表单 ==================== */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: #fafbfc;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(30,136,229,0.1);
}
.form-textarea {
  resize: none;
  height: 72px;
}
.form-row {
  display: flex;
  gap: 10px;
}
.form-row > * { flex: 1; }
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==================== 选择卡片（可点击） ==================== */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.option-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.option-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.option-chip {
  padding: 10px 8px;
  background: #f8f9fa;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}
.option-chip:hover {
  border-color: #b0c4de;
  background: #f0f4f8;
}
.option-chip.selected {
  border-color: var(--primary);
  background: #e3f2fd;
  color: var(--primary-dark);
  font-weight: 600;
}
.option-chip .chip-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}
.option-chip .chip-price {
  font-size: 11px;
  color: var(--accent-dark);
  margin-top: 2px;
}

/* ==================== 系列型号卡片 ==================== */
.series-card {
  padding: 14px;
  background: #f8f9fa;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}
.series-card:hover {
  border-color: #b0c4de;
}
.series-card.selected {
  border-color: var(--primary);
  background: #e3f2fd;
}
.series-card .series-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.series-card .series-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.series-card .series-brand {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.brand-domestic { background: #e8f5e9; color: #2e7d32; }
.brand-joint { background: #e3f2fd; color: #1565c0; }
.brand-imported { background: #fff3e0; color: #e65100; }
.series-card .series-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.series-card .series-features {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.series-feature-tag {
  font-size: 10px;
  padding: 2px 8px;
  background: white;
  border-radius: 4px;
  color: var(--text-secondary);
}
.series-card .series-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
  margin-top: 6px;
}

/* ==================== 底部操作栏 ==================== */
.footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 12px 16px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 100;
  display: flex;
  gap: 10px;
  align-items: center;
}
.footer-bar .price-preview {
  flex: 1;
}
.footer-bar .price-preview .price-label {
  font-size: 11px;
  color: var(--text-muted);
}
.footer-bar .price-preview .price-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--danger);
}
.footer-bar .price-preview .price-value small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary);
  color: white;
  min-width: 100px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-success {
  background: var(--success);
  color: white;
}
.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: var(--radius);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ==================== Toast ==================== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
  text-align: center;
  max-width: 320px;
}
.toast-error { background: var(--danger); }
.toast-success { background: var(--success); }
.toast-info { background: var(--primary); }

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

/* ==================== AI推荐专区 ==================== */
.ai-hero {
  text-align: center;
  padding: 10px 0;
}
.ai-hero .ai-icon {
  font-size: 48px;
  margin-bottom: 10px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.ai-hero h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.ai-hero .ai-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.ai-input-wrap {
  position: relative;
}
.ai-input {
  width: 100%;
  padding: 14px 50px 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: #fafbfc;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}
.ai-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,136,229,0.1);
}
.ai-input::placeholder {
  color: #bac8d4;
}
.ai-submit-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.ai-submit-btn:active { transform: translateY(-50%) scale(0.9); }
.ai-submit-btn:disabled { opacity: 0.5; }

.ai-examples {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-example-tag {
  font-size: 11px;
  padding: 4px 10px;
  background: #f0f4f8;
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.ai-example-tag:hover {
  background: #e3f2fd;
  border-color: var(--primary-light);
  color: var(--primary);
}

.ai-thinking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}
.ai-thinking .dot-pulse {
  display: flex;
  gap: 4px;
}
.ai-thinking .dot-pulse span {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: dotPulse 1.4s infinite ease-in-out;
}
.ai-thinking .dot-pulse span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking .dot-pulse span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

.ai-result-card {
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.ai-result-card:hover {
  box-shadow: 0 4px 16px rgba(30,136,229,0.2);
}
.ai-result-card.recommended {
  border-color: var(--accent);
  background: linear-gradient(135deg, #fff8e1, #fff3e0);
}
.ai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.ai-result-name {
  font-size: 16px;
  font-weight: 700;
}
.ai-result-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}
.badge-best { background: var(--accent); color: white; }
.badge-good { background: var(--primary); color: white; }

.ai-result-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.ai-result-reason {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.7);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.ai-result-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--danger);
}
.ai-result-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ==================== 价格明细 ==================== */
.price-detail {
  background: #f8f9fa;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 10px;
}
.price-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.price-row:last-child { border-bottom: none; }
.price-row.total {
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
  border-top: 2px solid var(--primary);
  padding-top: 10px;
  margin-top: 4px;
}
.price-row .label { display: flex; align-items: center; gap: 4px; }

/* ==================== 报价结果页 ==================== */
.quote-summary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 14px;
}
.quote-summary .total-price {
  font-size: 36px;
  font-weight: 900;
  margin: 8px 0;
}
.quote-summary .total-price small {
  font-size: 18px;
  font-weight: 400;
}
.quote-summary .quote-meta {
  font-size: 12px;
  opacity: 0.85;
}

/* ==================== 打印/导出 ==================== */
.export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== 历史记录 ==================== */
.history-item {
  padding: 14px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.history-item:hover {
  border-color: var(--primary-light);
}
.history-item .hist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.history-item .hist-name {
  font-weight: 700;
  font-size: 14px;
}
.history-item .hist-date {
  font-size: 11px;
  color: var(--text-muted);
}
.history-item .hist-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
}
.history-item .hist-detail {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 10px;
}
.empty-state p {
  font-size: 14px;
}

/* ==================== 隐藏/显示 ==================== */
.hidden { display: none !important; }

/* ==================== 响应式 ==================== */
@media (max-width: 380px) {
  .option-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; gap: 0; }
  .export-actions { flex-direction: column; }
}
@media (min-width: 768px) {
  .content { max-width: 600px; margin: 0 auto; }
  .steps-bar { max-width: 600px; margin-left: auto; margin-right: auto; }
  .header { text-align: center; padding: 30px 16px 70px; }
  .option-grid { grid-template-columns: repeat(4, 1fr); }
}
