/* Off-Grid PV Quote System - Dark Theme */
:root {
  --primary: #1a5276;
  --primary-light: #2980b9;
  --primary-dark: #0e2f44;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #e67e22;
  --bg: #0d1b2a;
  --bg-card: #1b2838;
  --bg-hover: #243447;
  --text: #e0e6ed;
  --text-secondary: #8899aa;
  --border: #2a3f52;
  --shadow: rgba(0,0,0,0.3);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}

/* === 导航栏 === */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 18px; font-weight: 700; color: #fff; }
.nav-brand i { font-size: 24px; color: var(--accent-light); }
.nav-logo { height: 32px; max-width: 120px; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  color: rgba(255,255,255,0.8); text-decoration: none; font-size: 13px; font-weight: 500; transition: all 0.2s;
  cursor: pointer;
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-link.router-link-active { background: rgba(255,255,255,0.15); color: #fff; }
.nav-link.lang-btn { font-size: 12px; padding: 4px 10px; border: 1px solid rgba(255,255,255,0.3); border-radius: 14px; }

/* === 移动端汉堡菜单按钮 === */
.nav-toggle {
  display: none; background: none; border: none; color: #fff; font-size: 22px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: background 0.2s;
}
.nav-toggle:hover { background: rgba(255,255,255,0.1); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
}

/* === 主内容区 === */
.main-content { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* === 通用 === */
.loading { text-align: center; padding: 60px; color: var(--text-secondary); font-size: 16px; }
.empty-state { text-align: center; padding: 60px; color: var(--text-secondary); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }

/* === 页面标题 === */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 22px; font-weight: 700; }

/* === 搜索栏 === */
.search-bar { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 380px; }
.search-bar input {
  flex: 1; padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); font-size: 14px; outline: none;
}
.search-bar input:focus { border-color: var(--primary-light); }
.search-bar i { color: var(--text-secondary); }

/* === 分类快速跳转 === */
.cat-jump { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-jump a {
  padding: 6px 14px; border-radius: 16px; font-size: 13px; color: var(--text-secondary);
  text-decoration: none; background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s;
}
.cat-jump a:hover { border-color: var(--primary-light); color: var(--text); }
.cat-jump a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* === 分类概览卡片 === */
.all-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.cat-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cat-section-header {
  padding: 14px 16px; font-size: 16px; font-weight: 700;
  background: var(--primary-dark); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.cat-section-header .count { font-size: 12px; font-weight: 400; color: #8ab4d6; }
.cat-section-body { padding: 0; }

/* === 产品缩略图 === */
.prod-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; margin-right: 10px; background: var(--bg-card); border: 1px solid var(--border); }
.prod-thumb-sm { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; display: block; margin: 0 auto; background: var(--bg-card); border: 1px solid var(--border); }

.cat-section-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  transition: background 0.15s; cursor: pointer;
}
.cat-section-item:last-child { border-bottom: none; }
.cat-section-item:hover { background: var(--bg-hover); }
.cat-section-item .info { flex: 1; }
.cat-section-item .info .name { font-size: 13px; font-weight: 500; }
.cat-section-item .info .model { font-size: 11px; color: var(--text-secondary); }
.cat-section-item .price { font-size: 16px; font-weight: 700; color: var(--accent-light); white-space: nowrap; }

/* === 产品表格 === */
.pro-table-wrap { overflow-x: auto; background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border); }
.pro-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.pro-table thead { background: var(--primary-dark); }
.pro-table th {
  padding: 12px 10px; font-size: 12px; font-weight: 600;
  color: #8ab4d6; text-align: center; white-space: nowrap; border-bottom: 2px solid var(--border);
}
.pro-table td { padding: 10px; font-size: 13px; text-align: center; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pro-table tbody tr { transition: background 0.15s; }
.pro-table tbody tr:hover { background: var(--bg-hover); }
.pro-table .brand-cell { font-weight: 600; color: var(--text); }
.pro-table .model-cell { color: var(--text-secondary); font-size: 12px; }
.pro-table .spec-cell { color: var(--text-secondary); font-size: 12px; }
.pro-table .price-cell { font-weight: 700; color: var(--accent-light); font-size: 15px; }

/* === 按钮 === */
.btn {
  padding: 10px 20px; border-radius: 8px; border: none; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); }
.btn-secondary { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.85; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-add {
  padding: 6px 16px; border-radius: 8px; border: none; background: var(--primary);
  color: #fff; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s;
}
.btn-add:hover { background: var(--primary-light); }

/* === 表单 === */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; outline: none; transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary-light); }
.form-textarea { resize: vertical; min-height: 60px; }
.form-select { cursor: pointer; }

