/* ===========================================================
   国家开发银行 · 助学贷款  —  移动端界面
   =========================================================== */
:root {
  --page-bg: #f1f1f1;
  --card: #ffffff;
  --ink: #16171a;
  --ink-2: #2c2d30;
  --ink-3: #8f9095;
  --line: #f0f0f2;
  --blue: #2166d6;
  --orange: #d8411f;
  --bar-h: 44px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 760px at 18% 6%, #fbf1e6 0%, rgba(251, 241, 230, 0) 62%),
    radial-gradient(900px 680px at 84% 94%, #edf0fa 0%, rgba(237, 240, 250, 0) 60%),
    #f2ece5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid #2b6fe0; outline-offset: 2px; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
svg { display: block; }

/* ---------- 舞台 / 设备 ---------- */
.stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.device {
  position: relative;
  width: 390px;
  height: 844px;
  max-height: calc(100dvh - 48px);
  background: var(--page-bg);
  border-radius: 42px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(60, 32, 12, .07),
    0 2px 6px rgba(60, 32, 12, .06),
    0 28px 60px -18px rgba(74, 38, 12, .32),
    0 64px 120px -46px rgba(74, 38, 12, .34);
}

/* ---------- 首页顶栏 ---------- */
.topbar {
  position: absolute;
  z-index: 35;
  top: 0;
  left: 0; right: 0;
  height: 50px;
  padding: 0 18px 0 14px;
  display: flex;
  align-items: center;
  gap: 0;
  color: #fff;
  transition: background .3s ease, color .3s ease, box-shadow .3s ease;
}
.device.is-scrolled .topbar {
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.device.is-records .topbar { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.topbar-back {
  width: 26px; height: 34px;
  display: grid; place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  transition: background .2s ease, transform .15s ease;
}
.topbar-back svg { width: 23px; height: 23px; }
.topbar-back:active { transform: scale(.92); }
.topbar-title {
  max-width: 140px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(90, 20, 0, .12);
  transition: color .3s ease, text-shadow .3s ease;
}
.device.is-scrolled .topbar-title { text-shadow: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.star-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(70, 24, 0, .22);
  color: #fff;
  transition: background .25s ease, color .25s ease, transform .2s ease;
}
.star-btn svg { width: 18px; height: 18px; }
.star-btn.is-on svg { fill: #ffd76a; stroke: #ffd76a; }
.star-btn:active { transform: scale(.9); }
.device.is-scrolled .star-btn { background: rgba(0, 0, 0, .05); color: #333; }
.capsule {
  height: 28px;
  width: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  background: rgba(70, 24, 0, .24);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .25s ease, box-shadow .25s ease, color .25s ease;
}
.capsule:active { transform: scale(.97); }
.capsule-dots { display: flex; gap: 3px; }
.capsule-dots i { width: 3.6px; height: 3.6px; border-radius: 50%; background: currentColor; opacity: .95; }
.capsule-sep { width: 1px; height: 14px; background: currentColor; opacity: .28; }
.capsule-target {
  width: 15px; height: 15px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  display: grid; place-items: center;
}
.capsule-target i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.device.is-scrolled .capsule { background: rgba(0, 0, 0, .045); color: #333; }

/* ---------- 视图容器 ---------- */
.views { position: absolute; inset: 0; }
.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.view::-webkit-scrollbar { display: none; }

.view-records {
  z-index: 20;
  background: #f3f3f3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform .34s cubic-bezier(.24, .72, .25, 1);
  box-shadow: -12px 0 30px rgba(20, 20, 20, .08);
  visibility: hidden;
}
.device.is-records .view-records { transform: none; visibility: visible; }
.scrim {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .34s ease;
}
.device.is-records .scrim { opacity: 1; }

/* ================= 首页 ================= */
.view-home { z-index: 10; background: var(--page-bg); }
.hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 212px;
  overflow: hidden;
  background: #d0451c url("assets/hero-bg.jpg") 0 -44px / 100% 256px no-repeat;
}

.home-body {
  position: relative;
  z-index: 1;
  padding: calc(var(--bar-h) + 31.5px) 12px calc(28px + env(safe-area-inset-bottom));
}
.hero-copy { padding: 0 0 14px; }
.slogan {
  font-size: clamp(18px, 5.6vw, 22px);
  font-weight: 800;
  line-height: 1.26;
  letter-spacing: .5px;
  transform: skewX(-8deg);
  transform-origin: left bottom;
  -webkit-text-stroke: .25px currentColor;
  color: #fff;
  text-shadow: 0 1px 1px rgba(110, 24, 0, .16);
  white-space: nowrap;
}
.subline {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 4.5px;
  font-size: 12px;
  letter-spacing: .35px;
  color: rgba(255, 255, 255, .88);
  text-shadow: 0 1px 2px rgba(110, 24, 0, .12);
}
.subline i { font-style: normal; opacity: .6; letter-spacing: 0; }

/* ---------- 金额卡 ---------- */
.fund-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18.8px 20px 27px;
  box-shadow: 0 10px 28px -10px rgba(150, 50, 10, .22), 0 2px 6px rgba(150, 50, 10, .05);
}
.fund-label {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  color: #1b1c1e;
  letter-spacing: .1px;
}
.info { color: #b9bcc2; display: inline-flex; margin-left: 5px; }
.info svg { width: 13.5px; height: 13.5px; }
.amount {
  margin-top: 5.25px;
  font-family: "DIN Alternate", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  font-size: 47px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .2px;
  color: #232428;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
}
.amount .dec { font-size: .5em; font-weight: 700; letter-spacing: .2px; margin-left: 1px; }
.fund-note {
  margin: 6.7px -4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 10px 1px;
  border-radius: 5px;
  background: #eef5ff;
  line-height: 1.2;
  font-size: clamp(11.9px, 3.46vw, 13.5px);
  color: #3a3d42;
  letter-spacing: .1px;
  white-space: nowrap;
}
.fund-note b { font-weight: 700; color: #17181a; }
.fund-note .muted { color: #55585e; }
.fund-note .gap { margin-left: 4px; }
.fund-note .ok { color: #17181a; }
.rule { height: 1px; background: #e9e9eb; margin: 30.9px 0 19px; }
.fund-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.balance-value {
  margin-top: 8.4px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.4px;
  color: #131416;
}
.btn-outline {
  min-width: 112px;
  height: 36px;
  margin-bottom: .7px;
  padding: 0 26px;
  border-radius: 8px;
  border: 1px solid #dcdde0;
  background: #fff;
  color: #6b6d72;
  font-size: 15px;
  letter-spacing: 1px;
  transition: background .18s ease, border-color .18s ease, transform .15s ease;
}
.btn-outline:active { background: #f6f6f7; transform: scale(.97); }

/* ---------- 功能入口 ---------- */
.tile-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12.5px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 3.6px;
  height: 82px;
  padding: 22.6px 13px 0;
  border-radius: 12px;
  background: #fff url("assets/tile-1.jpg") center / 100% 100% no-repeat;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(30, 30, 40, .035);
  transition: transform .16s ease, box-shadow .16s ease;
}
.tile:active { transform: scale(.982); box-shadow: 0 1px 4px rgba(30, 30, 40, .05); }
.tile-title {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 15.6px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .2px;
  color: #17181a;
}
.chev { width: 15px; height: 15px; color: #c9cbd0; }
.tile-sub { font-size: 12.4px; line-height: 1.4; color: #9b9da3; letter-spacing: .1px; }
.tile:nth-child(2) { background-image: url("assets/tile-2.jpg"); }
.tile-art { display: none; }

/* ---------- 常见问题 ---------- */
.qa-card {
  margin-top: 13.7px;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(30, 30, 40, .035);
}
.qa-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 47px;
  padding: 0 12.5px;
  border-bottom: 1px solid #ececee;
}
.qa-tab {
  position: relative;
  padding: 0;
  height: 47px;
  font-size: 16px;
  color: #3c3e44;
  letter-spacing: .2px;
  transition: color .2s ease;
  display: flex;
  align-items: flex-end;
  padding-bottom: 11px;
}
.qa-tab.is-active { color: #17181a; font-weight: 700; }
.qa-tab:nth-of-type(2) { margin-left: -4.4px; }
.qa-tab:nth-of-type(3) { margin-left: -13.1px; }
.qa-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 32px; height: 3px;
  margin-left: -16px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ff5a35, #ff9a3c);
}
.qa-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 17px 8.9px 12.5px;
  border-bottom: 1px solid #ececee;
  font-size: 15.8px;
  color: #232427;
  letter-spacing: .1px;
  text-align: left;
  transition: background .16s ease;
}
.qa-item:last-child { border-bottom: 0; }
.qa-item:active { background: #fafafb; }
.qa-item .chev { flex: 0 0 auto; }
.qa-list.is-fading { opacity: 0; transform: translateY(3px); }
.qa-list { transition: opacity .16s ease, transform .16s ease; }


/* ================= 我的记录 ================= */
.rec-nav {
  position: relative;
  z-index: 12;
  flex: 0 0 auto;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #fff;
  transition: box-shadow .2s ease;
}
.view-records.is-scrolled .rec-nav { box-shadow: 0 1px 0 rgba(0, 0, 0, .05); }
.rec-back {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  margin-left: -4px;
  border-radius: 50%;
}
.rec-back svg { width: 23px; height: 23px; }
.rec-back:active { background: #f4f4f5; }
.rec-title { font-size: 18.5px; font-weight: 600; letter-spacing: .2px; margin-left: 0; }
.rec-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.rec-star {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: #333;
}
.rec-star svg { width: 20px; height: 20px; }
.rec-star.is-on svg { fill: #f5b942; stroke: #f5b942; }
.capsule-light {
  width: 82px; height: 28px;
  background: #fff;
  color: #2b2c2f;
  border: 1px solid #e9e9ec;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}
.rec-tabs {
  position: relative;
  z-index: 11;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 45.7px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .02);
}
.rec-tab {
  position: relative;
  font-size: 15.5px;
  color: #4d4f54;
  letter-spacing: .1px;
  padding-top: 2.5px;
  transition: color .2s ease;
}
.rec-tab.is-active { color: var(--blue); font-weight: 600; }
.rec-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 59px; height: 3px;
  margin-left: -29.5px;
  border-radius: 2px 2px 0 0;
  background: var(--blue);
}
.rec-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 15.8px 12px calc(30px + env(safe-area-inset-bottom));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rec-body::-webkit-scrollbar { display: none; }
.pane { display: none; }
.pane.is-active { display: block; animation: paneIn .24s ease both; }
@keyframes paneIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.rec-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
}
.rec-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 8px 12px 13.4px;
  font-size: 17px;
  line-height: 1.4;
  color: #202124;
  border-bottom: 1px solid #f0f0f1;
}
.rec-row:last-child { border-bottom: 0; }
.rec-row .k { flex: 0 0 auto; letter-spacing: .5px; }
.rec-row .v { font-size: 15.5px; }
.pane#paneAuth .rec-row { gap: 6px; }
.pane#paneAuth .rec-row .v { font-size: 14.8px; }
.rec-row .v {
  flex: 1 1 auto;
  text-align: right;
  color: #989aa0;
  font-variant-numeric: tabular-nums;
  letter-spacing: .1px;
}
.rec-row .v.multi { line-height: 1.5; }
.rec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 8px 11px 13.4px;
  border-bottom: 1px solid #f0f0f1;
}
.rec-head .k { font-size: 16.2px; color: #9a9ca2; letter-spacing: .3px; }
.rec-head .amt { font-size: 15.5px; font-weight: 700; color: #131416; font-variant-numeric: tabular-nums; }
.rec-note {
  padding: 6px 4px 14px;
  font-size: 13.2px;
  line-height: 1.45;
  color: #a0a2a8;
}
.chip {
  height: 26px;
  padding: 0 13px;
  border-radius: 13px;
  font-size: 12.5px;
  letter-spacing: .3px;
  background: #fff;
  transition: transform .15s ease, background .15s ease;
}
.chip.danger { color: #d84a45; border: 1px solid #e7b3af; }
.chip.primary { color: #2a6fdc; border: 1px solid #a9c6f2; }
.chip:active { transform: scale(.95); background: #fafafa; }
.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #f2f2f3;
}
.auth-head h3 { font-size: 15.5px; font-weight: 600; letter-spacing: .2px; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 19px; height: 19px;
  margin-right: 4px;
  border-radius: 50%;
  background: linear-gradient(140deg, #f3e3cf, #e8d2ba);
  color: #8a6a4a;
  font-size: 10px;
  font-weight: 600;
  vertical-align: -3px;
}


/* ---------- 我的授权 · 异常状态 ---------- */
.rec-body:has(#paneAuth.is-active) { background: #f5f5f5; }
#paneAuth {
  margin: -15.8px -12px 0;
  background: #f5f5f5;
}
.auth-error { text-align: center; }
.err-art {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}
.err-title {
  margin: 8.5px 0 0;
  font-size: 18.5px;
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: .5px;
  color: #303030;
}
.err-retry {
  width: 80px;
  height: 30px;
  margin-top: 19.5px;
  border: 1px solid #2f7be0;
  border-radius: 6px;
  background: #fff;
  color: #2f7be0;
  font-size: 16px;
  line-height: 1;
  transition: background .15s ease, opacity .15s ease;
}
.err-retry:active { background: #f2f7ff; }
.err-retry:disabled { opacity: .55; }

/* ---------- 空状态 ---------- */
.empty {
  padding: 104px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.empty svg { width: 168px; height: 124px; }
.empty p { margin-top: 22px; font-size: 14px; color: #5c5e64; letter-spacing: .4px; }


/* ---------- 轻提示 ---------- */
.toast {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: 64px;
  transform: translate(-50%, 10px);
  max-width: 74%;
  padding: 10px 16px;
  border-radius: 20px;
  background: rgba(28, 28, 30, .86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: .3px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 桌面端 / 小屏 ---------- */
@media (max-width: 430px), (max-height: 620px) {
  html, body { height: auto; min-height: 100%; }
  body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .stage { display: block; padding: 0; min-height: 0; }
  .device {
    width: 100%;
    height: auto;
    min-height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  .views { position: static; }
  .view {
    position: static;
    inset: auto;
    height: auto;
    overflow: visible;
  }
  .view-home { display: block; }
  .device.is-records .view-home { display: none; }
  .view-records {
    display: none;
    transform: none;
    visibility: visible;
    min-height: 100dvh;
    box-shadow: none;
  }
  .device.is-records .view-records { display: flex; }
  .view-records .rec-nav { position: sticky; top: 0; }
  .view-records .rec-tabs { position: sticky; top: 50px; }
  .rec-body { flex: none; overflow: visible; }
  .scrim { display: none; }
  .toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); }
  .topbar { position: absolute; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
