:root {
  --iphone-w: 393px;
  --iphone-h: 852px;
  --orange: #ff7a1a;
  --orange-2: #ff9f43;
  --orange-3: #ffbd7a;
  --peach: #fff1e6;
  --peach-2: #fff7f0;
  --cream: #fffaf5;
  --card: rgba(255, 255, 255, 0.94);
  --ink: #17191f;
  --soft-ink: #59606d;
  --muted: #8a919f;
  --line: #f1dfd2;
  --blue: #2d7ff9;
  --mint: #18a866;
  --shadow: 0 12px 30px rgba(255, 122, 26, 0.09);
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 159, 67, 0.22), transparent 34%),
    linear-gradient(180deg, #fff7f0 0%, #f6f8fc 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.iphone {
  width: var(--iphone-w);
  height: var(--iphone-h);
  min-height: var(--iphone-h);
  max-width: 100vw;
  max-height: 100vh;
  position: relative;
  overflow: hidden;
  scrollbar-width: none;
  background:
    linear-gradient(180deg, #ffd7bc 0, #fff3e8 172px, #f6f8fc 390px),
    #f6f8fc;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 38px;
  box-shadow: 0 22px 64px rgba(48, 35, 26, 0.13);
  padding: 0 14px;
}

.iphone::-webkit-scrollbar {
  display: none;
}

.status-bar {
  height: 38px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 16px 7px;
  font-size: 12px;
  font-weight: 800;
  color: #1f2937;
}

.app-header {
  height: 62px;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 10px;
}

.app-header p,
.page-title p,
.profile-card p,
.ai-hero p {
  margin: 0 0 3px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.app-header h1,
.page-title h2,
.profile-card h2,
.ai-hero h2,
.hero-copy h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.app-header h1 {
  font-size: 22px;
  line-height: 1.1;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #1f2937;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 6px 14px rgba(255, 122, 26, 0.06);
}

.logo-btn {
  overflow: hidden;
  padding: 3px;
}

.logo-btn img {
  width: 100%;
  height: 100%;
  display: block;
}

svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view {
  display: none;
}

.view.active {
  display: block;
  height: calc(var(--iphone-h) - 38px - 62px);
  min-height: calc(var(--iphone-h) - 38px - 62px);
  margin: 0 -14px;
  padding: 0 14px 108px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  animation: viewIn 170ms ease-out;
}

.view.active::-webkit-scrollbar {
  display: none;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.home-dashboard {
  position: relative;
  margin-top: 2px;
  border-radius: 28px;
  padding: 16px 0 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 17%, rgba(255, 255, 255, 0.76) 0 58px, transparent 59px),
    radial-gradient(circle at 99% 35%, rgba(255, 225, 199, 0.88) 0 74px, transparent 75px),
    linear-gradient(145deg, #fff7ef 0%, #ffe0c6 100%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.home-dashboard::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 78px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffd4b5;
}

.hero-card {
  min-height: 172px;
  position: relative;
  padding: 16px 18px 14px;
  overflow: hidden;
}

.hero-copy {
  width: 218px;
  position: relative;
  z-index: 2;
}

.overline,
.card-label,
.section-title p,
.promo-card p,
.plan-summary span,
.quote-box span {
  margin: 0;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.hero-copy h2 {
  width: 210px;
  font-size: 24px;
  line-height: 1.18;
}

.hero-copy p:last-child,
.balance-card span,
.bill-item p,
.plan-summary p,
.quote-box p,
.status-card small,
.profile-card span,
.chain-step p,
.ai-strip p,
.promo-card small {
  margin: 0;
  color: var(--soft-ink);
  font-size: 12px;
  line-height: 1.45;
}

.xiaocheng {
  position: absolute;
  right: -8px;
  bottom: -6px;
  width: 156px;
  height: 156px;
  z-index: 1;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  filter: drop-shadow(0 6px 9px rgba(255, 122, 26, 0.09));
  animation: xiaochengFloat 3.4s ease-in-out infinite;
}

@keyframes xiaochengFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-6px) rotate(1deg);
  }
}

.balance-card,
.ai-strip,
.quick-actions,
.promo-card,
.plan-summary,
.bill-item,
.calculator-card,
.status-card,
.profile-card,
.settings-list button,
.ai-hero,
.ai-chat,
.chain-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(31, 41, 55, 0.045);
}

