/* ===== 报价系统 - 客户前台样式 ===== */

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #1a1a2e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  color: var(--gray-700);
  line-height: 1.6;
  min-height: 100vh;
  padding-top: 56px;
}

/* Top Bar */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}
.topbar.hidden { transform: translateY(-100%); }
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size:18px;
  font-weight: 700;
  color: var(--gray-900);
  text-decoration: none;
}
.btn-save-draft {
  padding: 6px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #dbeafe;
  border-radius: 6px;
  cursor: pointer;
  font-size:15px;
  font-weight: 500;
  transition: all .2s;
}
.btn-save-draft:hover { background: #dbeafe; }
.btn-save-draft:disabled { opacity: 0.6; cursor: not-allowed; }

/* Container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

/* Steps Indicator */
.steps-indicator {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 20px 24px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0.5;
  transition: all .3s;
  min-width: 60px;
}
.step-dot.active { opacity: 1; }
.step-dot.done { opacity: 0.8; }
.step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size:22px;
  transition: all .3s;
  border: 2px solid transparent;
}
.step-dot.active .step-circle {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: scale(1.1);
}
.step-dot.done .step-circle {
  background: var(--success-bg);
  border-color: var(--success);
}
.step-label {
  font-size:13px;
  color: var(--gray-500);
  text-align: center;
  white-space: nowrap;
}
.step-dot.active .step-label { color: var(--primary); font-weight: 600; }

/* Step Panels */
.step-panel {
  display: none;
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.step-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.step-panel h2 { font-size:24px; color: var(--gray-900); margin-bottom: 4px; }
.step-desc { color: var(--gray-500); font-size:16px; margin-bottom: 24px; }

/* Section Titles */
.section-title {
  font-size:18px;
  color: var(--gray-900);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}

/* Items Grid */
.items-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  gap: 12px;
}
.item-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  transition: all .2s;
  background: #fff;
}
.item-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.item-card.core { border-left: 3px solid var(--success); background: var(--success-bg); }
.item-card.included { border-left: 3px solid var(--primary); background: var(--primary-light); }
.item-card.uncommon { background: #fffbeb; border-color: #fde68a; }
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.item-name { font-size:16px; font-weight: 600; color: var(--gray-900); }
.item-price { font-size:15px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.item-desc { font-size:14px; color: var(--gray-500); margin-bottom: 10px; line-height: 1.5; }
.item-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--gray-300);
  transition: .3s;
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .3s;
  border-radius: 50%;
}
.toggle input:checked + .toggle-slider { background-color: var(--primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle-label { font-size:15px; color: var(--gray-500); }

/* Quantity Input */
.qty-label { font-size:15px; color: var(--gray-500); }
.qty-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size:15px;
  text-align: center;
  outline: none;
}
.qty-input:focus { border-color: var(--primary); }

/* Badges */
.badge-core {
  display: inline-block;
  padding: 2px 10px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 10px;
  font-size:14px;
  font-weight: 500;
}
.badge-info {
  display: inline-block;
  padding: 2px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
  font-size:14px;
}

/* Subtotal per item */
.item-subtotal {
  font-size:15px;
  color: var(--gray-700);
  font-weight: 500;
  margin-left: auto;
}

/* Category Summary */
.cat-summary {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: 8px;
  font-size:17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cat-summary span { font-weight: 700; color: var(--primary); font-size:20px; }

/* Navigation */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding: 16px 24px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-total { font-size:18px; font-weight: 700; color: var(--danger); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  font-size:16px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .2s;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); }
.btn-lg { padding: 14px 32px; font-size:18px; }

/* Preview Page */
.quote-summary-box {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  margin-bottom: 24px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size:17px;
}
.total-price { font-size:34px; font-weight: 700; }
.preview-category { margin-bottom: 24px; }
.preview-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--gray-50);
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--gray-200);
}
.preview-cat-header h3 { font-size:17px; color: var(--gray-900); }
.preview-cat-header span { font-size:16px; font-weight: 600; color: var(--primary); }
.preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-top: none;
}
.preview-item:last-child { border-radius: 0 0 8px 8px; }
.preview-item-info { flex: 1; min-width: 0; }
.preview-item-name { font-size:15px; font-weight: 500; }
.preview-item-desc { font-size:13px; color: var(--gray-500); margin-top: 2px; }
.preview-item-right { text-align: right; min-width: 200px; flex-shrink: 0; }
.preview-item-qty { font-size:14px; color: var(--gray-500); }
.preview-item-subtotal { font-size:16px; font-weight: 600; color: var(--gray-900); }

/* Customer Form */
.customer-form { max-width: 600px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size:15px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size:16px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-group textarea { min-height: 80px; resize: vertical; }

/* Complete Box */
.complete-box {
  text-align: center;
  padding: 48px 24px;
}
.complete-icon { font-size:66px; margin-bottom: 16px; }
.complete-box h3 { font-size:22px; color: var(--gray-900); margin-bottom: 12px; }
.complete-box p { color: var(--gray-500); margin-bottom: 6px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray-900);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size:16px;
  z-index: 999;
  transition: transform .3s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 768px) {
  body { padding-top: 48px; }
  .container { padding: 12px; }
  .step-panel { padding: 20px; }
  .form-row-2 { grid-template-columns: 1fr; }
  .step-dot { min-width: 40px; }
  .step-circle { width: 32px; height: 32px; font-size:18px; }
  .step-label { font-size:14px; }
  .steps-indicator { gap: 6px; padding: 12px; overflow-x: auto; flex-wrap: nowrap; }
  /* 移动端顶栏紧凑一行 */
  .topbar-inner { flex-direction: row; gap: 6px; padding: 8px 12px; align-items: center; }
  .logo { font-size:13px; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-save-draft { font-size:12px; padding: 4px 10px; white-space: nowrap; flex-shrink: 0; }
}
