﻿:root {
  color-scheme: light;
  --ink: #1a1f2e;
  --muted: #6b7280;
  --line: #e2e6ee;
  --paper: #ffffff;
  --soft: #f5f7fa;
  --brand: #2f5f8f;
  --brand-dark: #183f63;
  --brand-light: #dce8f3;
  --accent: #f59e0b;
  --danger: #dc2626;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #f0f2f5;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.shell.wide { width: min(1120px, calc(100% - 32px)); }

/* ===== Hero / Header ===== */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 600px;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: var(--ink);
}

h2 { margin: 0; font-size: 18px; }

/* ===== Buttons ===== */
button, .admin-link {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  font-size: 14px;
}

button:hover, .admin-link:hover { background: var(--brand-dark); }
button:active { transform: scale(0.97); }
button.soft { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
button.soft:hover { background: var(--line); }
button.danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }

/* ===== Panels ===== */
.login-panel, .search-panel, .form-panel, .table-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 24px;
}

.login-panel {
  max-width: 380px;
  margin: 0 auto;
}

.search-panel {
  margin-bottom: 20px;
}

/* ===== Form Elements ===== */
label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
  background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 95, 143, 0.13);
}

.quote-line-flash {
  animation: quoteLineFlash 0.35s ease-in-out 2;
}

@keyframes quoteLineFlash {
  0%, 100% {
    border-color: var(--line);
    box-shadow: none;
    background: var(--soft);
  }
  50% {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
    background: #fff7e6;
  }
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

/* ===== Section / Form Headers ===== */
.section-head, .form-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

#status, .hint {
  color: var(--muted);
  font-size: 13px;
}

.result-title-block {
  display: grid;
  gap: 4px;
}

.quote-disclaimer {
  margin: 0;
  color: #7c8b9a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

/* ===== Results (Quote Cards) ===== */
.results {
  display: grid;
  gap: 3px;
}

.results:not(:empty) {
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px rgba(47, 95, 143, 0.13);
  padding: 6px;
}

.quote-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  align-items: center;
  background: var(--soft);
  border: 0;
  border-radius: 4px;
  padding: 6px 10px;
}

.quote-card:hover {
  background: var(--line);
}

.quote-card.qc-compact { padding: 5px 10px; }
.quote-card.qc-compact .part-title { margin: 0; font-size: 14px; }
.quote-card.qc-compact .meta { margin-top: 0; }
.quote-card.qc-compact .price { font-size: 20px; }

.result-toggle {
  width: 100%;
  padding: 6px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--brand-dark);
  font-size: 13px;
  line-height: 1.2;
}

.result-toggle:hover {
  background: var(--brand-light);
}

