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

.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;
  }
}