:root {
  --bg1: #fef6ff;
  --bg2: #eaf4ff;
  --bg3: #fff7e6;
  --ink: #3d3a5e;
  --ink-soft: #7a769b;
  --primary: #7c5cff;
  --primary-d: #5b3fe0;
  --pink: #ff7eb6;
  --blue: #4d96ff;
  --yellow: #ffb703;
  --green: #34c98b;
  --red: #ff6b6b;
  --card: #ffffff;
  --shadow: 0 8px 22px rgba(124, 92, 255, 0.12);
  --shadow-sm: 0 4px 12px rgba(124, 92, 255, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Comic Sans MS", "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--bg2), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, var(--bg3), transparent 55%),
    var(--bg1);
  min-height: 100vh;
  padding-bottom: 84px;
}

#app { max-width: 760px; margin: 0 auto; padding: 14px 14px 0; }

/* ===== 顶部标题 ===== */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 6px 10px;
}
.topbar .mascot { font-size: 34px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.12)); }
.topbar h1 { font-size: 22px; margin: 0; letter-spacing: 1px; }
.topbar .sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.topbar .grow { flex: 1; }
.icon-btn {
  border: none; background: #fff; width: 42px; height: 42px; border-radius: 50%;
  font-size: 20px; box-shadow: var(--shadow-sm); cursor: pointer; color: var(--ink);
}
.icon-btn:active { transform: scale(.94); }