.part-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.history {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.price {
  color: var(--brand-dark);
  font-size: 26px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

/* ===== Admin Layout ===== */
.hidden { display: none !important; }

body.admin-active {
  background:
    linear-gradient(180deg, rgba(47, 95, 143, 0.13) 0, rgba(246, 248, 250, 0) 280px),
    #f3f6f8;
}

.admin-shell { width: min(1220px, calc(100% - 32px)); }

.admin-hero {
  align-items: center;
  background: linear-gradient(135deg, #102f4d, #183f63 56%, #2f5f8f);
  border: 0;
  color: white;
  box-shadow: 0 16px 36px rgba(24, 63, 99, 0.18);
}

.admin-hero h1,
.admin-hero .eyebrow { color: white; }

.admin-hero .eyebrow { opacity: 0.78; }

.admin-hero .admin-link {
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.28);
}

.admin-hero .admin-link:hover { background: rgba(255,255,255,0.22); }

.admin-login {
  display: grid;
  gap: 14px;
  max-width: 460px;
}

.admin-workspace {
  display: grid;
  gap: 14px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.admin-stat {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(47, 95, 143, 0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
}

.admin-stat span {
  color: #647587;
  font-size: 13px;
  font-weight: 800;
}

.admin-stat strong {
  color: #183f63;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #e8eef4;
  border: 1px solid rgba(47, 95, 143, 0.12);
  border-radius: 8px;
  padding: 6px;
  box-shadow: var(--shadow-sm);
}

.admin-tab {
  min-height: 42px;
  background: transparent;
  color: #526477;
  font-weight: 900;
  padding: 10px 18px;
  border-radius: 6px;
  text-align: center;
  border: 0;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.admin-tab:hover { background: rgba(255,255,255,0.66); color: #183f63; }
.admin-tab.active { background: #183f63; color: white; box-shadow: 0 8px 18px rgba(24, 63, 99, 0.18); }

.admin-panel {
  border-radius: 8px;
  border-color: rgba(47, 95, 143, 0.12);
  box-shadow: 0 12px 28px rgba(24, 63, 99, 0.08);
}

.admin-panel-head { margin-bottom: 16px; }

.admin-panel-head h2,
.editor-head h3,
.admin-form-section h3 {
  color: #183f63;
  font-weight: 900;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.form-panel { display: grid; gap: 14px; }
.mini-form { display: grid; gap: 12px; }
.actions { display: flex; gap: 10px; }
.compact-search { max-width: 320px; }
.parts-table { display: grid; gap: 6px; }

.admin-split {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-list-pane {
  display: grid;
  gap: 10px;
}

.admin-editor,
.admin-form-section {
  padding: 14px;
  border: 1px solid rgba(47, 95, 143, 0.12);
  border-radius: 8px;
  background: #f9fbfd;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.editor-head h3,
.admin-form-section h3 { margin: 0; font-size: 16px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dce8f3;
  color: #183f63;
  font-size: 12px;
  font-weight: 900;
}

.admin-form-section { display: grid; gap: 12px; }

.product-finder {
  gap: 8px;
  background: #f4f8fc;
}

.product-finder input {
  min-height: 42px;
  font-weight: 700;
}

.product-finder-results {
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.product-finder-row {
  min-height: 58px;
  padding: 8px 10px;
}

.product-finder-row strong {
  margin-bottom: 2px;
}

.product-finder-empty {
  padding: 12px;
  background: #ffffff;
}

.admin-actions button { min-width: 116px; }

.admin-list-hint { margin: -6px 0 12px; }

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(47, 95, 143, 0.25);
  border-radius: 8px;
  color: #647587;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.part-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.part-row:hover { background: #f7fafc; border-color: rgba(47, 95, 143, 0.38); box-shadow: var(--shadow-sm); }
.part-row strong { display: block; margin-bottom: 5px; font-size: 14px; }

.part-row-sm {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 11px 12px;
}

.part-row-sm strong { font-size: 14px; margin: 0 0 3px; }
.part-row-sm small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }

.admin-customer-row {
  grid-template-columns: 1fr;
  gap: 5px;
  min-height: 58px;
  padding: 8px 10px;
}

.admin-customer-row strong {
  margin: 0;
  line-height: 1.25;
}

.customer-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.customer-row-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid rgba(47, 95, 143, 0.14);
  border-radius: 999px;
  background: #e8f0f7;
  color: #2f5f8f;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}

.customer-status:hover {
  background: #dce8f3;
  color: #183f63;
  box-shadow: none;
}

.customer-status.is-inactive {
  border-color: rgba(220, 38, 38, 0.16);
  background: #f7eeee;
  color: #b91c1c;
}

.customer-status.is-inactive:hover {
  background: #fee2e2;
  color: #991b1b;
}

.customer-query-block {
  display: grid;
  gap: 2px;
}

.customer-query-line {
  margin: 0;
  color: #526477;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.customer-list-toggle {
  width: 100%;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.part-row-sm .numbers { font-size: 13px; font-weight: 900; }

.admin-customer-row.selected {
  border-color: #2f5f8f;
  background: #eef5fb;
  box-shadow: inset 3px 0 0 #2f5f8f;
}

.admin-product-row .meta { margin-top: 2px; }

.numbers {
  text-align: right;
  font-weight: 900;
  white-space: nowrap;
  font-size: 15px;
  color: #183f63;
}

.numbers small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
  font-size: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .hero, .section-head, .form-head, .quote-card { flex-direction: column; }
  .hero { flex-direction: column; text-align: center; }
  body.quote-active .app-hero h1::after {
    left: 50%;
    transform: translateX(-50%);
  }
  .search-row, .admin-grid, .admin-columns, .field-grid, .part-row {
    grid-template-columns: 1fr;
  }
  .admin-summary,
  .admin-tabs,
  .admin-split,
  .admin-price-grid {
    grid-template-columns: 1fr;
  }
  .compact-search { max-width: 100%; }
  .price, .numbers { text-align: left; }
  .login-panel { max-width: 100%; }
  .results { gap: 6px; }
}

/* ===== Tab Bar (legacy - kept for compatibility) ===== */
.tab-bar {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
}
.tab { background: none; color: var(--muted); font-weight: 600; padding: 10px 18px; border-radius: var(--radius-sm); }
.tab:hover { background: var(--soft); color: var(--ink); }
.tab.active { background: var(--brand); color: white; }

/* ===== Customer Quote Polish ===== */
body {
  background: linear-gradient(180deg, #eef4f6 0, #f6f7f9 240px, #eef1f4 100%);
}

body.quote-active {
  background:
    linear-gradient(180deg, rgba(47, 95, 143, 0.1) 0, rgba(246, 248, 250, 0) 300px),
    linear-gradient(180deg, #eef3f5 0, #f7f8fa 48%, #eef1f4 100%);
}

.shell {
  width: min(980px, calc(100% - 28px));
  padding: 18px 0 44px;
}

body.quote-active .shell {
  width: min(1080px, calc(100% - 28px));
  padding-top: 20px;
}

.hero {
  margin-bottom: 14px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbfc 100%);
  border-color: rgba(47, 95, 143, 0.18);
  border-radius: 8px;
}

body.quote-active .app-hero {
  margin-bottom: 12px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, #183f63 0%, #2f5f8f 58%, #f7fafb 58%, #ffffff 100%);
  border: 0;
  box-shadow: 0 12px 34px rgba(24, 63, 99, 0.14);
  color: #ffffff;
}

body.quote-active .app-hero .eyebrow,
body.quote-active .app-hero h1 {
  color: #ffffff;
}

body.quote-active .app-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 7px;
  padding: 3px 9px;
  border: 1px solid rgba(244, 181, 64, 0.46);
  border-radius: 999px;
  background: rgba(244, 181, 64, 0.12);
  color: #f4b540;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

body.quote-active .app-hero h1 {
  position: relative;
  padding-bottom: 8px;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
}

body.quote-active .app-hero h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: #f4b540;
}

.hero-badge {
  position: relative;
  min-width: 218px;
  padding: 11px 18px 12px;
  border: 1px solid rgba(47, 95, 143, 0.22);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(220,232,243,0.84));
  color: var(--brand-dark);
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-align: center;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 10px 24px rgba(24, 63, 99, 0.12);
}

.hero-badge::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 7px;
  height: 2px;
  border-radius: 999px;
  background: #f4b540;
  opacity: 0.88;
}

.eyebrow,
h1,
.price {
  letter-spacing: 0;
}

.search-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
}

body.quote-active .search-panel,
body.quote-active #resultPanel {
  border: 1px solid rgba(47, 95, 143, 0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 12px 30px rgba(24, 63, 99, 0.08);
}

body.quote-active .search-panel {
  padding: 14px;
}

body.quote-active #resultPanel {
  padding: 16px;
}

.customer-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(47, 95, 143, 0.18);
  border-radius: 8px;
  background: #f7fafc;
}

body.quote-active .customer-bar {
  margin-bottom: 12px;
  border-color: rgba(47, 95, 143, 0.22);
  background: linear-gradient(135deg, #f4f8fc 0%, #ffffff 100%);
}

.customer-welcome {
  min-width: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.customer-welcome strong {
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 800;
  word-break: break-word;
}

.customer-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.search-row {
  gap: 8px;
  margin-top: 8px;
}

body.quote-active .search-panel > .search-row {
  grid-template-columns: minmax(0, 1fr) 112px;
  margin-top: 10px;
}

body.quote-active #query {
  min-height: 48px;
  border-color: rgba(47, 95, 143, 0.18);
  background: #fbfcfd;
  font-size: 15px;
  font-weight: 400;
}

body.quote-active #searchBtn {
  min-height: 48px;
  background: var(--brand);
  font-size: 16px;
  font-weight: 800;
}

body.quote-active #searchBtn:hover {
  background: var(--brand-dark);
}

.vin-row {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(47, 95, 143, 0.12);
}

.vin-row label {
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
}

.vin-manual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.vin-manual-row input {
  height: 42px;
  min-height: 42px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.engine-input-wrap {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.engine-input-hint {
  margin: 0;
  color: #7c8b9a;
  font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.vin17-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vin17-btn {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(47, 95, 143, 0.18);
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.vin17-btn:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.vin17-open-link {
  color: #64747a;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.vin17-open-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

#vin17Status {
  color: #7c8b9a;
  font-size: 12px;
  font-weight: 700;
}

.vin17-panel {
  overflow: hidden;
  border: 1px solid rgba(47, 95, 143, 0.14);
  border-radius: 8px;
  background: #ffffff;
}

.vin17-panel-head {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(47, 95, 143, 0.12);
  background: #f1f6fb;
}

.vin17-panel-head span {
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
}

.vin17-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vin17-panel iframe {
  display: block;
  width: 100%;
  height: 520px;
  border: 0;
  background: #ffffff;
}

.engine-template-row {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(47, 95, 143, 0.14);
  border-radius: 8px;
  background: #f7fafc;
}

.engine-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.engine-template-head span {
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
}

.engine-template-head small {
  min-height: 17px;
  color: #7c8b9a;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.engine-template-buttons {
  display: grid;
  gap: 6px;
}

.engine-template-foot {
  display: flex;
  justify-content: flex-end;
}

.engine-template-toggle {
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid rgba(47, 95, 143, 0.18);
  border-radius: 6px;
  background: #ffffff;
  color: #526477;
  font-size: 12px;
  font-weight: 800;
}

.engine-template-toggle:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.engine-template-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.engine-template-btn {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(47, 95, 143, 0.18);
  border-radius: 6px;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.engine-template-btn:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.section-head {
  margin-bottom: 10px;
}

.query-head {
  align-items: center;
}

.query-note {
  margin: 4px 0 0;
  color: #7c8b9a;
  font-size: 12px;
  font-weight: 600;
}

.logout-btn {
  padding: 7px 14px;
  border: 1px solid var(--line);
  background: #f7fafb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

body.quote-active .logout-btn {
  min-height: 34px;
  padding: 6px 12px;
}

.logout-btn:hover {
  background: #eef2f4;
  color: var(--ink);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 35, 52, 0.56);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(0,0,0,0.25);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.icon-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafb;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-close:hover {
  background: #eef2f4;
  color: var(--ink);
}

.modal-form {
  display: grid;
  gap: 10px;
}

.modal-form button:not(.icon-close) {
  margin-top: 6px;
}

.results {
  gap: 4px;
}

body.quote-active #resultPanel .section-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

body.quote-active #status {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fafb;
  color: #64747a;
  font-weight: 700;
}

.results:not(:empty) {
  padding: 7px;
  background: rgba(255,255,255,0.72);
}

body.quote-active .results:not(:empty) {
  margin-top: 12px;
  padding: 8px;
  border-color: rgba(47, 95, 143, 0.22);
  background: #f7fafb;
  box-shadow: none;
}

.quote-card {
  gap: 12px;
  background: #f8fafc;
  padding: 7px 10px;
}

body.quote-active .quote-card {
  min-height: 52px;
  border: 1px solid rgba(47, 95, 143, 0.08);
  background: #ffffff;
}

.quote-card:hover {
  background: #eef4fa;
}

.quote-card.qc-compact {
  padding: 6px 10px;
}

.quote-card.qc-compact .price {
  font-size: 21px;
}

body.quote-active .part-title {
  font-size: 15px;
}

body.quote-active .price {
  color: #183f63;
  font-size: 22px;
}

body.quote-active .pill {
  background: #f1f5f6;
}

.copy-section {
  margin-top: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

body.quote-active .copy-section {
  margin-top: 16px;
  padding: 14px;
  background: #f7fafc;
  border-color: rgba(47, 95, 143, 0.12);
  box-shadow: none;
}

.copy-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 68px minmax(280px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.copy-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(47, 95, 143, 0.14);
  border-radius: 8px;
  background: #ffffff;
}

.copy-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(47, 95, 143, 0.12);
  background: #f1f6fb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

body.quote-active .copy-head {
  color: var(--brand-dark);
  font-size: 14px;
}

.copy-head-action {
  align-items: center;
}

.copy-panel textarea {
  width: 100%;
  flex: 1;
  min-height: 238px;
  font-size: 14px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  resize: vertical;
  background: #ffffff;
  color: var(--ink);
  line-height: 1.6;
}

body.quote-active .copy-panel textarea {
  min-height: 250px;
  background: #ffffff;
  font-size: 15px;
}

.markup-panel {
  display: grid;
  grid-template-rows: 42px repeat(5, 1fr);
  gap: 6px;
  width: 68px;
  height: 100%;
  align-self: stretch;
  flex-shrink: 0;
}

.markup-title {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(47, 95, 143, 0.14);
  border-radius: 8px;
  background: #f1f6fb;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.markup-btn {
  min-height: 38px;
  padding: 4px 0;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #40566b;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
}

.markup-btn:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: none;
}

.copy-result-btn {
  margin-left: auto;
  min-width: 70px;
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
  background: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
}

.copy-result-btn:hover {
  background: var(--brand-dark);
  color: #ffffff;
  box-shadow: none;
}

@media (max-width: 820px) {
  .copy-grid {
    grid-template-columns: 1fr;
  }

  .markup-panel {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto;
    width: 100%;
    height: auto;
  }

  .markup-title {
    grid-column: 1 / -1;
  }
}

/* ===== Customer Login Showcase ===== */
body.login-active {
  background: linear-gradient(135deg, #102f4d 0%, #183f63 48%, #2f5f8f 100%);
}

body.login-active .shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 28px 0;
}

body.login-active .app-hero {
  display: none;
}

.login-showcase {
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 20px;
  align-items: stretch;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-media,
.login-form-card {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 8px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 24px 70px rgba(10, 31, 51, 0.3);
  overflow: hidden;
}

.login-media {
  display: grid;
  grid-template-rows: minmax(280px, 1fr) auto auto;
}

.login-photo {
  position: relative;
  min-height: 330px;
  display: grid;
  align-items: center;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(16, 47, 77, 0.22), rgba(47, 95, 143, 0.08)),
    url("/assets/login-customer-service.jpg") center center / cover no-repeat;
}

.login-photo::after {
  content: "";
  position: absolute;
  pointer-events: none;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(16, 47, 77, 0.44));
}

.login-photo-lines {
  display: none;
}

.login-photo-lines span {
  height: 12px;
  border-radius: 2px;
  background: rgba(255,255,255,0.28);
}

.login-photo-lines span:nth-child(2) {
  width: 78%;
}

.login-photo-lines span:nth-child(3) {
  width: 54%;
}

.login-brand-strip {
  display: grid;
  gap: 3px;
  padding: 13px 24px;
  background: linear-gradient(135deg, #183f63, #2f5f8f);
  color: #ffffff;
}

.login-brand-strip p {
  margin: 0;
  color: #f4b540;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.login-brand-strip strong {
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: 0;
}

.login-proof-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px;
  background: #eef4f9;
}

.login-metric {
  position: relative;
  min-height: 100px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 16px 14px 18px;
  border: 1px solid rgba(47, 95, 143, 0.22);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(220,232,243,0.86));
  text-align: center;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 8px 18px rgba(24, 63, 99, 0.08);
}

.login-metric::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 8px;
  height: 2px;
  border-radius: 999px;
  background: #f4b540;
  opacity: 0.86;
}

.login-metric span {
  color: #7c8b9a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.5px;
}

.login-metric strong {
  color: #183f63;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
}

.login-form-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: rgba(255,255,255,0.96);
}

.login-form-head {
  padding: 46px 34px 44px;
  background: linear-gradient(135deg, #102f4d, #183f63 55%, #2f5f8f);
}

.login-form-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 34px 34px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,251,0.96));
}

.login-form-card .eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  margin-bottom: 10px;
  padding: 4px 11px;
  border: 1px solid rgba(244, 181, 64, 0.58);
  border-radius: 7px;
  background: rgba(244, 181, 64, 0.14);
  color: #f6c86d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.login-form-card h1 {
  position: relative;
  margin-bottom: 0;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.login-fields {
  display: grid;
  gap: 10px;
}

.login-fields label {
  color: #183f63;
  font-weight: 800;
}

.login-fields input {
  min-height: 46px;
  border-color: rgba(47, 95, 143, 0.2);
  background: #ffffff;
  font-weight: 700;
}

.login-fields label + input,
.login-fields label + .login-action-row {
  margin-bottom: 8px;
}

.forgot-link {
  justify-self: end;
  margin-top: -6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7c8b9a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.login-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  opacity: 0;
}

.login-error.is-visible {
  opacity: 1;
}

.forgot-link:hover {
  background: transparent;
  color: var(--brand-dark);
  text-decoration: underline;
}

.login-action-row {
  grid-template-columns: minmax(0, 1fr) 88px;
}

.login-action-row button {
  min-height: 46px;
  background: linear-gradient(135deg, #183f63, #2f5f8f);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(24, 63, 99, 0.18);
}

.login-action-row button:hover {
  background: linear-gradient(135deg, #123552, #28547e);
}

.login-note-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.login-note-row span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px 10px;
  border: 1px solid rgba(47, 95, 143, 0.22);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(220,232,243,0.86));
  color: var(--brand-dark);
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 8px 18px rgba(24, 63, 99, 0.08);
}

.login-note-row span::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: #f4b540;
  opacity: 0.86;
}

.login-form-card .hint {
  margin: 18px 0 0;
  text-align: center;
  color: #7c8b9a;
  font-weight: 700;
}

.login-showcase.hidden {
  display: none;
}

@media (max-width: 900px) {
  body.login-active .shell {
    align-items: start;
  }

  .login-showcase {
    grid-template-columns: 1fr;
  }

  .login-media {
    grid-template-rows: 240px auto auto;
  }

  .login-photo {
    min-height: 240px;
  }
}

@media (max-width: 560px) {
  body.login-active .shell {
    width: min(100% - 20px, 440px);
    padding: 10px 0 20px;
  }

  .login-media {
    grid-template-rows: 190px auto;
  }

  .login-photo {
    min-height: 190px;
  }

  .login-brand-strip {
    padding: 10px 16px;
  }

  .login-brand-strip strong {
    font-size: 19px;
  }

  .login-proof-row {
    grid-template-columns: 1fr;
  }

  .login-form-head {
    padding: 32px 18px 28px;
  }

  .login-form-body {
    padding: 24px 18px;
  }

  .login-form-card h1 {
    font-size: 24px;
  }

  .login-action-row,
  .login-note-row,
  .customer-bar {
    grid-template-columns: 1fr;
  }

  .customer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .customer-actions button {
    width: 100%;
  }

  body.quote-active .search-panel > .search-row {
    grid-template-columns: 1fr;
  }

  .vin-manual-row {
    grid-template-columns: 1fr;
  }

  body.quote-active #searchBtn {
    width: 100%;
  }

  .login-action-row button {
    width: 100%;
  }
}