/* === 报价单页 === */
.quotation-page { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.quotation-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.quotation-form h2 { font-size: 18px; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }

/* 报价单产品列表 - 可编辑表格 */
.quotation-items { margin-top: 20px; }
.quotation-items h3 { font-size: 16px; margin-bottom: 12px; }
.editable-table-wrap { overflow-x: auto; }
.item-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.item-table th {
  padding: 10px 8px; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); border-bottom: 2px solid var(--border); white-space: nowrap;
}
.item-table td { padding: 8px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.editable-table tbody tr:hover { background: var(--bg-hover); }

/* 列宽控制 */
.col-price { width: 100px; text-align: center; }
.col-qty { width: 90px; }
.col-unit { width: 100px; }
.col-subtotal { width: 110px; text-align: center; }
.col-del { width: 36px; text-align: center; }
.cell-model { font-size: 12px; color: var(--text-secondary); }

/* 内联编辑输入框 */
.inline-input {
  width: 100%; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.inline-input:focus {
  border-color: var(--accent-light); box-shadow: 0 0 0 2px rgba(243,156,18,0.15);
}
.inline-input:hover { border-color: var(--text-secondary); }
.qty-input { text-align: center; font-weight: 600; font-size: 14px; -moz-appearance: textfield; }
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-input { text-align: center; }
.price-val { font-weight: 600; color: var(--accent-light); text-align: center; }
.del-btn { color: var(--danger); cursor: pointer; font-size: 16px; opacity: 0.6; transition: opacity 0.2s; }
.del-btn:hover { opacity: 1; }

/* 摘要侧边栏 */
.quotation-summary {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; position: sticky; top: 80px;
}
.quotation-summary h2 { font-size: 18px; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.summary-row.total { font-size: 18px; font-weight: 700; color: var(--accent-light); border: none; padding-top: 12px; }
.summary-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }

/* === 历史报价 === */
.history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 12px; overflow: hidden; }
.history-table th {
  padding: 12px 14px; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); background: var(--primary-dark); border-bottom: 1px solid var(--border);
}
.history-table td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.history-table tr:hover td { background: var(--bg-hover); }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.status-badge.draft { background: rgba(255,255,255,0.1); color: var(--text-secondary); }
.status-badge.confirmed { background: rgba(39,174,96,0.2); color: var(--success); }
.status-badge.expired { background: rgba(231,76,60,0.2); color: var(--danger); }
.action-btns { display: flex; gap: 4px; }

