/* ========================================
   車價折舊率試算
======================================== */

.depreciation-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}


/* ========================================
   車輛類型選擇
======================================== */

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

.depreciation-type-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 18px;

  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;

  cursor: pointer;

  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.depreciation-type-card:hover {
  transform: translateY(-2px);
  border-color: #9aa9bf;
  box-shadow: 0 8px 20px rgba(15, 35, 70, 0.06);
}

.depreciation-type-card.is-selected {
  border-color: #526987;
  background: #fbfcfe;
  box-shadow: 0 8px 22px rgba(15, 35, 70, 0.08);
}

.depreciation-type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.depreciation-type-icon {
  display: grid;
  place-items: center;

  width: 52px;
  height: 52px;
  flex: 0 0 52px;

  border: 1px solid #dce3ec;
  border-radius: 16px;
  background: #f5f7fa;

  font-size: 27px;
}

.depreciation-type-card strong {
  display: block;
  margin-bottom: 4px;

  color: var(--navy);
  font-size: 19px;
}

.depreciation-type-card span {
  color: var(--muted);
  font-size: 13px;
}


/* ========================================
   試算結果
======================================== */

.depreciation-result {
  display: grid;
  grid-template-columns:
    minmax(0, 1.2fr)
    minmax(260px, 0.8fr);

  gap: 18px;
  align-items: stretch;
}


/* 折舊後車價主區塊 */
.depreciation-result-main {
  display: flex;
  flex-direction: column;
  justify-content: center;

  min-height: 176px;
  padding: 26px;

  border: 1px solid #d8dee8;
  border-radius: 22px;
  background: #fff;

  color: var(--navy);
}


/* 折舊後車價標題 */
.depreciation-result-label {
  margin: 0 0 10px;

  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}


/* 折舊後車價主要數字 */
.depreciation-result-value {
  margin: 0;

  color: var(--navy);
  font-size: clamp(36px, 7vw, 58px);
  font-weight: 950;
  letter-spacing: -0.05em;
  line-height: 1.1;
}


/* 新台幣約當金額 */
.depreciation-result-yuan {
  margin: 10px 0 0;

  color: #68758a;
  font-size: 15px;
  font-weight: 700;
}


/* 右側明細區塊 */
.depreciation-result-detail {
  display: grid;
  align-content: center;
  gap: 0;

  padding: 22px;

  border: 1px solid #d8dee8;
  border-radius: 22px;
  background: #fff;
}


/* 每一列明細 */
.depreciation-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 16px;
  min-height: 50px;

  padding: 12px 0;
  border-bottom: 1px solid #e5e9ef;
}

.depreciation-result-row:first-child {
  padding-top: 0;
}

.depreciation-result-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.depreciation-result-row span {
  color: var(--muted);
  font-size: 14px;
}

.depreciation-result-row strong {
  color: var(--navy);
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}


/* 計算式 */
.depreciation-formula {
  margin-top: 18px;
  padding: 15px 18px;

  border: 1px solid #d8dee8;
  border-radius: 15px;
  background: #fff;

  color: var(--navy);
  font-weight: 850;
  line-height: 1.6;
  text-align: center;
}


/* 結果下方提醒文字 */
#resultSection > .hf-subtitle {
  color: #6e7889;
  font-size: 13px;
  line-height: 1.7;
}


/* ========================================
   後台折舊率設定
======================================== */

.depreciation-rate-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.depreciation-rate-table-wrap {
  overflow: auto;
  max-height: 620px;

  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.depreciation-rate-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.depreciation-rate-table th,
.depreciation-rate-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.depreciation-rate-table th {
  position: sticky;
  top: 0;
  z-index: 1;

  background: #f4f6f9;
  color: var(--navy);
}

.depreciation-rate-table tr:last-child td {
  border-bottom: 0;
}

.depreciation-rate-input {
  width: 100%;
  min-width: 90px;
}


/* ========================================
   輔助說明與開關
======================================== */

.hf-help {
  margin-top: 7px;

  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hf-toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  min-height: 44px;
  padding: 0 15px;

  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;

  color: var(--navy);
  font-weight: 900;
  white-space: nowrap;
}

.hf-toggle-control input {
  width: 18px;
  height: 18px;
  accent-color: #526987;
}


/* ========================================
   手機版
======================================== */

@media (max-width: 720px) {
  .depreciation-type-grid,
  .depreciation-result,
  .depreciation-rate-layout {
    grid-template-columns: 1fr;
  }

  .depreciation-result {
    gap: 12px;
  }

  .depreciation-result-main {
    min-height: auto;
    padding: 22px;
    border-radius: 18px;
  }

  .depreciation-result-detail {
    padding: 18px 20px;
    border-radius: 18px;
  }

  .depreciation-result-value {
    font-size: clamp(38px, 12vw, 52px);
  }

  .depreciation-formula {
    margin-top: 12px;
    padding: 14px 16px;
  }
}
/* ========================================
   v75｜試算模式與中古書價
======================================== */

.depreciation-shell {
  width: min(1100px, 100%);
}

.depreciation-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 26px;
  padding: 6px;
  border: 1px solid #dce3ec;
  border-radius: 18px;
  background: #f4f6f9;
}

