:root {
  color: #202633;
  background: #f5f7fb;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f5f7fb;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 750px);
  min-height: 100vh;
  margin: 0 auto;
}

.page {
  display: none;
  min-height: 100vh;
  padding: 62px 34px 42px;
}

.page.active {
  display: block;
}

.card {
  border-radius: 24px;
  background: #fff;
}

.home-header {
  text-align: center;
}

h1,
h2,
p {
  margin: 0;
}

.home-header h1 {
  font-size: 30px;
  line-height: 1.45;
}

.home-header p {
  margin-top: 6px;
  color: #8995a8;
  font-size: 16px;
}

.intro-card {
  margin-top: 28px;
  padding: 27px 20px;
  text-align: center;
}

.intro-card h2 {
  font-size: 27px;
}

.intro-card p,
.section-tip {
  margin-top: 4px;
  color: #8995a8;
  font-size: 16px;
}

.model-list {
  margin-top: 72px;
}

.model-card {
  display: flex;
  width: 100%;
  min-height: 106px;
  align-items: center;
  margin-bottom: 28px;
  padding: 0 25px;
  border: 0;
  color: #202633;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.model-card:hover {
  box-shadow: 0 12px 28px rgb(49 104 245 / 10%);
  transform: translateY(-2px);
}

.model-card span:nth-child(2) {
  flex: 1;
  margin-left: 16px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
}

.model-mark {
  width: 14px;
  height: 46px;
  border-radius: 9px;
}

.blue {
  background: #3168f5;
}

.teal {
  background: #159f8b;
}

.model-card b {
  color: #98a2b2;
  font-size: 48px;
  font-weight: 300;
}

.home-tip {
  margin-top: 235px;
  color: #8995a8;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.page-nav {
  position: relative;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: center;
}

.page-nav h1 {
  max-width: 610px;
  font-size: 28px;
  line-height: 1.35;
  text-align: center;
}

.page-nav .long-title {
  font-size: 24px;
}

.back-button {
  position: absolute;
  left: 0;
  border: 0;
  color: #202633;
  background: transparent;
  font-size: 52px;
  font-weight: 300;
  line-height: 1;
}

.form-card {
  margin-top: 6px;
  padding: 42px 30px 38px;
}

.form-card h2 {
  font-size: 27px;
}

.section-tip {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 14px;
}

.form-row label {
  flex: 1;
  color: #202633;
  font-size: 18px;
}

.amount-box,
.helper-box {
  display: flex;
  height: 52px;
  align-items: center;
  border: 1px solid #d4dbea;
  border-radius: 14px;
  background: #f9fbff;
  color: #8995a8;
}

.amount-box {
  width: 258px;
  padding: 0 15px;
}

.amount-box input,
.helper-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #202633;
  text-align: right;
}

.amount-box span,
.helper-box span {
  flex: none;
  margin-left: 7px;
}

input::placeholder {
  color: #a6afbf;
}

.repayment-block {
  margin-top: 4px;
}

.compact-row {
  min-height: 58px;
}

.helper-link {
  display: block;
  margin: 0 0 5px auto;
  border: 0;
  color: #3168f5;
  background: transparent;
  font-size: 14px;
}

.field-note,
.helper-panel {
  width: 258px;
  margin-left: auto;
}

.field-note,
.helper-panel p {
  color: #8995a8;
  font-size: 12px;
  line-height: 1.6;
}

.helper-panel {
  padding: 6px 0 10px;
}

.helper-inputs {
  display: flex;
  align-items: center;
  margin-top: 6px;
}

.helper-box {
  width: 150px;
  height: 44px;
  padding: 0 8px;
  font-size: 12px;
}

.helper-inputs i {
  margin: 0 8px;
  color: #8995a8;
  font-style: normal;
}

.helper-inputs .month-box {
  width: 90px;
}

.helper-total {
  margin-top: 5px;
  color: #5f6b7e !important;
}

.ratio-section {
  margin-top: 18px;
  padding: 14px 12px;
  border-radius: 14px;
  background: #f8faff;
}

.ratio-section p {
  color: #5f6b7e;
  font-size: 15px;
}

.ratio-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  gap: 7px;
  color: #202633;
  font-size: 14px;
}

.ratio-box {
  display: flex;
  width: 64px;
  height: 38px;
  align-items: center;
  padding: 0 6px;
  border: 1px solid #d4dbea;
  border-radius: 10px;
  background: #fff;
  color: #8995a8;
}

.ratio-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #202633;
  font-size: 14px;
  text-align: right;
}

.ratio-box span {
  margin-left: 2px;
}

