:root {
  --primary: #3b82f6;
  --primary-dark: #1e40af;
  --primary-light: #eff6ff;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --accent: #8b5cf6;
  --bg: #f8fafc;
  --card: #ffffff;
  --header-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 2px 4px rgba(0,0,0,.04), 0 4px 8px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.04), 0 10px 20px rgba(0,0,0,.08);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: .15s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

.hidden { display: none !important; }

/* ---- 数据新鲜度 / 加载状态提示条 ---- */
.banner {
  padding: 10px 16px;
  margin: 0 0 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.banner-warn {
  background: var(--warning-light);
  color: #92400e;
  border-color: #fcd34d;
}
.banner-error {
  background: var(--danger-light);
  color: #991b1b;
  border-color: #fca5a5;
}

/* ---- Login ---- */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}
.login-card {
  background: var(--card);
  padding: 48px 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 400px;
  text-align: center;
  animation: fadeUp .4s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.login-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}
.form-group { text-align: left; margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus { border-color: var(--primary); }
.login-card button {
  width: 100%; padding: 12px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 600; cursor: pointer; margin-top: 8px;
  transition: background var(--transition);
}
.login-card button:hover { background: var(--primary-dark); }
.error-msg { color: var(--danger); margin-top: 12px; font-size: 14px; }

/* ---- Header ---- */
.header {
  background: var(--header-bg);
  color: #fff;
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.header h1, .header-title { font-size: 20px; font-weight: 700; color: #fff; margin: 0; letter-spacing: -.3px; }
.header-right { display: flex; gap: 10px; align-items: center; }
.header-right .date-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.header-right select {
  padding: 6px 12px; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius-sm);
  background: rgba(255,255,255,.1); color: #fff; font-size: 13px; cursor: pointer;
  transition: background var(--transition);
  outline: none;
}
.header-right select:hover { background: rgba(255,255,255,.18); }
.header-right select option { background: #1e293b; color: #fff; }


/* ===== Mode Tabs ===== */
.mode-tabs { display: flex; gap: 0; margin: 0 0 20px; background: var(--card); border-radius: 10px; padding: 4px; box-shadow: var(--shadow); }
.mode-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; background: transparent; transition: all 0.2s; color: var(--text-secondary); text-align: center; font-family: inherit; font-size: inherit; }
.mode-tab:hover { background: var(--primary-light); color: var(--primary); }
.mode-tab.active { background: var(--primary); color: #fff; box-shadow: 0 1px 4px rgba(59,130,246,.3); }
.mode-tab.active .mode-tab-desc { color: rgba(255,255,255,.6); }
.mode-tab-icon { font-size: 18px; line-height: 1; }
.mode-tab-label { font-size: 14px; font-weight: 600; }
.mode-tab-desc { font-size: 11px; color: var(--text-muted); }
.mode-tab:hover .mode-tab-desc { color: inherit; }
@media (max-width: 640px) { .mode-tab { padding: 8px 12px; } .mode-tab-desc { display: none; } }

/* ---- Buttons ---- */
.btn {
  padding: 7px 16px; border: none; border-radius: var(--radius-sm); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all var(--transition);
  letter-spacing: -.1px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #7c3aed; transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px 28px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card:nth-child(1) { border-top-color: var(--primary); }
.stat-card:nth-child(2) { border-top-color: var(--accent); }
.stat-card:nth-child(3) { border-top-color: var(--warning); }
.stat-card:nth-child(4) { border-top-color: var(--success); }
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.stat-value { font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }

/* ---- Main Row ---- */
.main-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 28px 20px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* Chart */
.chart-wrapper { position: relative; height: 320px; }

/* Table */
.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 11px 14px; text-align: left; font-size: 13px; }
th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
td { border-bottom: 1px solid var(--border); }
tbody tr { transition: background var(--transition); }
tbody tr:nth-child(odd) td { background: #fafbfc; }
tbody tr:hover td { background: var(--primary-light); }
tbody tr.excluded-row td { opacity: .45; font-style: italic; }
tbody tr.excluded-row:hover td { opacity: .65; }
.report-detail-row td { background: var(--bg) !important; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: -.1px;
}
.badge-high { background: var(--danger-light); color: #dc2626; }
.badge-ok { background: var(--success-light); color: #16a34a; }
.badge-low { background: var(--warning-light); color: #d97706; }
.effective-num { color: #64748b; font-size: 0.85em; margin-left: 2px; }

/* ---- Suggestions ---- */
.suggestions-card { margin: 0 28px 28px; }
.suggestions-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.suggestions-header h2 { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.placeholder-text { color: var(--text-muted); text-align: center; padding: 32px; font-size: 14px; }

.suggestion-item {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
  cursor: pointer;
}
.suggestion-item:hover { border-color: var(--primary); background: var(--primary-light); }
.suggestion-item.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px rgba(59,130,246,.15); }

.suggestion-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.suggestion-main { flex: 1; }
.suggestion-arrow { font-weight: 700; color: var(--primary); font-size: 14px; }
.suggestion-reports { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.suggestion-count {
  background: var(--primary); color: #fff; border-radius: 20px;
  padding: 3px 12px; font-size: 12px; font-weight: 600;
}

.simulation-bar {
  margin-top: 16px; padding: 14px 18px;
  background: var(--success-light); border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-sm); display: flex; align-items: center; gap: 16px;
  font-size: 14px;
}
.simulation-bar.danger { background: var(--danger-light); border-color: #fecaca; }

.execute-bar {
  margin-top: 16px; display: flex; justify-content: flex-end; gap: 12px;
}

/* ---- Report Detail Panel ---- */
.report-list { margin-top: 8px; }
.report-list-item {
  padding: 10px 14px; font-size: 13px;
  border-left: 3px solid var(--border);
  margin-left: 8px; margin-bottom: 4px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--card);
  transition: border-color var(--transition);
}
.report-list-item:hover { border-left-color: var(--primary); }
.report-list-item .rn { font-weight: 600; font-size: 13px; }
.report-list-item .rc { color: var(--text-muted); margin-left: 10px; font-size: 12px; }
.report-list-item .insp { color: #6366f1; margin-left: 10px; font-size: 12px; font-weight: 500; }
.report-list-item .rn-completed { color: #15803d; }
.report-list-item .order-count { color: var(--text-muted); font-size: 12px; margin-left: 10px; }

.order-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.order-info { flex: 1; min-width: 0; }
.order-action {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.transfer-select {
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  background: var(--card);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.transfer-select:focus { border-color: var(--primary); }
.btn-transfer {
  background: var(--primary); color: #fff;
  border: none; border-radius: 4px;
  padding: 5px 12px; font-size: 12px;
  font-weight: 600; cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-transfer:hover { background: var(--primary-dark); }
.btn-transfer:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Toast ---- */
/* (rendered dynamically by JS) */

/* ---- Loading ---- */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; z-index: 9999;
}
.spinner {
  width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { color: #fff; margin-top: 14px; font-size: 15px; font-weight: 500; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .main-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .header { flex-direction: column; height: auto; padding: 12px 16px; gap: 10px; }
  .stats-row, .main-row, .suggestions-card { padding-left: 16px; padding-right: 16px; }
  .suggestions-card { margin-left: 16px; margin-right: 16px; }
}

/* ---- Customer Distribution ---- */
.customer-card { margin: 0 28px 20px; }
.pie-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pie-card {
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border);
}
.pie-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pie-body {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pie-canvas-wrap {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}
.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}
.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pie-legend-name {
  color: var(--text-secondary);
}
.pie-legend-val {
  color: var(--text);
  font-weight: 600;
}

/* ---- Transfer Log ---- */
.log-card { margin: 0 28px 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.log-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.log-header h2 { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.log-table { width: 100%; min-width: 560px; font-size: 13px; }
.log-table th {
  background: var(--bg); font-weight: 600; color: var(--text-muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.log-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.log-table tr:hover td { background: var(--primary-light); }
.log-time { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.log-arrow { color: var(--primary); font-weight: 700; }
/* 转移记录撤销按钮 + 撤销/已撤销视觉 */
.btn-undo {
  background: #fff; color: var(--danger, #ef4444); border: 1.5px solid var(--danger, #ef4444);
  border-radius: 4px; padding: 4px 10px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-undo:hover { background: var(--danger, #ef4444); color: #fff; }
.btn-undo:disabled { opacity: .5; cursor: not-allowed; }
.log-revert td { background: #f8fafc; color: var(--text-muted); }
.log-revert .log-arrow { color: var(--text-muted); }
.log-reverted-tag { color: var(--text-muted); font-size: 12px; }


/* ---- INIT (待处理) Report ---- */
.rn-init {
  color: #ea580c !important;
}
.init-badge {
  display: inline-block;
  background: #f97316;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: .3px;
}

/* ---- Today New Badge ---- */
.new-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: .3px;
}

/* ---- Daily Unfinished Board ---- */
.daily-card { margin: 0 28px 20px; }
.daily-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.daily-col {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.daily-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.daily-badge {
  display: inline-block;
  min-width: 22px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
}
.daily-badge.daily-zero {
  background: var(--success);
}
.daily-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}
.daily-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  font-size: 12px;
  border-bottom: 1px dashed var(--border);
}
.daily-item:last-child { border-bottom: none; }
.daily-rn {
  font-weight: 600;
  color: var(--primary);
  font-size: 11px;
  white-space: nowrap;
}
.daily-status-pending,
.daily-status-review {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  white-space: nowrap;
}
.daily-status-pending {
  background: #fef3c7;
  color: #92400e;
}
.daily-status-review {
  background: #dbeafe;
  color: #1e40af;
}
.daily-meta {
  color: var(--text-muted);
  font-size: 11px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.daily-empty {
  text-align: center;
  color: var(--success);
  font-size: 13px;
  padding: 20px 8px;
}

@media (max-width: 900px) {
  .daily-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .daily-grid {
    grid-template-columns: 1fr;
  }
}

.completed-cell { display: inline-flex; align-items: center; gap: 6px; }
.bar-num { flex-shrink: 0; }
.mini-bar-wrap { width: 50px; height: 10px; background: #cbd5e1; border-radius: 5px; overflow: hidden; flex-shrink: 0; }
.mini-bar { height: 100%; background: #16a34a !important; border-radius: 5px; transition: width 0.5s ease; min-width: 2px; }

/* ---- Mobile PWA ---- */
@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .stats-row { flex-wrap: wrap; gap: 8px; }
  .stat-card { flex: 1 1 45%; min-width: 0; }
  .chart-container { height: auto !important; min-height: 280px; }
  .workload-table { font-size: 13px; display: block; overflow-x: auto; }
  .pie-row { grid-template-columns: 1fr !important; }
  .pie-body { flex-direction: column !important; }
  .customer-card { margin: 8px 0 !important; }
  .login-card { margin: 20px; padding: 24px; }
  body { -webkit-tap-highlight-color: transparent; }
  .btn { min-height: 44px; }
}

@media (max-width: 480px) {
  .stat-card { flex: 1 1 100%; }
  .header { padding: 0 14px; }
  .header-right .date-label { display: none; }
  .header-content h1 { font-size: 18px; }
  .header-content p { font-size: 12px; }
  .log-card { margin: 0 14px 20px; }
}

/* ---- Priority & Blocked ---- */
.priority-bar {
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
}
.priority-bar.recommended {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.priority-bar.optional {
  background: #f0f9ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.priority-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  vertical-align: middle;
}
.priority-tag.recommended {
  background: #fee2e2;
  color: #dc2626;
}
.priority-tag.optional {
  background: #dbeafe;
  color: #2563eb;
}
.suggestion-optional {
  opacity: 0.85;
}
.suggestion-optional:hover {
  opacity: 1;
}
.blocked-section {
  margin-top: 12px;
  padding: 12px 16px;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
}
.blocked-header {
  font-weight: 700;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 8px;
}
.blocked-item {
  padding: 6px 0;
  font-size: 13px;
  color: #78350f;
  border-bottom: 1px dashed #fde68a;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.blocked-item:last-child {
  border-bottom: none;
}
.blocked-reason {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #fee2e2;
  color: #dc2626;
  flex-shrink: 0;
}
.blocked-count {
  margin-left: auto;
  font-weight: 600;
  color: #92400e;
  flex-shrink: 0;
}

/* ===== Quote Suggestion ===== */
/* ===== Quote Search ===== */
.quote-search { display: flex; flex-direction: column; align-items: center; padding: 28px 0; }
.quote-search-inner { display: flex; gap: 12px; width: 100%; max-width: 600px; }
.quote-input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: var(--card);
  color: var(--text-primary);
  transition: border-color .2s, box-shadow .2s;
  min-width: 0;
}
.quote-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.quote-search-inner .btn-accent {
  padding: 14px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .1s;
}
.quote-search-inner .btn-accent:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ===== Quote Section Title ===== */
.quote-section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 20px 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }


/* ===== Quote Mode ===== */
.quote-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin-bottom: 16px; }
.quote-info-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; background: var(--bg); border-radius: 8px; }
.quote-info-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.quote-info-value { font-size: 15px; color: var(--text-primary); font-weight: 700; }
.quote-info-highlight { background: var(--primary-light); border-radius: 8px; border-left: 3px solid var(--primary); }
.quote-info-highlight .quote-info-value { color: var(--primary-dark); }

.quote-reports-box { margin-top: 16px; padding: 16px; background: var(--card); border-radius: 10px; border: 1px solid var(--border); }

/* ===== Quote Ref Table ===== */

.quote-suggestion-box { background: linear-gradient(135deg, #1e40af, #3b82f6); color: #fff; border-radius: 14px; padding: 20px 24px; margin-bottom: 16px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.quote-suggestion-big { font-size: 36px; font-weight: 800; line-height: 1; }
.quote-suggestion-big small { font-size: 14px; font-weight: 400; opacity: .7; }
.quote-confidence { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.conf-high { background: rgba(255,255,255,.25); }
.conf-mid { background: rgba(255,255,255,.18); }
.conf-low { background: rgba(255,255,255,.1); }
.quote-range { font-size: 13px; opacity: .7; margin-top: 6px; }
.quote-reason { margin-top: 20px; padding: 12px; background: var(--bg); border-radius: 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.quote-time-info { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.quote-time-note { margin-top: 4px; font-size: 12px; color: var(--warning); font-style: italic; }
.quote-no-data { color: var(--text-muted); text-align: center; padding: 20px; }

.quote-history-list { max-height: 400px; overflow-y: auto; }


.ref-table-wrap { overflow-x: auto; }
.quote-ref-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.quote-ref-table thead th { background: var(--bg); padding: 10px 8px; text-align: left; font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.quote-ref-table tbody td { padding: 8px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.quote-ref-table tbody td.prod-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-ref-table tbody tr:hover { background: var(--primary-light); }
.tier-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.tier1 { background: #dcfce7; color: #166534; }
.tier2 { background: #fef9c3; color: #854d0e; }
.tier3 { background: #f3e8ff; color: #6b21a8; }
/* Quote highlight & reports */
.quote-info-highlight { background: var(--primary-light); border-radius: 8px; border-left: 3px solid var(--primary); }
.quote-info-highlight .quote-info-value { color: var(--primary-dark); }
.quote-reports-box { margin-top: 16px; padding: 16px; background: var(--card); border-radius: 10px; border: 1px solid var(--border); }
.quote-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quote-info-grid .quote-info-row { padding: 8px 12px; border-radius: 6px; }
@media (max-width: 640px) {
  .quote-info-grid { grid-template-columns: 1fr; }
  /* 转移记录：窄屏改为竖向卡片堆叠，杜绝横向滑动触发浏览器后退手势 */
  .log-card { overflow-x: visible; margin: 0 14px 20px; }
  .log-table { min-width: 0; width: 100%; display: block; }
  .log-table thead { display: none; }
  .log-table tbody { display: block; }
  .log-table tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 4px 0;
  }
  .log-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 7px 12px;
    border: none;
    text-align: right;
    font-size: 13px;
    word-break: break-word;
  }
  .log-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-align: left;
  }
  .log-table td.log-time { white-space: normal; }
  /* 参考订单 / 查询历史：窄屏改为竖向卡片堆叠，杜绝横向滑动触发浏览器后退手势 */
  .ref-table-wrap { overflow-x: visible; }
  .ref-table-wrap .quote-ref-table,
  #quoteHistoryContent .quote-ref-table { min-width: 0; width: 100%; display: block; }
  .ref-table-wrap .quote-ref-table thead,
  #quoteHistoryContent .quote-ref-table thead { display: none; }
  .ref-table-wrap .quote-ref-table tbody,
  #quoteHistoryContent .quote-ref-table tbody { display: block; }
  .ref-table-wrap .quote-ref-table tr,
  #quoteHistoryContent .quote-ref-table tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 4px 0;
  }
  .ref-table-wrap .quote-ref-table td,
  #quoteHistoryContent .quote-ref-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 7px 12px;
    border: none;
    text-align: right;
    font-size: 13px;
    word-break: break-word;
    white-space: normal;
  }
  .ref-table-wrap .quote-ref-table td::before,
  #quoteHistoryContent .quote-ref-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-align: left;
  }
  .ref-table-wrap .quote-ref-table tbody td.prod-cell { white-space: normal; overflow: visible; max-width: none; }
  .ref-table-wrap .quote-ref-table td.ref-action,
  #quoteHistoryContent .quote-ref-table td.ref-action { display: block; text-align: left; }
  .ref-table-wrap .quote-ref-table td.ref-action::before,
  #quoteHistoryContent .quote-ref-table td.ref-action::before { margin-bottom: 6px; }
  .ref-table-wrap .quote-ref-table td.ref-action .btn,
  #quoteHistoryContent .quote-ref-table td.ref-action .btn { width: 100%; }
  /* 订单详情的 4 列表格：窄屏允许内部横向滚动兜底（body 已禁用滑动链，不会触发后退手势） */
  .quote-reports-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
