:root {
  --blue: #2167dc;
  --blue-deep: #143c86;
  --navy: #15294c;
  --ink: #263655;
  --muted: #8797b1;
  --line: #e9eef7;
  --bg: #f3f7fd;
  --card: #ffffff;
  --gold: #c69a3d;
  --gold-deep: #a87920;
  --gold-soft: #fbf1da;
  --orange: #f09b25;
  --purple: #7a5ce0;
  --green: #2aa98a;
  --danger: #e25858;
  --radius: 18px;
  --shadow: 0 8px 26px rgba(26, 67, 143, .07);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, #e6f0ff 0%, #f5f8fd 46%, #f8f5ec 100%) fixed;
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }

.app {
  position: relative;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: transparent;
  overflow: hidden;
}
.page { padding: 0 16px 92px; min-height: 100vh; position: relative; z-index: 1; }
.page.no-tab { padding-bottom: 36px; }
.page-home { padding-top: 14px; }
.page-discover { padding-top: 14px; }
.tabbar { display: none; }

/* ============ 顶部导航 ============ */
.hd {
  position: relative;
  display: flex;
  align-items: center;
  height: 54px;
  margin: 0 -16px 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
}
.hd.no-bg { background: transparent; border-bottom-color: transparent; }
.hd-title { flex: 1; text-align: center; font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: .5px; }
.hd-left, .hd-right { width: 34px; display: flex; align-items: center; }
.hd-right { justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: #f3f7ff; color: var(--blue);
}
.icon-btn svg { width: 20px; height: 20px; }
.hd-underline {
  position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #a9cbff, var(--blue));
}

