:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #23262b;
  --muted: #6b7280;
  --brand: #2f6fed;
  --brand-soft: #e8f0ff;
  --ok: #1f9d55;
  --bad: #d6453d;
  --line: #e4e7ee;
  --radius: 16px;
  --tap: 48px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
}
.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* ===== 登录 ===== */
#login { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  background: var(--card); width: 100%; max-width: 420px;
  border-radius: 20px; padding: 28px 24px;
  box-shadow: 0 8px 30px rgba(30,40,80,.10);
}
.brand { font-size: 26px; font-weight: 800; text-align: center; }
.brand-sub { text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0 18px; }
.login-card input {
  width: 100%; height: var(--tap); padding: 0 14px; margin-bottom: 14px;
  border: 1.5px solid var(--line); border-radius: 12px; font-size: 16px;
}
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.role-grid { display: grid; gap: 12px; }
.role-btn {
  height: var(--tap); border: 1.5px solid var(--brand);
  background: var(--brand-soft); color: var(--brand);
  border-radius: 12px; font-size: 17px; font-weight: 600; cursor: pointer;
  transition: transform .05s ease;
}
.role-btn:active { transform: scale(.98); }
.msg { color: var(--bad); text-align: center; min-height: 20px; font-size: 14px; margin: 10px 0 0; }
.demo-tip { color: var(--muted); font-size: 12px; text-align: center; margin-top: 14px; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.identity { font-weight: 700; font-size: 17px; }
.child-switch {
  margin-left: 10px; height: 38px; border: 1px solid var(--line);
  border-radius: 10px; padding: 0 8px; font-size: 15px; background: #fff;
}
.sync-pill {
  margin-left: 10px; font-size: 12px; padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; cursor: pointer; border: 1px solid transparent; max-width: 60vw;
  overflow: hidden; text-overflow: ellipsis;
}
.sync-pill.idle { background: #eef2fb; color: #4a5a86; }
.sync-pill.offline { background: #f1f1f3; color: #777; cursor: help; }
.sync-pill.syncing { background: #fff4e0; color: #b5791a; }
.sync-pill.ok { background: #e7f7ec; color: #1d8a44; }
.sync-pill.error { background: #fdeaea; color: #c0392b; }
.ghost-btn {
  height: 38px; padding: 0 16px; border: 1px solid var(--line);
  background: #fff; border-radius: 10px; font-size: 15px; cursor: pointer;
}

/* ===== 视图区 ===== */
.view { padding: 16px 16px 96px; max-width: 860px; margin: 0 auto; }
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(30,40,80,.05);
}
.card h2 { margin: 0 0 12px; font-size: 19px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.center { text-align: center; }

/* 孩子首页「加油」卡片下的每日一句 */
.dq { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.dq-text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); font-weight: 500; }
.dq-cat {
  display: inline-block; margin-top: 6px; padding: 1px 10px; border-radius: 999px;
  font-size: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* 科目 / 入口网格 */
.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 96px; border-radius: 14px; cursor: pointer;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 17px;
  border: 1.5px solid transparent;
}
.tile .emoji { font-size: 30px; }
.tile:active { border-color: var(--brand); }

/* 题目卡 */
.q {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  margin-bottom: 16px; box-shadow: 0 2px 10px rgba(30,40,80,.05);
}
.q-meta { color: var(--brand); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.q-stem { font-size: 18px; margin-bottom: 12px; white-space: pre-wrap; }
.q-img { width: 100%; max-width: 320px; border-radius: 12px; margin: 8px 0; display: block; }
.q-imgs { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.q-imgs .q-img { width: auto; max-width: 240px; max-height: 240px; margin: 0; }
.audio-btn {
  display: inline-flex; align-items: center; gap: 8px; height: var(--tap);
  padding: 0 18px; border: none; border-radius: 12px; background: var(--brand);
  color: #fff; font-size: 16px; cursor: pointer; margin: 8px 0;
}
.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap);
  padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; font-size: 16px; cursor: pointer;
}
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.correct { border-color: var(--ok); background: #eafaf0; }
.opt.wrong { border-color: var(--bad); background: #fdecea; }
.opt .tag { width: 26px; height: 26px; border-radius: 50%; background: #eef1f6; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }

.primary-btn {
  width: 100%; height: var(--tap); border: none; border-radius: 12px;
  background: var(--brand); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
  margin-top: 8px;
}
.primary-btn:disabled { opacity: .5; }

/* 填空题输入 */
.fill-wrap { margin: 10px 0; }
.fill-input {
  width: 100%; min-height: var(--tap); padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 12px; font-size: 18px;
  font-family: inherit;
}
.fill-input:focus { outline: none; border-color: var(--brand); }
.fill-input.fill-ok { border-color: var(--ok); background: #eafaf0; }
.fill-input.fill-bad { border-color: var(--bad); background: #fdecea; }
.feedback .norm-hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
.feedback { margin-top: 12px; padding: 12px; border-radius: 12px; font-size: 15px; }
.feedback.ok { background: #eafaf0; color: #16653a; }
.feedback.bad { background: #fdecea; color: #922; }
.feedback .analysis { margin-top: 6px; color: var(--muted); font-size: 14px; }

/* 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.stat { background: var(--brand-soft); border-radius: 14px; padding: 14px 8px; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--brand); }
.stat .lbl { font-size: 13px; color: var(--muted); }

/* 列表项 */
.item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 10px; background: #fff;
}
.item .info { font-size: 15px; }
.item .sub { font-size: 12px; color: var(--muted); }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #eef1f6; color: var(--muted); }
.pill.pending { background: #fff4e0; color: #b5741a; }
.pill.active { background: #eafaf0; color: #16653a; }

/* 底部导航 */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav-btn {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; color: var(--muted); font-size: 12px;
}
.nav-btn .ico { font-size: 22px; }
.nav-btn.active { color: var(--brand); font-weight: 700; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 12px; font-size: 16px; font-family: inherit;
}

/* 打印（PDF 错题） */
.print-only { display: none; }
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { display: block; position: absolute; inset: 0; padding: 16px; }
  .print-q { border-bottom: 1px dashed #999; padding: 10px 0; page-break-inside: avoid; }
  .print-q h3 { margin: 0 0 4px; }
}

/* 开放题（问答/应用/作文）输入与展示 */
.open-input {
  width: 100%; box-sizing: border-box; padding: 12px;
  font-size: 16px; line-height: 1.6; border: 1.5px solid var(--line);
  border-radius: 12px; resize: vertical; font-family: inherit;
}
.feedback .analysis { white-space: pre-wrap; margin-top: 6px; color: var(--muted); }
.comp-card .analysis { white-space: pre-wrap; }
.wdetail .analysis, .wedit .analysis { overflow-wrap: break-word; word-break: break-word; }
/* 错题详情/修改表单：.item 是 flex 容器，展开的详情/表单必须占满整行（flex:1 1 100%），
   否则会和其他子项（信息/缩略图/按钮）并排挤压，文字被切成竖条 */
.wdetail, .wedit { flex: 1 1 100%; width: 100%; box-sizing: border-box; }
/* 错题详情/修改表单/作文卡片内的图片：等比缩放不超出容器、不与文字挤一行 */
.wdetail img, .wedit img, .comp-card img { max-width: 100%; height: auto; display: block; }
/* imgWithFallback 容器：包裹 img + fallback span，确保 flex 子项中不被挤压 */
.img-wrap { display: inline-block; position: relative; line-height: 0; }
.img-wrap .img-fallback { display: inline-flex; } /* 覆盖默认 display:none，仅 onerror 后可见 */
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.pill.active { background: #e6f7ee; color: var(--ok); }
.pill.pending { background: #fff3e0; color: #c77700; }

/* ===== 掌握度复习计划 ===== */
:root { --warn: #c77700; --good: #1f9d55; }
.review-home { background: linear-gradient(135deg, #eef4ff, #ffffff); }
.stat { text-align: center; }
.stat .num { font-size: 30px; font-weight: 800; }
.stat .lbl { font-size: 13px; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.mastery-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.mastery-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--good)); border-radius: 999px; }
.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-size: 14px; cursor: pointer; color: var(--ink);
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.back-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.back-btn:hover { background: #f2f4f7; }
.qp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.qp-prog { font-size: 14px; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.filter-row > label { width: 76px; flex: none; font-weight: 600; color: var(--ink); }
.fsel { height: 38px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: 15px; background: #fff; min-width: 160px; }

/* ============ 云宠物 ============ */
.pet-card {
  background: linear-gradient(160deg, #f4f9ff 0%, #eef6ff 60%, #eafbf2 100%);
  border: 1.5px solid #dbe9ff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 6px;
}
.pet-card-compact { padding: 12px 14px; }
.pet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.pet-badge {
  font-weight: 700; font-size: 15px; color: #2f6fed;
  background: #fff; border: 1.5px solid #cfe0ff; border-radius: 999px; padding: 3px 12px;
}
.pet-owner { font-size: 13px; color: var(--muted); }
.pet-scene { position: relative; display: flex; align-items: flex-end; gap: 12px; padding: 6px 0 2px; }
.pet-figure { position: relative; width: 96px; height: 96px; flex: none; animation: petFloat 3.2s ease-in-out infinite; transform-origin: center; }
.pet-card-compact .pet-figure { width: 72px; height: 72px; }
.pet-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 8px rgba(60,90,160,0.18)); }
.pet-shadow {
  position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%);
  width: 56%; height: 9px; background: rgba(80,110,170,0.18); border-radius: 50%;
  filter: blur(2px); animation: petShadow 3.2s ease-in-out infinite;
}
.pet-bubble {
  flex: 1; background: #fff; border: 1.5px solid #e3ecff; border-radius: 14px;
  padding: 10px 12px; font-size: 14px; color: #3a4256; line-height: 1.45;
  position: relative; min-height: 44px;
}
.pet-bubble::before {
  content: ""; position: absolute; left: -8px; top: 16px; width: 0; height: 0;
  border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-right: 8px solid #e3ecff;
}
.pet-actions { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; flex-wrap: wrap; }
.pet-name { font-weight: 700; color: #44506a; margin-right: auto; }
.pet-name::before { content: ""; }
.xp-bar { height: 12px; background: #e7eefc; border-radius: 999px; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg, #56b6ff, #6fe0a8); border-radius: 999px; transition: width .5s ease; }
.xp-text { font-size: 13px; color: var(--muted); margin-top: 5px; }
.pet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .pet-grid { grid-template-columns: 1fr; } }

/* 摸摸头动画 */
.pet-pat-anim { animation: petPat .6s ease; }
.pet-heart {
  position: absolute; bottom: 30px; font-size: 18px; pointer-events: none;
  animation: petHeart 1.2s ease-out forwards; opacity: 0;
}
@keyframes petFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes petShadow { 0%,100% { transform: scale(1); opacity: .35; } 50% { transform: scale(.82); opacity: .22; } }
@keyframes petPat { 0% { transform: rotate(0); } 25% { transform: rotate(-8deg) scale(1.05); } 60% { transform: rotate(6deg) scale(1.05); } 100% { transform: rotate(0); } }
@keyframes petHeart { 0% { opacity: 0; transform: translateY(0) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46px) scale(1.1); } }

/* 升级飘字 */
.pet-toast {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%) translateY(-12px);
  background: linear-gradient(90deg, #2f6fed, #6a5cff); color: #fff; font-weight: 700;
  padding: 12px 22px; border-radius: 999px; box-shadow: 0 10px 30px rgba(60,90,200,.35);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 999; font-size: 16px;
}
.pet-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 云宠物进化庆祝全屏动画 ============ */
.pet-celebrate {
  position: fixed; inset: 0; z-index: 9999; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 28, 48, .55); backdrop-filter: blur(2px);
  animation: celebrateIn .3s ease;
}
.pet-celebrate.out { opacity: 0; transition: opacity .35s ease; }
@keyframes celebrateIn { from { opacity: 0; } to { opacity: 1; } }
.celebrate-card {
  position: relative; z-index: 2; background: #fff; border-radius: 22px;
  padding: 26px 36px; text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.35);
  animation: celebratePop .45s cubic-bezier(.2,1.5,.4,1); max-width: 86vw;
}
@keyframes celebratePop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.celebrate-card .pet-figure { width: 150px; margin: 0 auto; }
.celebrate-card .pet-svg { width: 150px; height: 150px; }
.pet-pop { animation: petPop 1s ease-in-out infinite alternate; }
@keyframes petPop { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-12px) rotate(2deg); } }
.celebrate-card .big { font-size: 26px; font-weight: 800; margin-top: 10px; color: #e8590c; }
.pet-celebrate.legend .big { color: #b8860b; text-shadow: 0 0 12px rgba(255,215,0,.6); }
.confetti {
  position: absolute; top: -24px; border-radius: 2px; opacity: .95;
  animation-name: confettiFall; animation-timing-function: linear; animation-fill-mode: forwards;
  z-index: 1;
}
@keyframes confettiFall {
  0% { transform: translateY(-10px) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: .85; }
}

/* ===== 拍照识别·题目详情/编辑弹窗 ===== */
.photo-detail-overlay {
  position: fixed; inset: 0; z-index: 9998; overflow: hidden;
  display: flex; align-items: flex-start; justify-content: center;
  background: rgba(20, 28, 48, .55); backdrop-filter: blur(2px);
  animation: celebrateIn .25s ease; padding: 24px 12px;
}

/* ===== 宠物 v2：物种 / 互动 / 状态 / 成就 / 探险 ===== */
.pet-species { font-size: 12px; color: var(--muted); background: #eef3ff; padding: 1px 8px; border-radius: 999px; }
.pet-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; }
.pet-chip { border: 1px solid #dde3ef; background: #fff; border-radius: 999px; padding: 2px 9px; font-size: 12px; cursor: pointer; color: #55617a; }
.pet-chip.on { background: #4d8dff; color: #fff; border-color: #4d8dff; font-weight: 700; }
.pet-bg { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; pointer-events: none; }
.pet-bg::before, .pet-bg::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.55); }
.pet-bg::before { width: 26px; height: 26px; top: 6px; left: -8px; box-shadow: 72px 16px 0 -4px rgba(255,255,255,.45), 30px 52px 0 -8px rgba(255,255,255,.4); animation: drift 9s linear infinite; }
.pet-bg::after { width: 14px; height: 14px; bottom: 10px; right: 6px; box-shadow: -40px -10px 0 -3px rgba(255,255,255,.4); animation: drift 12s linear infinite reverse; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(20px); } }
.pet-soon { position: absolute; top: 4px; right: 6px; font-size: 12px; background: linear-gradient(90deg,#ffe08a,#ffb347); color: #6b4b00; padding: 2px 8px; border-radius: 999px; animation: pulse 1.4s ease-in-out infinite; }
.pet-acc { position: absolute; font-size: 22px; pointer-events: none; }
.pet-acc.hat { top: -6px; left: 50%; transform: translateX(-50%); }
.pet-acc.scarf { bottom: 2px; right: 6px; }
.pet-fun { display: flex; gap: 6px; margin: 6px 0; }
.pet-fun .ghost-btn { font-size: 18px; padding: 4px 8px; border-radius: 10px; }
.pet-bars { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px; }
.mini-bar { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.mini-bar > span { width: 18px; text-align: center; }
.mini-bar .mb-fill { flex: 1; height: 8px; border-radius: 999px; overflow: hidden; background: #eef1f7; }
.mini-bar .mb-fill.hunger { background: linear-gradient(90deg,#ffb347,#ff8c42); }
.mini-bar .mb-fill.mood { background: linear-gradient(90deg,#ff9ec4,#ff6b9d); }
.pet-eat-anim { animation: petEat .7s ease; }
.pet-jump-anim { animation: petJump .7s ease; }
.pet-spin-anim { animation: petSpin .7s ease; }
.pet-travel-anim { animation: petTravel 1.6s ease; }
@keyframes petEat { 0%,100% { transform: scale(1); } 40% { transform: scale(1.12) translateY(-2px); } 70% { transform: scale(.96); } }
@keyframes petJump { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-16px) scale(1.05); } 60% { transform: translateY(-6px); } }
@keyframes petSpin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.1); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes petTravel { 0% { transform: translateX(0) rotate(0); opacity: 1; } 100% { transform: translateX(40px) rotate(20deg); opacity: .35; } }
.pet-adopt { background: linear-gradient(90deg,#7b6cff,#9a7cff); border: none; color: #fff; font-weight: 700; }
/* 进化庆祝光束 */
.celebrate-beams { position: absolute; inset: -20%; pointer-events: none; background: conic-gradient(from 0deg, rgba(255,215,0,0) 0deg, rgba(255,215,0,.35) 30deg, rgba(255,215,0,0) 60deg); animation: beamSpin 3s linear infinite; opacity: .6; }
@keyframes beamSpin { to { transform: rotate(360deg); } }
.pet-celebrate.legend .celebrate-card { box-shadow: 0 0 0 3px rgba(255,215,0,.6), 0 20px 60px rgba(184,134,11,.5); }
/* 成就墙 */
.pet-ach-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(20,28,48,.55); backdrop-filter: blur(2px); animation: celebrateIn .25s ease; }
.pet-ach-overlay.out { opacity: 0; transition: opacity .3s ease; }
.ach-wall { background: #fff; border-radius: 18px; padding: 18px 18px 14px; max-width: 92vw; width: 420px; box-shadow: 0 20px 60px rgba(40,60,120,.3); }
.ach-wall h3 { margin: 0 0 12px; font-size: 18px; }
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ach-item { border: 1px solid #e6eaf2; border-radius: 14px; padding: 10px; text-align: center; background: #f7f9fd; opacity: .7; }
.ach-item.on { opacity: 1; border-color: #ffd76a; background: linear-gradient(180deg,#fffdf3,#fff4d6); box-shadow: 0 4px 14px rgba(255,200,60,.25); }
.ach-emoji { font-size: 28px; }
.ach-name { font-weight: 700; margin-top: 2px; color: #36405a; }
.ach-desc { font-size: 12px; color: #8a93a8; margin-top: 2px; }
.photo-detail-overlay.out { opacity: 0; transition: opacity .25s ease; }
.photo-detail-card {
  position: relative; z-index: 2; background: #fff; border-radius: 18px;
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  padding: 18px 18px 22px; box-shadow: 0 24px 70px rgba(0,0,0,.35);
  animation: detailPop .3s cubic-bezier(.2,1.2,.4,1);
}
@keyframes detailPop { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.photo-detail-card h3 { margin: 0 0 2px; font-size: 18px; }
.photo-detail-card .pd-close {
  position: absolute; top: 12px; right: 14px; border: none; background: transparent;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted);
}
.photo-detail-card .pd-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.photo-detail-card .pd-row > .field { flex: 1; min-width: 130px; margin-bottom: 10px; }
.photo-detail-card .pd-actions {
  display: flex; gap: 10px; margin-top: 14px; position: sticky; bottom: 0;
  background: #fff; padding-top: 10px; border-top: 1px solid var(--line);
}
.photo-detail-card textarea { resize: vertical; }
.photo-detail-card .pd-tag { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.photo-detail-card .pd-hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }

/* 课程标签删除按钮 */
.chip.sub-item { display: inline-flex; align-items: center; gap: 4px; padding-right: 6px; }
.sub-del {
  border: none; background: rgba(229,57,53,.12); color: #e53935; cursor: pointer;
  border-radius: 50%; width: 18px; height: 18px; line-height: 1; font-size: 13px; padding: 0;
}
.sub-del:hover { background: #e53935; color: #fff; }

/* ===== 考试成绩 ===== */
.inp {
  height: var(--tap); padding: 0 12px; border: 1.5px solid var(--line);
  border-radius: 12px; font-size: 15px; background: var(--card); color: var(--ink);
  max-width: 100%;
}
.inp:focus { outline: none; border-color: var(--brand); }
#exSub, #exType, #exChild, #exSubFilter { min-width: 96px; }
#examChart svg { background: var(--card); }
#examList .ex-del { color: var(--bad); border-color: var(--line); }
#examList .ex-edit { color: var(--brand); border-color: var(--line); }


/* ===== 危险操作按钮（从云端恢复） ===== */
.btn-danger {
  background: #d6453d;
  border-color: #d6453d;
  color: #fff;
}
.btn-danger:hover {
  background: #b33a32;
  border-color: #b33a32;
}
.btn-danger:active {
  transform: scale(0.98);
}

/* 题目配图上传 UI（录入新题 / 题库修改） */
.q-img-row { display: flex; align-items: center; gap: 8px; }
.q-img-label {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  max-width: 170px; height: 38px; padding: 0 16px; margin: 0;
  border: none; border-radius: 10px; background: var(--brand); color: #fff;
  font-size: 15px; cursor: pointer;
}
.q-img-label input[type="file"] { display: none; }
.q-img-prev { margin-top: 8px; }
.q-img-prev img { max-width: 220px; border-radius: 8px; display: block; }
.q-img-prev .muted { font-size: 14px; }
.q-img-prev .err { color: var(--bad); font-size: 14px; }
.q-img-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.q-img-item { position: relative; }
.q-img-item img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; background: var(--line); }
.q-img-item .q-img-del {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: var(--bad); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
}
