:root {
  --primary: #4f6ef7;
  --primary-d: #3f5bd6;
  --gold: #ffce5c;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2433;
  --muted: #8a90a2;
  --line: #eef0f6;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.boot { text-align: center; color: var(--muted); padding: 80px 0; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }

/* 顶部品牌栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary), #7b5cff);
  color: #fff;
}
.topbar .brand { font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.topbar .follow-btn {
  font-size: 12px; border: 1px solid rgba(255,255,255,.7);
  padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.12);
}

/* 通用按钮 */
.btn {
  display: block; width: 100%; border: none; border-radius: 12px;
  padding: 14px; font-size: 16px; font-weight: 600; cursor: pointer;
  text-align: center; transition: opacity .15s;
}
.btn:active { opacity: .85; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #7b5cff); color: #fff; }
.btn-gold { background: linear-gradient(135deg, #ffd56b, #ffb43d); color: #4a3200; }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-block-mt { margin-top: 14px; }

/* 横幅 */
.banner {
  margin: 14px; padding: 18px 16px; border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, #ff8a5b, #ff5e8a);
  box-shadow: 0 8px 20px rgba(255,94,138,.25);
}
.banner h2 { margin: 0 0 6px; font-size: 19px; }
.banner p { margin: 0; font-size: 13px; opacity: .95; }

/* 课程列表 */
.section-title { margin: 18px 16px 10px; font-size: 15px; font-weight: 700; color: #444; }
.course-list { padding: 0 14px 30px; }
.course-card {
  display: flex; background: var(--card); border-radius: 16px; overflow: hidden;
  margin-bottom: 14px; box-shadow: 0 4px 14px rgba(40,50,90,.06); cursor: pointer;
}
.course-card .cover {
  width: 110px; min-height: 110px; display: flex; align-items: center; justify-content: center;
  font-size: 46px; flex-shrink: 0;
}
.course-card .body { padding: 12px 14px; flex: 1; min-width: 0; }
.course-card .body h3 { margin: 0 0 4px; font-size: 16px; }
.course-card .body .sub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.course-card .body .tags { margin-bottom: 8px; }
.tag {
  display: inline-block; font-size: 11px; color: var(--primary);
  background: rgba(79,110,247,.1); border-radius: 6px; padding: 2px 7px; margin: 0 6px 4px 0;
}
.course-card .price { color: #ff5e57; font-weight: 700; }
.course-card .price b { font-size: 20px; }
.course-card .price s { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }

/* 详情页 */
.detail { padding-bottom: 90px; }
.detail .hero { color: #fff; padding: 30px 18px; }
.detail .hero .emoji { font-size: 64px; }
.detail .hero h1 { margin: 10px 0 6px; font-size: 22px; }
.detail .hero .sub { opacity: .95; font-size: 13px; }
.detail .hero .price { margin-top: 14px; }
.detail .hero .price b { font-size: 30px; }
.detail .hero .price s { opacity: .8; margin-left: 8px; font-size: 13px; }
.detail .block { background: #fff; margin: 12px 14px; border-radius: 14px; padding: 16px; }
.detail .block h4 { margin: 0 0 10px; font-size: 15px; }
.detail .block p { margin: 0; color: #555; font-size: 14px; }
.detail .hl li { margin-bottom: 8px; color: #555; font-size: 14px; list-style: none; padding-left: 22px; position: relative; }
.detail .hl li:before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.detail .teacher { color: var(--muted); font-size: 13px; }
.detail .bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  display: flex; gap: 10px; padding: 12px 14px calc(12px + var(--safe-b)); background: #fff;
  border-top: 1px solid var(--line); z-index: 15;
}
.detail .bottom-bar .btn { margin: 0; }

/* 表单页（登录/支付） */
.page { padding: 18px 16px calc(30px + var(--safe-b)); }
.page h2 { font-size: 19px; margin: 6px 0 4px; }
.page .hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.field input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 13px 12px;
  font-size: 16px; outline: none; background: #fff;
}
.field input:focus { border-color: var(--primary); }
.field.row { display: flex; gap: 10px; align-items: flex-end; }
.field.row input { flex: 1; }
.code-btn {
  flex-shrink: 0; border: 1px solid var(--primary); color: var(--primary);
  background: #fff; border-radius: 10px; padding: 13px 12px; font-size: 13px; white-space: nowrap;
}
.code-btn:disabled { color: var(--muted); border-color: var(--line); }

/* 金额输入 */
.amount-box { background: #fff; border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.amount-box .label { font-size: 13px; color: #555; margin-bottom: 8px; }
.amount-input { display: flex; align-items: center; border-bottom: 2px solid var(--primary); padding-bottom: 6px; }
.amount-input span { font-size: 26px; font-weight: 700; color: var(--primary); margin-right: 6px; }
.amount-input input { border: none; outline: none; font-size: 30px; font-weight: 700; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px;
  background: #fff; cursor: pointer; color: #444;
}
.chip.active { border-color: var(--primary); color: var(--primary); background: rgba(79,110,247,.08); }

.summary { background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.summary .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.summary .row span:first-child { color: var(--muted); }
.summary .row.total { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 12px; font-weight: 700; }
.summary .row.total b { color: #ff5e57; font-size: 20px; }

/* 成功页 */
.success { text-align: center; padding: 70px 24px; }
.success .check {
  width: 76px; height: 76px; border-radius: 50%; background: #2ecc71; color: #fff;
  font-size: 42px; line-height: 76px; margin: 0 auto 18px;
}
.success h2 { margin: 0 0 8px; }
.success p { color: var(--muted); margin: 0 0 26px; }
.success .amt { color: #ff5e57; font-weight: 700; }

/* 海报页 */
.poster-page { padding: 16px; text-align: center; }
.poster-page img { width: 100%; max-width: 320px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.poster-page .tip { color: var(--muted); font-size: 13px; margin: 14px 0; }
.poster-page .actions { display: flex; gap: 10px; max-width: 320px; margin: 0 auto; }

/* 返回 */
.back {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font-size: 14px; color: inherit; background: rgba(255,255,255,.18);
  border: none; padding: 6px 12px; border-radius: 999px;
}
.detail .back, .page .back { color: var(--primary); background: transparent; padding: 4px 0; margin-bottom: 8px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 320px; padding: 22px 20px;
  text-align: center;
}
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.modal img.qr { width: 180px; height: 180px; object-fit: contain; margin: 0 auto 14px; border-radius: 8px; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal .modal-actions .btn { margin: 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 42%;
  transform: translateX(-50%); z-index: 80; background: rgba(0,0,0,.82); color: #fff;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; max-width: 80%; text-align: center;
}
