:root {
  --blue: #1f7af4;
  --blue-strong: #1267df;
  --blue-soft: #eef6ff;
  --page-bg: #eef2f7;
  --app-bg: #f8fafc;
  --card: #ffffff;
  --text: #111318;
  --muted: #7c8491;
  --line: #e7ebf2;
  --line-strong: #d9e0eb;
  --shadow: 0 12px 28px rgba(26, 42, 70, 0.08);
  --shadow-soft: 0 8px 20px rgba(26, 42, 70, 0.05);
  --warning-bg: #fff8ea;
  --warning-line: #ffe2a8;
  --warning-text: #8d5b00;
  --bottom-height: 154px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.95), rgba(238, 242, 247, 0.9) 420px),
    var(--page-bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background:
    linear-gradient(180deg, #ffffff 0, #fbfcfe 76px, var(--app-bg) 220px, #ffffff 100%),
    var(--app-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.9);
}

.topbar {
  height: 74px;
  display: grid;
  grid-template-columns: 48px 1fr 58px;
  align-items: center;
  padding: 12px 18px 0;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(232, 236, 243, 0.8);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(16px);
}

.back-btn,
.ghost-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  line-height: 1;
  padding: 0;
}

.back-btn {
  width: 42px;
  height: 42px;
  font-size: 34px;
  text-align: left;
}

.back-btn:disabled {
  visibility: hidden;
}

.ghost-btn {
  justify-self: end;
  width: 52px;
  height: 34px;
  border: 1px solid #edf0f5;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(30, 45, 70, 0.04);
  font-size: 24px;
  letter-spacing: 1px;
}

.top-title {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.content {
  flex: 1;
  padding: 30px 22px calc(var(--bottom-height) + 30px);
}

.content.result-content {
  padding-bottom: 28px;
}

.step-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 28px;
}

.step-icon {
  width: 58px;
  height: 58px;
  border-radius: 22px;
  background: linear-gradient(180deg, #edf6ff, #f7fbff);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 244, 0.05);
}

.step-title {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.14;
  font-weight: 850;
  letter-spacing: 0;
}

.step-subtitle {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
  line-height: 1.35;
}

.step-subtitle strong {
  color: var(--blue);
  margin-right: 6px;
}

.step-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.option-list {
  display: grid;
  gap: 18px;
}

.option-card {
  width: 100%;
  min-height: 120px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 30px;
  gap: 18px;
  align-items: center;
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.option-card:active {
  transform: scale(0.99);
}

.option-card.is-selected {
  border-color: var(--blue);
  background: #f2f7ff;
  box-shadow: 0 12px 28px rgba(31, 122, 244, 0.12);
}

.option-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #edf5ff;
  display: grid;
  place-items: center;
  font-size: 31px;
  overflow: hidden;
}

.option-card.is-selected .option-icon {
  background: linear-gradient(180deg, #2586ff, #126ee9);
  color: #fff;
}

.option-title {
  margin: 0 0 9px;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.22;
}

.option-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.option-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #b8c0cc;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.option-card.is-selected .option-mark {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.hint {
  margin-top: 22px;
  border: 1px solid #edf1f6;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  padding: 16px 18px;
  color: #343a44;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-soft);
  line-height: 1.45;
}

.hint-icon,
.pill-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.amount-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-soft);
}

.amount-panel label {
  display: block;
  color: #303743;
  margin-bottom: 14px;
  font-size: 17px;
}

.amount-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 5px 0 14px;
  font-size: 54px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: 0;
  outline: none;
  background: transparent;
  color: #05070a;
}

.amount-input::placeholder {
  color: #c4cad4;
}

.amount-panel .step-desc {
  padding-top: 14px;
  font-size: 15px;
}

.quick-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.quick-btn {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 8px 4px;
  background: #fff;
  color: #202733;
  box-shadow: 0 5px 14px rgba(26, 42, 70, 0.04);
}