/* ===== 卡片 ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.hint { color: var(--ink-soft); font-size: 12px; line-height: 1.6; background: rgba(77,150,255,.08);
  border-left: 3px solid var(--accent,#4D96FF); padding: 8px 10px; border-radius: 8px; margin: 6px 0 10px; }
.hint code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.hint a { color: var(--accent,#4D96FF); font-weight: 600; }

/* ===== 首页大按钮 ===== */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.home-card {
  border: none; border-radius: var(--radius); padding: 22px 16px; cursor: pointer;
  text-align: left; color: #fff; box-shadow: var(--shadow); position: relative; overflow: hidden;
  min-height: 120px; display: flex; flex-direction: column; justify-content: space-between;
}
.home-card:active { transform: translateY(2px); }
.home-card .emoji { font-size: 40px; }
.home-card .t { font-size: 18px; font-weight: 700; margin-top: 10px; }
.home-card .d { font-size: 12px; opacity: .92; }
.home-card.wrong { background: linear-gradient(135deg, #ff8fab, #ff6b6b); }
.home-card.behave { background: linear-gradient(135deg, #5ec5ff, #4d96ff); }
.home-card.master { background: linear-gradient(135deg, #ffd166, #ffb703); color: #6b4e00; }
.home-card.reward { background: linear-gradient(135deg, #9be15d, #34c98b); color: #0f5132; }

.stat-row { display: flex; gap: 10px; }
.stat {
  flex: 1; background: #fff; border-radius: var(--radius-sm); padding: 12px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.stat .num { font-size: 26px; font-weight: 800; }
.stat .lbl { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.num.pink { color: var(--red); } .num.blue { color: var(--blue); }
.num.yellow { color: #d99a00; } .num.green { color: var(--green); }

/* ===== 底部导航 ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; height: 70px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  display: flex; justify-content: space-around; align-items: center;
  box-shadow: 0 -6px 20px rgba(124,92,255,.10); border-top-left-radius: 22px; border-top-right-radius: 22px;
  max-width: 760px; margin: 0 auto;
}
.bottom-nav a {
  flex: 1; text-align: center; text-decoration: none; color: var(--ink-soft);
  font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0;
}
.bottom-nav a .ic { font-size: 22px; }
.bottom-nav a.active { color: var(--primary); font-weight: 700; }

/* ===== 通用控件 ===== */
.btn {
  border: none; border-radius: 999px; padding: 12px 18px; font-size: 15px; font-weight: 700;
  background: var(--primary); color: #fff; cursor: pointer; box-shadow: var(--shadow-sm);
}
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.btn.pink { background: var(--pink); }
.btn.green { background: var(--green); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%; border: 2px solid #eee; border-radius: var(--radius-sm); padding: 11px 13px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fbfbff; outline: none;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); }

/* ===== 错题列表 ===== */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: none; background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px;
  color: var(--ink-soft); box-shadow: var(--shadow-sm); cursor: pointer;
}
.chip.active { background: var(--primary); color: #fff; }

.wq-item {
  display: flex; gap: 12px; align-items: center; padding: 12px; background: #fff;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); margin-bottom: 10px; cursor: pointer;
}
.wq-item .thumb {
  width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #f0f0f7; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: #c9c6e0;
}
.wq-item .info { flex: 1; min-width: 0; }
.wq-item .title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wq-item .meta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag.subject { color: #fff; }
.tag.mastered { background: #e6f9f0; color: var(--green); }
.tag.practicing { background: #fff0f3; color: var(--red); }

/* ===== 掌握进度条 ===== */
.bar { height: 12px; border-radius: 999px; background: #eef0f7; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), #8ee0b8); }
.subject-stat { padding: 12px 0; border-bottom: 1px dashed #eee; }
.subject-stat:last-child { border-bottom: none; }

/* ===== 行为打卡 ===== */
.behave-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); margin-bottom: 10px; cursor: pointer;
}
.behave-card:active { transform: scale(.98); }
.behave-card .ic { font-size: 30px; width: 46px; text-align: center; }
.behave-card .nm { flex: 1; font-weight: 700; }
.behave-card .pt { color: var(--green); font-weight: 800; font-size: 15px; }

/* ===== 周汇总 ===== */
.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.week-big { text-align: center; font-size: 28px; font-weight: 800; color: var(--primary); }
.week-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #eee; }
.week-item .ic { font-size: 24px; }
.week-item .nm { flex: 1; }
.week-item .cnt { font-weight: 700; }
.week-item .pts { color: var(--green); font-weight: 800; min-width: 54px; text-align: right; }

/* ===== 表扬墙 ===== */
.praise-card {
  background: linear-gradient(135deg, #fff3b0, #ffd6e8); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.praise-card .head { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.praise-card .txt { margin-top: 8px; font-size: 15px; }

/* ===== 奖励 ===== */
.points-hero {
  background: linear-gradient(135deg, #9be15d, #34c98b); color: #08361f; border-radius: var(--radius);
  padding: 20px; text-align: center; box-shadow: var(--shadow); margin-bottom: 14px;
}
.points-hero .big { font-size: 46px; font-weight: 900; }
.reward-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.reward-card .ic { font-size: 32px; }
.reward-card .nm { flex: 1; font-weight: 700; }
.reward-card .cost { color: var(--yellow); font-weight: 800; }

/* ===== 详情页 ===== */
.detail-img { width: 100%; border-radius: var(--radius-sm); margin: 10px 0; box-shadow: var(--shadow-sm); }
.train-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #eee; font-size: 14px; }
.train-row .ok { color: var(--green); font-weight: 700; }
.train-row .no { color: var(--red); font-weight: 700; }
.var-card { background: #f6f4ff; border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.var-card img { width: 100%; border-radius: 10px; margin-top: 8px; }

.center { text-align: center; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.toast {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%);
  background: rgba(61,58,94,.95); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 999; box-shadow: var(--shadow); animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; } }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 28px; box-shadow: var(--shadow); padding: 28px 22px; width: 100%; max-width: 360px; text-align: center; }
.login-card .mascot { font-size: 56px; }
.login-card h1 { margin: 6px 0 2px; font-size: 24px; }
.login-card .sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 20px; }

.empty { text-align: center; color: var(--ink-soft); padding: 30px 10px; font-size: 14px; }

/* ===== 行为打卡：点击反馈 ===== */
.behave-card { position: relative; transition: background .25s, box-shadow .25s, transform .12s; }
.behave-card.pop {
  background: linear-gradient(135deg, #d8ffe9, #b6f0ff);
  box-shadow: 0 0 0 3px var(--green), var(--shadow-sm);
  transform: scale(1.04);
}
.behave-card.done { background: #f1fff7; }
.behave-card.done .nm::after { content: ' ✓'; color: var(--green); font-weight: 800; }
.score-float {
  position: absolute; right: 14px; top: 6px;
  font-weight: 900; font-size: 22px; color: var(--green);
  pointer-events: none; animation: floatUp .9s ease forwards;
  text-shadow: 0 2px 4px rgba(0,0,0,.12);
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(6px) scale(.8); }
  20% { opacity: 1; transform: translateY(-2px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-34px) scale(1); }
}

/* ===== 添加页：已选学科徽标 ===== */
.subject-badge {
  display: flex; align-items: center; gap: 8px;
  background: #eef4ff; border-radius: 999px; padding: 10px 14px; margin-bottom: 12px; font-size: 15px;
}
.link-btn { border: none; background: none; color: var(--primary); font-weight: 700; cursor: pointer; font-size: 13px; padding: 0; }
.big-capture { padding: 18px; text-align: center; background: #f3f0ff; border-style: dashed; }

/* ===== 设置页：勾选与一键填充 ===== */
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0 12px; cursor: pointer; }
.chk input { width: 18px; height: 18px; }

/* ===== 头像 & 首页英雄区 ===== */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.avatar-lg { width: 84px; height: 84px; }
.avatar-hero { width: 64px; height: 64px; }
.hero { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #fff, #f3f0ff); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.hero-name { font-size: 22px; font-weight: 800; }
.hero-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.login-hint { font-size: 12px; color: var(--ink-soft); margin-top: 12px; text-align: center; }

/* 行为打卡：已打卡徽标 + 你真棒 */
.behave-card { position: relative; }
.done-badge { position: absolute; right: 12px; top: 10px; background: var(--green); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.you-rock {
  position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%);
  font-size: 34px; font-weight: 900; color: var(--primary);
  background: rgba(255,255,255,.95); padding: 14px 26px; border-radius: 999px;
  box-shadow: var(--shadow); z-index: 999; pointer-events: none;
  animation: rock 1s ease forwards;
}
@keyframes rock { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.6); } 30% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%,-90%) scale(1); } }
.you-rock .en { font-size: 18px; font-weight: 700; color: #4D96FF; margin-top: 4px; letter-spacing: .5px; }
/* 撤回按钮（撤销打卡，弱化的危险色） */
.btn.sm.undo { color: #e23b3b; border-color: #f1c9c9; background: #fff; }
.btn.sm.undo:hover { background: #fdeaea; }

/* 错题添加：图片预览 */
.preview { width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--radius-sm); margin-top: 10px; border: 1px solid #eee; background: #fafafa; }

/* 拍照/选图 大按钮 */
.capture-btn {
  display: block; text-align: center; padding: 22px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg,#f3f0ff,#eef4ff); border: 2px dashed var(--primary);
  color: var(--primary); font-size: 16px; font-weight: 700; cursor: pointer; transition: transform .15s;
}
.capture-btn:active { transform: scale(.98); }
.cap-row { display: flex; gap: 10px; margin-top: 8px; }
.cap-row .capture-btn { flex: 1; padding: 16px 8px; font-size: 15px; margin-top: 0; }
.capture-btn.alt { background: linear-gradient(135deg,#eafff3,#eef4ff); border-color: var(--green); color: var(--green); }

/* 成长档案相册 */
.album-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.album-item { margin: 0; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
.album-item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.album-item figcaption { font-size: 11px; padding: 4px 6px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) { .album-grid { grid-template-columns: repeat(2,1fr); } }

/* ===== 成长朋友圈（仿微信朋友圈） ===== */
.avatar-sm { width: 36px; height: 36px; flex-shrink: 0; }
.moment { display: flex; gap: 10px; padding: 14px; background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.moment .moment-body { flex: 1; min-width: 0; }
.moment-name { font-weight: 800; font-size: 15px; color: var(--primary); }
.moment-text { margin: 4px 0 8px; line-height: 1.6; font-size: 15px; word-break: break-word; }
.moment-imgs { display: grid; gap: 6px; margin-top: 6px; }
.moment-imgs.one { grid-template-columns: minmax(0, 62%); }
.moment-imgs.multi { grid-template-columns: repeat(3, 1fr); }
.moment-imgs.four { grid-template-columns: repeat(2, 1fr); }
.moment-imgs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; cursor: pointer; background: #f0f0f7; }
.moment-imgs.one img { aspect-ratio: auto; max-height: 280px; object-fit: contain; }
.moment-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.moment-time { font-size: 12px; color: var(--ink-soft); }
.moment-del { border: none; background: none; color: var(--ink-soft); font-size: 12px; cursor: pointer; padding: 0; }

/* 发表说说 composer */
.composer { background: linear-gradient(135deg, #fff, #f7f3ff); }
.composer-head { display: flex; gap: 10px; align-items: flex-start; }
.composer-head .input { flex: 1; }
.composer-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.composer-imgs:empty { display: none; }
.post-thumb { position: relative; width: 72px; height: 72px; overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.post-thumb video { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; background: #000; }
.post-thumb .rm { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 22px; cursor: pointer; padding: 0; }
.composer-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.composer-bar .grow { flex: 1; }
.composer-add { border: 2px dashed var(--primary); color: var(--primary); background: #f3f0ff; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.composer-add:active { transform: scale(.97); }

/* 首页成长卡片 */
.home-growth-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.home-growth-head h2 { margin: 0; }

/* 说说操作按钮（分享/删除/海报） */
.moment-del, .moment-share, .moment-poster { border: none; background: none; font-size: 12px; cursor: pointer; padding: 0; }
.moment-del { color: var(--ink-soft); }
.moment-share { color: var(--primary); font-weight: 600; margin-right: 14px; }
.moment-poster { color: var(--pink); font-weight: 600; margin-right: 14px; }

/* 朋友圈：视频瓦片 + 播放角标 */
.moment-media.video { position: relative; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; }
.moment-media.video video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.moment-media.video .play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; pointer-events: none;
}
.moment-imgs.one .moment-media.video video { aspect-ratio: auto; max-height: 280px; object-fit: contain; }
.play-badge { text-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* 朋友圈：点赞 / 评论 */
.moment-inter { margin-top: 8px; }
.moment-acts { display: flex; gap: 10px; margin-bottom: 6px; }
.moment-acts .act { border: none; background: #f3f0ff; color: var(--primary); border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 700; cursor: pointer; }
.moment-acts .act:active { transform: scale(.95); }
.moment-acts .act.on { background: var(--primary); color: #fff; }
.moment-likes { background: #f7f5ff; border-radius: 10px; padding: 8px 10px; font-size: 13px; color: var(--primary); margin-bottom: 6px; }
.moment-likes span { color: var(--ink); }
.moment-cmts { background: #f7f5ff; border-radius: 10px; padding: 8px 10px; }
.moment-cmt { font-size: 13px; line-height: 1.7; }
.moment-cmt .who { color: var(--primary); font-weight: 700; }
.moment-cmt .cmt-del { border: none; background: none; color: var(--ink-soft); font-size: 11px; cursor: pointer; margin-left: 6px; padding: 0; }
.cmt-add { display: flex; gap: 8px; margin-top: 8px; }
.cmt-add .input { flex: 1; padding: 8px 10px; font-size: 13px; }

/* 首页成长封面轮播 */
.cover-carousel { position: relative; margin-bottom: 12px; }
.cover-track { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cover-track::-webkit-scrollbar { display: none; }
.cover-slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; border-radius: 14px; overflow: hidden; height: 184px; background: #f0f0f7; }
.cover-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 12px 8px; color: #fff; font-size: 13px; background: linear-gradient(transparent, rgba(0,0,0,.55)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.cover-dot { width: 7px; height: 7px; border-radius: 50%; background: #d9d4f0; transition: width .2s; }
.cover-dot.on { background: var(--primary); width: 16px; border-radius: 4px; }

/* 分享海报弹窗 */
.poster-mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1001; display: flex; align-items: center; justify-content: center; padding: 16px; }
.poster-mask.hidden { display: none; }
.poster-box { background: #fff; border-radius: 18px; padding: 14px; width: min(86vw, 420px); text-align: center; box-shadow: var(--shadow); }
.poster-img { width: 100%; border-radius: 12px; display: block; }
.poster-tip { font-size: 12px; margin: 8px 0; }

/* 大图查看器：仿微信朋友圈（左右滑动 + 双击/双指放大 + 拖拽平移） */
.gallery { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 1000; display: flex; align-items: center; justify-content: center; touch-action: none; }
.gallery.hidden { display: none; }
.gallery-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery-img { max-width: 100%; max-height: 100%; transition: transform .12s ease; will-change: transform; user-select: none; -webkit-user-drag: none; }
.gallery-video { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; }
.gallery-close { position: absolute; top: 14px; right: 16px; width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 26px; line-height: 42px; cursor: pointer; z-index: 1002; }
.gallery-counter { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; z-index: 1002; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 30px; line-height: 46px; cursor: pointer; z-index: 1002; }
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }
.gallery-nav[disabled] { opacity: .25; cursor: default; }

/* 对话框（添加照片 / 查看大图） */
dialog { border: none; border-radius: 14px; padding: 18px; max-width: 92vw; width: 380px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { font-size: 17px; margin-bottom: 12px; }

/* 离线 OCR 状态条 */
.ocr-status { margin-top: 10px; font-size: 13px; padding: 9px 12px; border-radius: 10px; background: #eef4ff; color: var(--primary); }
.ocr-status.ok { background: #e8f8ee; color: #1f9d55; }
.ocr-status.warn { background: #fff4e6; color: #d9730a; }

/* 小字提示 */
.muted-sm { color: var(--ink-soft); font-size: 12px; font-weight: 400; }

/* 详情：题目文字 */
.q-text { margin: 8px 0 0; background: #fafafe; border: 1px solid #eee; border-radius: 10px; padding: 10px 12px; line-height: 1.6; }

/* 学情分析：知识点诊断 */
.weak-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.kp { padding: 10px 0; border-bottom: 1px dashed #eee; }
.kp:last-child { border-bottom: none; }
.kp-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.kp.weak .kp-head b { color: var(--red); }
.kp-detail { margin-top: 6px; font-size: 13px; color: var(--ink-soft); line-height: 1.6; background: #fff7f3; border-radius: 12px; padding: 10px 12px; }
.kp-detail b { color: var(--ink); }

/* 导出训练卷 */
.ex-sheet { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 14px; }
.ex-title { text-align: center; font-size: 22px; font-weight: 800; }
.ex-meta { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 4px 0 16px; }
.ex-item { border: 1px solid #eee; border-radius: 12px; padding: 12px; margin-bottom: 14px; break-inside: avoid; }
.ex-no { font-weight: 800; color: var(--primary); display: inline-block; margin-right: 6px; }
.ex-img { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; margin: 8px 0; }
.ex-q { font-size: 16px; font-weight: 600; }
.ex-kp { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.ex-blank { margin: 10px 0; color: var(--ink-soft); }
.ex-why { font-size: 13px; color: var(--red); }
.ex-var { margin-top: 8px; font-size: 14px; background: #f6f4ff; border-radius: 10px; padding: 8px 10px; }
.ex-foot { margin-top: 16px; font-size: 14px; color: var(--ink-soft); }
.ex-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 成长周报 / 月报 */
.report-card { line-height: 1.6; }
.rp-narrative { font-size: 15px; color: var(--ink); background: #f7f5ff; border-radius: 14px; padding: 14px; margin: 6px 0 14px; }
.rp-stats { display: flex; gap: 8px; }
.rp-stat { flex: 1; background: #fff; border-radius: 14px; padding: 14px 6px; text-align: center; box-shadow: var(--shadow-sm); }
.rp-stat b { display: block; font-size: 24px; color: var(--primary); }
.rp-stat span { font-size: 12px; color: var(--ink-soft); }
.rp-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.rp-covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.rp-cover { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #eee; }
.rp-cover img { width: 100%; height: 100%; object-fit: cover; }

/* 设置页：分享链接条目 */
.share-item { background: #fff; border-radius: 14px; padding: 12px; margin-top: 10px; box-shadow: var(--shadow-sm); }
.si-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.si-url { font-size: 12px; color: var(--ink-soft); word-break: break-all; margin: 6px 0; }

/* 导出：按学科 / 分类分组 */
.ex-subject { margin-bottom: 14px; }
.ex-subject-title { font-size: 17px; font-weight: 800; color: var(--primary); border-bottom: 2px solid #eee; padding-bottom: 4px; margin: 10px 0 6px; }
.ex-cat { margin: 6px 0; }
.ex-cat-title { font-weight: 700; color: var(--yellow); margin: 6px 0; }

@media print {
  .topbar, .bottom-nav, .no-print, .ex-actions { display: none !important; }
  body { background: #fff; padding: 0; }
  #app { max-width: 100%; padding: 0; }
  .ex-sheet { box-shadow: none; border-radius: 0; }
  .card, .hero { box-shadow: none; }
  .ex-subject-title, .ex-cat-title { color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
