* {
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --stroke: rgba(15, 23, 42, .10);
  --txt: #0f172a;
  --muted: rgba(15, 23, 42, .62);

  --brand: #2563eb;
  --brand2: #4f46e5;

  --good: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;

  --shadow: 0 10px 26px rgba(15, 23, 42, .08);
  --r: 18px;
}

body.mode-pre {
  --brand: #2563eb;
  --brand2: #4f46e5;
}

body.mode-pro {
  --brand: #f97316;
  --brand2: #fb7185;
}

body.mode-school {
  --brand: #16a34a;
  --brand2: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--txt);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
}

.back {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--txt);
  border: 1px solid var(--stroke);
  background: #fff;
}

.twrap {
  flex: 1;
  min-width: 0;
}

.t1 {
  font-weight: 900;
  font-size: 12px;
  color: var(--muted);
}

.t2 {
  font-weight: 1100;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iconBtn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--txt);
  cursor: pointer;
}

.page {
  padding: 14px 14px 92px;
}

.space {
  height: 16px;
}

/* banner */
.banner {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--stroke);
  background: #fff;
  min-height: 220px;
}

.banner img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  background: #eef2ff;
}

.bannerOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, .58));
  color: #fff;
}

.bTag {
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  font-weight: 1000;
  font-size: 12px;
}

.bTitle {
  margin-top: 8px;
  font-weight: 1200;
  font-size: 18px;
}

.bSub {
  margin-top: 4px;
  opacity: .92;
  font-weight: 800;
  font-size: 12px;
}

/* timer */
.timerWrap {
  margin-top: 12px;
}

.timerBox {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: #ffe5e5;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-weight: 1200;
  font-size: 15px;
  line-height: 1.35;
  box-shadow: var(--shadow);
}

/* cards */
.card {
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hTitle {
  font-weight: 1100;
  font-size: 16px;
}

.hSub {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.pill {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, .10);
  border: 1px solid rgba(22, 163, 74, .18);
  color: #0f6b2f;
  font-weight: 1100;
  font-size: 12px;
}

/* stats */
.stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 10px;
  background: #fff;
}

.sLbl {
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.sVal {
  margin-top: 4px;
  font-weight: 1200;
  font-size: 18px;
}

/* progress bar */
.barHead {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.barTxt {
  font-weight: 1100;
  font-size: 13px;
}

.miniBtn {
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--txt);
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 1000;
  cursor: pointer;
}

.bar {
  margin-top: 10px;
  height: 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .10);
  border: 1px solid rgba(37, 99, 235, .14);
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  transition: width .7s ease;
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

/* reward */
.rewardCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rwLbl {
  color: var(--muted);
  font-weight: 1000;
  font-size: 12px;
}

.rwTitle {
  margin-top: 4px;
  font-weight: 1200;
  font-size: 17px;
}

.rwSub {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.rwRight {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.rwState {
  font-weight: 1100;
  font-size: 12px;
}

.btnPrimary {
  border: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 1200;
  cursor: pointer;
}

.btnGhost {
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--txt);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 1100;
  cursor: pointer;
}

/* road map */
.roadWrap {
  position: relative;
  margin-top: 12px;
  height: 110px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--stroke);
  overflow: hidden;
}

.road {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  height: 14px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
}

.roadFill {
  position: absolute;
  left: 14px;
  top: 50%;
  height: 14px;
  transform: translateY(-50%);
  border-radius: 999px;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  transition: width .7s ease;
}

.nodes {
  position: absolute;
  inset: 0;
}

.node {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--stroke);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
  cursor: pointer;
}

.node.done {
  border-color: rgba(22, 163, 74, .22);
  background: rgba(22, 163, 74, .10);
}

.node.locked {
  opacity: .55;
}

.node .ico {
  font-size: 18px;
}

.node .lbl {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 1100;
  color: var(--muted);
  white-space: nowrap;
}

.pointer {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -95%);
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, .22);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
  display: grid;
  place-items: center;
  transition: left .7s ease;
}

.pointer::before {
  content: "🚀";
  font-size: 16px;
}

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

/* milestones */
.mileList {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.mileItem {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
}

.miLeft .miT {
  font-weight: 1100;
}

.miLeft .miS {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.miRight {
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 1100;
  font-size: 12px;
  border: 1px solid var(--stroke);
  color: var(--muted);
  background: #fff;
}

.mileItem.ok .miRight {
  border-color: rgba(22, 163, 74, .20);
  background: rgba(22, 163, 74, .10);
  color: #0f6b2f;
}

/* request */
.requestBox {
  margin-top: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  border-radius: 22px;
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.rqTitle {
  font-weight: 1200;
  font-size: 16px;
}

.rqBtn {
  margin-top: 10px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 235, .18);
  background: rgba(37, 99, 235, .10);
  color: #0b2a7a;
  font-weight: 1200;
  cursor: pointer;
}

.rqHint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

/* bottom nav */
.bottomNav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--stroke);
}

.navItem {
  text-decoration: none;
  color: rgba(15, 23, 42, .60);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 1000;
  font-size: 11px;
}

.navIco {
  font-size: 18px;
}

.navItem.active {
  color: var(--txt);
}

.navItem.active .navIco {
  filter: drop-shadow(0 10px 18px rgba(37, 99, 235, .22));
}

/* modal */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, .35);
  backdrop-filter: blur(6px);
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 420px);
  z-index: 101;
  border: 1px solid var(--stroke);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .24);
  overflow: hidden;
}

.mTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-bottom: 1px solid var(--stroke);
}

.mTitle {
  font-weight: 1200;
}

.mBody {
  padding: 14px;
}

.mBig {
  font-weight: 1300;
  font-size: 18px;
}

.mSub {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  line-height: 1.35;
}

.mBtns {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.mBtns button {
  flex: 1;
}

@media (max-width: 640px) {
  .banner img {
    height: auto;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .rewardCard {
    flex-direction: column;
    align-items: flex-start;
  }

  .rwRight {
    width: 100%;
    align-items: stretch;
  }

  .mapBottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .timerBox {
    font-size: 14px;
    padding: 11px 12px;
    font-weight: bold;
  }
}