.quick-btn.is-selected {
  border-color: var(--blue);
  color: var(--blue);
  background: #f3f8ff;
  box-shadow: 0 7px 18px rgba(31, 122, 244, 0.12);
}

.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: 19px 22px max(22px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(232, 236, 243, 0.9);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -14px 28px rgba(24, 38, 64, 0.06);
  backdrop-filter: blur(18px);
}

.progress {
  height: 5px;
  background: #edf1f6;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto 14px;
  width: 76%;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #2b95ff);
  border-radius: inherit;
  transition: width 180ms ease;
}

.step-count {
  text-align: center;
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 18px;
}

.step-count strong {
  color: var(--blue);
  font-weight: 800;
}

.primary-btn,
.secondary-btn {
  width: 100%;
  min-height: 58px;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.primary-btn {
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, #2787ff, var(--blue));
  box-shadow: 0 10px 22px rgba(31, 122, 244, 0.22);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
}

.secondary-btn {
  border: 1.5px solid var(--blue);
  color: var(--blue);
  background: #fff;
}

.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 10px;
  color: #303743;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 5px 14px rgba(26, 42, 70, 0.04);
}

.pill-icon {
  width: 22px;
  height: 22px;
  font-size: 13px;
}

.warning {
  border: 1px solid var(--warning-line);
  background: var(--warning-bg);
  color: #363029;
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 18px;
  line-height: 1.6;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-soft);
}

.warning-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff1c9;
  color: #f0a000;
  font-size: 26px;
}

.warning-title {
  color: var(--warning-text);
  font-weight: 850;
  margin-bottom: 4px;
}

.result-list {
  display: grid;
  gap: 15px;
}

.result-card {
  border: 1px solid #edf1f6;
  border-radius: 22px;
  background: #fff;
  padding: 18px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-soft);
}

.result-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #2787ff, #126ee9);
  font-size: 23px;
  font-weight: 800;
}

.result-title {
  margin: 0 0 9px;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.25;
}

.result-pay {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.result-total {
  color: var(--blue);
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
  letter-spacing: 0;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.result-actions .primary-btn,
.result-actions .secondary-btn {
  min-height: 54px;
  font-size: 18px;
  border-radius: 16px;
}

@media (min-width: 431px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    border-radius: 28px;
    overflow: hidden;
  }
}

@media (max-width: 390px) {
  .topbar {
    grid-template-columns: 44px 1fr 54px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .step-head {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
  }

  .step-title {
    font-size: 31px;
  }

  .step-subtitle {
    font-size: 17px;
  }

  .option-card {
    grid-template-columns: 58px minmax(0, 1fr) 28px;
    gap: 14px;
    padding: 22px 16px;
  }

  .option-icon {
    width: 58px;
    height: 58px;
  }

  .option-title {
    font-size: 21px;
  }

  .bottom-bar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .result-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 17px;
  }

  .result-total {
    grid-column: auto;
    justify-self: end;
    font-size: 27px;
  }

  .result-title {
    font-size: 18px;
  }

  .result-pay {
    font-size: 15px;
  }
}

@media (max-width: 375px) {
  .top-title {
    font-size: 17px;
  }

  .content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .step-title {
    font-size: 29px;
  }

  .option-card {
    min-height: 112px;
    border-radius: 22px;
    grid-template-columns: 52px minmax(0, 1fr) 26px;
  }

  .option-icon {
    width: 52px;
    height: 52px;
    font-size: 27px;
  }

  .option-title {
    font-size: 20px;
  }

  .option-desc,
  .hint,
  .step-desc {
    font-size: 15px;
  }

  .amount-input {
    font-size: 50px;
  }

  .quick-list {
    gap: 8px;
  }

  .quick-btn {
    min-height: 44px;
    font-size: 15px;
  }

  .result-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 16px;
  }

  .result-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .result-title {
    font-size: 17px;
  }

  .result-total {
    font-size: 25px;
  }
}
