:root {
  --bg: #eef4ff; --card: #ffffff; --ink: #1e293b; --muted: #64748b; --line: #e2e8f0;
  --p: #2563eb; --p2: #1d4ed8; --ok: #16a34a; --bad: #dc2626; --gold: #f59e0b; --boss: #7c3aed;
  --radius: 18px; --shadow: 0 6px 20px rgba(30, 41, 59, .08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 16px;
  background-image: radial-gradient(circle at 20% 0%, #dbeafe 0, transparent 40%), radial-gradient(circle at 90% 100%, #fde68a55 0, transparent 40%); min-height: 100vh; }
#app { max-width: 600px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 84px; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
small, .tiny { color: var(--muted); font-size: .82rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.page { padding: 14px 16px 24px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
.card.gold { background: linear-gradient(135deg, #fff7d6, #ffe9a8); border: 1px solid #fcd34d; }
.card.info .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 6px 0; }
.card.info .kv span, .modal-card .kv span { color: var(--muted); }
.modal-card .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 6px 0; text-align: left; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.topbar h2 { flex: 1; text-align: center; margin: 0; }
.coins { background: #fff7d6; border: 1px solid #fcd34d; border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center; }

/* 按钮 */
.btn { border: 2px solid var(--line); background: #fff; color: var(--ink); border-radius: 14px; padding: 10px 16px; font-weight: 600; transition: transform .08s, box-shadow .2s; box-shadow: 0 3px 0 var(--line); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.primary { background: var(--p); border-color: var(--p2); color: #fff; box-shadow: 0 4px 0 var(--p2); }
.btn.boss { background: var(--boss); border-color: #5b21b6; color: #fff; box-shadow: 0 4px 0 #5b21b6; }
.btn.boss.disabled { opacity: .5; }
.btn.danger { background: #fee2e2; border-color: #fca5a5; color: var(--bad); box-shadow: 0 3px 0 #fca5a5; }
.btn.ghost { background: #f8fafc; }
.btn.big { width: 100%; padding: 14px 18px; font-size: 1.05rem; }
.btn.small { padding: 6px 12px; font-size: .85rem; font-weight: 500; min-height: 40px; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.actions.row { flex-direction: row; } .actions.row .btn { flex: 1; }
.input { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; }
.input:focus { outline: none; border-color: var(--p); }
.input.right { border-color: var(--ok); background: #f0fdf4; } .input.wrong { border-color: var(--bad); background: #fef2f2; }
textarea.input { font-size: .85rem; font-family: inherit; line-height: 1.6; }

/* 导航 */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 600px; display: flex; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
.nav button { flex: 1; border: 0; background: none; color: var(--muted); font-size: .72rem; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border-radius: 12px; }
.nav button span { font-size: 1.35rem; }
.nav button.on { color: var(--p); background: #eff6ff; font-weight: 700; }

/* 首页 */
.hero { background: linear-gradient(135deg, #1e3a8a, #2563eb 60%, #38bdf8); color: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.hero-row { display: flex; align-items: center; gap: 12px; }
.hero-info { flex: 1; min-width: 0; }
.hero .coins { color: var(--ink); }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: #fff3; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.avatar.big { width: 80px; height: 80px; font-size: 2.6rem; background: #eff6ff; margin: 0 auto 8px; display: flex; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .82rem; opacity: .95; }
.blink { animation: blink 1.6s infinite; } @keyframes blink { 50% { opacity: .5; } }
.xp { margin-top: 4px; } .xp-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: .8rem; margin-bottom: 3px; } .xp-row span { white-space: nowrap; } .xp-row span:last-child { margin-left: auto; }
.progress { height: 10px; background: #0003; border-radius: 999px; overflow: hidden; }
.hero .progress { background: #ffffff44; }
.progress .bar { height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); border-radius: 999px; transition: width .4s; }
.books { display: flex; gap: 10px; overflow-x: auto; padding: 14px 2px 6px; scrollbar-width: none; }
.books::-webkit-scrollbar { display: none; }
.book { flex: 0 0 auto; min-width: 128px; border: 2px solid var(--line); border-radius: 16px; background: #fff; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.book span { font-size: 1.5rem; } .book small { font-size: .72rem; }
.book.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.path { position: relative; padding: 10px 0; }
.path::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 4px dashed color-mix(in srgb, var(--c) 40%, #fff); }
.node-row { display: flex; align-items: center; gap: 14px; margin: 14px 0; position: relative; }
.node-row.r { flex-direction: row-reverse; }
.node-row.r .node-info { text-align: right; }
.node { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: var(--c); color: #fff; box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 60%, #000), var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; flex: 0 0 auto; transition: transform .1s; }
.node:active { transform: translateY(3px); box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 60%, #000); }
.node-icon { font-size: 1.7rem; line-height: 1; }
.node-no { position: absolute; bottom: -8px; background: #fff; color: var(--ink); font-size: .7rem; font-weight: 700; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); }
.node.locked { background: #cbd5e1; box-shadow: 0 6px 0 #94a3b8; }
.node.gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 6px 0 #b45309, 0 0 0 4px #fde68a; }
.node.boss-done::after { content: "👹"; position: absolute; top: -8px; right: -8px; font-size: .9rem; background: #fff; border-radius: 50%; padding: 1px; }
.node-info { flex: 1; min-width: 0; background: #fff; border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow); }
.node-info b { display: block; } .node-info small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-info .tag { font-size: .7rem; background: #ede9fe; color: var(--boss); border-radius: 6px; padding: 0 6px; margin-left: 6px; }
.stars { color: #f59e0b; letter-spacing: 1px; } .stars.big { font-size: 2rem; display: block; }

/* 关卡页 */
.unit-hero { text-align: center; padding: 10px 0; }
.big-icon { font-size: 3rem; display: block; line-height: 1.2; }
.unit-stat small { display: block; }
.lesson-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.lesson-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #f8fafc; border-radius: 12px; padding: 10px 12px; text-align: left; }
.lesson-item span { width: 26px; height: 26px; border-radius: 50%; background: var(--c, var(--p)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; flex: 0 0 auto; }
.lesson-item em { margin-left: auto; font-style: normal; color: var(--muted); font-size: .78rem; }
.rules { text-align: left; padding-left: 20px; }

/* 知识卡 */
.dots { display: flex; gap: 6px; justify-content: center; margin: 6px 0; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); } .dots i.on { background: var(--p); width: 22px; border-radius: 6px; } .dots i.done { background: #93c5fd; }
.lesson-card { min-height: 300px; background: linear-gradient(180deg, #fff, #f8fbff); border: 1px solid #dbeafe; }
.lc-no { color: var(--muted); font-size: .8rem; }
.points { padding-left: 0; list-style: none; margin: 10px 0; }
.points li { background: #eff6ff; border-left: 4px solid var(--p); border-radius: 8px; padding: 8px 12px; margin: 8px 0; animation: slidein .4s both; }
@keyframes slidein { from { opacity: 0; transform: translateX(14px); } }
.tip { background: #fffbeb; border: 1px dashed #f59e0b; border-radius: 10px; padding: 8px 12px; font-size: .92rem; }

/* 答题 */
.quiz { padding: 10px 14px 24px; }
.quiz-top { display: flex; align-items: center; gap: 10px; }
.quiz-top .progress { flex: 1; background: #dbe3f0; }
.quiz-meta { display: flex; gap: 8px; align-items: center; font-size: .9rem; white-space: nowrap; }
.hearts { letter-spacing: -2px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; } .timer.urgent { color: var(--bad); animation: blink .6s infinite; }
.combo { color: #ea580c; font-weight: 700; font-size: .85rem; min-width: 0; } .combo.hot { animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }
.boss-bar { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.boss-face { font-size: 1.6rem; }
.boss-hp { flex: 1; height: 14px; background: #e2e8f0; border-radius: 999px; overflow: hidden; border: 2px solid #5b21b6; }
.boss-hp-fill { height: 100%; background: linear-gradient(90deg, #a855f7, #7c3aed); transition: width .4s; }
.boss-name { font-size: .8rem; font-weight: 700; color: var(--boss); }
.quiz-body { margin-top: 14px; }
.quiz-body.pop, .pop { animation: popin .3s ease-out; } @keyframes popin { from { opacity: 0; transform: scale(.96); } }
.q-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.chip { font-size: .72rem; background: #e0e7ff; color: #3730a3; border-radius: 999px; padding: 1px 8px; }
.chip.lv { background: #fef3c7; color: #92400e; } .chip.unit { background: #f1f5f9; color: var(--muted); }
.q-no { margin-left: auto; color: var(--muted); font-size: .8rem; }
.q-text { font-size: 1.12rem; font-weight: 600; background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.blank { border-bottom: 2px solid var(--p); color: var(--p); padding: 0 4px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.options.tf { flex-direction: row; } .options.tf .opt { justify-content: center; font-size: 1.1rem; }
.opt { display: flex; align-items: center; gap: 10px; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: 0 3px 0 var(--line); transition: transform .08s; flex: 1; }
.opt:not(:disabled):hover { border-color: #93c5fd; }
.opt:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
.opt-l { width: 28px; height: 28px; border-radius: 50%; background: #eff6ff; color: var(--p); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.opt.right { border-color: var(--ok); background: #f0fdf4; box-shadow: 0 3px 0 #86efac; } .opt.right .opt-l { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: #fef2f2; box-shadow: 0 3px 0 #fca5a5; animation: shake .4s; } .opt.wrong .opt-l { background: var(--bad); color: #fff; }
.opt.ruled { opacity: .35; text-decoration: line-through; }
.opt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.quiz.shake { animation: shake .4s; }
.fill-row { display: flex; gap: 8px; } .fill-row .input { flex: 1; font-size: 1.05rem; }
.hint-text { color: var(--muted); font-size: .8rem; margin: 8px 0; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.mi { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 8px; font-size: .92rem; text-align: center; box-shadow: 0 3px 0 var(--line); min-height: 44px; }
.mi.sel { border-color: var(--p); background: #eff6ff; }
.mi.c1 { border-color: #f59e0b; background: #fffbeb; } .mi.c2 { border-color: #10b981; background: #ecfdf5; } .mi.c3 { border-color: #8b5cf6; background: #f5f3ff; } .mi.c4 { border-color: #ec4899; background: #fdf2f8; } .mi.c5 { border-color: #06b6d4; background: #ecfeff; }
.mi.right { border-color: var(--ok) !important; background: #dcfce7 !important; } .mi.wrong { border-color: var(--bad) !important; background: #fee2e2 !important; }
.mi:disabled { opacity: .35; }
.order-ans { min-height: 48px; background: #fff; border: 2px dashed #93c5fd; border-radius: 12px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.o-item { background: #dbeafe; border-radius: 8px; padding: 4px 10px; font-size: .9rem; } .o-item.right { background: #dcfce7; box-shadow: inset 0 0 0 2px var(--ok); } .o-item.wrong { background: #fee2e2; box-shadow: inset 0 0 0 2px var(--bad); } .o-empty { color: var(--muted); font-size: .85rem; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; } .order-pool .mi { flex: 1 1 40%; }
.feedback { margin-top: 14px; border-radius: var(--radius); padding: 14px 16px; animation: popin .3s; }
.feedback.good { background: #ecfdf5; border: 2px solid #86efac; } .feedback.bad { background: #fff1f2; border: 2px solid #fda4af; }
.fb-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; } .feedback.good .fb-title { color: var(--ok); } .feedback.bad .fb-title { color: var(--bad); }
.fb-detail { font-size: .92rem; margin-bottom: 6px; } .fb-explain { font-size: .92rem; color: #334155; }
.quiz-foot { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

/* 地图 */
.map-wrap { position: relative; background: #e0f2fe; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); touch-action: none; }
.map-wrap svg { width: 100%; height: auto; display: block; cursor: grab; }
.map-wrap.explore svg { max-height: 70vh; }
.map-china { background: #e0f2fe; }
.map .ocean { fill: #cfe8fb; stroke: #1e3a8a; stroke-width: 1.2; }
.map .grat { fill: none; stroke: #60a5fa; stroke-width: .7; stroke-dasharray: 4 3; opacity: .8; } .map .grat-main { stroke: #ef4444; stroke-dasharray: none; }
.map .feat { fill: #fde68a; stroke: #92400e; stroke-width: .8; transition: fill .15s; cursor: pointer; }
.map-world .feat { fill: #d9f99d; stroke: #3f6212; stroke-width: .5; }
.map-world .feat.cont-asia { fill: #fde68a; } .map-world .feat.cont-europe { fill: #c7d2fe; } .map-world .feat.cont-africa { fill: #fdba74; } .map-world .feat.cont-namerica { fill: #bbf7d0; } .map-world .feat.cont-samerica { fill: #a7f3d0; } .map-world .feat.cont-oceania { fill: #fbcfe8; } .map-world .feat.cont-antarctica { fill: #f1f5f9; }
.map .feat:hover { fill: #fcd34d; filter: brightness(1.05); }
.map .feat.sel { fill: #60a5fa; stroke: #1d4ed8; stroke-width: 1.5; }
.map .feat.ok { fill: #4ade80 !important; stroke: #166534; stroke-width: 1.5; animation: flash .5s 3; }
.map .feat.bad { fill: #f87171 !important; stroke: #991b1b; stroke-width: 1.5; }
@keyframes flash { 50% { fill: #bbf7d0; } }
.map .cap { fill: #dc2626; stroke: #fff; stroke-width: .8; pointer-events: none; }
.map .feat-label { font-size: 24px; fill: #1f2937; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; font-weight: 600; }
.map .feat-label.small { font-size: 13px; font-weight: 500; }
.map .feat-label.pop { font-size: 28px; fill: #111; animation: popin .3s; }
.map .ocean-label { font-size: 18px; fill: #1d4ed8; text-anchor: middle; pointer-events: none; font-style: italic; letter-spacing: 2px; }
.map .cont-label { font-size: 18px; fill: #7c2d12; text-anchor: middle; pointer-events: none; font-weight: 800; paint-order: stroke; stroke: #fff8; stroke-width: 4px; }
.map .inset-box { fill: #e0f2fe; } .map .inset-frame { fill: none; stroke: #334155; stroke-width: 1.2; }
.map .inset-ref { fill: #fde68a; stroke: #92400e; stroke-width: .6; pointer-events: none; }
.map .inset-sea { fill: #fde68a; stroke: #b91c1c; stroke-width: 1.4; pointer-events: none; }
.map .inset-label { font-size: 13px; text-anchor: middle; fill: #334155; }
.map .map-credit { font-size: 10px; fill: #94a3b8; }
.zoom-ctl { position: absolute; left: 8px; bottom: 8px; display: flex; flex-direction: row; gap: 6px; } /* 放在左下角空白处，避免挡住新疆 */
.zoom-ctl.below { position: static; justify-content: center; padding: 6px 0; }
.zoom-ctl button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #fffd; font-size: 1rem; }

/* 结算 */
.result-top { text-align: center; padding: 12px 0 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat-grid b { display: block; font-size: 1.3rem; }
.wrong-mini { padding-left: 18px; font-size: .88rem; color: #334155; } .wrong-mini li { margin: 4px 0; }
.result.win .result-top h1 { color: var(--ok); }

/* 挑战中心 */
.ch-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; } .ch-head .big-icon { font-size: 2.2rem; }
.ch .done { color: var(--ok); font-weight: 600; }
.exam-log { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .exam-log span { background: #f1f5f9; border-radius: 8px; padding: 2px 8px; font-size: .78rem; }
.big-num { font-size: 2.4rem; font-weight: 800; color: var(--p); margin: 4px 0; }
.wq { border-top: 1px solid var(--line); padding: 8px 0; } .wq summary { cursor: pointer; font-weight: 500; } .wq em { display: block; font-style: normal; color: var(--muted); font-size: .78rem; margin: 2px 0 0 1.1em; } /* 错几次、何时复习单独一行，免得折断 */
.map-world:not(.zin) .map-labels { display: none; } /* 世界地图默认只显示大洲、大洋名，放大后再显示国名 */
#mq-foot:not(:empty) { font-size: .92rem; color: #b91c1c; background: #fef2f2; border-radius: 10px; padding: 8px 10px; line-height: 1.5; }
.mq-tip { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.wq-body { font-size: .9rem; color: #334155; padding: 6px 0 0 14px; }

/* 分段 / 图鉴 */
.seg { display: flex; background: #e2e8f0; border-radius: 12px; padding: 4px; margin: 8px 0; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 8px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--p); box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cardlet { border: 2px solid #fcd34d; background: linear-gradient(160deg, #fffbeb, #fde68a); border-radius: 12px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; }
.cardlet b { font-size: .95rem; } .cardlet small { font-size: .72rem; }
.cardlet.locked { border-color: var(--line); background: #f1f5f9; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { background: #fff; border-radius: 14px; padding: 12px; text-align: center; box-shadow: var(--shadow); border: 2px solid #fcd34d; }
.badge span { font-size: 2rem; display: block; } .badge b { display: block; } .badge small { font-size: .72rem; display: block; }
.badge.locked { border-color: var(--line); opacity: .7; filter: grayscale(1); }
.profile { text-align: center; }
.switch { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }

/* 开场 */
.onboard { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.onboard .logo { font-size: 5rem; animation: float 3s ease-in-out infinite; } @keyframes float { 50% { transform: translateY(-10px); } }
.onboard .sub { color: var(--muted); }
.onboard label { display: block; text-align: left; font-weight: 600; margin: 10px 0 6px; }
.avatars { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.av { width: 48px; height: 48px; font-size: 1.6rem; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.av.on { border-color: var(--p); background: #eff6ff; box-shadow: 0 0 0 3px #bfdbfe; }

/* 弹窗 / 提示 / 彩带 */
#modal { position: fixed; inset: 0; background: #0f172a99; display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
#modal.open { display: flex; }
.modal-card { background: #fff; border-radius: 20px; padding: 20px; max-width: 420px; width: 100%; text-align: center; animation: popin .25s; max-height: 90vh; overflow: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; } .modal-actions .btn { flex: 1; }
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; pointer-events: none; width: min(92vw, 420px); }
.toast { background: #1e293b; color: #fff; border-radius: 12px; padding: 8px 14px; font-size: .9rem; opacity: 0; transform: translateY(-10px); transition: .3s; text-align: center; }
.toast.show { opacity: 1; transform: none; } .toast.gold { background: #b45309; } .toast.warn { background: #b91c1c; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
#confetti i { position: absolute; top: -10px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .6; } }
.loading { text-align: center; padding: 40vh 0; color: var(--muted); }
@media (min-width: 700px) { body { font-size: 17px; } #app { box-shadow: 0 0 40px #0001; background: #f8fbff; } }

/* 示意图题 / 材料题 */
.dg { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); background: #fff; margin-bottom: 10px; }
.dg .dg-t { font-size: 13px; fill: #475569; } /* 图内说明字：示意图约 420 宽、手机上缩到约 330px，13 约等于屏上 10px */
.dg .dg-c { font-size: 10px; fill: #92400e; paint-order: stroke; stroke: #fefce8; stroke-width: 3px; }
.dg .dg-p { font-size: 14px; font-weight: 700; fill: #1d4ed8; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.material { background: #fffbeb; border: 1px solid #fcd34d; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; font-size: .95rem; }
.material h4 { margin: 0 0 6px; color: #92400e; }
.material p { margin: 4px 0; white-space: pre-wrap; }
.mastery { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: .72rem; color: var(--muted); }
.mastery i { width: 54px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; display: inline-block; }
.mastery i b { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #10b981); }
.mastery i.low b { background: linear-gradient(90deg, #fca5a5, #ef4444); } .mastery i.mid b { background: linear-gradient(90deg, #fcd34d, #f59e0b); }
.lesson-item span.mastery { width: auto; height: auto; border-radius: 0; background: none; color: var(--muted); font-size: .72rem; font-weight: 500; margin-left: auto; }
.lesson-item span.mastery i { flex: 0 0 auto; }
.dg.dg-map { background: #e0f2fe; }
.dg.dg-map .dg-t { font-size: 20px; fill: #1e3a8a; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.dg.dg-map .dg-p { font-size: 34px; fill: #dc2626; }

.ptag { display: inline-block; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 999px; padding: 1px 8px; font-size: .78rem; margin: 2px 3px 2px 0; }
.pc-row { text-align: left; margin: 6px 0; } .pc-row em { font-style: normal; font-size: .8rem; color: var(--muted); margin-right: 6px; }
.pc-text { text-align: left; font-size: .88rem; color: #334155; }
.rt { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 6px 0; } .rt th, .rt td { padding: 4px 6px; text-align: left; border-bottom: 1px solid var(--line); } .rt th { color: var(--muted); font-weight: 500; }
.weak-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.weak { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; text-align: left; border: 1px solid #fecaca; background: #fff1f2; border-radius: 10px; padding: 8px 10px; }
.weak b { grid-column: 1; } .weak small { grid-column: 1; } .weak span { grid-row: 1 / span 2; align-self: center; color: var(--p); font-size: .85rem; font-weight: 600; }
.report h4 { margin: 10px 0 4px; font-size: .95rem; }
.wg { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.wg-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.wg-head b { font-size: .95rem; } .wg-head small { margin-right: auto; }
.wg .wq { border-top: 0; padding: 4px 0 4px 8px; }
.wg-head b { flex-basis: 100%; }
.opt:disabled { color: var(--ink); }
.opt:disabled:not(.right):not(.wrong) { opacity: .6; }
.opt.right, .opt.wrong { opacity: 1; }

.due-banner { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center; width: 100%; text-align: left; margin-top: 12px; border: 2px solid #fca5a5; background: #fff1f2; border-radius: 16px; padding: 10px 14px; }
.due-banner span { grid-row: 1 / span 2; font-size: 1.6rem; } .due-banner b { color: #b91c1c; } .due-banner small { color: #9f1239; }

.mini { border: 2px dashed #93c5fd; background: #f8fbff; }
.mini h4 { margin: 0 0 6px; } .mini h4 small { font-weight: 400; margin-left: 6px; }
.mini-q { font-weight: 600; margin: 4px 0 10px; }
.mini-opts { display: flex; flex-direction: column; gap: 8px; } .mini-opts.tf { flex-direction: row; } .mini-opts .opt { padding: 10px 12px; }
.postcard { position: relative; background: linear-gradient(135deg, #fefce8, #fff7ed); border: 2px solid #fdba74; padding-right: 64px; }
.postcard h4 { margin: 0 0 6px; color: #9a3412; } .postcard p { margin: 0 0 6px; }
.pc-stamp { position: absolute; right: 12px; top: 12px; width: 44px; height: 52px; border: 2px dashed #fb923c; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; transform: rotate(6deg); background: #fff; }
.g-go { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: #2563eb; color: #fff; font-size: .8rem; }
.guide { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 0; margin-top: 12px; }
.g-face { font-size: 2rem; flex: 0 0 auto; animation: float 3s ease-in-out infinite; }
.g-bubble { position: relative; background: #fff; border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow); font-size: .92rem; flex: 1; }
.g-bubble small { display: block; color: var(--p); font-weight: 700; }
html.big-font { font-size: 18px; } html.big-font body { font-size: 18px; }
html.big-font .q-text { font-size: 1.2rem; } html.big-font .opt { padding: 14px 16px; }

.topic-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.topic { display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 3px 0 var(--line); }
.topic:active { transform: translateY(2px); box-shadow: none; }
.t-icon { font-size: 1.8rem; flex: 0 0 auto; } .t-body { flex: 1; min-width: 0; } .t-body b { display: block; } .t-body small { display: block; }
.t-star { font-size: 1.4rem; }
.backup-tip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; background: #fefce8; border: 1px solid #fde047; border-radius: 14px; padding: 10px 12px; font-size: .88rem; }
.backup-tip span { flex-basis: 100%; }

.figure { margin: 10px 0; background: #fff; border: 1px solid #dbeafe; border-radius: 12px; padding: 8px; }
.figure .dg { margin-bottom: 6px; }
.fig-tag { font-size: .78rem; color: var(--p); font-weight: 700; margin-bottom: 4px; }
.fig-cap { font-size: .88rem; color: #334155; margin: 0; }

.prof-row { display: flex; align-items: center; gap: 10px; } .prof-row.cur { border: 2px solid var(--p); }
.pr-info { flex: 1; min-width: 0; } .pr-info b, .pr-info small { display: block; }
.print-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pp-sheet { background: #fff; color: #000; padding: 16px; border-radius: 8px; box-shadow: var(--shadow); margin-bottom: 14px; font-size: 15px; line-height: 1.6; }
.pp-title { text-align: center; font-size: 1.2rem; margin: 0 0 6px; }
.pp-meta { text-align: center; font-size: .9rem; margin: 0 0 12px; }
.pp-q { margin: 10px 0 14px; break-inside: avoid; page-break-inside: avoid; } .pp-q p { margin: 4px 0; }
.pp-opts { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-left: 1.4em; } .pp-opts span { min-width: 40%; }
.pp-match { display: flex; gap: 24px; padding-left: 1.4em; } .pp-match div { display: flex; flex-direction: column; }
.pp-blank { display: inline-block; min-width: 6em; border-bottom: 1px solid #000; height: 1em; vertical-align: bottom; } .pp-blank.s { min-width: 3em; }
.pp-fig { max-width: 360px; } .pp-fig .dg { border-color: #999; }
.pp-mat { border: 1px solid #999; padding: 8px 10px; margin: 10px 0 6px; font-size: .92rem; } .pp-mat p { margin: 4px 0 0; white-space: pre-wrap; }
.pp-answers p { margin: 4px 0; font-size: .9rem; } .pp-a { color: #b91c1c; }
@media print {
  body { background: #fff !important; } #app { max-width: none; padding: 0; box-shadow: none; background: #fff; }
  .nav, .print-actions, #toasts, #confetti { display: none !important; }
  .pp-sheet { box-shadow: none; padding: 0; margin: 0; }
  .pp-answers { page-break-before: always; break-before: page; }
  .pp-fig .dg { background: #fff; }
}

.shape-box { background: #e0f2fe; border-radius: var(--radius); padding: 12px; margin-bottom: 12px; display: flex; justify-content: center; box-shadow: var(--shadow); }
.shape-svg { width: 100%; max-width: 320px; height: 220px; }
.locator { width: 100%; max-width: 300px; height: auto; display: block; margin: 6px auto; background: #f8fafc; border-radius: 8px; }
.cal h3 small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.exam-row .btn { flex: 1; min-width: 0; padding-left: 4px; padding-right: 4px; white-space: nowrap; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid b { font-size: .75rem; color: var(--muted); font-weight: 500; }
.cal-grid i { font-style: normal; font-size: .8rem; padding: 4px 0; border-radius: 8px; background: #f1f5f9; color: var(--muted); min-height: 26px; }
.cal-grid i:empty { background: none; } .cal-grid i.on { background: #dbeafe; color: var(--ink); } .cal-grid i.today { outline: 2px solid var(--p); }

.quests { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; margin-top: 12px; }
.qs-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 6px; } .qs-head small { font-size: .74rem; color: var(--muted); }
.qs-item { display: grid; grid-template-columns: 1.6em 1fr 60px 2.8em; align-items: center; gap: 6px; font-size: .9rem; padding: 3px 0; }
.qs-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; } .qs-bar i { display: block; height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.qs-n { text-align: right; font-size: .8rem; color: var(--muted); }
.qs-item.done .qs-text { text-decoration: line-through; color: var(--muted); } .qs-item.done .qs-n { color: var(--ok); font-weight: 700; }

.report-btn { display: block; margin: 8px 0 0 auto; border: 0; background: none; color: var(--muted); font-size: .78rem; text-decoration: underline; padding: 2px 0; }
.report-btn:disabled { text-decoration: none; color: var(--ok); }
.rp-q { text-align: left; background: #f8fafc; border-radius: 8px; padding: 6px 8px; }
.rp-reasons { display: flex; flex-direction: column; gap: 6px; text-align: left; margin: 8px 0; } .rp-reasons label { font-size: .92rem; }
.rp-item b, .rp-item small { display: block; } .rp-item p { margin: 4px 0 0; font-size: .9rem; }

.week { margin-top: 10px; } .wk-bars { display: flex; gap: 6px; align-items: flex-end; height: 96px; padding: 4px 0; }
.wk-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.wk-col i { display: flex; flex-direction: column; justify-content: flex-end; width: 70%; min-height: 2px; background: #bfdbfe; border-radius: 4px 4px 0 0; overflow: hidden; }
.wk-col i b { display: block; width: 100%; background: #3b82f6; }
.wk-col small { font-size: .72rem; color: var(--muted); margin-top: 2px; } .wk-n { font-size: .68rem; color: var(--muted); }
.tts-btn { border: 0; background: #eef2ff; border-radius: 50%; width: 1.9em; height: 1.9em; margin-right: 6px; font-size: .9em; vertical-align: middle; cursor: pointer; }
#pt-text { width: 100%; font-size: .85rem; }

.share-wrap { text-align: center; } .share-wrap img { width: 100%; max-width: 420px; border-radius: 16px; box-shadow: var(--shadow); }
#set-share { margin-top: 10px; } a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.smart-list { padding-left: 0; list-style: none; margin: 8px 0; } .smart-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }

.backup-tip.warn { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.howto { text-align: left; font-size: .92rem; } .howto p { margin: 8px 0; }

.search-bar { display: block; width: 100%; margin-top: 12px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 16px; color: var(--muted); font-size: .92rem; box-shadow: var(--shadow); cursor: pointer; }
.search-box { display: flex; gap: 8px; } .search-box .input { flex: 1; min-width: 0; }
.hot { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; } .hot .chip { border: 0; cursor: pointer; font-size: .85rem; padding: 9px 14px; } /* 手指好点：高度约 38–40px */
.sr-item { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-radius: 12px; padding: 10px 12px; margin: 6px 0; box-shadow: var(--shadow); cursor: pointer; }
.sr-item b, .sr-item small { display: block; } .sr-item small { color: var(--muted); font-size: .78rem; } .sr-item p, .sr-place p { margin: 4px 0 0; font-size: .88rem; }
.sr-place small { display: block; color: var(--muted); font-size: .78rem; }
.sr-q { background: #fff; border-radius: 12px; padding: 8px 12px; margin: 6px 0; box-shadow: var(--shadow); font-size: .9rem; } .sr-q summary { cursor: pointer; } .sr-q p { margin: 6px 0 0; }
mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.outline .ol-unit { break-inside: auto; margin-top: 10px; } .outline h3 { margin: 12px 0 4px; border-bottom: 2px solid #333; }
.outline .ol-lesson { break-inside: avoid; margin: 6px 0; font-size: .9rem; } .outline ul { margin: 2px 0 0; padding-left: 1.3em; } .outline .ol-tip { margin: 2px 0 0; font-size: .85rem; }

.family h3 small { font-size: .74rem; color: var(--muted); font-weight: 400; }
.fm-row { display: grid; grid-template-columns: 2em 2.2em 1fr auto; align-items: center; gap: 6px; padding: 6px 4px; border-bottom: 1px dashed var(--line); }
.fm-row.cur { background: #eff6ff; border-radius: 8px; } .fm-rank { font-size: 1.2rem; text-align: center; } .fm-n small { color: var(--muted); font-size: .74rem; }
.fm-row .avatar { width: 2em; height: 2em; font-size: 1.1rem; }

.cross-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #f3e8ff; color: #7e22ce; font-size: .74rem; font-weight: 600; }

/* 设置开关：复选框放大，整行可点 */
.switch { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.switch input[type=checkbox] { width: 22px; height: 22px; flex: 0 0 auto; }
.wrong-mini .wm-ans { color: #15803d; font-size: .85rem; } /* 结算页错题下的正确答案 */
.mm-best { display: flex; flex-wrap: wrap; gap: 2px 12px; } .mm-best span { white-space: nowrap; } /* 地图页各项最佳成绩不在词中间折断 */
.hot .chip.on { background: var(--p); color: #fff; border-color: var(--p); } /* 搜索：当前关键词 */
.opt-num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 3px solid #dc2626; border-radius: 50%; color: #dc2626; background: #fff; font-weight: 700; font-size: 1.05rem; line-height: 1; } /* 选项是圆圈数字时画成与地图标号一样的红圈（不依赖字体里①的字形大小） */
