/* 小小自学室 · 样式表
   浅色主题 / 手机优先 / 平板双栏 / 电视大字模式
*/
:root {
  --bg: #f2f5fb;
  --bg2: #e9eef9;
  --card: #ffffff;
  --ink: #17202e;
  --ink2: #33415a;
  --muted: #6b7b8f;
  --line: #e5ebf5;
  --brand: #4f6ef7;
  --brand-d: #3a56d6;
  --brand-l: #eef1ff;
  --ok: #22b573;
  --warn: #f5a623;
  --err: #e5484d;
  --gold: #f6b73c;
  --purple: #8b5cf6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 6px rgba(23, 32, 46, .05), 0 10px 28px rgba(23, 32, 46, .06);
  --shadow-s: 0 1px 3px rgba(23, 32, 46, .06);
  --fs: 16px;
}

html[data-font="sm"] { --fs: 14.5px; }
html[data-font="md"] { --fs: 16px; }
html[data-font="lg"] { --fs: 18px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: var(--fs);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(900px 500px at 110% -10%, rgba(79, 110, 247, .10), transparent 60%),
    radial-gradient(700px 400px at -10% 0%, rgba(246, 183, 60, .12), transparent 55%);
  background-attachment: fixed;
}

button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font-family: inherit; font-size: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 8px 0; padding-left: 20px; }

/* ---------------- 基础布局 ---------------- */
.app {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px calc(86px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  margin: 0 -16px 4px;
  padding: 0 12px;
  background: rgba(244, 247, 252, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 235, 245, .8);
}

.brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.logo {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #7c8cff);
  color: #fff; font-size: 17px; font-weight: 800;
  box-shadow: 0 4px 10px rgba(79, 110, 247, .35);
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: .3px; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--ink2);
  transition: background .15s;
}
.icon-btn:hover { background: rgba(23, 32, 46, .06); }
.icon-btn:active { transform: scale(.94); }

.chip-star {
  display: flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 12px 0 10px;
  border-radius: 999px;
  background: #fff8e8;
  border: 1px solid #ffe6b8;
  color: #a86a00; font-weight: 800;
}
.ic.fill { fill: currentColor; }

/* 顶栏「登录」入口：未登录/游客时一直可见 */
.chip-login {
  height: 34px; padding: 0 14px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff; font-weight: 800; font-size: 13.5px;
  box-shadow: 0 4px 12px rgba(79, 110, 247, .3);
}
.chip-login[hidden] { display: none; }
.chip-login:active { transform: scale(.96); }

.view { padding-top: 10px; min-height: 60vh; }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(23, 32, 46, .05);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  height: 100%;
  color: #93a1b5; font-size: 11px; font-weight: 600;
  transition: color .15s;
}
.tab.on { color: var(--brand); }
.tab.on .ic { transform: translateY(-1px); }
.tab .ic { transition: transform .15s; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  box-shadow: var(--shadow-s);
  border: 1px solid rgba(229, 235, 245, .9);
  animation: fadeUp .28s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.card-title { font-weight: 800; font-size: 15px; margin-bottom: 10px; color: var(--ink); letter-spacing: .2px; }

.page-title { font-size: 24px; font-weight: 900; letter-spacing: -.3px; margin: 6px 0 4px; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; line-height: 1.65; }
.muted { color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.foot-note { color: #98a5b8; font-size: 12px; text-align: center; margin: 14px 0; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 20px;
  border-radius: 14px;
  font-weight: 700; font-size: 15px;
  transition: transform .12s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), #6d84ff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 110, 247, .32);
}
.btn.ghost {
  background: #f4f6fc; color: var(--ink2);
  border: 1px solid var(--line);
}
.btn.danger { background: #fdeced; color: var(--err); border: 1px solid #f9d6d8; }
.btn.block { width: 100%; }
.btn.tiny { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .ic { flex: none; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }

.chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none;
  height: 36px; padding: 0 15px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink2);
  box-shadow: 0 1px 2px rgba(23, 32, 46, .04);
  font-weight: 600; font-size: 14px;
  transition: all .15s;
}
.chip.on {
  background: var(--brand-l);
  border-color: #c9d3ff;
  color: var(--brand-d);
  font-weight: 800;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: #f1f4fb;
  color: #6b7b8f;
  font-size: 11.5px; font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}

.input {
  width: 100%; height: 46px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: #fbfcff;
  color: var(--ink);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: #a9b8ff; box-shadow: 0 0 0 4px rgba(79, 110, 247, .12); }

.field { margin: 12px 0; }
.field .chips { flex-wrap: wrap; overflow: visible; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 0; font-size: 14.5px;
  border-bottom: 1px dashed var(--line);
}
.switch-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 48px; height: 28px; border-radius: 999px;
  background: #dfe5f0; position: relative; transition: background .2s; flex: none;
}
.switch-row input[type="checkbox"]::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2); transition: transform .2s;
}
.switch-row input[type="checkbox"]:checked { background: var(--brand); }
.switch-row input[type="checkbox"]:checked::after { transform: translateX(20px); }
input[type="range"] { width: 100%; accent-color: var(--brand); height: 30px; }