.depreciation-mode-btn {
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #68758a;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.depreciation-mode-btn:hover {
  color: var(--navy);
}

.depreciation-mode-btn.is-active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 5px 16px rgba(15, 35, 70, .08);
}

.depreciation-mode-panel[hidden] {
  display: none !important;
}

.depreciation-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.depreciation-panel-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 20px;
}

.depreciation-panel-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.depreciation-form-grid {
  margin-top: 18px;
}

.depreciation-required {
  color: #b42318;
  font-weight: 950;
}

.depreciation-button-note {
  margin: 12px 0 0;
  color: #68758a;
  font-size: 13px;
  line-height: 1.7;
}

.depreciation-dual-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.depreciation-price-card {
  position: relative;
  min-height: 210px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid #d8dee8;
  border-radius: 22px;
  background: #fff;
}

.depreciation-price-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #526987;
}

.depreciation-price-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 22px;
  padding: 0 11px;
  border-radius: 999px;
  background: #f1f4f8;
  color: #526987;
  font-size: 12px;
  font-weight: 900;
}

.depreciation-book-details {
  margin-top: 18px;
  padding: 18px 22px;
  border: 1px solid #d8dee8;
  border-radius: 18px;
  background: #fff;
}

.depreciation-book-details .depreciation-result-row strong {
  max-width: 70%;
  line-height: 1.55;
}

.depreciation-result-notice {
  margin-top: 14px;
}

.depreciation-source-note {
  margin-top: 14px;
  padding: 15px 18px;
  border: 1px solid #e0e5ec;
  border-radius: 15px;
  background: #f8fafc;
  color: #596579;
  font-size: 13px;
  line-height: 1.7;
}

.hf-select:disabled,
.hf-input:read-only {
  color: #7a8596;
  background: #f4f6f9;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .depreciation-mode-switch,
  .depreciation-dual-result {
    grid-template-columns: 1fr;
  }

  .depreciation-panel-heading {
    flex-direction: column;
  }

  .depreciation-price-card {
    min-height: auto;
    padding: 22px;
    border-radius: 18px;
  }

  .depreciation-book-details {
    padding: 16px 18px;
  }

  .depreciation-book-details .depreciation-result-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .depreciation-book-details .depreciation-result-row strong {
    max-width: 100%;
    text-align: left;
  }
}


/* ========================================
   v80｜汽車中古車價結果版型
======================================== */
.book-hot-result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 76px minmax(280px, .85fr);
  gap: 18px;
  align-items: stretch;
}

.book-hot-input-card,
.book-hot-output-card {
  border: 1px solid #d8dee8;
  border-radius: 22px;
  background: #fff;
}

.book-hot-input-card {
  display: grid;
  align-content: center;
  padding: 18px 24px;
}

.book-hot-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 64px;
  padding: 14px 0;
  border-bottom: 1px solid #e5e9ef;
}

.book-hot-input-row:last-child {
  border-bottom: 0;
}

.book-hot-input-row span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.book-hot-input-row strong {
  color: var(--navy);
  font-size: 21px;
  font-weight: 950;
  text-align: right;
  white-space: nowrap;
}

.book-hot-arrow {
  display: grid;
  place-items: center;
  color: #526987;
}

.book-hot-arrow span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #eef3fb;
  font-size: 38px;
  font-weight: 950;
  line-height: 1;
}

.book-hot-output-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 250px;
  padding: 30px;
  overflow: hidden;
}

.book-hot-output-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: #526987;
}

.book-hot-output-label {
  margin: 0 0 10px;
  color: #526987;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .02em;
}

.book-hot-formula {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid #e5e9ef;
  color: #596579;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.65;
}

.book-hot-instruction {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #d7e0ee;
  border-radius: 16px;
  background: #f4f7fc;
  color: var(--navy);
  line-height: 1.65;
}

.book-hot-instruction strong {
  flex: 0 0 auto;
  font-weight: 950;
}

.book-hot-instruction span {
  font-weight: 800;
}

@media (max-width: 860px) {
  .book-hot-result-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .book-hot-arrow {
    height: 54px;
  }

  .book-hot-arrow span {
    transform: rotate(90deg);
    width: 50px;
    height: 50px;
    font-size: 32px;
  }

  .book-hot-output-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .book-hot-input-card,
  .book-hot-output-card {
    border-radius: 18px;
  }

  .book-hot-input-card {
    padding: 12px 18px;
  }

  .book-hot-input-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    min-height: auto;
  }

  .book-hot-input-row strong {
    font-size: 19px;
    text-align: left;
  }

  .book-hot-output-card {
    padding: 24px;
  }

  .book-hot-instruction {
    flex-direction: column;
    gap: 4px;
  }
}