/* === 分页 === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; }
.page-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); cursor: pointer; font-size: 14px;
}
.page-btn:hover { border-color: var(--primary-light); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* === 弹窗 === */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); display: flex; align-items: center;
  justify-content: center; z-index: 1000;
}
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; max-width: 900px; width: 95%;
  max-height: 85vh; overflow-y: auto;
}
.modal-box h3 { font-size: 20px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* === 预览报价单 === */
.preview-quotation { background: #fff; color: #333; padding: 40px; border-radius: 8px; font-family: 'Arial', 'Microsoft YaHei', serif; }
.preview-quotation h1 { text-align: center; font-size: 22px; color: #1a5276; margin-bottom: 4px; }
.preview-quotation .preview-sub { text-align: center; font-size: 12px; color: #999; margin-bottom: 20px; }
.preview-quotation table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.preview-quotation th { background: #1a5276; color: #fff; padding: 8px 10px; font-size: 12px; text-align: center; }
.preview-quotation td { padding: 8px 10px; font-size: 12px; border: 1px solid #ddd; text-align: center; }
.preview-notes { font-size: 11px; color: #666; margin-top: 16px; }

/* === 浮动购物车 === */
.cart-float {
  position: fixed; bottom: 24px; right: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; padding: 14px 20px; border-radius: 50px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; box-shadow: 0 4px 20px rgba(26,82,118,0.5);
  z-index: 99; transition: transform 0.2s;
}
.cart-float:hover { transform: scale(1.05); }
.cart-float-count { background: var(--accent); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.cart-float-price { font-size: 16px; font-weight: 700; }

/* === Toast === */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 10px; color: #fff; font-size: 14px;
  font-weight: 500; z-index: 2000; animation: toastIn 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
@keyframes toastIn { from { opacity:0; transform:translateX(-50%) translateY(-20px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* === 数量弹窗 === */
.qty-modal { max-width: 320px; }
.qty-big { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0; }
.qty-big button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); cursor: pointer; font-size: 20px; font-weight: 700;
}
.qty-big button:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.qty-big span { font-size: 28px; font-weight: 700; min-width: 60px; text-align: center; }

/* === 型号点击链接 === */
.model-link {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  cursor: pointer;
  border-bottom: 1px dashed var(--primary-light);
}
.model-link:hover { color: var(--accent-light); border-bottom-color: var(--accent-light); }

/* === 产品参数详情弹窗 === */
.spec-detail-modal { max-width: 520px; padding: 0; overflow: hidden; border-radius: 16px; }
.spec-detail-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.spec-detail-title { flex: 1; min-width: 0; }
.spec-detail-brand { font-size: 16px; font-weight: 700; color: #fff; }
.spec-detail-model { font-size: 13px; color: rgba(255,255,255,0.7); margin-left: 4px; }
.spec-detail-price {
  font-size: 18px; font-weight: 700; color: var(--accent-light);
  white-space: nowrap;
}
.modal-close-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.1); border: none;
  color: rgba(255,255,255,0.7); font-size: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.modal-close-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.spec-detail-body { padding: 16px 20px; }
.spec-detail-table { width: 100%; border-collapse: collapse; }
.spec-detail-table tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.spec-detail-table tr:last-child { border-bottom: none; }
.spec-detail-table tr:hover { background: var(--bg-hover); }
.spec-detail-table tr.key-row {
  background: rgba(230, 126, 34, 0.08);
  border-left: 3px solid var(--accent);
}
.spec-detail-table tr.key-row:hover { background: rgba(230, 126, 34, 0.15); }
.spec-label {
  padding: 10px 8px 10px 0; font-size: 13px;
  color: var(--text-secondary); width: 45%; white-space: nowrap;
  vertical-align: top;
}
.spec-unit { font-size: 11px; color: var(--text-secondary); }
.spec-value {
  padding: 10px 0; font-size: 13px; font-weight: 500;
  color: var(--text); text-align: right;
}
.spec-empty { text-align: center; padding: 40px 0; color: var(--text-secondary); font-size: 14px; }

/* 移动端适配详情弹窗 */
@media (max-width: 768px) {
  .spec-detail-modal { max-width: 100%; }
  .spec-detail-header { flex-wrap: wrap; gap: 8px; }
  .spec-detail-brand { font-size: 14px; }
  .spec-detail-price { font-size: 16px; }
  .spec-detail-body { padding: 12px 14px; }
  .spec-label { font-size: 12px; width: 40%; }
  .spec-value { font-size: 12px; }
}
@media (max-width: 480px) {
  .spec-detail-header { padding: 12px 14px; }
  .spec-detail-body { padding: 8px 12px; }
}

/* ==================== 响应式设计 — 全面移动端适配 ==================== */

@media (max-width: 900px) {
  .quotation-page { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .all-overview { grid-template-columns: 1fr; }
}

/* 平板和小屏 */
@media (max-width: 768px) {
  /* --- 导航栏：汉堡菜单 --- */
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 56px; left: 0; right: 0;
    flex-direction: column; background: var(--primary-dark);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px; gap: 2px;
    transform: translateY(-110%); opacity: 0;
    transition: transform 0.25s ease, opacity 0.2s;
    z-index: 99; pointer-events: none;
  }
  .nav-links.open {
    transform: translateY(0); opacity: 1; pointer-events: auto;
  }
  .nav-link {
    padding: 10px 14px; font-size: 14px; border-radius: 8px;
    justify-content: flex-start;
  }
  .nav-link.lang-btn {
    margin-top: 4px; padding: 8px 14px; font-size: 13px;
    justify-content: center; border: 1px solid rgba(255,255,255,0.2);
  }

  /* --- 主内容区 --- */
  .main-content { padding: 12px; }

  /* --- 页面标题 --- */
  .page-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .page-header h1 { font-size: 18px; }
  .search-bar { max-width: 100%; }
  .search-bar input { font-size: 16px; padding: 10px 14px; } /* 防止iOS缩放 */

  /* --- 分类跳转 --- */
  .cat-jump { gap: 4px; }
  .cat-jump a { font-size: 12px; padding: 5px 10px; }

  /* --- 产品概览卡片 --- */
  .cat-section-item { padding: 12px 14px; }
  .cat-section-item .info .name { font-size: 14px; }
  .cat-section-item .price { font-size: 15px; }

  /* --- 产品表格 → 卡片布局 --- */
  .pro-table-wrap {
    overflow: visible; border: none; background: transparent; border-radius: 0;
  }
  .pro-table {
    min-width: 0; border-collapse: separate; border-spacing: 0 8px;
  }
  .pro-table thead { display: none; }
  .pro-table tbody tr {
    display: block; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  }
  .pro-table tbody tr:hover { background: var(--bg-card); }
  .pro-table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border: none; font-size: 13px; text-align: left;
  }
  .pro-table td::before {
    content: attr(data-label); font-size: 11px; font-weight: 600;
    color: var(--text-secondary); white-space: nowrap; margin-right: 8px;
  }
  .pro-table td:last-child {
    justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px;
  }
  .pro-table .price-cell { font-size: 16px; }
  .btn-add {
    padding: 8px 20px; font-size: 14px; min-height: 36px;
  }

  /* --- 报价单页 --- */
  .quotation-form { padding: 16px; }
  .quotation-form h2 { font-size: 16px; }

  /* 报价单可编辑表格 → 卡片布局 */
  .editable-table-wrap { overflow: visible; }
  .item-table { min-width: 0; border-collapse: separate; border-spacing: 0 8px; }
  .item-table thead { display: none; }
  .item-table tbody tr {
    display: block; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px; margin-bottom: 8px;
    position: relative;
  }
  .item-table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border: none; font-size: 13px; text-align: left; width: 100%;
  }
  .item-table td::before {
    content: attr(data-label); font-size: 11px; font-weight: 600;
    color: var(--text-secondary); white-space: nowrap; margin-right: 8px; flex-shrink: 0;
  }
  .item-table .col-price { width: auto; }
  .item-table .col-qty { width: auto; }
  .item-table .col-unit { width: auto; }
  .item-table .col-subtotal { width: auto; }
  .item-table .col-del { width: auto; position: absolute; top: 8px; right: 10px; }
  .item-table .col-del::before { display: none; }
  .item-table .price-val { text-align: left; }
  .inline-input { width: 80px; font-size: 15px; padding: 6px 8px; }
  .qty-input { width: 60px; font-size: 16px; }

  /* --- 报价单摘要 --- */
  .quotation-summary { position: static; margin-top: 16px; padding: 16px; }
  .quotation-summary h2 { font-size: 16px; }

  /* --- 汇总按钮 --- */
  .btn { min-height: 44px; font-size: 15px; } /* 移动端触摸友好 */
  .btn-sm { min-height: 36px; font-size: 13px; }

  /* --- 表单输入 --- */
  .form-input, .form-select, .form-textarea { font-size: 16px; padding: 10px 12px; } /* 防止iOS缩放 */

  /* --- 弹窗 → 全屏 --- */
  .modal-box {
    width: 100%; max-width: 100%; max-height: 100vh; height: 100vh;
    border-radius: 0; padding: 20px; position: fixed; top: 0; left: 0;
    display: flex; flex-direction: column;
  }
  .modal-box h3 { font-size: 18px; margin-bottom: 12px; }
  .modal-actions { margin-top: auto; padding-top: 12px; }

  /* 数量弹窗保留小尺寸 */
  .qty-modal { max-width: 90%; width: auto; height: auto; max-height: 80vh; border-radius: 16px; position: relative; }

  /* --- 预览报价单 --- */
  .preview-quotation { padding: 20px 14px; font-size: 12px; }
  .preview-quotation h1 { font-size: 17px; }
  .preview-quotation table { font-size: 11px; }
  .preview-quotation th, .preview-quotation td { padding: 5px 4px; }

  /* --- 浮动购物车 (移动端改左下) --- */
  .cart-float {
    bottom: 16px; right: 16px; padding: 12px 16px; font-size: 13px;
  }
  .cart-float-price { font-size: 14px; }

  /* --- 历史报价页 --- */
  .history-header { flex-direction: column; align-items: stretch; }
  .history-table { min-width: 0; }
  .history-table th, .history-table td { padding: 10px 8px; font-size: 12px; }

  /* --- Toast --- */
  .toast { width: 90%; font-size: 13px; padding: 10px 16px; text-align: center; }
}

/* 小屏手机 <480px 进一步优化 */
@media (max-width: 480px) {
  .main-content { padding: 8px; }
  .navbar { padding: 0 12px; }
  .nav-title { font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pro-table td { font-size: 12px; padding: 5px 0; }
  .cat-section { border-radius: 8px; }
  .cat-section-item { padding: 10px 12px; }
  .btn-add { padding: 6px 14px; font-size: 13px; }

  .all-overview { gap: 12px; }
  .cat-section-header { padding: 10px 12px; font-size: 14px; }

  /* 报价单卡片 */
  .item-table tbody tr { padding: 10px; }
  .inline-input { width: 70px; font-size: 14px; }
  .qty-input { width: 50px; }

  /* 浮动购物车 */
  .cart-float { bottom: 12px; right: 12px; padding: 10px 14px; gap: 8px; }
  .cart-float-count { width: 20px; height: 20px; font-size: 10px; }

  /* 弹窗全屏无内边距 */
  .modal-box { padding: 14px; }
  .preview-quotation { padding: 14px 10px; }
  .preview-quotation h1 { font-size: 15px; }
}

/* ==================== 参数对比 ==================== */
.compare-cb {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary-light);
  flex-shrink: 0; margin-right: 8px;
}
.compare-cb-sm {
  width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary-light);
  display: block; margin: 0 auto;
}
/* 对比浮动栏 */
.compare-bar {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--accent); border-radius: 50px;
  padding: 8px 16px 8px 20px; display: flex; align-items: center; gap: 12px;
  z-index: 99; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: compareBarIn 0.3s ease;
}
@keyframes compareBarIn { from { opacity:0; transform:translateX(-50%) translateY(20px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
.compare-bar-info { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.compare-bar-close {
  width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(255,255,255,0.1);
  color: var(--text-secondary); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.compare-bar-close:hover { background: var(--danger); color: #fff; }

/* 工具栏对比按钮 */
.btn-compare { position: relative; white-space: nowrap; margin-left: 4px; }
.compare-badge {
  display: inline-block; min-width: 20px; padding: 1px 5px; margin-left: 4px;
  background: rgba(255,255,255,0.28); border-radius: 10px; font-size: 11px;
  line-height: 16px; text-align: center; vertical-align: 1px;
}
/* 选中2款后脉冲高亮 */
.compare-ready { animation: comparePulse 1.2s ease-in-out infinite; }
@keyframes comparePulse {
  0% { box-shadow: 0 0 0 0 rgba(230,126,34,0.65); }
  70% { box-shadow: 0 0 0 12px rgba(230,126,34,0); }
  100% { box-shadow: 0 0 0 0 rgba(230,126,34,0); }
}

/* 对比弹窗表格 */
.compare-modal { max-width: 800px; }
.compare-table-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
.compare-table th {
  padding: 14px 12px; text-align: center; font-size: 12px; font-weight: 600;
  border-bottom: 2px solid var(--border); vertical-align: middle;
}
.compare-field-th { width: 30%; color: var(--text-secondary); background: var(--primary-dark); }
.compare-a-th { background: rgba(37,99,235,0.1); border-left: 1px solid var(--border); }
.compare-b-th { background: rgba(5,150,105,0.1); border-left: 1px solid var(--border); }
.compare-prod-name { font-size: 13px; font-weight: 700; color: var(--text); }
.compare-prod-model { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.compare-table td {
  padding: 10px 12px; text-align: center; border-bottom: 1px solid rgba(71,85,105,0.3);
  vertical-align: middle;
}
.compare-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.compare-label { text-align: left; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.compare-unit { font-size: 11px; color: var(--text-secondary); font-weight: 400; }
.compare-price { font-weight: 700; color: var(--accent-light); }
.compare-row-basic td { font-size: 13px; }
.compare-row-key { background: rgba(230,126,34,0.06); border-left: 3px solid var(--accent); }
.compare-row-key td:first-child { color: var(--accent-light); }
.compare-diff { color: #f87171; font-weight: 700; position: relative; }
.compare-diff::before { content: '⚠ '; font-size: 11px; }