.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-weight: 800; }
.card.danger { border-color: #f6d7d9; background: #fffafa; }

/* ---------------- 首页 ---------------- */
.hero {
  position: relative;
  border-radius: 24px;
  padding: 18px 18px 16px;
  background: linear-gradient(140deg, #4f6ef7 0%, #6d84ff 45%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(79, 110, 247, .32);
  overflow: hidden;
  animation: fadeUp .3s ease both;
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -80px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; z-index: 1; }
.hello { font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.hello-sub { font-size: 12.5px; opacity: .85; margin-top: 3px; }
.hero-right { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.pill-star, .pill-fire {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px; padding: 4px 11px;
  font-size: 13px; font-weight: 800;
  backdrop-filter: blur(4px);
}
.goal-wrap { margin-top: 18px; position: relative; z-index: 1; }
.goal-bar {
  height: 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  overflow: hidden;
}
.goal-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #ffe08a, #ffc247);
  border-radius: 999px;
  transition: width .5s ease;
  box-shadow: 0 0 10px rgba(255, 210, 110, .8);
}
.goal-row {
  display: flex; justify-content: space-between;
  font-size: 12px; margin-top: 7px; opacity: .95;
}
.goal-row b { font-weight: 800; }
.lv-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11.5px; position: relative; z-index: 1; }
.lv-name { background: rgba(255, 255, 255, .22); padding: 2px 9px; border-radius: 6px; font-weight: 800; }
.lv-bar { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.lv-bar i { display: block; height: 100%; background: #fff; border-radius: 999px; }

.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.qa {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto;
  gap: 0 10px;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  transition: transform .14s, box-shadow .18s;
  animation: fadeUp .3s ease both;
}
.qa:active { transform: scale(.98); }
.qa:hover { box-shadow: var(--shadow); }
.qa-ic {
  grid-row: span 2;
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 12%, #fff);
  color: var(--c);
}
.qa-t { font-weight: 800; font-size: 14.5px; align-self: end; }
.qa-s { font-size: 11.5px; color: var(--muted); }

.continue-card { cursor: pointer; }
.cont-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cont-main b { font-size: 15px; }
.cont-right { font-size: 12.5px; color: var(--muted); }
.cont-right b { color: var(--ok); font-size: 16px; }
.cont-sub { font-size: 11.5px; color: #98a5b8; margin-top: 4px; }

/* 每日任务 */
.tasks { display: flex; flex-direction: column; gap: 12px; }
.task { display: flex; align-items: center; gap: 12px; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.task-bar { height: 7px; border-radius: 999px; background: #eef1f8; overflow: hidden; }
.task-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6d84ff, #8b5cf6); transition: width .4s; }
.task-sub { font-size: 11px; color: #98a5b8; margin-top: 3px; }
.task-claim {
  flex: none; font-size: 12px; font-weight: 800; color: var(--gold);
  background: #fff8e8; border-radius: 9px; padding: 5px 10px;
}
.task-claim.done { color: var(--ok); background: #eaf9f1; }
.task-claim.wait { color: #98a5b8; background: #f4f6fa; }
.task.done .task-title { color: var(--ok); }

/* ---------------- 学科选择 ---------------- */
.subj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.subj {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 6px;
  text-align: left;
  padding: 14px 14px 13px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  transition: transform .14s, border-color .15s;
  overflow: hidden;
}
.subj::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--c);
}
.subj:hover { border-color: color-mix(in srgb, var(--c) 45%, #fff); transform: translateY(-1px); }
.subj-name { font-weight: 800; font-size: 16px; color: var(--ink); }
.subj-topic { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }
.subj-num { font-size: 11px; color: #98a5b8; align-self: center; }
.subj-dot { display: none; }
.subj.mixed { --c: #64748b; }

/* ---------------- 答题 ---------------- */
/* 答题时进入沉浸模式：隐藏顶栏与底栏，避免误触 */
body.in-quiz .topbar,
body.in-quiz .tabbar { display: none; }
body.in-quiz .app { padding-bottom: 32px; }
body.in-quiz .view { padding-top: calc(10px + env(safe-area-inset-top)); }

.quiz-head {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0 8px;
}
.quiz-title { font-weight: 800; font-size: 15px; flex: 1; }
.quiz-title .dot { margin: 0 6px; color: #c3cbd8; }
.quiz-meta { display: flex; gap: 8px; align-items: center; }
.q-timer, .q-score {
  display: flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 800; color: var(--ink2);
  background: #fff; border: 1px solid var(--line);
  border-radius: 9px; padding: 4px 8px;
}
.q-score { color: var(--ok); }

.qbar { height: 6px; background: #e7ecf6; border-radius: 999px; overflow: hidden; }
.qbar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), #8b5cf6); transition: width .3s; }
.qpos { font-size: 12.5px; color: var(--muted); margin: 8px 0 12px; display: flex; align-items: center; flex-wrap: wrap; }
.answered { margin-left: auto; font-size: 11.5px; }

.qcard {
  background: var(--card);
  border-radius: 20px;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: fadeUp .25s ease both;
}
.qstem {
  font-size: 18px; font-weight: 700; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
  margin-bottom: 6px;
}
.speak-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--brand); font-weight: 700;
  background: var(--brand-l); border-radius: 8px; padding: 5px 10px;
  margin-bottom: 14px;
}

.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 14px 14px;
  border-radius: 15px;
  background: #fbfcff;
  border: 1.5px solid var(--line);
  font-size: 15.5px;
  transition: all .15s;
  color: var(--ink);
}
.opt:hover { border-color: #c3cdf0; background: #fff; }
.opt-key {
  flex: none;
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  background: #eff3fb; color: #6b7b8f;
  font-size: 13px; font-weight: 800;
}
.opt-text { flex: 1; line-height: 1.5; }
.opt.sel { border-color: var(--brand); background: var(--brand-l); }
.opt.sel .opt-key { background: var(--brand); color: #fff; }
.opt.right { border-color: #7ddcb2; background: #eefaf4; }
.opt.right .opt-key { background: var(--ok); color: #fff; }
.opt.wrong { border-color: #f5b4b7; background: #fdf0f1; }
.opt.wrong .opt-key { background: var(--err); color: #fff; }
.opt.dim { opacity: .55; }
.opt-mark { flex: none; display: grid; place-items: center; }
.opt-mark.ok { color: var(--ok); }
.opt-mark.no { color: var(--err); }

.fb {
  margin-top: 16px;
  padding: 14px;
  border-radius: 15px;
  animation: fadeUp .25s ease both;
}
.fb.ok { background: #eefaf4; border: 1px solid #c9f0dc; }
.fb.no { background: #fdf1f2; border: 1px solid #f8d3d6; }
.fb-head { font-weight: 900; font-size: 15px; margin-bottom: 6px; }
.fb.ok .fb-head { color: #128a56; }
.fb.no .fb-head { color: #c03338; }
.fb-correct { font-size: 14px; margin-bottom: 6px; }
.fb-why { font-size: 13px; color: #8a4a3a; background: #fff6ec; border-radius: 10px; padding: 9px 11px; margin: 8px 0; line-height: 1.65; }
.fb-exp { font-size: 14.5px; line-height: 1.75; color: var(--ink2); }
.steps { margin: 10px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.85; color: #45536b; }
.steps li { margin-bottom: 2px; }
.steps li::marker { color: var(--brand); font-weight: 800; }
.fb-tip {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 12.5px; color: #8a6a1a; background: #fffaea;
  border-radius: 10px; padding: 8px 10px; margin-top: 10px; line-height: 1.6;
}
.fb-tip .ic { flex: none; margin-top: 2px; }

.exam-nav { margin-top: 16px; justify-content: space-between; }
.sheet { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sheet-cell {
  height: 40px; border-radius: 11px;
  background: #f4f6fb; border: 1px solid var(--line);
  font-weight: 800; font-size: 14px; color: var(--muted);
}
.sheet-cell.done { background: #e9f0ff; color: var(--brand-d); border-color: #c9d6ff; }
.sheet-cell.cur { box-shadow: 0 0 0 2px var(--brand) inset; color: var(--brand); }

/* ---------------- 成绩报告 ---------------- */
.report { text-align: center; padding: 18px 0 4px; animation: fadeUp .3s ease both; }
.report-ring {
  width: 132px; height: 132px; border-radius: 50%;
  margin: 6px auto 12px;
  display: grid; place-content: center;
  border: 9px solid #eef1f8;
}
.report-ring.good { border-color: #bfeed6; }
.report-ring.mid { border-color: #ffe2ab; }
.report-ring.low { border-color: #f9cfd1; }
.ring-num { font-size: 38px; font-weight: 900; letter-spacing: -1px; line-height: 1; }
.ring-num span { font-size: 15px; font-weight: 800; color: var(--muted); }
.ring-label { font-size: 12px; color: var(--muted); margin-top: 3px; }
.report-title { font-size: 19px; font-weight: 900; margin: 4px 0 10px; }
.score-big { font-size: 62px; font-weight: 900; line-height: 1; letter-spacing: -2px; color: var(--brand); }
.score-big span { font-size: 18px; color: var(--muted); margin-left: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.stat {
  background: #f8fafd; border-radius: 13px; padding: 11px 6px;
  border: 1px solid var(--line);
}
.stat b { display: block; font-size: 17px; font-weight: 900; color: var(--ink); }
.stat span { font-size: 10.5px; color: var(--muted); }
.badge-pop {
  margin-top: 14px; font-size: 13px; color: #8a6a1a;
  background: #fffaea; border-radius: 12px; padding: 10px;
}
.stat-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.stat-bar .stat { background: #fff; box-shadow: var(--shadow-s); }

.review-list { display: flex; flex-direction: column; gap: 8px; }
.review-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: 12px;
  background: #fbfcff; border: 1px solid var(--line);
  cursor: pointer; font-size: 13.5px;
}
.review-item.no { background: #fffafa; border-color: #f7dcdd; }
.rv-idx {
  flex: none; width: 22px; height: 22px; border-radius: 7px;
  background: #eef2fa; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: var(--muted);
}
.review-item.ok .rv-mark { color: var(--ok); }
.review-item.no .rv-mark { color: var(--err); }
.rv-stem { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-mark { flex: none; }

.topic-list { display: flex; flex-direction: column; gap: 10px; }
.topic-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.topic-name { width: 96px; flex: none; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-bar { flex: 1; height: 8px; border-radius: 999px; background: #eef1f8; overflow: hidden; }
.topic-bar i { display: block; height: 100%; border-radius: 999px; }
.topic-bar i.g { background: var(--ok); }
.topic-bar i.m { background: var(--warn); }
.topic-bar i.l { background: var(--err); }
.topic-pct { width: 42px; text-align: right; color: var(--muted); font-weight: 700; }

/* ---------------- 陪读 ---------------- */
.tutor-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 136px);
  height: calc(100vh - 136px);
  padding-bottom: 4px;
}
.tutor-head { display: flex; align-items: center; gap: 10px; padding: 6px 2px 10px; flex: none; }
.tutor-ava {
  width: 40px; height: 40px; border-radius: 14px;
  background: linear-gradient(135deg, #22b573, #12a172);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(34, 181, 115, .3);
}
.tutor-name { font-weight: 800; font-size: 15px; }
.tutor-sub { font-size: 11.5px; color: var(--muted); }

.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding: 6px 2px 10px;
  scroll-behavior: smooth;
}
.msg { display: flex; gap: 6px; align-items: flex-end; max-width: 100%; }
.msg.me { flex-direction: row-reverse; }
.bubble {
  max-width: 78%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14.5px; line-height: 1.7;
  white-space: normal; word-break: break-word;
  animation: fadeUp .2s ease both;
}
.msg.bot .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow-s); }
.msg.me .bubble { background: linear-gradient(135deg, var(--brand), #6d84ff); color: #fff; border-bottom-right-radius: 6px; }
.msg-speak {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: #f1f5fb; color: var(--muted);
  display: grid; place-items: center;
}
.quick-ask { margin: 4px 0 8px; flex: none; }
.chat-input {
  flex: none;
  display: flex; gap: 8px; align-items: center;
  padding: 8px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(23, 32, 46, .1);
  margin-bottom: 4px;
}
.chat-input .input { border: 0; background: transparent; padding: 0 6px; height: 42px; }
.chat-input .input:focus { box-shadow: none; }
.mic-btn {
  flex: none; width: 44px; height: 44px; border-radius: 14px;
  background: #eef3ff; color: var(--brand);
  display: grid; place-items: center;
}
.mic-btn.rec { background: var(--err); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .5); } 50% { box-shadow: 0 0 0 10px rgba(229, 72, 77, 0); } }
.send-btn { flex: none; padding: 0 16px; height: 44px; }

/* ---------------- 错题本 ---------------- */
.wrong-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.wrong-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px; box-shadow: var(--shadow-s); }
.wi-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.wi-sub {
  background: color-mix(in srgb, var(--c) 12%, #fff);
  color: var(--c); font-weight: 800; padding: 2px 8px; border-radius: 6px;
}
.wi-count { margin-left: auto; }
.wi-due { color: #98a5b8; }
.due-now { color: var(--err); }
.wi-stem {
  font-size: 14px; line-height: 1.6; margin: 8px 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wi-acts { display: flex; gap: 8px; justify-content: flex-end; }

.empty { text-align: center; padding: 40px 20px; }
.empty-ic {
  width: 76px; height: 76px; border-radius: 50%;
  background: #eefaf4; color: var(--ok);
  display: grid; place-items: center; margin: 0 auto 14px;
}
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ---------------- 成长 ---------------- */
.chart { width: 100%; height: 150px; display: block; }
.sess-list { display: flex; flex-direction: column; gap: 2px; }
.sess { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.sess:last-child { border-bottom: 0; }
.sess-l b { font-size: 14px; }
.sess-time { font-size: 11px; color: #98a5b8; margin-top: 2px; }
.sess-r { text-align: right; }
.sess-score { font-weight: 900; font-size: 16px; }
.sess-score.g { color: var(--ok); }
.sess-score.m { color: var(--warn); }
.sess-score.l { color: var(--err); }
.sess-sub { display: block; font-size: 11px; color: var(--muted); }

/* ---------------- 历史长廊 ---------------- */
.timeline { position: relative; padding-left: 22px; margin-top: 10px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, #f6b73c, #b45309);
  border-radius: 2px; opacity: .35;
}
.tl-item { position: relative; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; box-shadow: var(--shadow-s); }
.tl-dot {
  position: absolute; left: -22px; top: 18px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid #f6b73c;
}
.tl-year { font-size: 12px; font-weight: 800; color: #b45309; }
.tl-era { margin-left: 6px; background: #fdf3e3; border-radius: 5px; padding: 1px 6px; font-size: 11px; }
.tl-title { font-size: 15.5px; font-weight: 800; margin: 3px 0 4px; }
.tl-desc { font-size: 13px; color: var(--muted); line-height: 1.7; }
.tl-speak { margin-top: 8px; font-size: 11.5px; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }

/* ---------------- 奖励 ---------------- */
.wallet {
  display: flex; gap: 16px; align-items: center;
  background: linear-gradient(135deg, #fff6e3, #ffeccc);
  border: 1px solid #ffe0ae;
  border-radius: 20px; padding: 18px;
  box-shadow: 0 8px 22px rgba(246, 183, 60, .2);
}
.wallet-main { text-align: center; flex: none; }
.w-num { font-size: 40px; font-weight: 900; line-height: 1; color: #a86a00; }
.w-label { font-size: 12px; color: #a86a00; display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 3px; }
.wallet-side { flex: 1; font-size: 13px; color: #8a6a1a; }
.wallet-side b { font-size: 18px; }
.wallet-side .lv-bar { background: rgba(168, 106, 0, .15); margin: 8px 0 4px; }
.wallet-side .lv-bar i { background: #f6b73c; }
.w-sub { font-size: 11.5px; opacity: .8; }

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge {
  text-align: center; padding: 12px 6px;
  border-radius: 14px; background: #f8fafd;
  border: 1px solid var(--line);
  opacity: .5;
}
.badge.got { opacity: 1; background: #fffdf5; border-color: #ffe3ae; }
.badge-ic {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto 7px;
  background: #eef1f8; color: #9aa7ba;
}
.badge.got .badge-ic { background: linear-gradient(135deg, #ffe08a, #f6b73c); color: #fff; box-shadow: 0 4px 10px rgba(246, 183, 60, .4); }
.badge-name { display: block; font-size: 12px; font-weight: 800; }
.badge-desc { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.reward-list { display: flex; flex-direction: column; gap: 9px; }
.reward-item {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: 13px;
  background: #fbfcff; border: 1px solid var(--line);
}
.ri-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ri-main b { font-size: 14px; font-weight: 700; }
.ri-cost { font-size: 11.5px; color: #a86a00; display: flex; align-items: center; gap: 3px; }

.ledger { display: flex; flex-direction: column; gap: 6px; }
.lg-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink2); padding: 4px 0; }
.lg-n { font-weight: 800; }
.lg-n.p { color: var(--ok); }
.lg-n.m { color: var(--err); }

/* ---------------- 家长中心 ---------------- */
.pin-box { text-align: center; padding: 34px 18px; background: #fff; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.pin-ic { width: 68px; height: 68px; border-radius: 50%; background: #eef1ff; color: var(--brand); display: grid; place-items: center; margin: 0 auto 16px; }
.pin-input { text-align: center; letter-spacing: 8px; font-size: 20px; max-width: 240px; margin: 0 auto 14px; }
.weak-list { display: flex; flex-direction: column; gap: 8px; }
.weak-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.weak-n { color: var(--err); font-weight: 700; }
.advice { font-size: 14px; line-height: 1.85; color: var(--ink2); }

/* 题库管理 */
.bank-bars { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.bank-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bb-name { width: 42px; flex: none; color: var(--ink2); }
.bb-track { flex: 1; height: 9px; border-radius: 99px; background: #eef1f7; overflow: hidden; }
.bb-track > i { display: block; height: 100%; border-radius: 99px; transition: width .35s ease; }
.bb-num { width: 34px; text-align: right; flex: none; font-variant-numeric: tabular-nums; color: var(--ink); }

.pack-row {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.pack-row:last-child { border-bottom: 0; }
.pack-main { flex: 1; min-width: 0; }
.pack-name {
  font-size: 14px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.pack-ver {
  font-size: 11px; font-weight: 600; color: #64748b;
  background: #f1f5f9; border-radius: 6px; padding: 1px 6px;
}
.pack-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.pack-row .btn.tiny { flex: none; }
.danger-text { color: var(--err) !important; }

.sync-log { margin-top: 8px; }
.sync-log:empty { display: none; }
.sync-line {
  font-size: 12.5px; color: var(--ink2); background: #f8fafc;
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px;
  word-break: break-all;
}

/* ---------------- 弹窗 / 提示 ---------------- */
.modal-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.modal-root.open { pointer-events: auto; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 38, .48);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 22px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1.2) both;
  max-height: 84vh; overflow-y: auto;
}
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-title { font-size: 17px; font-weight: 900; margin-bottom: 10px; }
.modal-body { font-size: 14.5px; line-height: 1.75; color: var(--ink2); }
.modal-stem { font-weight: 700; margin-bottom: 10px; white-space: pre-wrap; }
.modal-opts { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.mo { font-size: 13.5px; padding: 8px 10px; border-radius: 9px; background: #f7f9fd; }
.mo.right { background: #eefaf4; color: #128a56; font-weight: 700; }
.mo.wrong { background: #fdf1f2; color: #c03338; text-decoration: line-through; }
.modal-foot { display: flex; gap: 10px; margin-top: 18px; }
.modal-foot .btn { flex: 1; }
.welcome-ul { font-size: 13.5px; line-height: 1.9; color: var(--ink2); }
.welcome-ul b { color: var(--brand-d); }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: rgba(23, 32, 46, .92);
  color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 120;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: rgba(18, 138, 86, .95); }

/* ---------------- 电视模式 ---------------- */
html[data-tv="1"] {
  --fs: 22px;
  --radius: 22px;
}
html[data-tv="1"] body { background: #eef2fa; }
html[data-tv="1"] .app { max-width: 1280px; padding: 0 40px 140px; }
html[data-tv="1"] .topbar { height: 84px; margin: 0 -40px; padding: 0 32px; }
html[data-tv="1"] .brand-name { font-size: 24px; }
html[data-tv="1"] .logo { width: 42px; height: 42px; font-size: 24px; border-radius: 12px; }
html[data-tv="1"] .quick { grid-template-columns: repeat(4, 1fr); gap: 18px; }
html[data-tv="1"] .qa { padding: 22px; grid-template-columns: 54px 1fr; }
html[data-tv="1"] .qa-ic { width: 54px; height: 54px; border-radius: 16px; }
html[data-tv="1"] .qa-t { font-size: 20px; }
html[data-tv="1"] .qa-s { font-size: 14px; }
html[data-tv="1"] .subj-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
html[data-tv="1"] .subj { padding: 22px; }
html[data-tv="1"] .subj-name { font-size: 22px; }
html[data-tv="1"] .subj-topic { font-size: 15px; }
html[data-tv="1"] .tabbar { height: 92px; }
html[data-tv="1"] .tab { font-size: 15px; }
html[data-tv="1"] .page-title { font-size: 34px; }
html[data-tv="1"] .page-sub { font-size: 17px; }
html[data-tv="1"] .hello { font-size: 30px; }
html[data-tv="1"] .qstem { font-size: 26px; }
html[data-tv="1"] .opt { font-size: 22px; padding: 20px; }
html[data-tv="1"] .opt-key { width: 38px; height: 38px; font-size: 17px; }
html[data-tv="1"] .btn { height: 58px; font-size: 19px; border-radius: 16px; }
html[data-tv="1"] .btn.tiny { height: 44px; font-size: 16px; }
html[data-tv="1"] .chip { height: 48px; font-size: 17px; padding: 0 22px; }
html[data-tv="1"] .card { padding: 24px; }
html[data-tv="1"] .card-title { font-size: 20px; }
html[data-tv="1"] .stat b { font-size: 24px; }
html[data-tv="1"] .stat span { font-size: 13px; }
html[data-tv="1"] .sheet { grid-template-columns: repeat(10, 1fr); }
html[data-tv="1"] .sheet-cell { height: 54px; font-size: 19px; }
html[data-tv="1"] .bubble { font-size: 20px; }
html[data-tv="1"] .tutor-page { height: calc(100dvh - 210px); }
html[data-tv="1"] .badge-grid { grid-template-columns: repeat(6, 1fr); }

/* 遥控焦点 */
:focus-visible { outline: 3px solid #ffb020; outline-offset: 3px; border-radius: 12px; }
html[data-tv="1"] :focus { outline: 4px solid #ffb020; outline-offset: 4px; }
html[data-tv="1"] .opt:focus { box-shadow: 0 0 0 4px rgba(255, 176, 32, .35); }

/* ---------------- 平板 / 桌面 ---------------- */
@media (min-width: 700px) {
  .app { max-width: 860px; padding: 0 24px calc(90px + env(safe-area-inset-bottom)); }
  .topbar { margin: 0 -24px; }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .quick-2 { grid-template-columns: repeat(4, 1fr); }
  .subj-grid { grid-template-columns: repeat(3, 1fr); }
  .badge-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { gap: 12px; }
  .stat b { font-size: 20px; }
  .sheet { grid-template-columns: repeat(10, 1fr); }
}

@media (min-width: 1060px) {
  .app { max-width: 1040px; }
  .view { display: block; }
  .page-title { font-size: 28px; }
}

@media (prefers-color-scheme: dark) {
  /* 保持浅色（学习场景更护眼），仅在系统深色时略降低亮度 */
  html { color-scheme: light; }
}

/* ================================================================
 * 通用：加载态 / 空态
 * ================================================================ */
.page-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 60px 20px; color: var(--muted); font-size: 14.5px;
}
.spinner {
  width: 20px; height: 20px; flex: none;
  border: 2.5px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-card { text-align: center; padding: 28px 20px; }
.empty-card p { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }
.center { text-align: center; }

/* ================================================================
 * 广告位
 * ================================================================ */
.ad-slot { margin: 12px 0; }
.ad-slot:empty { display: none; }
.ad-card {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 10px 12px 10px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-s);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ad-card:active { transform: scale(.985); }
.ad-img {
  width: 56px; height: 56px; flex: none;
  border-radius: 12px;
  background-color: #eef1ff;
  background-size: cover; background-position: center;
}
.ad-img-ph {
  display: grid; place-items: center;
  background: linear-gradient(135deg, #dfe5ff, #f3e6ff);
  color: var(--brand); font-weight: 800; font-size: 16px;
}
.ad-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ad-body b { font-size: 14.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-body i { font-style: normal; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-badge {
  position: absolute; top: -1px; right: 10px;
  font-size: 10px; line-height: 1; padding: 3px 6px;
  color: #8a6d1f; background: #fdf3d8;
  border-radius: 0 0 6px 6px;
  border: 1px solid #f6e3b4; border-top: 0;
}
.ad-go { color: var(--muted); font-size: 20px; line-height: 1; padding-right: 2px; }

/* ================================================================
 * 登录 / 注册
 * ================================================================ */
.auth-layer {
  position: fixed; inset: 0; z-index: 900;
  overflow-y: auto;
  background:
    radial-gradient(900px 500px at 100% 0%, rgba(79, 110, 247, .18), transparent 60%),
    radial-gradient(700px 460px at 0% 10%, rgba(246, 183, 60, .20), transparent 55%),
    linear-gradient(180deg, #f7f9ff, #eef2fc 60%, #f6f8fd);
  -webkit-overflow-scrolling: touch;
}
.auth-layer[hidden] { display: none; }
body.auth-open { overflow: hidden; }
.auth-wrap {
  min-height: 100%;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 18px calc(28px + env(safe-area-inset-bottom));
  gap: 16px;
}
.auth-card {
  width: min(400px, calc(100vw - 36px));
  max-width: 400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 24px;
  padding: 24px 22px 20px;
  box-shadow: 0 20px 60px rgba(30, 45, 90, .14), 0 2px 6px rgba(30, 45, 90, .06);
  animation: authIn .3s cubic-bezier(.2, .9, .3, 1.1) both;
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-logo {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #4f6ef7, #8b5cf6);
  color: #fff; font-size: 22px; font-weight: 800;
  box-shadow: 0 8px 20px rgba(79, 110, 247, .32);
}
.auth-brand b { display: block; font-size: 17px; letter-spacing: .2px; }
.auth-brand i { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.auth-tabs {
  display: flex; gap: 4px;
  background: #f2f5fb; border-radius: 13px; padding: 4px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1; height: 38px; border-radius: 10px;
  font-size: 14.5px; font-weight: 700; color: var(--muted);
  transition: all .16s ease;
}
.auth-tab.on { background: #fff; color: var(--brand); box-shadow: 0 2px 8px rgba(30, 45, 90, .08); }
.auth-tab:disabled { opacity: .5; }

.auth-field { display: block; margin-bottom: 13px; }
.auth-field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.auth-field input, .auth-select {
  width: 100%; height: 48px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: #fbfcff;
  font-size: 15.5px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-field input:focus, .auth-select:focus {
  outline: 0; border-color: #a9b8ff; background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 110, 247, .12);
}
.auth-submit { height: 50px; font-size: 16px; margin-top: 6px; }
.auth-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px;
}
.link-btn {
  font-size: 13px; color: var(--brand); font-weight: 600;
  padding: 4px 2px; text-decoration: none;
}
.link-btn:active { opacity: .65; }
.auth-err {
  background: #fdeced; color: #b02a2f;
  border: 1px solid #f9d6d8;
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 13.5px;
  margin-bottom: 12px;
  line-height: 1.6;
}
.auth-err.info { background: #eef4ff; color: #2a4a8f; border-color: #d8e3ff; }
.auth-err.warn { background: #fff8e8; color: #8a5a00; border-color: #ffe6b8; }
.auth-err.warn code { background: #fff; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.auth-note {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px; line-height: 1.75; color: #93a1b5;
}
.auth-copy { font-size: 12px; color: #9aa8bc; }

/* ================================================================
 * 账号卡片（设置页）
 * ================================================================ */
.acct-card { padding: 16px; }
.acct-row { display: flex; align-items: center; gap: 12px; }
.acct-avatar {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f6ef7, #8b5cf6);
  color: #fff; font-size: 19px; font-weight: 800;
}
.acct-avatar.guest { background: #eef1f8; color: #93a1b5; }
.acct-main { flex: 1; min-width: 0; }
.acct-main b { display: block; font-size: 15.5px; }
.acct-main i { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.acct-sync {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; flex: none; }
.dot.ok { background: var(--ok); }
.dot.err { background: var(--err); }
.dot.busy { background: var(--warn); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.acct-ops { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ================================================================
 * 首页商城入口条
 * ================================================================ */
.shop-strip {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  margin: 12px 0 4px;
  padding: 13px 14px;
  border-radius: 16px;
  background: linear-gradient(120deg, #fff7e8, #fff);
  border: 1px solid #f7e6c4;
  box-shadow: var(--shadow-s);
}
.ss-ic {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #f6b73c, #f59e0b);
  color: #fff;
}
.ss-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ss-main b { font-size: 14.5px; }
.ss-main i { font-style: normal; font-size: 12px; color: #a08a5c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-go { color: #c9a55a; display: grid; place-items: center; }

/* ================================================================
 * 商城
 * ================================================================ */
.shop-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-top: 10px;
}
.shop-card {
  display: flex; flex-direction: column;
  text-align: left; padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-s);
  transition: transform .15s ease;
}
.shop-card:active { transform: scale(.98); }
.shop-cover {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  background-color: #f2f5fb;
  background-size: cover; background-position: center;
}
.shop-cover i {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; height: 100%;
  font-style: normal; color: #b3bfd0;
  background: linear-gradient(135deg, #eef1f9, #f7f9ff);
}
.shop-cover i em, .pd-img-ph i em { font-style: normal; font-size: 11px; color: #b8c4d6; }
.shop-info { display: flex; flex-direction: column; gap: 3px; padding: 10px 11px 12px; }
.shop-title {
  font-size: 13.5px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shop-brief {
  font-style: normal; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shop-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 2px; }
.shop-price { color: var(--err); font-weight: 800; font-size: 16px; }
.shop-price s { font-size: 11px; color: #b3bfd0; font-weight: 500; margin-left: 4px; }
.price-cur { font-size: 12px; margin-right: 1px; }
.price-free { font-size: 13px; }
.shop-stock { font-size: 11px; color: var(--muted); }

/* 商品详情 */
.pd-gallery {
  display: flex; gap: 8px; overflow-x: auto;
  margin: 4px 0 12px; padding-bottom: 2px;
  scroll-snap-type: x mandatory;
}
.pd-img {
  flex: none; width: 100%; aspect-ratio: 4 / 3;
  border-radius: 16px;
  background-color: #f2f5fb; background-size: cover; background-position: center;
  scroll-snap-align: start;
}
.pd-gallery .pd-img:only-child { width: 100%; }
.pd-gallery .pd-img { width: 92%; }
/* 没有图片时不要占掉半屏 */
.pd-gallery .pd-img-ph { aspect-ratio: 2 / 1; }
.pd-img-ph { display: grid; place-items: center; background: linear-gradient(135deg, #eef1f9, #f7f9ff); }
.pd-img-ph i { display: flex; flex-direction: column; align-items: center; gap: 8px; font-style: normal; font-size: 13px; color: #a9b6cc; }
.pd-main { padding: 16px; }
.pd-price { display: flex; align-items: baseline; gap: 8px; color: var(--err); font-size: 26px; font-weight: 800; }
.pd-price s { font-size: 13px; color: #b3bfd0; font-weight: 500; }
.pd-sold { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.pd-title { font-size: 18px; font-weight: 800; margin: 8px 0 4px; line-height: 1.4; }
.pd-brief { font-size: 13.5px; color: var(--muted); }
.pd-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pd-detail { font-size: 14px; line-height: 1.85; color: var(--ink2); }
.pd-detail p { margin: 0 0 8px; }
.buy-card { padding: 16px; }
.buy-tip {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #8a6d1f;
  background: #fdf7e6; border: 1px solid #f7e9c8;
  border-radius: 11px; padding: 9px 11px; margin-bottom: 12px;
}
.buy-modal { text-align: center; }
.buy-qr {
  width: 180px; height: 180px; margin: 0 auto 12px;
  border-radius: 14px; object-fit: contain;
  background: #fff; border: 1px solid var(--line);
  display: block;
}
.buy-qr-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: #b3bfd0; background: #f7f9ff;
}
.buy-qr-ph i { font-style: normal; font-size: 11.5px; }
.buy-wx {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; margin-bottom: 8px;
}
.buy-wx span { color: var(--muted); font-size: 12.5px; }
.buy-wx b { font-size: 15px; letter-spacing: .3px; }
.buy-form { margin-top: 14px; text-align: left; }
.lead-done { padding: 8px 0; color: var(--ok); font-weight: 600; font-size: 14px; }

/* ================================================================
 * 运营后台
 * ================================================================ */
.adm { padding-bottom: 10px; }
.adm-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: 6px 0 14px;
}
.adm-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 12px;
  scrollbar-width: none;
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab {
  display: flex; align-items: center; gap: 5px;
  flex: none; height: 34px; padding: 0 12px;
  border-radius: 10px;
  background: #fff; border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink2);
}
.adm-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(79, 110, 247, .28); }
.adm-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 12px;
}
.adm-stat {
  position: relative;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 15px; padding: 12px 13px 13px;
  box-shadow: var(--shadow-s);
}
.adm-stat .as-ic {
  position: absolute; top: 11px; right: 11px;
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  background: #f2f5fb; color: var(--muted);
}
.adm-stat b { display: block; font-size: 23px; font-weight: 800; line-height: 1.15; }
.adm-stat i { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 1px; }
.adm-stat em { display: block; font-style: normal; font-size: 11px; color: #a5b2c6; margin-top: 3px; }
.adm-stat.b .as-ic { background: #eef1ff; color: var(--brand); }
.adm-stat.g .as-ic { background: #e9f9f1; color: var(--ok); }
.adm-stat.p .as-ic { background: #f3ecff; color: var(--purple); }
.adm-stat.o .as-ic { background: #fff6e6; color: #d08a00; }
.adm-stat.r .as-ic { background: #fdeced; color: var(--err); }
.adm-list { display: flex; flex-direction: column; }
.adm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.adm-row:last-child { border-bottom: 0; }
.ar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ar-main b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-main .muted { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-ops { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.ar-thumb {
  width: 40px; height: 40px; flex: none;
  border-radius: 10px; background-color: #f2f5fb; background-size: cover; background-position: center;
  display: grid; place-items: center; font-size: 14px; color: #a9b6cc; font-weight: 700;
}
.adm-time { font-size: 11.5px; color: #a5b2c6; flex: none; }
.adm-kv {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; font-size: 13.5px; color: var(--ink2);
  border-bottom: 1px dashed var(--line);
}
.adm-kv b { font-size: 16px; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: #f2f5fb; color: var(--muted);
}
.pill.ok { background: #e9f9f1; color: #128a55; }
.pill.warn { background: #fff6e6; color: #a06c00; }

/* 后台表单 */
.form-grid { display: flex; flex-direction: column; }
.form-grid .field { margin: 9px 0; }
.form-grid .field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.form-grid textarea.input { height: auto; padding: 10px 14px; font-size: 14px; line-height: 1.6; resize: vertical; }
.form-grid select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #93a1b5 50%), linear-gradient(135deg, #93a1b5 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-2 .field { margin: 9px 0; }
.form-grid .switch-row { padding: 11px 0; margin: 4px 0; border-bottom: 0; }
.img-pick { display: flex; align-items: center; gap: 10px; }
.img-pick img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.img-pick .input { flex: 1; }
.img-pick .file-btn { flex: none; }
.set-list { display: flex; flex-direction: column; }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-row span { display: flex; flex-direction: column; }
.set-row b { font-size: 14px; font-weight: 700; }
.set-row i { font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }

@media (min-width: 700px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .adm-stats { grid-template-columns: repeat(3, 1fr); }
  .pd-gallery .pd-img { width: 46%; }
}

/* 电视大字模式下的登录与商城 */
html[data-tv="1"] .auth-card { max-width: 560px; padding: 30px 28px; }
html[data-tv="1"] .auth-brand b { font-size: 22px; }
html[data-tv="1"] .auth-field input, html[data-tv="1"] .auth-select { height: 56px; font-size: 19px; }
html[data-tv="1"] .auth-tab { height: 46px; font-size: 18px; }
html[data-tv="1"] .shop-grid { grid-template-columns: repeat(4, 1fr); }
html[data-tv="1"] .ad-body b { font-size: 18px; }
html[data-tv="1"] .adm-tab { height: 44px; font-size: 16px; }

/* 价格整体：¥ 与数字连写，不受父级 flex gap 影响 */
.price { white-space: nowrap; }
.price .price-cur { font-size: .72em; margin-right: 1px; }

/* AI 陪读状态行（设置页 / 陪读页共用观感） */
.ai-status { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 12px 14px; margin: 4px 0 10px; border-radius: 12px;
  background: rgba(79, 110, 247, .08); border: 1px solid rgba(79, 110, 247, .18); }
.ai-status b { font-size: 15px; }
.ai-status i { font-style: normal; font-size: 12px; color: var(--muted); }
.tutor-sub.ai-on { color: #22b573; }
