* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #efefef;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #222;
}

body {
  min-height: 100vh;
}

.page-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 18px 10px 40px;
}

.app-shell {
  width: 100%;
  max-width: 560px;
}

.top-card,
.main-card {
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.top-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 18px;
  margin-bottom: 16px;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1f6df4 0%, #0b4fd8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(32, 102, 243, 0.25);
}

.brand-text h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  color: #1758d8;
  font-weight: 800;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #7f8ea8;
}

.safe-entry {
  color: #2f73ee;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.main-card {
  padding: 22px 18px 24px;
}

.section-block + .section-block {
  margin-top: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 18px;
}

.amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.amount-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.currency {
  font-size: 22px;
  font-weight: 700;
  color: #222;
  line-height: 1;
}

.loan-amount-input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: #1e1f23;
  font-size: 64px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1px;
}

.loan-amount-input::-webkit-outer-spin-button,
.loan-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.all-borrow-btn {
  border: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  background: linear-gradient(180deg, #61a2ff 0%, #1b6df5 100%);
  box-shadow: 0 8px 16px rgba(38, 110, 241, 0.25);
  white-space: nowrap;
}

.divider {
  height: 1px;
  background: #e9e9ee;
  margin-bottom: 18px;
}

.stats-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  text-align: center;
  margin-bottom: 16px;
}

.stat-item {
  flex: 1;
}

.stat-item + .stat-item {
  border-left: 1px solid #ececf2;
}

.stat-value {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  color: #222;
}

.stat-label {
  margin-top: 6px;
  color: #888;
  font-size: 13px;
}

.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #edf4ff;
  color: #1e6df2;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
}

.notice-icon {
  font-size: 16px;
}

.term-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.term-btn {
  border: 1px solid #e7e7ee;
  border-radius: 999px;
  background: #f7f7fa;
  color: #666;
  font-size: 16px;
  font-weight: 700;
  height: 42px;
  cursor: pointer;
}

.term-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #61a2ff 0%, #1b6df5 100%);
  box-shadow: 0 8px 16px rgba(38, 110, 241, 0.22);
}

.repayment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 16px;
}

.repayment-label {
  font-weight: 700;
  color: #222;
}

.repayment-value {
  color: #333;
  font-weight: 600;
}

.repayment-value strong {
  font-size: 18px;
}

.pay-way-title {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
}

.pay-way-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}