.ratio-row i {
  color: #8995a8;
  font-style: normal;
}

.formula-box {
  display: flex;
  min-height: 64px;
  align-items: center;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 14px;
}

.formula-box strong {
  width: 145px;
  flex: none;
  font-size: 16px;
}

.formula-box span {
  color: #8995a8;
  font-size: 14px;
  line-height: 1.55;
}

.blue-formula {
  background: #f1f5ff;
}

.blue-formula strong {
  color: #3168f5;
}

.teal-formula {
  margin-top: 22px;
  background: #f0faf8;
}

.teal-formula strong,
.teal-text {
  color: #159f8b !important;
}

.source-note {
  margin: 10px 4px 0;
  color: #8995a8;
  font-size: 12px;
  line-height: 1.6;
}

.result-box {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 0 20px;
  border: 1px solid #8aa9ff;
  border-radius: 16px;
}

.result-box strong {
  font-size: 17px;
}

.result-box b {
  color: #3168f5;
  font-size: 24px;
}

.emphasis {
  margin-top: 14px;
  border-width: 2px;
}

.blue-border {
  border-color: #3168f5;
}

.teal-border {
  border-color: #159f8b;
}

.result-only {
  margin-top: 26px;
}

.primary-button,
.secondary-button,
.download-button {
  display: flex;
  width: calc(100% - 92px);
  height: 74px;
  align-items: center;
  justify-content: center;
  margin: 32px auto 0;
  border-radius: 38px;
  font-size: 27px;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  border: 0;
  color: #fff;
}

.secondary-button {
  height: 66px;
  margin-top: 16px;
  background: #fff;
  font-size: 23px;
}

.blue-button {
  background: #3168f5;
}

.blue-secondary {
  border: 2px solid #3168f5;
  color: #3168f5;
}

.teal-button {
  background: #159f8b;
}

.teal-secondary {
  border: 2px solid #159f8b;
  color: #159f8b;
}

.toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  z-index: 10;
  padding: 12px 18px;
  border-radius: 20px;
  color: #fff;
  background: rgb(32 38 51 / 88%);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: auto;
  padding: 28px 16px;
  background: rgb(18 25 38 / 75%);
}

.image-dialog {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 20px;
  background: #fff;
  text-align: center;
}

.image-dialog h2 {
  margin-bottom: 14px;
}

.image-dialog img {
  width: 100%;
  border: 1px solid #edf0f5;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  color: #8995a8;
  background: transparent;
  font-size: 30px;
}

.download-button {
  width: 100%;
  height: 58px;
  margin-top: 16px;
  color: #fff;
  background: #3168f5;
  font-size: 20px;
}

@media (max-width: 560px) {
  .page {
    padding: 38px 18px 34px;
  }

  .home-header h1 {
    font-size: 24px;
  }

  .home-header p {
    font-size: 14px;
  }

  .intro-card h2 {
    font-size: 23px;
  }

  .model-list {
    margin-top: 54px;
  }

  .model-card {
    padding: 0 18px;
  }

  .model-card span:nth-child(2) {
    font-size: 18px;
  }

  .home-tip {
    margin-top: 170px;
  }

  .page-nav h1 {
    max-width: 285px;
    font-size: 21px;
  }

  .page-nav .long-title {
    font-size: 18px;
  }

  .form-card {
    padding: 28px 16px;
  }

  .form-card h2 {
    font-size: 23px;
  }

  .section-tip {
    font-size: 14px;
  }

  .form-row {
    gap: 8px;
  }

  .form-row label {
    font-size: 15px;
  }

  .amount-box {
    width: 176px;
    height: 48px;
    padding: 0 10px;
    font-size: 14px;
  }

  .amount-box input {
    font-size: 14px;
  }

  .field-note,
  .helper-panel {
    width: 176px;
  }

  .helper-box {
    width: 108px;
    padding: 0 5px;
  }

  .helper-inputs .month-box {
    width: 66px;
  }

  .formula-box {
    padding: 9px 12px;
  }

  .ratio-row {
    gap: 5px;
    font-size: 12px;
  }

  .ratio-box {
    width: 55px;
    height: 34px;
    padding: 0 4px;
  }

  .ratio-box input {
    font-size: 12px;
  }

  .formula-box strong {
    width: 100px;
    font-size: 14px;
  }

  .formula-box span {
    font-size: 12px;
  }

  .result-box {
    padding: 0 14px;
  }

  .result-box strong {
    font-size: 15px;
  }

  .result-box b {
    font-size: 20px;
  }

  .primary-button,
  .secondary-button {
    width: calc(100% - 48px);
  }
}
