:root {
  --bg: #f0f3f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --primary: #2f6bff;
  --primary-dark: #1f56e0;
  --primary-soft: #e8f0ff;
  --hero: #2f6bff;
  --border: #eef0f4;
  --shadow: 0 8px 24px rgba(47, 107, 255, 0.1);
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 56px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  --font-num: "DIN Alternate", "DIN Condensed", "Roboto", "Helvetica Neue",
    Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: #d8dee8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 14px calc(var(--tabbar-h) + 20px + var(--safe-bottom));
  position: relative;
  overflow: hidden;
  background: var(--bg);
  border-radius: 0; /* 最外层直角，铺满边角 */
}

/* 底层上半蓝色色块 */
.page::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 168px;
  background: linear-gradient(180deg, #2a62f0 0%, #3b78ff 72%, #3b78ff 100%);
  z-index: 0;
}

.page::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 140px;
  height: 48px;
  background: linear-gradient(180deg, rgba(240, 243, 248, 0) 0%, var(--bg) 100%);
  z-index: 0;
  pointer-events: none;
}

.page > * {
  position: relative;
  z-index: 1;
}

/* —— 主卡片 —— */
.loan-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow);
}

.loan-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.loan-card__company {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-add-company {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid #c9d8ff;
  background: #f3f7ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
}

.btn-add-company svg {
  width: 12px;
  height: 12px;
}

/* 金额区：横向直线底纹 */
.loan-card__amount-block {
  position: relative;
  margin: 0 -4px;
  padding: 18px 8px 14px;
  overflow: hidden;
}

.loan-card__amount-block::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 10px;
  bottom: 8px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(47, 107, 255, 0.07) 0,
    rgba(47, 107, 255, 0.07) 1px,
    transparent 1px,
    transparent 9px
  );
  -webkit-mask-image: radial-gradient(
    85% 70% at 50% 45%,
    #000 20%,
    transparent 75%
  );
  mask-image: radial-gradient(85% 70% at 50% 45%, #000 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.loan-card__amount-block > * {
  position: relative;
  z-index: 1;
}

.loan-card__label {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.loan-card__amount {
  text-align: center;
  font-family: var(--font-num);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.05;
  color: #222;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.loan-card__total {
  text-align: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.btn-borrow {
  display: block;
  width: 100%;
  margin-top: 8px;
  height: 46px;
  border-radius: 23px;
  background: linear-gradient(180deg, #4b84ff 0%, var(--primary) 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 8px 16px rgba(47, 107, 255, 0.28);
}

.btn-borrow:active {
  background: var(--primary-dark);
  transform: scale(0.99);
}

.loan-card__tip {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* —— 双广告 + 风险检测：整图横向撑满 —— */
.promo-banner {
  display: block;
  width: calc(100% + 28px);
  margin: 10px -14px 0;
  padding: 0;
  border: none;
  background: transparent;
  line-height: 0;
  cursor: pointer;
}

.promo-banner img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

/* —— 卖点 —— */
.features {
  margin-top: 12px;
  background: var(--card);
  border-radius: 12px;
  padding: 18px 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  box-shadow: 0 4px 14px rgba(20, 40, 80, 0.04);
}

.feature {
  text-align: center;
  padding: 0 6px;
}

.feature__icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  color: var(--primary);
}

.feature__icon svg {
  width: 20px;
  height: 20px;
}

.feature__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.feature__desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* —— 底栏 —— */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #eceff3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 20;
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #8a8f99;
  font-size: 11px;
}

.tabbar__item svg {
  width: 22px;
  height: 22px;
}

.tabbar__item.is-active {
  color: var(--primary);
}

/* —— Toast —— */
.toast {
  position: fixed;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 100;
  min-width: 120px;
  max-width: 70%;
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

@media (min-width: 481px) {
  .page {
    min-height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
}