.balance-card {
  margin: 0;
  position: relative;
  z-index: 3;
  border-radius: 28px 28px 0 0;
  padding: 20px 16px 18px;
  border-width: 1px 0 0;
  box-shadow: 0 -4px 24px rgba(255, 122, 26, 0.06);
}

.amount-button {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  color: var(--ink);
}

.amount-button span {
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
}

.amount-button svg {
  width: 18px;
  color: var(--muted);
}

.balance-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.balance-grid div {
  min-height: 58px;
  padding: 10px;
  border-radius: 16px;
  background: #fff7f0;
}

.balance-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.ai-strip {
  margin-top: 12px;
  border-radius: 18px;
  padding: 10px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
}

.ai-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--orange), var(--orange-2));
}

.ai-strip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.mini-btn,
.link-btn,
.white-btn,
.soft-btn,
.primary-btn {
  min-height: 38px;
  border-radius: 14px;
  padding: 0 13px;
  font-weight: 900;
}

.mini-btn,
.link-btn {
  background: #fff5ee;
  color: var(--orange);
}

.quick-actions {
  margin-top: 12px;
  border-radius: 22px;
  padding: 12px 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.quick-actions button {
  min-height: 72px;
  display: grid;
  justify-items: center;
  gap: 7px;
  background: transparent;
  color: var(--ink);
}

.quick-actions strong {
  font-size: 12px;
  font-weight: 800;
}

.icon-bubble {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  font-weight: 900;
}

.icon-bubble.pay {
  background: linear-gradient(145deg, #ff7a1a, #ffa64d);
}

.icon-bubble.loan {
  background: linear-gradient(145deg, #2d7ff9, #63b3ff);
}

.icon-bubble.ai {
  background: linear-gradient(145deg, #18a866, #65d58a);
}

.icon-bubble.coupon {
  background: linear-gradient(145deg, #ffb020, #ffd65a);
}

.icon-bubble.auto {
  background: linear-gradient(145deg, #9b7cff, #5f75ff);
}

.section-title {
  margin: 20px 2px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title h2,
.status-card h3,
.chain-card h3 {
  margin: 0;
  font-size: 19px;
}

.activity-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 10px;
}

.promo-card {
  min-height: 138px;
  border-radius: 18px;
  padding: 15px;
}

.promo-card.primary {
  background: linear-gradient(145deg, #ff9f43, #ffbf75);
  color: white;
}

.promo-card.primary p,
.promo-card.primary h3 {
  color: white;
}

.promo-card h3 {
  margin: 8px 0 12px;
  font-size: 20px;
  line-height: 1.24;
}

.white-btn {
  background: white;
  color: var(--orange);
}

.page-title {
  padding: 6px 2px 12px;
}

.page-title h2 {
  font-size: 24px;
  line-height: 1.18;
}

.plan-summary,
.calculator-card,
.status-card,
.profile-card,
.ai-hero,
.ai-chat,
.chain-card {
  border-radius: 22px;
  padding: 16px;
}

.plan-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.progress-track {
  height: 10px;
  margin: 12px 0 10px;
  border-radius: 99px;
  background: #ffeadb;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
}

.segment-bar {
  margin: 12px 0;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-radius: 17px;
  background: #fff1e6;
}

.segment {
  height: 38px;
  border-radius: 13px;
  background: transparent;
  color: var(--soft-ink);
  font-weight: 900;
}

.segment.active {
  background: white;
  color: var(--orange);
  box-shadow: 0 6px 14px rgba(255, 122, 26, 0.08);
}

.bill-list {
  display: grid;
  gap: 10px;
}

.bill-item {
  min-height: 78px;
  border-radius: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
}

.bill-item h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.bill-item strong {
  font-size: 14px;
}

.bill-item.paid {
  opacity: 0.66;
}

.check-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ffd0ae;
  background: #fffaf5;
}

.check-btn.checked {
  position: relative;
  border-color: var(--mint);
  background: var(--mint);
}

.check-btn.checked::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 10px;
  height: 6px;
  border: 2px solid white;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg);
}

.ai-hero {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 14px;
}

.ai-hero img,
.profile-card img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: contain;
  object-position: 52% 48%;
  background: #fff2e6;
}

.ai-hero h2 {
  font-size: 22px;
  line-height: 1.2;
}

.ai-chat {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.bubble {
  max-width: 86%;
  border-radius: 18px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.bubble.bot {
  justify-self: start;
  background: #fff1e6;
}

.bubble.user {
  justify-self: end;
  color: white;
  background: linear-gradient(145deg, var(--orange), var(--orange-2));
}

.ai-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.primary-btn {
  color: white;
  background: linear-gradient(145deg, var(--orange), var(--orange-2));
  box-shadow: 0 8px 18px rgba(255, 122, 26, 0.14);
}

.soft-btn {
  color: var(--orange);
  background: #fff1e6;
}

.chain-card {
  margin-top: 12px;
}

.chain-step {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
}

.chain-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  font-size: 13px;
  font-weight: 900;
  background: var(--orange);
}

.chain-step strong {
  display: block;
  margin-bottom: 2px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--soft-ink);
  font-size: 12px;
  font-weight: 900;
}

.field input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  outline: none;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  background: #fffaf5;
}

input[type="range"] {
  width: 100%;
  margin: 18px 0;
  accent-color: var(--orange);
}

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

.term {
  height: 42px;
  border-radius: 14px;
  color: var(--soft-ink);
  background: #fff7f0;
  font-weight: 900;
}

.term.active {
  color: white;
  background: linear-gradient(145deg, var(--orange), var(--orange-2));
}

.quote-box {
  margin: 14px 0;
  border-radius: 18px;
  padding: 14px;
  background: #fff7f0;
}

.quote-box strong {
  display: block;
  margin: 4px 0 6px;
  color: var(--orange);
  font-size: 32px;
}

.full {
  width: 100%;
}

.status-card {
  margin-top: 12px;
}

.status-card div,
.settings-list button {
  margin-top: 10px;
  min-height: 48px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.ok {
  background: var(--mint);
}

.dot.wait {
  background: var(--orange);
}

.profile-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 14px;
}

.settings-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.settings-list button {
  width: 100%;
  margin: 0;
  border-radius: 18px;
  padding: 0 14px;
  grid-template-columns: 1fr auto;
  color: var(--ink);
  background: var(--card);
  text-align: left;
}

.settings-list strong {
  color: var(--orange);
}

.float-ai {
  position: absolute;
  right: 18px;
  bottom: 92px;
  width: 54px;
  height: 54px;
  border-radius: 20px;
  color: white;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(145deg, #18a866, #38c98a);
  box-shadow: 0 10px 20px rgba(24, 168, 102, 0.16);
  z-index: 6;
}

.bottom-nav {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  width: auto;
  height: 68px;
  transform: none;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
  backdrop-filter: blur(18px);
}

.nav-btn {
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 18px;
  color: #717887;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
}

.ai-tab-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #fff2e6;
}

.ai-tab-icon img {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 8px;
}

.nav-btn.active {
  color: var(--orange);
  background: #fff1e6;
}

.repay-dialog {
  width: min(348px, calc(100vw - 40px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(23, 25, 31, 0.24);
}

.repay-dialog::backdrop {
  background: rgba(23, 25, 31, 0.28);
  backdrop-filter: blur(6px);
}

.repay-dialog form {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.repay-dialog h2 {
  margin: 0;
}

.repay-dialog p {
  margin: 0;
  color: var(--soft-ink);
  line-height: 1.55;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 112px;
  z-index: 10;
  transform: translateX(-50%) translateY(20px);
  max-width: 330px;
  border-radius: 999px;
  padding: 11px 16px;
  color: white;
  background: rgba(23, 25, 31, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  font-size: 13px;
  font-weight: 800;
}

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

@media (max-width: 520px) {
  .stage {
    display: block;
    padding: 0;
  }

  .iphone {
    width: 100vw;
    height: 100vh;
    min-height: var(--iphone-h);
    max-height: none;
    border-radius: 0;
    border: 0;
  }

  .view.active {
    height: calc(100vh - 38px - 62px);
    min-height: calc(var(--iphone-h) - 38px - 62px);
  }

  .bottom-nav {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
  }

  .float-ai {
    right: 18px;
  }
}