/* ========================================
   v80｜汽車銀行件確認與候選車型選擇
======================================== */
.book-bank-question {
  padding: 30px;
  border: 1px solid #d8dee8;
  border-radius: 22px;
  background: #fff;
  text-align: center;
}

.book-bank-question-kicker {
  margin: 0 0 8px;
  color: #526987;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
}

.book-bank-question h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 950;
}

.book-bank-question > p:not(.book-bank-question-kicker) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.book-bank-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.book-bank-warning {
  padding: 30px;
  border: 2px solid #e53935;
  border-radius: 22px;
  background: #fff3f3;
  color: #c62828;
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 950;
  line-height: 1.65;
  text-align: center;
}

.book-candidate-section {
  margin-top: 26px;
  padding: 22px;
  border: 1px solid #d8dee8;
  border-radius: 20px;
  background: #f8fafc;
}

.book-candidate-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.book-candidate-heading h4 {
  margin: 0;
  color: var(--navy);
  font-size: 19px;
  font-weight: 950;
}

.book-candidate-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.book-candidate-table-wrap {
  overflow-x: auto;
  border: 1px solid #d8dee8;
  border-radius: 16px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.book-candidate-table {
  width: 100%;
  min-width: 660px;
  border-collapse: separate;
  border-spacing: 0;
}

.book-candidate-table th,
.book-candidate-table td {
  padding: 15px 18px;
  border-bottom: 1px solid #e5e9ef;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  vertical-align: middle;
}

.book-candidate-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3f9;
  color: #526987;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.book-candidate-table tbody tr {
  cursor: pointer;
  outline: none;
  transition: background-color .16s ease, box-shadow .16s ease;
}

.book-candidate-table tbody tr:hover,
.book-candidate-table tbody tr:focus-visible {
  background: #f5f8fd;
}

.book-candidate-table tbody tr.is-selected {
  background: #eaf1ff;
  box-shadow: inset 4px 0 0 #2f5bea;
}

.book-candidate-table tbody tr:last-child td {
  border-bottom: 0;
}

.book-candidate-select-col {
  width: 74px;
  text-align: center !important;
}

.book-candidate-price-col {
  width: 150px;
  font-weight: 950;
  text-align: right !important;
  white-space: nowrap;
}

.book-candidate-radio {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid #9aa9bf;
  border-radius: 999px;
  background: #fff;
}

.book-candidate-table tr.is-selected .book-candidate-radio {
  border-color: #2f5bea;
}

.book-candidate-table tr.is-selected .book-candidate-radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: #2f5bea;
}

/* v80｜最高貸款金額上限說明 */
.book-hot-output-label {
  font-size: 20px;
}

.book-hot-instruction {
  border: 1px solid #ffc9c9;
  border-left: 6px solid #e53935;
  background: #fff3f3;
  color: #c62828;
}

.book-hot-instruction strong,
.book-hot-instruction span {
  color: #c62828;
  font-size: 18px;
  font-weight: 850;
}

@media (max-width: 720px) {
  .book-bank-actions {
    flex-direction: column;
  }

  .book-bank-actions .hf-btn {
    width: 100%;
  }

  .book-bank-question,
  .book-bank-warning {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .book-candidate-section {
    padding: 16px;
    border-radius: 18px;
  }

  .book-candidate-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .book-hot-instruction strong,
  .book-hot-instruction span {
    font-size: 17px;
  }
}


/* ========================================
   V95｜EZ貸+ 重點提示與中古車價結果顯示
======================================== */
.book-hot-instruction {
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  border-color: #f2b8b8;
  border-left-width: 6px;
  background: #fff7f7;
  color: var(--navy);
}

.book-hot-instruction > strong {
  color: #c62828;
  font-size: 16px;
  font-weight: 950;
  white-space: nowrap;
}

.book-hot-instruction > span {
  color: var(--navy);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.75;
}

.book-hot-instruction .book-loan-key {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 4px;
  padding: 2px 10px;
  border: 1px solid #ef9a9a;
  border-radius: 9px;
  background: #fff;
  color: #b71c1c;
  font-weight: 950;
  line-height: 1.35;
  vertical-align: baseline;
}

.book-hot-instruction .book-loan-source {
  min-width: 50px;
  justify-content: center;
  font-size: 22px;
  letter-spacing: .04em;
}

.book-hot-instruction .book-loan-wholesale {
  font-size: 19px;
}

@media (max-width: 560px) {
  .book-hot-instruction {
    align-items: flex-start;
    gap: 7px;
  }

  .book-hot-instruction > span {
    font-size: 15px;
  }

  .book-hot-instruction .book-loan-source {
    font-size: 20px;
  }

  .book-hot-instruction .book-loan-wholesale {
    font-size: 17px;
  }
}