/* ============ 通用 ============ */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.sec-title { display: flex; align-items: center; gap: 8px; margin: 20px 2px 12px; font-size: 16px; font-weight: 700; color: var(--navy); }
.sec-title::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: linear-gradient(180deg, #a9cbff, var(--blue)); }
.sec-title .more { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.gold { color: var(--gold-deep) !important; }
.blue { color: var(--blue) !important; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.between > svg { width: 28px; height: 28px; color: var(--blue); opacity: .55; flex: none; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.chev { color: #b4c1d5; font-size: 18px; font-weight: 300; }
.dot-red { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: 4px; vertical-align: middle; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 600; font-size: 15px;
}
.btn-primary { color: #fff; background: linear-gradient(135deg, #3b85f0, #1a5ed2); box-shadow: 0 8px 18px rgba(33, 103, 220, .24); }
.btn-gold { color: var(--blue); background: #fff; box-shadow: 0 8px 18px rgba(20, 60, 134, .18); }
.btn-ghost { color: var(--blue); background: #eef5ff; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); opacity: .92; }

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 14px; border-radius: 999px; background: #f2f6fd; color: var(--muted);
  font-size: 13px; border: 1px solid transparent; white-space: nowrap;
}
.chip.on { background: #e9f2ff; color: var(--blue); border-color: #bfd8ff; font-weight: 600; }
.chip.gold-on { background: #eaf3ff; color: var(--blue); border-color: #a9cbff; font-weight: 600; }

.tabs { display: flex; align-items: center; border-bottom: 1px solid var(--line); margin: 0 -16px 14px; padding: 0 16px; }
.tab { flex: 1; text-align: center; padding: 10px 0 12px; color: var(--muted); font-size: 15px; position: relative; }
.tab.on { color: var(--blue); font-weight: 700; }
.tab.on::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 3px; border-radius: 3px; background: var(--blue); }

.segment { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.segment::-webkit-scrollbar { display: none; }

.empty { padding: 40px 10px; text-align: center; color: var(--muted); }
.empty svg { width: 52px; height: 52px; margin: 0 auto 8px; opacity: .45; }

/* ============ 底部导航 ============ */
.tabbar {
  display: flex; position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; height: 66px; padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(26, 67, 143, .05);
}
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #9aa9c0; font-size: 11px; }
.tab-item svg { width: 23px; height: 23px; }
.tab-item.on { color: var(--blue); font-weight: 700; }
.tab-item.on svg { filter: drop-shadow(0 3px 5px rgba(33, 103, 220, .28)); }

/* ============ 登录 ============ */
.login-page { min-height: 100vh; padding: 0 26px; position: relative; overflow: hidden; }
.login-page::before { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; top: -130px; right: -120px; background: radial-gradient(circle, rgba(33,103,220,.16), transparent 70%); }
.login-page::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; bottom: -120px; left: -110px; background: radial-gradient(circle, rgba(198,154,61,.14), transparent 70%); }
.login-inner { position: relative; z-index: 1; padding-top: 12vh; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, #4b91f4, #1655c4); box-shadow: 0 8px 18px rgba(33,103,220,.28); }
.brand-logo svg { width: 26px; height: 26px; }
.brand-name { font-size: 19px; font-weight: 800; color: var(--navy); letter-spacing: 1px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 2px; }
.login-title { margin: 34px 0 4px; font-size: 27px; font-weight: 800; color: var(--navy); }
.login-desc { color: var(--muted); font-size: 13px; }
.login-card { margin-top: 28px; padding: 22px 18px; }
.field { display: flex; align-items: center; gap: 10px; height: 52px; border-bottom: 1px solid var(--line); }
.field:last-of-type { border-bottom: none; }
.field svg { width: 19px; height: 19px; color: var(--blue); flex: none; }
.field input { flex: 1; border: none; outline: none; background: transparent; height: 100%; }
.field input::placeholder { color: #b3bfd1; }
.field .eye-btn { flex: none; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; margin-right: -6px; background: none; border-radius: 50%; }
.field .eye-btn:active { background: #eef5ff; }
.field .eye-btn svg { width: 20px; height: 20px; color: #8a97ab; }
.login-tip { margin: 10px 2px 18px; font-size: 12px; color: var(--muted); }
.login-tip b { color: var(--blue); }

/* ============ 首页 ============ */
.hero {
  position: relative; margin: 0 -16px 16px; padding: 22px 20px 26px; overflow: hidden;
  color: #fff; background: linear-gradient(135deg, #2a70e4 0%, #1a55bd 52%, #123d8c 100%);
  border-radius: 0 0 28px 28px;
}
.hero::before { content: ""; position: absolute; width: 200px; height: 200px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; right: -70px; top: -90px; }
.hero::after { content: ""; position: absolute; width: 140px; height: 140px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; right: 18px; bottom: -85px; }
.hero-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; }
.hero-hello { font-size: 20px; font-weight: 800; }
.hero-sub { font-size: 12px; color: rgba(255,255,255,.8); margin-top: 4px; }
.vip-badge { padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #513c12; background: linear-gradient(135deg, #fbeecb, #e2b761); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.hero-date { position: relative; z-index: 1; margin-top: 20px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.92); }
.hero-date svg { width: 17px; height: 17px; }
.hero-quote { position: relative; z-index: 1; margin-top: 8px; font-size: 13px; color: rgba(255,255,255,.72); }
.hero-line { width: 52px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #f3dca4, #c69a3d); margin: 12px 0 0; }

.remind-banner { display: flex; gap: 12px; align-items: center; }
.remind-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; color: var(--blue); background: #eaf3ff; }
.remind-icon svg { width: 24px; height: 24px; }
.progress-dots { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.progress-dots i { width: 12px; height: 12px; border-radius: 50%; background: #e5ebf5; display: block; }
.progress-dots i.done { background: linear-gradient(135deg, #5ea0f6, #2167dc); }
.progress-dots i.gift { background: linear-gradient(135deg, #a9cbff, #2167dc); }
.progress-dots span { flex: 1; height: 2px; background: #e6ecf5; }
.progress-dots span.done { background: #2167dc; }

.entry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.entry {
  position: relative; overflow: hidden; min-height: 104px; padding: 14px;
  border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.entry .entry-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; }
.entry .entry-ico svg { width: 21px; height: 21px; }
.entry h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy); }
.entry p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.entry .corner { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; opacity: .18; }
.entry.blue { background: linear-gradient(145deg, #ffffff 60%, #e9f3ff); }
.entry.gold { background: linear-gradient(145deg, #fbfdff 55%, #e7f0ff); }
.entry.gold h3 { color: #1c4f9c; }
.entry.purple { background: linear-gradient(145deg, #ffffff 60%, #f1edff); }
.entry.green { background: linear-gradient(145deg, #ffffff 60%, #e7f8f3); }

.premium-card { position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px; color: #fff; background: linear-gradient(120deg, #2a70e4, #143c86); box-shadow: 0 10px 24px rgba(20, 60, 134, .22); }
.premium-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.premium-card p { margin: 0; font-size: 12px; color: rgba(255,255,255,.88); }
.premium-card .deco { position: absolute; right: -6px; bottom: -8px; width: 92px; height: 92px; opacity: .22; }
.premium-card .deco svg, .entry .corner svg, .mini-card .mini-ico svg { width: 100%; height: 100%; }
.premium-card .btn-gold { height: 32px; padding: 0 12px; font-size: 12px; margin-top: 12px; }

/* ============ 提醒页 ============ */
.step-card { display: flex; align-items: center; gap: 12px; padding: 15px; background: #f7f9fe; border-radius: 14px; margin-bottom: 10px; }
.step-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: #eaf2ff; color: var(--blue); }
.step-ico svg { width: 20px; height: 20px; }
.step-card h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--navy); }
.step-card p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.status-tag { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: #e9f7f2; color: var(--green); }
.status-tag.todo { background: #eaf3ff; color: var(--blue); }

.course-banner { display: block; position: relative; overflow: hidden; border-radius: var(--radius); min-height: 116px; padding: 18px 16px; color: #fff; background: linear-gradient(120deg, #2a70e4, #143c86); margin-bottom: 12px; }
.course-banner::after { content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%; right: -30px; bottom: -70px; background: rgba(255,255,255,.09); }
.course-banner h3 { margin: 0 0 8px; font-size: 16px; font-weight: 800; max-width: 210px; }
.course-banner p { margin: 0; font-size: 11px; color: rgba(255,255,255,.88); }
.course-banner .play-mini { position: absolute; right: 16px; bottom: 16px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.24); border: 1px solid rgba(255,255,255,.5); }
.course-banner .play-mini svg { width: 20px; height: 20px; }

.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-card { display: block; padding: 15px; border-radius: var(--radius); box-shadow: var(--shadow); }
.mini-card.green { background: linear-gradient(145deg, #f2fbf7, #e4f6ee); }
.mini-card.blue { background: linear-gradient(145deg, #f4f8ff, #e8f0ff); }
.mini-card h4 { margin: 0 0 6px; font-size: 15px; color: var(--navy); }
.mini-card p { margin: 0; font-size: 11px; color: var(--muted); }
.mini-card .mini-ico { float: right; width: 38px; height: 38px; opacity: .32; }

.med-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.med-row:last-child { border-bottom: none; }
.med-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #fff2e5; color: var(--orange); flex: none; }
.med-dot svg { width: 19px; height: 19px; }

/* ============ 睡眠日记 ============ */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.week .wd { font-size: 11px; color: var(--muted); padding-bottom: 6px; }
.week .day { padding: 7px 0; border-radius: 12px; font-size: 14px; color: var(--ink); }
.week .day.on { background: linear-gradient(135deg, #5b9bf5, #2167dc); color: #fff; font-weight: 700; box-shadow: 0 6px 12px rgba(33,103,220,.24); }
.week .day.has::after { content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); margin: 3px auto -3px; }
.week .day.off { color: #c3cddd; cursor: default; }
.week-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.week-nav button { color: var(--blue); font-size: 13px; padding: 4px 8px; }
.field-row { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.field-row:last-child { border-bottom: none; }
.field-row .fr-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #f0f5ff; color: var(--blue); flex: none; }
.field-row .fr-ico svg { width: 17px; height: 17px; }
.field-row label { flex: 1; font-size: 14px; color: var(--ink); }
.field-row input, .field-row select, .field-row textarea {
  border: none; outline: none; background: #f5f8fd; border-radius: 9px; padding: 8px 10px; text-align: right; max-width: 52%; font-size: 14px;
}
.field-row textarea { width: 100%; max-width: none; text-align: left; min-height: 68px; resize: none; }
.field-row .unit { color: var(--muted); font-size: 12px; }
.value-options { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
.value-options .chip { padding: 5px 10px; font-size: 12px; }

/* 睡眠日记：条目列表 */
.entry-card { padding: 2px 16px; }
.entry-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; border-bottom: 1px solid var(--line); text-align: left; }
.entry-row:last-child { border-bottom: none; }
.entry-row .er-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #f0f5ff; color: var(--blue); flex: none; }
.entry-row .er-ico svg { width: 18px; height: 18px; }
.entry-row .er-label { flex: 1; font-size: 14px; color: var(--ink); }
.entry-row .er-value { font-size: 15px; color: var(--blue); font-weight: 700; max-width: 52%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-row .er-arrow { color: #c3cee0; font-size: 20px; line-height: 1; }
.entry-row:active { background: #f7faff; }

/* 睡眠日记：底部抽屉选择器 */
.sheet-mask { z-index: 95; }
.sheet { width: 100%; max-width: 430px; background: #fff; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sheet-head b { font-size: 15px; color: var(--navy); }
.sheet-cancel { font-size: 14px; color: var(--muted); }
.sheet-ok { font-size: 14px; color: var(--blue); font-weight: 700; }
.wheel-wrap { position: relative; display: flex; justify-content: center; gap: 6px; height: 220px; padding: 22px 16px; }
.wheel-wrap::before { content: ""; position: absolute; left: 16px; right: 16px; top: 50%; height: 44px; transform: translateY(-50%); border-radius: 10px; background: #f1f6ff; pointer-events: none; }
.wheel-col { position: relative; width: 96px; height: 100%; overflow: hidden; }
.wheel-list { height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 66px 0; }
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-item { height: 44px; line-height: 44px; text-align: center; scroll-snap-align: center; font-size: 17px; color: var(--muted); }
.wheel-item.on { color: var(--blue); font-weight: 700; }
.wheel-item small { font-size: 12px; margin-left: 2px; }
.wheel-wrap.single .wheel-col { width: 140px; }
.sheet-options { padding: 8px 18px 22px; }
.sheet-opt { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-radius: 12px; background: #f5f8fd; margin-bottom: 8px; font-size: 14px; color: var(--ink); }
.sheet-opt.on { background: #eaf3ff; color: var(--blue); font-weight: 700; }
.sheet-opt svg { width: 18px; height: 18px; }
/* 睡眠日记：备注居中弹窗 */
.modal-mask.dialog-mask { align-items: center; padding: 0 18px; }
.dialog { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 18px 44px rgba(12, 26, 52, .24); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dialog-head b { font-size: 16px; color: var(--navy); }
.dialog-text { display: block; width: 100%; box-sizing: border-box; height: 190px; min-height: 190px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; resize: none; outline: none; font-size: 15px; line-height: 1.7; color: var(--ink); background: #f7faff; font-family: inherit; }
.dialog-text:focus { border-color: var(--blue); background: #fff; }
.dialog-actions { display: flex; gap: 10px; margin-top: 14px; }
.dialog-actions .btn { flex: 1; }

/* ============ 报告 ============ */
.dim-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 -16px 14px; padding: 0 16px; }
.dim-tab { text-align: center; padding: 10px 2px 8px; color: var(--muted); position: relative; }
.dim-tab .dim-ico { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; background: #f1f5fc; color: var(--muted); }
.dim-tab .dim-ico svg { width: 22px; height: 22px; }
.dim-tab span { font-size: 12px; }
.dim-tab.on { color: var(--blue); font-weight: 700; }
.dim-tab.on .dim-ico { color: #fff; box-shadow: 0 6px 14px rgba(33,103,220,.25); }
.dim-tab.on .dim-ico.c1 { background: linear-gradient(135deg, #a48bf0, #7a5ce0); }
.dim-tab.on .dim-ico.c2 { background: linear-gradient(135deg, #f7bb66, #ed9a2c); }
.dim-tab.on .dim-ico.c3 { background: linear-gradient(135deg, #66b6f4, #2482d8); }
.dim-tab.on .dim-ico.c4 { background: linear-gradient(135deg, #f58e92, #e15b64); }
.dim-tab.on::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 3px; border-radius: 3px; background: var(--blue); }
.chart-wrap { background: #fff; border-radius: var(--radius); padding: 14px 8px 10px; box-shadow: var(--shadow); }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; justify-content: center; gap: 18px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.chart-note { text-align: center; font-size: 12px; color: var(--purple); margin: 2px 0 10px; }
.chart-unit { font-size: 12px; color: var(--muted); padding-left: 10px; }

/* ============ 量表 ============ */
.scale-card { display: flex; gap: 12px; align-items: center; }
.scale-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 800; font-size: 13px; }
.scale-ico.c1 { background: linear-gradient(135deg, #6aa4f6, #2167dc); }
.scale-ico.c2 { background: linear-gradient(135deg, #f3c06d, #d99a30); }
.scale-ico.c3 { background: linear-gradient(135deg, #a78ef2, #7658db); }
.scale-ico.c4 { background: linear-gradient(135deg, #6fd2bb, #249b80); }
.progress-bar { height: 6px; border-radius: 6px; background: #edf2fa; overflow: hidden; margin-top: 8px; }
.progress-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6aa4f6, #2167dc); }
.q-card { margin-bottom: 12px; }
.q-title { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 12px; }
.q-title em { font-style: normal; color: var(--blue); margin-right: 6px; }
.q-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; }
.q-opt { padding: 10px 6px; border-radius: 10px; background: #f5f8fd; text-align: center; font-size: 12px; color: var(--ink); border: 1px solid transparent; }
.q-opt.on { background: #eaf3ff; border-color: #a9cbff; color: var(--blue); font-weight: 700; }
.result-ring { width: 110px; height: 110px; margin: 6px auto 10px; }
.result-level { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; margin-top: 6px; }

/* ============ 课程 / 播放器 ============ */
.course-cat { display: flex; gap: 8px; margin-bottom: 12px; }
.course-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.course-item:last-child { border-bottom: none; }
.cover { width: 78px; height: 62px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4b8ef0, #1b58c3); }
.cover.gold { background: linear-gradient(135deg, #4b8ef0, #1b58c3); }
.cover.purple { background: linear-gradient(135deg, #a691ee, #7052d2); }
.cover svg { width: 28px; height: 28px; }
.course-item h4 { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--navy); }
.course-item p { margin: 0; font-size: 11px; color: var(--muted); }
.badge { display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 6px; background: #eaf3ff; color: var(--blue); }
.badge.gold { background: #eaf3ff; color: var(--blue); }
.badge.green { background: #e7f7f1; color: var(--green); }

.player-cover { height: 190px; border-radius: var(--radius); display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.28), transparent 55%), linear-gradient(140deg, #2a70e4, #123d8c); position: relative; overflow: hidden; }
.player-cover.gold { background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.28), transparent 55%), linear-gradient(140deg, #2a70e4, #123d8c); }
.player-cover svg { width: 72px; height: 72px; opacity: .85; }
.player-cover::before, .player-cover::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.player-cover::before { width: 220px; height: 220px; }
.player-cover::after { width: 150px; height: 150px; }
.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; margin: 16px 0; }
.wave i { width: 3px; border-radius: 3px; background: #bcd4f8; height: 8px; }
.wave i.on { background: var(--blue); }
.player-btn { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; color: #fff; background: linear-gradient(135deg, #3b85f0, #1a5ed2); box-shadow: 0 10px 22px rgba(33,103,220,.3); }
.player-btn svg { width: 26px; height: 26px; }

/* ============ 发现 / 我的 ============ */
.profile-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 4px; margin: 0 -16px 10px; color: var(--navy); }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #eef2f8; border: 2px solid #dde5f0; color: var(--blue); font-size: 20px; font-weight: 800; flex: none; }
.profile-head h3 { margin: 0; font-size: 17px; }
.profile-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.info-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--muted); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
.list-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: #eaf3ff; color: var(--blue); }
.list-ico svg { width: 20px; height: 20px; }
.list-item .t { flex: 1; }
.list-item h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--navy); }
.list-item p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.article h2 { font-size: 18px; color: var(--navy); margin: 6px 0 12px; }
.article p { color: #51627f; line-height: 1.9; font-size: 14px; margin: 10px 0; }
.article .lead { padding: 12px; border-radius: 12px; background: #f5f8fe; color: var(--blue); font-size: 13px; }
.chat-item { padding: 12px; border-radius: 12px; background: #f5f8fe; margin-bottom: 10px; }
.chat-item.doctor { background: #fff8ea; }
.chat-item .who { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.chat-item .txt { font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 96px; transform: translate(-50%, 12px); background: rgba(20, 38, 72, .92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; max-width: 88%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-mask { position: fixed; z-index: 90; inset: 0; background: rgba(12, 26, 52, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal { width: 100%; max-width: 480px; background: #fff; border-radius: 20px 20px 0 0; padding: 18px 18px 24px; }
.modal h3 { margin: 0 0 12px; font-size: 16px; color: var(--navy); }

/* ============ 登录方式与安全提示 ============ */
.login-tabs { display: flex; gap: 24px; margin: 26px 0 14px; border-bottom: 1px solid var(--line); }
.login-tab { position: relative; padding: 0 2px 12px; font-size: 15px; color: var(--muted); font-weight: 500; }
.login-tab.on { color: var(--navy); font-weight: 700; }
.login-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #5b9bf5, #2167dc); }
.login-card { margin-top: 0; padding: 6px 18px; }
.code-btn { flex: none; padding: 6px 10px; font-size: 12px; color: var(--blue); background: #eef5ff; border-radius: 8px; white-space: nowrap; }
.code-btn[disabled] { color: var(--muted); background: #f2f5fa; }
.login-help { margin-top: 14px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.8; }
.login-help button { color: var(--blue); font-size: 12px; margin-right: 6px; }

@media (min-width: 520px) {
  .app { margin: 0 auto; }
}