.pay-way-item {
  color: #444;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.dot.wechat {
  background: linear-gradient(180deg, #6bdd84 0%, #32b25a 100%);
}

.dot.alipay {
  background: linear-gradient(180deg, #70a8ff 0%, #3673ee 100%);
}

.dot.bank {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(180deg, #55b0ff 0%, #2a6be7 100%);
  position: relative;
}

.dot.bank::after {
  content: '';
  position: absolute;
  left: 1px;
  right: 1px;
  top: 3px;
  height: 2px;
  background: rgba(255,255,255,.85);
}

.tips-block {
  color: #9b9ba4;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 18px;
}

.tips-block p {
  margin: 0;
}

.receive-btn {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #61a2ff 0%, #1b6df5 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(38, 110, 241, 0.22);
}

.receive-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.agreement-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  cursor: pointer;
}

.agreement-row input {
  display: none;
}

.fake-radio {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #bec3d1;
  margin-top: 5px;
  flex: 0 0 auto;
}

.agreement-row input:checked + .fake-radio {
  background: #2b70ef;
}

.agreement-text {
  font-size: 14px;
  color: #6f7684;
  line-height: 1.6;
}

.agreement-text a {
  color: #2b70ef;
  text-decoration: none;
}

@media (max-width: 480px) {
  .page-wrap {
    padding: 10px 8px 28px;
  }

  .top-card,
  .main-card {
    border-radius: 22px;
  }

  .top-card {
    padding: 18px 16px;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .brand-text h1 {
    font-size: 22px;
  }

  .brand-text p {
    font-size: 12px;
  }

  .safe-entry {
    font-size: 14px;
  }

  .main-card {
    padding: 18px 14px 20px;
  }

  .section-title {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .amount-row {
    align-items: center;
    gap: 10px;
  }

  .currency {
    font-size: 18px;
  }

  .loan-amount-input {
    font-size: 44px;
  }

  .all-borrow-btn {
    padding: 10px 14px;
    font-size: 14px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 12px;
  }

  .notice-bar {
    padding: 11px 12px;
    font-size: 14px;
  }

  .term-buttons {
    gap: 8px;
  }

  .term-btn {
    height: 40px;
    font-size: 14px;
  }

  .repayment-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .pay-way-row {
    gap: 12px;
  }

  .receive-btn {
    height: 52px;
    font-size: 17px;
  }

  .agreement-text {
    font-size: 13px;
  }
}


.agreement-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff1f1;
  color: #d84a4a;
  font-size: 14px;
  font-weight: 600;
}

.loan-amount-input {
  appearance: textfield;
  -moz-appearance: textfield;
}

.loan-amount-input::-webkit-outer-spin-button,
.loan-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


/* ===== 够花品牌 Logo 图片版 ===== */
.brand-box-logo-only {
  gap: 0;
}

.brand-logo-image {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  overflow: hidden;
}

.brand-logo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.top-card {
  align-items: center;
}

@media (max-width: 480px) {
  .brand-logo-image {
    width: 86px;
    height: 86px;
    border-radius: 20px;
  }
}


/* 统一头部：logo 居中 + 小框 */
.top-card { position: relative; justify-content: center !important; }
.top-card .safe-entry { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); }
.header-logo-center { display: flex; justify-content: center; width: 100%; }
.brand-frame { display: inline-flex; align-items: center; justify-content: center; padding: 6px; border-radius: 18px; background: #f5f7fb; border: 1px solid #e7ecf5; box-shadow: inset 0 1px 0 rgba(255,255,255,0.9); }
.brand-logo-image { width: 78px !important; height: 78px !important; border-radius: 16px !important; }
@media (max-width: 480px) { .top-card .safe-entry { right: 14px; font-size: 13px; } .brand-frame { padding: 5px; border-radius: 16px; } .brand-logo-image { width: 64px !important; height: 64px !important; border-radius: 14px !important; } }


/* ===== 头部 logo 再缩小一档 ===== */
.brand-frame {
  padding: 4px !important;
  border-radius: 14px !important;
}

.brand-logo-image {
  width: 58px !important;
  height: 58px !important;
  border-radius: 12px !important;
}

@media (max-width: 480px) {
  .brand-logo-image {
    width: 50px !important;
    height: 50px !important;
    border-radius: 10px !important;
  }

  .brand-frame {
    padding: 3px !important;
    border-radius: 12px !important;
  }
}


/* ===== logo 再缩小一档并统一 ===== */
.brand-frame {
  padding: 2px !important;
  border-radius: 10px !important;
}

.brand-logo-image {
  width: 46px !important;
  height: 46px !important;
  border-radius: 10px !important;
}

@media (max-width: 480px) {
  .brand-frame {
    padding: 2px !important;
    border-radius: 9px !important;
  }

  .brand-logo-image {
    width: 42px !important;
    height: 42px !important;
    border-radius: 9px !important;
  }
}


/* ===== logo 再缩小一档（首页 / 过渡页 / 聊天页） ===== */
.brand-frame {
  padding: 1px !important;
  border-radius: 8px !important;
}

.brand-logo-image {
  width: 38px !important;
  height: 38px !important;
  border-radius: 8px !important;
}

@media (max-width: 480px) {
  .brand-frame {
    padding: 1px !important;
    border-radius: 7px !important;
  }

  .brand-logo-image {
    width: 34px !important;
    height: 34px !important;
    border-radius: 7px !important;
  }
}


/* ===== 本轮修复：/loan/ 首页去掉顶部头部区域 ===== */
.page-wrap {
  padding-top: 10px !important;
}

.main-card {
  margin-top: 0 !important;
}

.top-card {
  display: none !important;
}

@media (max-width: 480px) {
  .page-wrap {
    padding-top: 8px !important;
  }

  .main-card {
    border-radius: 20px !important;
  }
}
