/* ===== 学习闯关工作台 · 游戏风（手机优先） ===== */
:root {
  --primary: #7c5cfc;
  --primary-d: #5b3fd6;
  --green: #2ed573;
  --yellow: #ffb400;
  --pink: #ff6b9d;
  --blue: #4bc0f9;
  --red: #ff6b6b;
  --ink: #2d2a4a;
  --muted: #8a87a8;
  --card: #ffffff;
  --radius: 22px;
  --shadow: 0 10px 24px rgba(80, 60, 160, 0.16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #8e7bff 0%, #b39bff 26%, #ffd6ec 60%, #fff3e0 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 84px; }
.loading { text-align: center; padding: 80px 0; color: #fff; font-size: 18px; }

/* 顶部条 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-radius: 0 0 24px 24px; box-shadow: var(--shadow);
}
.topbar .title { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 6px; }
.topbar .level-pill {
  background: linear-gradient(135deg, var(--yellow), var(--pink));
  color: #fff; font-weight: 700; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; display: flex; align-items: center; gap: 4px;
}
.topbar .points-pill {
  background: rgba(124,92,252,0.12); color: var(--primary-d);
  font-weight: 800; font-size: 14px; padding: 6px 12px; border-radius: 999px;
}

/* 容器 */
.wrap { padding: 16px; }
.section-title { font-weight: 800; font-size: 17px; margin: 8px 4px 12px; color: #fff; text-shadow: 0 2px 6px rgba(90,60,160,.2); }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 4px 0; color: var(--muted); font-size: 14px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 16px; padding: 14px 18px; font-size: 16px; font-weight: 800;
  cursor: pointer; width: 100%; transition: transform .08s ease, box-shadow .2s;
  color: #fff; background: var(--primary); box-shadow: 0 6px 14px rgba(124,92,252,.35);
}
.btn:active { transform: translateY(2px) scale(.99); }
.btn.green { background: var(--green); box-shadow: 0 6px 14px rgba(46,213,115,.35); }
.btn.yellow { background: var(--yellow); box-shadow: 0 6px 14px rgba(255,180,0,.35); }
.btn.pink { background: var(--pink); box-shadow: 0 6px 14px rgba(255,107,157,.35); }
.btn.ghost { background: #fff; color: var(--primary-d); border: 2px solid var(--primary); box-shadow: none; }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 12px; }
.btn:disabled { opacity: .5; }

/* 科目色 */
.sub-语文 { background: linear-gradient(135deg,#ff9a9e,#ff6b9d); }
.sub-数学 { background: linear-gradient(135deg,#4bc0f9,#5b8def); }
.sub-英语 { background: linear-gradient(135deg,#43e97b,#38f9d7); }
.sub-体育 { background: linear-gradient(135deg,#ffb75e,#ed8f03); }
.sub-其他 { background: linear-gradient(135deg,#b06ab3,#4568dc); }
.tag { display: inline-block; color:#fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #9aa5b1; }

/* 首页闯关地图 */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--pink));
  border-radius: var(--radius); padding: 20px; color: #fff; box-shadow: var(--shadow);
  margin-bottom: 16px; position: relative; overflow: hidden;
}
.hero h2 { margin: 0; font-size: 22px; }
.hero .sub { opacity: .9; margin-top: 4px; font-size: 14px; }
.hero .big-emoji { position: absolute; right: 14px; top: 10px; font-size: 64px; opacity: .35; }

.islands { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.island {
  border-radius: var(--radius); padding: 18px 14px; color: #fff; text-align: center;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .1s;
}
.island:active { transform: scale(.97); }
.island .ic { font-size: 40px; }
.island .nm { font-weight: 800; margin-top: 6px; font-size: 16px; }
.island .ds { font-size: 12px; opacity: .9; margin-top: 2px; }

/* 列表行 */
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 10px;
}
.row .ico { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: 0 0 auto; }
.row .body { flex: 1; min-width: 0; }
.row .body .t { font-weight: 700; font-size: 15px; }
.row .body .m { color: var(--muted); font-size: 12px; margin-top: 2px; }
.row.done .body .t { text-decoration: line-through; color: var(--muted); }
.row .act { flex: 0 0 auto; }

/* 进度条 */
.bar { height: 10px; border-radius: 999px; background: #eee; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,var(--green),var(--blue)); }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; border: 2px solid #eceaff; border-radius: 14px; padding: 13px 14px;
  font-size: 15px; outline: none; background: #fafaff; color: var(--ink); font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }
.field textarea { resize: vertical; min-height: 70px; }

/* 底部 Tab */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px); display: flex; box-shadow: 0 -6px 20px rgba(80,60,160,.12);
  border-radius: 22px 22px 0 0; z-index: 30;
}
.tabbar a {
  flex: 1; text-align: center; padding: 10px 0 12px; color: var(--muted);
  text-decoration: none; font-size: 11px; font-weight: 700;
}
.tabbar a .em { font-size: 24px; display: block; }
.tabbar a.active { color: var(--primary); }
/* 孩子端 6 个入口：图标和字号略缩，避免小屏挤在一起 */
.tabbar.six a { padding: 8px 0 10px; font-size: 10px; }
.tabbar.six a .em { font-size: 21px; line-height: 26px; }

/* 徽章墙 */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge { text-align: center; padding: 12px 6px; border-radius: 18px; background: #f3f1ff; }
.badge.locked { filter: grayscale(1); opacity: .45; }
.badge .be { font-size: 34px; }
.badge .bn { font-size: 12px; font-weight: 700; margin-top: 4px; }
.badge .bd { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* 番茄钟 */
.timer { text-align: center; }
.timer .clock {
  font-size: 72px; font-weight: 800; color: var(--primary);
  background: #fff; border-radius: 50%; width: 220px; height: 220px; line-height: 220px;
  margin: 18px auto; box-shadow: var(--shadow);
}
.timer .subject-pick { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }

/* 刷题 */
.quiz-card { text-align: center; }
.quiz-card .q { font-size: 20px; font-weight: 800; margin: 10px 0 18px; }
.options { display: grid; gap: 10px; }
.option {
  border: 2px solid #eceaff; border-radius: 16px; padding: 14px; font-size: 16px; font-weight: 700;
  background: #fafaff; cursor: pointer; text-align: left;
}
.option.correct { border-color: var(--green); background: #eafff3; color: #1a9e54; }
.option.wrong { border-color: var(--red); background: #fff0f0; color: #d63a3a; }
.quiz-result { font-size: 22px; font-weight: 800; text-align: center; padding: 20px; }

/* 统计网格 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow); text-align: center; }
.stat .v { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 提示气泡 */
.toast {
  position: fixed; left: 50%; top: 80px; transform: translateX(-50%);
  background: rgba(45,42,74,.95); color: #fff; padding: 12px 20px; border-radius: 14px;
  font-size: 14px; z-index: 99; box-shadow: var(--shadow); max-width: 90%;
}
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.flex { display: flex; gap: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.hr { height: 1px; background: #eee; margin: 12px 0; }

/* 今日作业 / 拍照凭证 */
.hw-summary { background: linear-gradient(135deg,#fff,#f3f0ff); }
.hw-capture { background: linear-gradient(135deg,var(--green),#26c281); color:#fff; font-weight:800; }
.tag-verify { background: linear-gradient(135deg,#ff9a3d,#ff6b9d) !important; }
.tag-daily { background: linear-gradient(135deg,#4f7cff,#7a5cff) !important; }
.tag-weekly { background: linear-gradient(135deg,#2fb37a,#12b886) !important; color:#fff; }

/* ===== AI 讲解 底部抽屉 ===== */
.sheet { position: fixed; top:0; left:0; right:0; bottom:0; width:100%; height:100%; z-index: 100; display: none; }
.sheet.show { display: block; }
.sheet-mask { position: absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%; background: rgba(45,42,74,.5); backdrop-filter: blur(2px); }
.sheet-panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 480px; max-height: 86vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(80,60,160,.25);
  animation: sheetUp .25s ease;
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #eee; position: sticky; top: 0; background: #fff;
  border-radius: 22px 22px 0 0;
}
.sheet-title { font-weight: 800; font-size: 17px; }
.sheet-x { border: none; background: #f0eefb; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.sheet-body { padding: 14px 16px 24px; overflow-y: auto; }

.ex-ctx { background: linear-gradient(135deg,#f3efff,#fdeef6); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.ex-ctx .ex-qt { font-weight: 700; font-size: 15px; margin: 8px 0 6px; line-height: 1.5; }
.ex-ctx .ex-cmp { font-size: 13px; color: var(--muted); }
.ex-ctx .ex-cmp .ok { color: var(--green); }

/* 聊天对话区 */
.ex-chat { flex: 1; overflow-y: auto; padding: 6px 2px 10px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.ex-msg { display: flex; gap: 8px; align-items: flex-end; }
.ex-msg.me { flex-direction: row-reverse; }
.ex-av { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: #f0eefb; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.ex-bubble { max-width: 78%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.6; word-break: break-word; }
.ex-msg.ai .ex-bubble { background: #f3f0ff; color: var(--ink); border-bottom-left-radius: 4px; }
.ex-msg.me .ex-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ex-bubble.typing { display: flex; gap: 4px; align-items: center; padding: 13px 14px; }
.ex-bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .5; animation: blink 1.2s infinite; }
.ex-bubble.typing span:nth-child(2) { animation-delay: .2s; }
.ex-bubble.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* 底部操作条 + 输入条 */
.ex-bar { display: flex; gap: 10px; padding: 8px 2px 4px; border-top: 1px solid #f0eefb; }
.ex-reveal { flex: 1; border: none; background: linear-gradient(135deg,var(--yellow),#ff9a3d); color: #fff; font-weight: 800; font-size: 14px; padding: 11px; border-radius: 14px; cursor: pointer; }
.ex-restart { flex: 0 0 auto; border: 2px solid #eceaff; background: #fff; color: var(--muted); font-weight: 700; font-size: 13px; padding: 11px 14px; border-radius: 14px; cursor: pointer; }
.ex-inputbar { display: flex; gap: 8px; padding: 8px 2px 2px; }
.ex-inputbar input { flex: 1; border: 2px solid #eceaff; border-radius: 14px; padding: 11px 13px; font-size: 14px; font-family: inherit; outline: none; }
.ex-inputbar input:focus { border-color: var(--primary); }
.ex-send { flex: 0 0 auto; border: none; background: var(--primary); color: #fff; font-weight: 800; font-size: 14px; padding: 0 18px; border-radius: 14px; cursor: pointer; }
.ex-send:active { transform: scale(.97); }

.check { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text); cursor:pointer; }
.check input { width:18px; height:18px; accent-color:var(--green); }
.hw-verify { background: linear-gradient(135deg,#ffb400,#ff7a59); color:#fff; font-weight:800; }
.hw-pending { background: #cdd0e0; color:#fff; font-weight:700; }
.hw-photo { margin-top: 8px; }
.hw-thumb {
  width: 92px; height: 92px; object-fit: cover; border-radius: 14px;
  border: 2px solid #eceaff; box-shadow: var(--shadow); cursor: pointer;
}
/* 孩子申请家长确认时填的说明 */
.hw-note {
  margin-top: 8px; padding: 8px 10px; border-radius: 12px;
  background: #fff8e6; border: 1px solid #ffe2a8; color: #8a6212;
  font-size: 13px; line-height: 1.45;
}
/* 家长退回/驳回的理由：醒目的红橙色提示，孩子端一直显示到重新完成 */
.hw-note.redo-note {
  background: #fff1ef; border-color: #ffd0c7; color: #b8452f; font-weight: 600;
}
/* 驳回理由的快捷标签 */
.redo-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.redo-tag {
  font-family: inherit; font-size: 13px; line-height: 1;
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
  background: #f6f4ff; border: 1px solid #ded7ff; color: #5b47c9;
}
.redo-tag:active { background: #ece7ff; }

/* 一份作业多张照片：可横向滑动的缩略图条 */.hw-photos { display:flex; gap:8px; overflow-x:auto; margin-top:8px; padding:2px 0 4px; -webkit-overflow-scrolling:touch; }
.hw-photo-cell { position:relative; flex:0 0 auto; }
.hw-photo-cell .hw-thumb { width:84px; height:84px; }
.hw-photo-cell .pg {
  position:absolute; left:5px; bottom:5px; background:rgba(0,0,0,.55); color:#fff;
  font-size:11px; line-height:1; padding:2px 5px; border-radius:8px;
}
.hw-photo-add {
  flex:0 0 auto; width:84px; height:84px; border-radius:14px; border:2px dashed #c9c4f0;
  background:#f7f5ff; color:#7a6bd6; font-size:12px; font-weight:700; font-family:inherit;
  display:flex; align-items:center; justify-content:center; text-align:center; line-height:1.35; cursor:pointer;
}

/* 大图查看器（看作业照片 / 重拍这张 / 删除这张） */
.photo-viewer {
  position:fixed; top:0; left:0; right:0; bottom:0; width:100%; height:100%; z-index:9500; background:rgba(12,10,26,.95);
  display:flex; flex-direction:column;
}
.photo-viewer .pv-bar {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 16px; color:#fff; font-size:14px;
}
.photo-viewer .pv-stage { flex:1; display:flex; align-items:center; justify-content:center; overflow:hidden; padding:0 8px; }
.photo-viewer .pv-stage img { max-width:100%; max-height:100%; object-fit:contain; border-radius:10px; }
.photo-viewer .pv-nav {
  position:absolute; top:50%; transform:translateY(-50%); width:44px; height:44px;
  border-radius:50%; border:0; background:rgba(255,255,255,.18); color:#fff; font-size:22px; line-height:1;
}
.photo-viewer .pv-prev { left:10px; }
.photo-viewer .pv-next { right:10px; }
.photo-viewer .pv-actions { display:flex; gap:10px; justify-content:center; padding:16px 16px 26px; }
.photo-viewer .pv-actions button {
  border:0; border-radius:999px; padding:11px 18px; font-size:14px; font-weight:700; font-family:inherit; cursor:pointer;
}
.pv-close { background:rgba(255,255,255,.92); color:#2d2a4a; font-size:13px !important; padding:8px 14px !important; }
.pv-retake { background:#4c8bf5; color:#fff; }
.pv-del { background:#e0653a; color:#fff; }

.hw-pill {  display: inline-block; margin-top: 8px; padding: 6px 12px; border-radius: 14px;
  background: linear-gradient(135deg,var(--blue),var(--primary)); color:#fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.hw-pill.pending {
  background: linear-gradient(135deg,#ff9a3d,#ff6b9d);
  animation: pillPulse 1.8s ease-in-out infinite;
}
@keyframes pillPulse { 0%,100% { opacity: 1; } 50% { opacity: .72; } }
.mb { margin-bottom: 10px; }
textarea {
  width: 100%; border: 2px solid #eceaff; border-radius: 14px; padding: 10px 12px;
  font-size: 15px; font-family: inherit; resize: vertical;
}

/* 错题：知识点 / 错因标签 + 筛选条 */
.tag-kp { background: linear-gradient(135deg,#3da9fc,#5b8def) !important; }
.tag-err { background: linear-gradient(135deg,#ff8a5b,#ff6b6b) !important; }
.tag-quiz { background: linear-gradient(135deg,#7c5cfc,#b06bff) !important; }
/* 错题城堡顶部说明 */
.mistake-tip { background: linear-gradient(150deg,#fff8f0,#f4f0ff); border: 2px solid #efe6ff; }
.mistake-tip .mt-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; color: var(--primary-d); }
.mistake-tip .muted { font-size: 13px; line-height: 1.6; }
/* 错题图片 */
.mistake-photo { display: block; width: 100%; max-width: 220px; border-radius: 12px; margin-top: 8px; border: 1px solid #eee6ff; cursor: zoom-in; }
.mistake-photo.big { max-width: 100%; }
.mPhotoBox { margin-bottom: 10px; }
.mistake-more { margin: 4px 0 12px; }
.mistake-more summary { cursor: pointer; color: var(--primary-d); font-weight: 700; font-size: 14px; padding: 4px 0; }
/* 刷题答错时的自动收录提示 */
.quiz-auto-mistake {
  display: block; margin-top: 8px; padding: 8px 12px; border-radius: 12px;
  background: #f4f0ff; color: var(--primary-d); font-size: 13px; font-weight: 700;
  border: 1px dashed #cfc2ff;
}

/* ===== 拍照后框选一道题 ===== */
.crop-sheet {
  position: fixed; top:0; left:0; right:0; bottom:0; width:100%; height:100%; z-index: 80; background: rgba(16, 12, 36, 0.94);
  display: flex; align-items: center; justify-content: center; padding: 14px;
}
.crop-panel { width: 100%; max-width: 480px; max-height: 100%; display: flex; flex-direction: column; gap: 10px; }
.crop-head { display: flex; align-items: center; justify-content: space-between; color: #fff; font-size: 16px; font-weight: 800; }
.crop-x { background: none; border: 0; color: #fff; font-size: 20px; line-height: 1; padding: 4px; cursor: pointer; }
.crop-tip { color: #cfc7ff; font-size: 13px; line-height: 1.55; }
.crop-tip b { color: #fff; }
.crop-stage {
  position: relative; align-self: center; width: 100%; max-width: 100%; height: 56vh;
  line-height: 0; touch-action: none; user-select: none; -webkit-user-select: none;
  border-radius: 12px; overflow: hidden; cursor: crosshair; background: #0a0a14;
}
.crop-stage img { position: absolute; top:0; left:0; width: 100%; height: 100%; object-fit: contain; }
.crop-stage video { position: absolute; top:0; left:0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.crop-box {
  position: absolute; display: none; pointer-events: none;
  border: 2px solid #a78bfa; border-radius: 4px;
  box-shadow: 0 0 0 9999px rgba(10, 6, 30, 0.55);
  background: rgba(167, 139, 250, 0.08);
}
.crop-actions { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.crop-actions .btn { margin: 0; }

/* ===== OCR 识别结果（每行可改、可删、可指定角色） ===== */
.ocr-head { font-size: 12px; font-weight: 800; color: var(--primary-d); margin: 10px 0 4px; }
.ocr-tip { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 8px; }
.ocr-tip b { color: var(--primary-d); }
.ocr-line {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 9px; margin-bottom: 7px;
  border: 1px solid #efeaff; border-radius: 12px; background: #fff;
}
.ocr-line.role-my { border-color: #b9dcff; background: #f4faff; }
.ocr-line.role-correct { border-color: #ffd0d0; background: #fff7f7; }
.ocr-line-input {
  width: 100%; box-sizing: border-box; border: 1px solid #e8e3ff; border-radius: 9px;
  padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--ink); background: #fff;
}
.ocr-line-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,92,255,.12); }
.ocr-line .ops { display: flex; gap: 5px; flex-wrap: wrap; }
.ocr-line .mini {
  border: 1px solid #ded8ff; background: #f7f5ff; color: var(--primary-d);
  border-radius: 999px; font-size: 11px; font-weight: 700; padding: 4px 9px; cursor: pointer;
  font-family: inherit;
}
.ocr-line .mini.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ocr-line .mini.del { border-color: #ffd6d6; background: #fff5f5; color: #d63a3a; }
.ocr-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 8px; }
.ocr-tools .mini {
  border: 1px dashed #d9d2ff; background: #fff; color: var(--primary-d);
  border-radius: 999px; font-size: 11px; font-weight: 700; padding: 5px 10px; cursor: pointer;
  font-family: inherit;
}

/* ===== 一页多道小题：一小题一张卡 ===== */
.ocr-multi-head {
  font-size: 13px; font-weight: 800; color: var(--primary-d); margin: 12px 0 6px;
  background: #f4f0ff; border: 1px dashed #d6caff; border-radius: 12px; padding: 10px 12px;
}
.ocr-multi-head .ocr-tip { margin: 4px 0 0; font-weight: 400; }
.oi-pre {
  background: #fffbf0; border: 1px dashed #ffd9a0; border-radius: 12px;
  padding: 9px 11px; margin-bottom: 8px; font-size: 12px; color: #8a5a00;
}
.oi-pre-t { line-height: 1.5; margin-bottom: 4px; }
.oi-pre-c { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.ocr-items { display: flex; flex-direction: column; gap: 9px; }
.ocr-item {
  border: 1px solid #e7e0ff; border-radius: 14px; padding: 10px; background: #fff;
  display: flex; flex-direction: column; gap: 7px;
}
.oi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.oi-no {
  font-size: 12px; font-weight: 800; color: #fff; background: var(--primary);
  border-radius: 999px; padding: 3px 10px;
}
.oi-q {
  width: 100%; box-sizing: border-box; border: 1px solid #e8e3ff; border-radius: 10px;
  padding: 8px 10px; font-size: 13px; font-family: inherit; line-height: 1.5;
  color: var(--ink); resize: vertical;
}
.oi-q:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,92,255,.12); }
.oi-ans { display: flex; gap: 8px; }
.oi-ans label { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 700; }
.oi-in {
  width: 100%; box-sizing: border-box; border: 1px solid #e8e3ff; border-radius: 9px;
  padding: 7px 9px; font-size: 13px; font-family: inherit; color: var(--ink); background: #fff;
}
.oi-in:focus { outline: none; border-color: var(--primary); }
.ocr-item .btn.small { align-self: flex-start; }
.ocr-multi-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0 8px; }
.ocr-multi-bar .btn { flex: 1; margin: 0; }
.ocr-loading { font-size: 13px; color: var(--primary-d); padding: 8px 0; }
.ocr-warn { font-size: 12px; color: #a35a00; background: #fff7e6; border: 1px dashed #ffd9a0; border-radius: 10px; padding: 8px 10px; }
.filter-bar { display: flex; gap: 10px; margin: 4px 0 12px; }
.filter-bar select { flex: 1; border: 2px solid #eceaff; border-radius: 14px; padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); }
.review-banner {
  background: linear-gradient(135deg,#fff3e0,#ffe0ec); border: 2px solid #ffd9b3;
  border-radius: 16px; padding: 13px 14px; margin-bottom: 12px; font-size: 14px;
  cursor: pointer; box-shadow: var(--shadow);
}
.review-banner b { color: #ff7a59; font-size: 17px; }
/* 每日复习卡片 */
.review-progress { background: #fff; border-radius: 14px; padding: 10px 14px; margin-bottom: 10px; font-size: 14px; box-shadow: var(--shadow); }
.review-progress b { color: var(--primary); font-size: 16px; }
.review-card { box-shadow: var(--shadow); }
.rf-head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rf-q { font-weight: 700; font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.rf-ans { background: #f7f5ff; border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; line-height: 1.7; }
.rf-ans .ok { color: var(--green); }
.rf-act { display: flex; gap: 8px; flex-wrap: wrap; }
.rf-done { margin-top: 4px; }
.rf-ok { color: var(--green); font-weight: 800; font-size: 14px; padding: 8px 0; }
.rf-no { color: #ff6b6b; font-weight: 800; font-size: 14px; padding: 8px 0; }

/* ===== 等级 / 经验条 ===== */
.lvl-hero { padding-bottom: 16px; }
.xpbar {
  height: 12px; border-radius: 999px; background: rgba(255,255,255,.35);
  overflow: hidden; margin-top: 12px; box-shadow: inset 0 1px 3px rgba(60,40,120,.2);
}
.xpbar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg,#ffe07a,#ffb400,#ff8a3d);
  box-shadow: 0 0 10px rgba(255,200,60,.7);
  transition: width .6s ease;
}
.xptxt { font-size: 12px; margin-top: 7px; opacity: .95; }
.xptxt b { font-size: 15px; }

/* 勋章进度 */
.badge .bd.ok { color: var(--green); font-weight: 800; }
.bprog { height: 5px; border-radius: 999px; background: #e7e3f8; overflow: hidden; margin: 5px 6px 0; }
.bprog > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#a78bfa,#7c5cfc); }

/* 勋章：把「达成要求」直接写在格子上 + 点击看详情 */
.badge { cursor: pointer; }
/* 稀有度：铜 / 银 / 金 / 钻（底色 + 右上角小角标），未解锁时整体灰掉 */
.badge { position: relative; }
.badge.r-bronze { background: #fbf2e6; }
.badge.r-silver { background: #f2f4f8; }
.badge.r-gold { background: #fdf7e6; }
.badge.r-diamond { background: #eef2ff; }
.badge .rtag { position: absolute; top: 6px; right: 8px; font-size: 9px; font-weight: 800; line-height: 1.5; padding: 0 5px; border-radius: 999px; font-style: normal; }
.badge.r-bronze .rtag { color: #9a6420; background: #f3e0c8; }
.badge.r-silver .rtag { color: #5f6a7d; background: #e4e8ef; }
.badge.r-gold .rtag { color: #946800; background: #faeec4; }
.badge.r-diamond .rtag { color: #4358c9; background: #e0e7ff; }
.rarity-row { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.rchip { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.rchip.r-bronze { color: #8a5a1c; background: #f6e7d2; }
.rchip.r-silver { color: #5f6a7d; background: #e9edf3; }
.rchip.r-gold { color: #946800; background: #fbf0cd; }
.rchip.r-diamond { color: #4358c9; background: #e6ebff; }
.badge .breq {
  font-size: 9.5px; line-height: 1.32; color: #7d78a0;
  margin-top: 3px; padding: 0 2px; word-break: break-word;
}
.badge.locked .breq { color: #6f6a92; }
.goal-d { font-size: 11.5px; color: var(--muted); margin: 2px 0 4px; }
.section-hint { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 6px; }

/* 勋章详情弹层 */
.badge-detail { text-align: center; margin-bottom: 12px; }
.badge-detail .bd-emoji { font-size: 56px; line-height: 1.15; }
.badge-detail .bd-name { font-size: 20px; font-weight: 800; margin-top: 4px; }
.badge-detail .bd-cat { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bd-req-box { background: #f6f4ff; border-radius: 16px; padding: 12px 14px; }
.bd-req-label { font-size: 12px; font-weight: 800; color: var(--primary-d); margin-bottom: 4px; }
.bd-req-text { font-size: 15px; line-height: 1.55; color: #2b2b3c; }
.bd-progress { margin-top: 12px; }
.bd-tip { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.bd-tip.ok { color: var(--green); font-weight: 700; }

/* ===== 作业截止时间 ===== */
.dl-line { margin-top: 4px; }
.dl {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.4;
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.dl-ok { background: #f1edff; color: #6b53c8; }
.dl-soon { background: #fff1d8; color: #c9761a; }
.dl-late { background: #ffe3e3; color: #d63b3b; }
.dl-done { background: #e6f8ec; color: #1f9d55; }
.dl-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.dl-quick .btn { font-size: 11px; padding: 6px 10px; }

/* 学习币明细：筛选标签 + 汇总行 */
.coin-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.coin-tag {
  border: 1.5px solid #eceaff; background: #fff; color: #5b5570; border-radius: 999px;
  padding: 5px 11px; font-size: 12px; font-family: inherit; cursor: pointer;
}
.coin-tag.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.coin-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin: 8px 0 2px; }
.coin-meta b { color: var(--ink); }

/* 快到期提醒弹窗 */
.due-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #eeebfa; }
.due-item:last-child { border-bottom: none; }
.due-e { font-size: 22px; width: 30px; text-align: center; }
.due-t { font-size: 14px; font-weight: 700; }
.due-left { font-size: 13px; font-weight: 800; color: #e0653a; white-space: nowrap; }

/* 离你最近的目标 */
.goal { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #eeebfa; }
.goal:last-child { border-bottom: none; }
.goal-e { font-size: 26px; width: 34px; text-align: center; }
.goal-n { font-size: 14px; font-weight: 700; }

/* 成长阶梯 */
.ranks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rank { border-radius: 14px; padding: 9px 4px; text-align: center; background: #f6f4ff; opacity: .55; }
.rank.on { background: linear-gradient(135deg,#fff2c9,#ffd9ec); opacity: 1; box-shadow: 0 4px 12px rgba(255,180,0,.25); }
.rank .rk-e { font-size: 22px; }
.rank .rk-n { font-size: 11px; font-weight: 800; margin-top: 2px; }
.rank .rk-l { font-size: 10px; color: var(--muted); }

/* 最近 7 天经验柱 */
.week-xp { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.week-xp .wcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.week-xp .wv { font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.week-xp .wb { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.week-xp .wb > span {
  width: 100%; border-radius: 8px 8px 4px 4px; min-height: 4px;
  background: linear-gradient(180deg,#a78bfa,#7c5cfc);
}
.week-xp .wd { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* 经验规则 */
.rule { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed #eeebfa; }
.rule:last-of-type { border-bottom: none; }
.rule span { flex: 1; }
.rule b { color: var(--primary-d); font-size: 15px; }
.rule em { font-style: normal; font-size: 11px; color: var(--muted); }

/* 新勋章弹窗 */
.badge-new-list { display: flex; flex-direction: column; gap: 10px; }
.badge-new {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(135deg,#fff6d9,#ffe9f3); box-shadow: 0 6px 16px rgba(255,180,0,.18);
  animation: pop .35s ease;
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.badge-new .bn-emoji { font-size: 34px; }
.badge-new .bn-name { font-weight: 800; font-size: 15px; }
.badge-new .bn-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== 家庭码 ===== */
.code-card { background: linear-gradient(135deg,#eef4ff,#f6efff); border: 2px dashed #b9a8ff; }
.code-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.code-row .code {
  flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 24px;
  font-weight: 800; letter-spacing: 2px; color: var(--primary-d);
  background: #fff; border-radius: 14px; padding: 10px 14px; text-align: center;
  cursor: pointer; box-shadow: inset 0 0 0 2px #eceaff;
}
.code-strip {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  background: rgba(255,255,255,.94); border-radius: 16px; padding: 9px 12px; box-shadow: var(--shadow);
  font-size: 12px; color: var(--muted);
}
.code-strip span { flex: 1; }
.code-strip b {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; color: var(--primary-d);
  letter-spacing: 1px; cursor: pointer;
}

/* ---------- 孩子端学习锁定（全屏恢复浮层 / 退出申请状态标签） ---------- */
#fsRestore {
  position: fixed; top:0; left:0; right:0; bottom:0; width:100%; height:100%; z-index: 9999;
  background: radial-gradient(circle at 50% 30%, #2d2a4a, #14122a);
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px; text-align: center; padding: 28px;
}
#fsRestore .btn { min-width: 160px; }
#lockBadge {
  position: fixed; left: 50%; top: 6px; transform: translateX(-50%);
  z-index: 9000; pointer-events: none;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 1.4;
  padding: 4px 12px; border-radius: 999px; letter-spacing: .5px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.tag.pending { background: linear-gradient(135deg,#ff9a3d,#ff6b9d) !important; }
.tag.ok { background: linear-gradient(135deg,#2fb37a,#12b886) !important; }
.tag.no { background: linear-gradient(135deg,#9aa5b1,#7b8794) !important; }

/* 家长端「孩子的退出申请」审批卡片 */
.lock-req { border-left: 4px solid #ff9a3d; }
.lock-req .req-item { border-top: 1px solid #eee; padding-top: 8px; margin-top: 8px; }
.lock-req .req-item:first-of-type { border-top: none; margin-top: 4px; padding-top: 4px; }

/* 家长端「完全锁死」引导卡 */
.lockdown-guide { border-left: 4px solid #2fb37a; }
.lockdown-guide ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.9; }
.lockdown-guide li b { color: #2fb37a; }
.lockdown-guide .step-num { display:inline-block; min-width:18px; }

/* 锁定开关行 / 输入框 */
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.switch-row > span { flex: 1; }
.switch-row input[type=checkbox] { width: 22px; height: 22px; flex: none; accent-color: #2fb37a; margin-top: 2px; }
.inp { padding: 6px 8px; border: 1px solid #d6deea; border-radius: 8px; font-size: 14px; text-align: center; }
.lock-auto { background: #f7fafc; border-radius: 10px; padding: 10px 12px; }

/* 兼容老 WebView（Chromium<84 不支持 flex 的 gap）：给关键弹层/照片条加间距兜底 */
@supports not (gap: 10px) {
  .crop-panel > * + * { margin-top: 10px; }
  .hw-photos .hw-photo-cell + .hw-photo-cell { margin-left: 8px; }
  .photo-viewer .pv-actions .btn + .btn { margin-left: 10px; }
  .crop-actions .btn + .btn { margin-left: 8px; }
}

/* ===== 学习币：钱包条 / 兑换商城 / 奖励管理 ===== */
.wallet-card {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 20px; padding: 12px 14px;
  box-shadow: var(--shadow); margin: 0 0 14px; cursor: pointer;
}
.wallet-card .w-it { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; }
.wallet-card .w-ic { font-size: 22px; line-height: 1; flex: none; }
.wallet-card b { font-size: 20px; font-weight: 800; color: var(--primary); display: block; line-height: 1.1; }
.wallet-card .w-it.coin b { color: #d98a00; }
.wallet-card em { font-style: normal; font-size: 11px; color: var(--muted); }
.wallet-card .w-sep { width: 1px; align-self: stretch; background: #eee; margin: 2px 6px; }

.coin-hero {
  text-align: center; color: #fff; border-radius: 26px; padding: 22px 16px 16px;
  background: linear-gradient(135deg, #ffc93c 0%, #ff9f1a 55%, #ff7a45 100%);
  box-shadow: 0 12px 26px rgba(255,150,40,.35); margin-bottom: 14px;
}
.coin-hero .coin-big { font-size: 44px; line-height: 1; }
.coin-hero .coin-num { font-size: 46px; font-weight: 900; letter-spacing: -1px; margin-top: 2px; }
.coin-hero .sub { color: rgba(255,255,255,.92); font-size: 13px; margin-top: -2px; }
.coin-split { display: flex; margin-top: 14px; background: rgba(255,255,255,.18); border-radius: 16px; padding: 8px 0; }
.coin-split > div { flex: 1; }
.coin-split b { display: block; font-size: 17px; }
.coin-split em { font-style: normal; font-size: 11px; opacity: .9; }

.tip-card { background: #fffaf0; border: 1px solid #ffe2b0; }

.rw {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 16px; background: #faf9ff; border: 1px solid #efeaff; margin-bottom: 10px;
}
.rw.poor { background: #f7f7fa; border-color: #eee; opacity: .72; }
.rw .rw-e { font-size: 28px; width: 44px; height: 44px; border-radius: 14px;
  background: #fff; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 2px 8px rgba(120,90,200,.12); }
.rw .rw-b { flex: 1; min-width: 0; }
.rw .rw-t { font-weight: 800; font-size: 15px; }
.rw .rw-n { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rw .rw-c { font-size: 13px; color: #d98a00; font-weight: 700; margin-top: 4px; }
.rw .rw-c em { font-style: normal; color: var(--muted); font-weight: 400; }
.rw .rw-go { flex: none; font-size: 13px; font-weight: 800; color: var(--primary); }

.c-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #f0f0f5; }
.c-row:last-child { border-bottom: none; }
.c-row .c-dot { width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 15px; font-weight: 800; flex: none; }
.c-row .c-dot.in { background: #fff5e0; color: #d98a00; }
.c-row .c-dot.out { background: #eef6ff; color: #3b7fd4; }
.c-row .c-dot.go { background: #f4f0ff; font-size: 18px; }
.c-row .body { flex: 1; min-width: 0; }
.c-row .body .t { font-weight: 700; font-size: 14px; }
.c-row .body .m { color: var(--muted); font-size: 11px; margin-top: 2px; }
.c-row .c-amt { font-weight: 800; font-size: 15px; flex: none; }
.c-row .c-amt.in { color: #d98a00; }
.c-row .c-amt.out { color: #7a8699; }

.ost-p { color: #d98a00; }
.ost-d { color: #2fb37a; }
.ost-r { color: #c0392b; }
.ico.gold { background: #fff5e0; }

/* ===== APP 内自更新提示条 ===== */
.upd-banner {
  position: fixed; top: 10px; left: 12px; right: 12px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #7c5cff, #4d7dff);
  color: #fff; border-radius: 16px; padding: 11px 14px;
  box-shadow: 0 10px 24px rgba(90, 110, 255, .38);
  animation: updIn .35s ease;
}
@keyframes updIn { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.upd-banner .ub-t { flex: 1; min-width: 0; font-weight: 800; font-size: 14px; line-height: 1.25; }
.upd-banner .ub-t em { display: block; font-style: normal; font-weight: 400; font-size: 11px; opacity: .88; margin-top: 2px; }
.upd-banner .ub-btn {
  flex: none; border: none; cursor: pointer;
  background: #fff; color: #5346e6; font-weight: 800; font-size: 13px;
  padding: 9px 14px; border-radius: 22px;
}
.upd-banner .ub-btn:active { transform: scale(.96); }

/* ===== 专注塔：进行中 / 结算结果 ===== */
.timer.running .clock { color: var(--green); }
.focus-meta { font-size: 13px; color: var(--muted); margin: -6px 0 14px; }
.focus-meta b { color: var(--red); }
.focus-result { border-left: 5px solid var(--green); }
.focus-result.warn { border-left-color: var(--yellow); }
.focus-result .fr-h { font-weight: 800; font-size: 15px; }
.focus-result .fr-row { display: flex; gap: 8px; margin-top: 10px; }
.focus-result .fr-row > div {
  flex: 1; text-align: center; background: #faf9ff; border-radius: 14px; padding: 8px 4px;
}
.focus-result .fr-row b { display: block; font-size: 20px; color: var(--primary); }
.focus-result .fr-row em { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 2px; }
.fr-warn { color: #d9822b; }
.fq { font-size: 11px; padding: 1px 6px; border-radius: 8px; margin-left: 4px; font-weight: 700; }
.fq.ok { background: #e8faf0; color: #2fa96b; }
.fq.warn { background: #fff4e0; color: #d9822b; }
.focus-photo { width: 100%; max-height: 190px; object-fit: cover; border-radius: 14px; margin-top: 10px; }
