:root {
  --paper: #f3f3f3;
  --ink: #111111;
  --muted: #5f6670;
  --line: #2c2c2c;
  --grid: #c8c8c8;
  --blue: #91c4ef;
  --pale-blue: #d9f3ef;
  --yellow: #ffeb00;
  --gold: #f5c400;
  --cream: #eee0c1;
  --red: #e60000;
  --green: #03a24c;
  --panel: #ffffff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 32px;
  font-family: "Microsoft YaHei", "SimSun", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 32px 32px 110px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(520px, 690px);
  align-items: start;
  gap: 30px;
  max-width: 1220px;
  margin: 0 auto;
}

.control-panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid #d8d8d8;
  box-shadow: var(--shadow);
}

.panel-title p {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}

label span {
  color: #18212f;
}

input {
  width: 100%;
  height: 40px;
  padding: 8px 10px;
  border: 1px solid #bfc4ca;
  border-radius: 0;
  background: #fff;
  color: #000;
  outline: none;
}

input:focus {
  border-color: #1686ff;
  box-shadow: 0 0 0 2px rgba(22, 134, 255, 0.16);
}

.search-field {
  position: relative;
}

.vehicle-results {
  max-height: 280px;
  overflow: auto;
  border: 1px solid #d7d7d7;
  background: #fff;
}

.vehicle-results:empty {
  display: none;
}

.vehicle-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #ececec;
  background: #fff;
  text-align: left;
}

.vehicle-option:hover,
.vehicle-option.active {
  background: #eef6ff;
}

.vehicle-option strong {
  font-size: 13px;
  line-height: 1.45;
}

.vehicle-option span {
  color: #0d65c7;
  font-weight: 800;
  white-space: nowrap;
}

.loan-tools {
  display: grid;
  gap: 10px;
}

.ratio-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ratio-buttons button {
  height: 38px;
  border: 1px solid #c8c8c8;
  background: #f1f1f1;
  font-weight: 800;
}

.ratio-buttons button.active {
  border-color: #0078ff;
  background: #0078ff;
  color: #fff;
}

.settings-box {
  border: 1px solid #d5d5d5;
  background: #fafafa;
}

.settings-box summary {
  padding: 12px;
  font-weight: 800;
  cursor: pointer;
}

.settings-box label {
  padding: 0 12px 12px;
}

.quote-stage {
  display: grid;
  gap: 18px;
}

.quote-card {
  width: min(100%, 620px);
  background: #fff;
  border: 3px solid var(--red);
  box-shadow: var(--shadow);
  padding: 14px;
}

.quote-slogan {
  min-height: 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--cream);
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.quote-row {
  display: grid;
  grid-template-columns: 88px 1fr 96px 1fr;
  min-height: 34px;
}

.quote-row > div {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 5px 7px;
  text-align: center;
  line-height: 1.25;
}

.quote-row:last-child > div {
  border-bottom: 1px solid var(--line);
}

.vehicle-row {
  grid-template-columns: 88px 1fr;
}

.vehicle-row .quote-value {
  background: var(--pale-blue);
}

.quote-label {
  background: #fff;
  font-weight: 800;
}

.quote-label.blue {
  background: var(--blue);
  font-size: 18px;
}

.quote-label.yellow {
  background: var(--gold);
}

.quote-value {
  min-width: 0;
  font-weight: 700;
}

.quote-value.strong {
  font-size: 18px;
  font-weight: 900;
}

.quote-value.serial {
  color: var(--red);
  font-size: 18px;
}

.quote-value.highlight {
  background: var(--yellow);
  font-size: 18px;
  font-weight: 900;
}

.quote-value.total {
  grid-column: span 3;
  color: var(--red);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.landing-row {
  grid-template-columns: 88px 1fr;
}

.landing-row .quote-value {
  border-left: 1px solid var(--line);
}

.quote-footer {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-top: 0;
  padding: 6px 8px;
  font-size: 18px;
  font-weight: 900;
}

.quote-footer em {
  color: var(--red);
  font-style: normal;
}

.value-blue {
  color: #3d7df0;
}

.value-red {
  color: var(--red);
}

.value-green {
  color: var(--green);
}

.loan-table-wrap {
  width: min(100%, 620px);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.loan-table {
  width: 100%;
  border-collapse: collapse;
}

.loan-table th,
.loan-table td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  text-align: center;
}

.loan-table th {
  background: #ffc400;
}

.loan-table th button {
  width: 100%;
  border: 0;
  background: transparent;
  font-weight: 900;
}

.loan-table th.selected {
  background: #8e63b6;
  color: #fff;
}

.login-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
}

.login-card,
.user-badge {
  width: 260px;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 2px solid #82df00;
  box-shadow: var(--shadow);
}

.login-card strong {
  font-size: 17px;
}

.login-card button,
.user-badge button {
  height: 38px;
  border: 0;
  background: #d93649;
  color: #fff;
  font-weight: 800;
}

.user-badge {
  width: 300px;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.user-badge span {
  font-weight: 900;
}

.user-badge button {
  width: 88px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 18px 14px 150px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }

  .quote-card,
  .loan-table-wrap {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .field-grid.two,
  .field-grid.three {
    grid-template-columns: 1fr;
  }

  .quote-row,
  .quote-row.vehicle-row,
  .landing-row {
    grid-template-columns: 82px 1fr;
  }

  .quote-row > div:nth-child(3),
  .quote-row > div:nth-child(4) {
    border-top: 0;
  }

  .quote-value.total {
    grid-column: span 1;
    font-size: 28px;
  }

  .login-dock {
    left: 14px;
    right: 14px;
  }

  .login-card,
  .user-badge {
    width: 100%;
  }
}
