/* ============================================================
 * SASU 线上图书馆 · 样式（手机优先，桌面居中显示成手机宽度；老师端加宽）
 * 配色取自经过色盲/对比度校验的调色板：蓝 #2a78d6 主色，橙 #eb6834 强调
 * ============================================================ */
:root {
  color-scheme: light;
  --bg: #f4f5f7; --surface: #ffffff; --ink: #0b0b0b; --ink-2: #474640; --muted: #696762; --line: #deddd6; --hair: rgba(11,11,11,.09);
  --primary: #1769c2; --primary-deep: #124f91; --primary-soft: #e4effb;
  --accent: #b9471c; --accent-soft: #fdeee7;
  --good: #0ca30c; --good-text: #006300; --good-soft: #e8f7e8; --warn: #fab219; --warn-soft: #fff4d6; --danger: #d03b3b; --danger-soft: #fbe6e6;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11,11,11,.05), 0 8px 24px -14px rgba(11,11,11,.18);
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 6px 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: var(--primary-soft); padding: 1px 5px; border-radius: 4px; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; position: relative; background: var(--bg); transition: max-width .2s; }
#app.wide { max-width: 920px; }
@media (min-width: 560px) {
  body { background: #e6e8ec; }
  #app { box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 24px 60px -24px rgba(0,0,0,.3); }
}
#topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); background: rgba(244,245,247,.9); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
#topbar h1 { flex: 1; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { font-size: 20px; width: 36px; text-align: center; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.role-tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#view { flex: 1; padding: 6px 14px calc(96px + env(safe-area-inset-bottom)); }
/* 底部署名承担导航栏的避让空间，随页面滚动。 */
#app > #view { padding-bottom: 20px; }
.site-credit { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding: 16px 20px calc(100px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12px; line-height: 1.8; text-align: center; }
.site-credit > span { max-width: 100%; }
#tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
#app.wide #tabbar { max-width: 920px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 4px 0 2px; border: 0; background: none; }
.tab.on { color: var(--primary); font-weight: 600; }
.tab.fab .fab-circle { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(160deg, var(--primary), var(--primary-deep)); color: #fff; display: grid; place-items: center; margin-top: -30px; box-shadow: 0 8px 18px -6px rgba(42,120,214,.7), 0 0 0 5px var(--surface); }
.tab.fab.on .fab-circle { background: linear-gradient(160deg, var(--accent), #b8471c); box-shadow: 0 8px 18px -6px rgba(235,104,52,.7), 0 0 0 5px var(--surface); }
.ic { flex: none; vertical-align: -3px; }

/* ---------- 通用 ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 14px; margin: 10px 0; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card > h3:first-child { margin-bottom: 8px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; } .good { color: var(--good-text); }
.link { color: var(--primary); font-size: 13px; display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; padding: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--hair); }
.icon-btn.flip { transform: scaleX(-1); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 15px; background: var(--surface); transition: transform .08s, opacity .15s; }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); }
.btn-ghost { border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--hair); }
.btn.danger { color: var(--danger); }
.btn-block { display: flex; width: 100%; margin-top: 8px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.btn-row .btn { flex: 1; }
.btn-row.tight { margin-top: 0; gap: 6px; } .btn-row.tight .btn { flex: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.chip.sm { padding: 3px 10px; font-size: 12px; }
.chip-btn { display: inline-flex; align-items: center; gap: 2px; padding: 6px 10px 6px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 600; border: 0; white-space: nowrap; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: #f0efec; color: var(--ink-2); vertical-align: middle; margin-right: 3px; font-weight: 600; }
.badge-req { background: var(--accent-soft); color: var(--accent); } .badge-en { background: var(--primary-soft); color: var(--primary); }
.badge-ok { background: var(--good-soft); color: var(--good-text); } .badge-warn { background: var(--warn-soft); color: #8a5a00; }
.seg { display: flex; background: #e9eaee; border-radius: 12px; padding: 3px; margin: 8px 0; }
.seg a { flex: 1; text-align: center; padding: 8px 4px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.alert { display: flex; gap: 8px; align-items: flex-start; background: var(--danger-soft); color: #7a1f1f; padding: 10px 12px; border-radius: var(--radius-sm); margin: 8px 0; font-size: 14px; }
.rec-note { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); background: var(--warn-soft); padding: 8px 10px; border-radius: var(--radius-sm); margin: 8px 0; }
.rec-note .ic { margin-top: 3px; color: #8a5a00; }

/* ---------- 头像 / 统计块 ---------- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--primary-soft); flex: none; }
.avatar.xs { width: 22px; height: 22px; font-size: 13px; vertical-align: -5px; }
.avatar.sm { width: 34px; height: 34px; font-size: 18px; }
.avatar.lg { width: 54px; height: 54px; font-size: 30px; }
.avatar.xl { width: 68px; height: 68px; font-size: 38px; }
.hero-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hero-text { flex: 1; min-width: 0; }
.hero-name { font-size: 19px; font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.tile { background: var(--bg); border-radius: 12px; padding: 10px 10px 8px; }
.tile-label { font-size: 12px; color: var(--muted); }
.tile-value { font-size: 22px; font-weight: 700; margin-top: 2px; letter-spacing: -.3px; }
.tile-value .unit { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.tile-attn { background: var(--warn-soft); }

/* ---------- 阅读之树 ---------- */
.tree-card { display: flex; gap: 12px; align-items: center; background: linear-gradient(180deg, #f3fbf6, #fff); }
.tree-wrap { width: 132px; flex: none; }
.tree { width: 100%; height: auto; display: block; }
.tree-info { flex: 1; min-width: 0; }
.tree-stage { font-weight: 700; margin-bottom: 6px; }
.progress { height: 8px; border-radius: 4px; background: #d9efe3; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #1baf7a, #12855b); border-radius: 4px; transition: width .4s; }

/* ---------- 拍照入口 ---------- */
.scan-cta { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(135deg, var(--accent), #d95926); color: #fff; margin: 10px 0; box-shadow: 0 10px 24px -12px rgba(235,104,52,.7); }
.scan-cta div { flex: 1; display: flex; flex-direction: column; } .scan-cta span { font-size: 12.5px; opacity: .9; }

/* ---------- 书架 / 列表 ---------- */
.shelf { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.shelf-item { flex: none; width: 96px; }
.shelf-title { font-size: 13px; font-weight: 600; margin-top: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf-meta { display: flex; align-items: center; gap: 4px; font-size: 11px; margin-top: 3px; }
.recommendations-all { display: grid; gap: 10px; margin-top: 12px; }
.recommendations-all > .section-title { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px; }
.recommendations-all > .section-title h2 { margin: 0; }
.rec-grade-card { margin: 0; }
.rec-grade-card .card-head h3 { display: flex; align-items: center; gap: 6px; }
.rec-note.compact { margin: 0 0 10px; padding: 8px 10px; }
.rec-grade-books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rec-grade-books .shelf-item, body.big .rec-grade-books .shelf-item { width: auto; min-width: 0; }
.rec-grade-books .cover-md, body.big .rec-grade-books .cover-md { width: 100%; }
.rec-empty { grid-column: 1 / -1; margin: 4px 0; }
.review-evidence-grid { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 12px; margin: 10px 0; }
.review-evidence-grid figure { margin: 0; min-width: 0; }
.review-evidence-grid figcaption { color: var(--muted); font-size: 12px; text-align: center; margin-top: 5px; }
.review-evidence-cover { min-height: 180px; display: grid; place-items: center; border: 1px solid var(--hair); border-radius: 12px; background: var(--surface-2, #f5f7fa); }
.review-evidence-image { display: block; width: 100%; max-height: 360px; object-fit: contain; background: var(--surface-2, #f5f7fa); border: 1px solid var(--hair); border-radius: 12px; }
.review-evidence-missing { min-height: 180px; display: grid; place-items: center; padding: 18px; text-align: center; color: var(--muted); background: var(--surface-2, #f5f7fa); border: 1px dashed var(--hair); border-radius: 12px; }
.evidence-facts { display: grid; gap: 7px; margin: 0; }
.evidence-facts > div { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 8px; }
.evidence-facts dt { color: var(--muted); }
.evidence-facts dd { margin: 0; min-width: 0; }
.review-evidence-isbn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
@media(max-width:600px) { .review-evidence-grid { grid-template-columns: 1fr; } .evidence-facts > div { grid-template-columns: 1fr; gap: 2px; } }
.list { padding: 4px 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--hair); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.list .row:last-child { border-bottom: 0; }
.row.on { background: var(--primary-soft); border-radius: 10px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.row-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.rank-no { width: 24px; text-align: center; font-weight: 700; color: var(--muted); flex: none; }
.rank-pts { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.likes { color: var(--accent); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }

/* ---------- 封面 ---------- */
.cover { position: relative; flex: none; border-radius: 5px; background: linear-gradient(160deg, var(--c1), var(--c2)); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 7px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 2px 3px 8px -3px rgba(0,0,0,.35); aspect-ratio: 3 / 4; }
.cover::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6%; background: rgba(255,255,255,.22); }
.cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 15%, rgba(255,255,255,.28), transparent 45%); }
.cover-title { font-weight: 700; line-height: 1.15; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,.25); position: relative; }
.cover-en .cover-title { word-break: normal; }
.cover-author { font-size: .6em; opacity: .85; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.cover-sm { width: 44px; font-size: 9px; padding: 4px 4px 4px 6px; } .cover-sm .cover-author { display: none; } .cover-sm .cover-title { -webkit-line-clamp: 3; }
.cover-md { width: 96px; font-size: 14px; }
.cover-lg { width: 120px; font-size: 17px; padding: 10px 10px 10px 13px; }

/* ---------- 书籍详情 ---------- */
.book-hero { display: flex; gap: 14px; padding: 10px 2px; }
.book-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.book-title { font-size: 20px; line-height: 1.25; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.like-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; margin-top: 4px; }
.like-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.like-btn.on .ic { fill: var(--accent); }
.meta-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 4px; margin: 8px 0; text-align: center; }
.meta-strip div { display: flex; flex-direction: column; } .meta-strip b { font-size: 17px; } .meta-strip span { font-size: 11px; color: var(--muted); }
.meta-strip div + div { border-left: 1px solid var(--hair); }
.summary { color: var(--ink-2); line-height: 1.65; margin: 0; }
.status { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-deep); margin-bottom: 6px; }
.status .ic { margin-top: 2px; flex: none; }
.status.ok { background: var(--good-soft); color: var(--good-text); } .status.warn { background: var(--warn-soft); color: #8a5a00; }
.cform { display: flex; gap: 8px; margin-bottom: 10px; } .cform input { flex: 1; }
.comments li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--hair); align-items: flex-start; }
.c-main { flex: 1; min-width: 0; } .c-text { margin-top: 2px; line-height: 1.5; }
.c-like { border: 0; background: none; color: var(--muted); font-size: 12px; display: inline-flex; gap: 3px; align-items: center; padding: 4px; }

/* ---------- 动态 ---------- */
.feed li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--hair); align-items: flex-start; }
.feed li:first-child { border-top: 0; }
.pts { color: var(--good-text); font-weight: 700; margin-left: 6px; font-size: 13px; }

/* ---------- 搜索 / 表单 ---------- */
.search { position: relative; margin: 6px 0; }
.search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search input { width: 100%; padding: 11px 12px 11px 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label, .form-label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.form-row { display: flex; gap: 8px; } .form-row label { flex: 1; min-width: 0; }
.or { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0; }

/* ---------- 拍照录书 ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; margin: 10px 0; border: 2px dashed #9ec5f4; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-deep); cursor: pointer; text-align: center; }
.drop b { font-size: 17px; }
.sample-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sample { aspect-ratio: 3 / 4; border: 0; border-radius: 6px; background: linear-gradient(160deg, var(--c1), var(--c2)); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 6px; text-align: left; gap: 2px; box-shadow: 2px 3px 8px -3px rgba(0,0,0,.35); }
.sample span { font-weight: 700; font-size: 12px; line-height: 1.2; } .sample small { font-size: 9px; opacity: .85; }
.preview { display: flex; justify-content: center; margin: 10px 0; }
.preview img { max-width: 60%; max-height: 300px; border-radius: 10px; box-shadow: var(--shadow); }
.preview.sm img { max-width: 30%; max-height: 160px; }
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; }
.loading-text { color: var(--ink-2); font-weight: 600; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.spinner.xs { display: inline-block; width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; border-top-color: currentColor; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 答题 ---------- */
.quiz-book { display: flex; gap: 12px; align-items: center; padding: 8px 2px; }
.rules li { padding: 4px 0 4px 18px; position: relative; color: var(--ink-2); }
.rules li::before { content: ''; position: absolute; left: 4px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.quiz-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px; }
.dots { display: flex; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #d8d9de; }
.dot.cur { background: var(--primary); transform: scale(1.25); } .dot.ok { background: var(--good); } .dot.bad { background: var(--danger); }
.q-card { padding: 18px 16px; }
.q-text { font-size: 18px; font-weight: 700; line-height: 1.45; margin-bottom: 12px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; margin: 8px 0; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-size: 15.5px; line-height: 1.4; transition: transform .08s; }
.opt:not(:disabled):hover { border-color: #9ec5f4; background: #f6faff; }
.opt:not(:disabled):active { transform: scale(.985); }
.opt-letter { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.opt.correct { border-color: var(--good); background: var(--good-soft); } .opt.correct .opt-letter { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--danger); background: var(--danger-soft); } .opt.wrong .opt-letter { background: var(--danger); color: #fff; }
.opt.dim { opacity: .5; }
.explain { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); background: var(--bg); padding: 8px 10px; border-radius: 8px; display: flex; gap: 6px; align-items: flex-start; }
.result { text-align: center; padding: 22px 16px; }
.result h2 { font-size: 24px; margin: 12px 0 4px; }
.ring { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: #e9eaee; stroke-width: 11; }
.ring circle.val { stroke: var(--primary); stroke-linecap: round; transition: stroke-dasharray .8s ease; }
.result.pass .ring circle.val { stroke: var(--good); } .result.fail .ring circle.val { stroke: var(--accent); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text b { font-size: 30px; line-height: 1; } .ring-text span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.result-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; } .result-actions .btn { flex: 1; }
.review li { padding: 10px 0 10px 26px; border-top: 1px solid var(--hair); position: relative; line-height: 1.5; }
.review li::before { content: '✓'; position: absolute; left: 2px; top: 10px; font-weight: 700; color: var(--good); }
.review li.bad::before { content: '✗'; color: var(--danger); }

/* ---------- 榜单 ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; margin: 14px 0 6px; }
.podium-item { background: var(--surface); border-radius: var(--radius); padding: 14px 8px 12px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.podium-item.r1 { padding-top: 18px; background: linear-gradient(180deg, #fff8e1, #fff); }
.podium-item.r2 { background: linear-gradient(180deg, #f3f4f6, #fff); } .podium-item.r3 { background: linear-gradient(180deg, #fdf0e8, #fff); }
.podium-item.empty { visibility: hidden; }
.p-rank { font-size: 20px; margin-top: -8px; } .p-pts { font-size: 20px; font-weight: 700; color: var(--primary-deep); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--hair); }
.rank-row:last-child { border-bottom: 0; }
.rank-row.me { background: var(--primary-soft); border-radius: 10px; }
.bar { height: 8px; border-radius: 4px; background: var(--primary-soft); margin-top: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
.my-rank { text-align: center; padding: 12px; } .my-rank b { color: var(--primary); font-size: 18px; } .my-rank a { color: var(--primary); text-decoration: underline; }

/* ---------- 我的 ---------- */
.badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; padding: 8px 4px; border-radius: 12px; background: var(--bg); }
.badge-item span { font-size: 26px; } .badge-item small { font-size: 11px; color: var(--ink-2); text-align: center; }
.menu { padding: 4px 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 8px; border: 0; border-bottom: 1px solid var(--hair); background: none; text-align: left; font-size: 15px; }
.menu-item:last-child { border-bottom: 0; } .menu-item span { flex: 1; } .menu-item .ic { color: var(--ink-2); }

/* ---------- Toast / Modal ---------- */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); background: rgba(11,11,11,.88); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 100; opacity: 0; transition: .25s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.err { background: var(--danger); }
.modal-wrap { position: fixed; inset: 0; background: rgba(11,11,11,.4); z-index: 90; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.modal-wrap.show { opacity: 1; }
.modal { background: var(--surface); width: 100%; max-width: 480px; max-height: 88vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; transform: translateY(20px); transition: transform .2s; }
.modal-wrap.show .modal { transform: none; }
.modal-wide { max-width: 720px; }
@media (min-width: 560px) { .modal-wrap { align-items: center; } .modal { border-radius: 20px; max-height: 84vh; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 8px 18px; } .modal-head h3 { font-size: 16px; }
.modal-body { padding: 4px 16px 16px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; padding: 10px 16px 16px; border-top: 1px solid var(--hair); } .modal-foot .btn { flex: 1; }
.login { text-align: center; padding: 28px 18px; margin-top: 30px; }
.login-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 10px; }
.login .list { text-align: left; margin: 14px 0; }

/* ---------- 老师端 ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 56px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .bar { margin: 0; height: 12px; border-radius: 6px; } .bar-row .bar-fill { border-radius: 0 6px 6px 0; }
.bar-label { color: var(--ink-2); white-space: nowrap; } .bar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; background: var(--bg); font-size: 12px; color: var(--ink-2); text-align: center; position: relative; }
.quick a .ic { color: var(--primary); }
.dot-n { position: absolute; top: 6px; right: 8px; background: var(--danger); color: #fff; font-style: normal; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
.month-nav { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 0 2px; font-size: 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px 6px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.tbl tr[data-s] { cursor: pointer; } .tbl tr[data-s]:hover td { background: var(--primary-soft); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.table-wrap .tbl { min-width: 640px; }
.review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.review-toolbar > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.review-check { width: 20px; height: 20px; flex: none; accent-color: var(--primary); }
.setup-list { display: flex; flex-direction: column; gap: 2px; }
.setup-item { display: flex; align-items: center; gap: 9px; padding: 9px 4px; border-bottom: 1px solid var(--hair); }
.setup-item:last-child { border-bottom: 0; }
.setup-mark { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--line); color: var(--muted); font-weight: 700; flex: none; }
.setup-item.done .setup-mark { background: var(--good-soft); color: var(--good-text); }
.setup-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setup-main b { font-size: 14px; }
.setup-main .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-filters { margin-bottom: 6px; }
.q-edit { padding: 12px; }
.q-edit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .q-edit-head b { flex: 1; } .q-edit-head select { width: auto; padding: 5px 8px; font-size: 13px; }
.qtext { margin-bottom: 6px; }
.opt-edit { display: flex; align-items: center; gap: 8px; margin: 6px 0; } .opt-edit input[type=radio] { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--good); }
.opt-edit .opt-letter { width: 24px; height: 24px; font-size: 12px; }
.qexp { margin-top: 6px; font-size: 13.5px; }
.sticky-foot { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); }
.hint { background: var(--bg); padding: 10px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; font-family: var(--font); color: var(--ink-2); }
.poster { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); display: block; }

/* ---------- 未接入 AI 的全局提醒 ---------- */
.ai-banner { display: flex; align-items: center; gap: 10px; margin: 6px 14px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: #5c3d00; font-size: 13px; line-height: 1.4; border: 1px solid #f5d98a; }
.ai-banner[hidden] { display: none; }
.ai-banner > .ic { flex: none; color: #8a5a00; }
.ai-banner > div { flex: 1; min-width: 0; }
.ai-banner .btn { flex: none; }
.sync-banner { background: #fdecec; color: #7a1f1f; border-color: #f3b8b8; }
.sync-banner > .ic { color: #b23b3b; }

/* 真实封面测试图 */
.sample-row.real { grid-template-columns: repeat(5, 1fr); }
.sample.real { padding: 0; background: #e9eaee; overflow: hidden; }
.sample.real img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 视觉升级：渐变头部卡 ---------- */
.card.hero { background: linear-gradient(135deg, #2f80e0 0%, #1c5cab 100%); color: #fff; position: relative; overflow: hidden; }
.card.hero::before { content: ''; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.card.hero::after { content: ''; position: absolute; left: -30px; bottom: -80px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.06); }
.card.hero > * { position: relative; }
.card.hero .muted { color: rgba(255,255,255,.78); }
.card.hero .avatar { background: rgba(255,255,255,.22); box-shadow: 0 0 0 3px rgba(255,255,255,.28); }
.card.hero .chip-btn { background: rgba(255,255,255,.2); color: #fff; }
.card.hero .tile { background: rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.card.hero .tile-label, .card.hero .tile-value .unit { color: rgba(255,255,255,.78); }
.card.hero .tile-attn { background: rgba(250,178,25,.35); }
/* 真实封面图：加载成功前保留文字封面，失败时自动降级，不闪空白 */
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; opacity: 0; transition: opacity .16s ease; }
.cover.has-img img { opacity: 1; }
.cover.has-img .cover-title, .cover.has-img .cover-author { display: none; }
.cover.has-img::after { background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.05)); z-index: 2; }
.book-hero .cover.has-img img { object-fit: contain; background: #f3f4f6; }
/* 加载块 */
.loading-sub { margin-top: -4px; } .loading-tip { min-height: 18px; transition: opacity .3s; }
.loading .btn { margin-top: 4px; }
/* 彩带 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -20px; border-radius: 2px; opacity: .95; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(110vh) rotate(720deg); opacity: .6; } }
/* 首页推荐书架 */
.shelf-item .cover { transition: transform .15s; } .shelf-item:active .cover { transform: scale(.97); }

/* 老师端题目编辑：底部操作栏更紧凑 */
.sticky-foot { padding: 10px 12px; margin-bottom: 0; box-shadow: 0 -8px 24px -16px rgba(11,11,11,.35), var(--shadow); }
.sticky-foot .btn-block { margin-top: 0; }
.sticky-foot .btn-row { margin-top: 8px; }
.sticky-foot .btn-row .btn { padding: 8px 12px; font-size: 13.5px; }
#qs { padding-bottom: 8px; }

/* 推荐书目行：操作放在信息下方一行 */
.rec-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rec-actions .chip { display: inline-flex; align-items: center; gap: 3px; }
.chip.danger { color: var(--danger); border-color: #f1c4c4; }
.rec-row { align-items: flex-start; } .rec-row .cover { margin-top: 2px; }

/* ---------- 警告框变体 / 键盘焦点 ---------- */
.alert.warn { background: var(--warn-soft); color: #6b4700; }
.alert.ok { background: var(--good-soft); color: var(--good-text); }
.alert > div { flex: 1; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* ---------- 深色模式（跟随系统） ---------- */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --bg: #141416; --surface: #1e1f23; --ink: #f2f1ee; --ink-2: #c9c7c1; --muted: #8f8d87; --line: #33343a; --hair: rgba(255,255,255,.08);
    --primary-soft: #1d3350; --accent-soft: #3b2418; --good-soft: #17301a; --good-text: #7ed58a; --warn-soft: #3a2f14; --danger-soft: #3a1b1b; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -14px rgba(0,0,0,.6); }
  body { background: #0e0e10; }
  @media (min-width: 560px) { body { background: #0a0a0c; } }
  #topbar { background: rgba(20,20,22,.88); }
  .seg { background: #2a2b30; } .seg a.on { background: #3a3b41; color: var(--ink); }
  .badge { background: #2c2d32; color: var(--ink-2); } .badge-warn { color: #f2c66d; } .badge-ok { color: #7ed58a; } .badge-req { color: #ff9b6e; } .badge-en { color: #8fbaf0; }
  .rec-note { color: #e6cf8f; } .rec-note .ic { color: #e6cf8f; }
  .status { color: #8fbaf0; } .status.ok { color: #7ed58a; } .status.warn { color: #f2c66d; }
  .alert { color: #ff9c9c; } .alert.warn { color: #f2c66d; } .alert.ok { color: #92d6aa; }
  .tile { background: #26272c; } .hero .tile { background: rgba(255,255,255,.12); }
  .tree-card { background: linear-gradient(180deg, #16241c, var(--surface)); } .progress { background: #23352b; }
  .drop { background: #1d2a3a; border-color: #35557a; color: #9ec5f4; }
  .opt { background: var(--surface); } .opt-letter { background: #2c2d32; } .opt.correct { background: #17301a; } .opt.wrong { background: #3a1b1b; }
  .explain, .hint, .quick a, .badge-item, .menu { background: #26272c; }
  .podium-item.r1 { background: linear-gradient(180deg, #33290f, var(--surface)); } .podium-item.r2 { background: linear-gradient(180deg, #26272c, var(--surface)); } .podium-item.r3 { background: linear-gradient(180deg, #33200f, var(--surface)); }
  .ring circle { stroke: #2c2d32; }
  .modal-wrap { background: rgba(0,0,0,.6); }
  .toast { background: #f2f1ee; color: #0b0b0b; } .toast.err { background: var(--danger); color: #fff; }
  .ai-banner { background: #3a2f14; color: #f2c66d; }
  .sync-banner { background: #3a1d1d; color: #f2a0a0; border-color: #6b2f2f; }
  .sample.real { background: #26272c; }
  .search input, input, select, textarea { background: #26272c; color: var(--ink); border-color: #3a3b41; }
  .tbl th { color: var(--muted); }
  .my-rank b, .my-rank a { color: #8fbaf0; }
  .p-pts { color: #8fbaf0; }
  .link { color: #8fbaf0; }
}

.big-emoji { font-size: 56px; line-height: 1; margin-bottom: 6px; }
.sem-goal { margin-top: 10px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.14); }

/* ---------- 大字模式（低年级） ---------- */
body.big { font-size: 17px; }
body.big .row-title { font-size: 17px; } body.big .small { font-size: 14px; } body.big .q-text { font-size: 21px; }
body.big .opt { font-size: 18px; padding: 16px 14px; } body.big .btn { font-size: 17px; padding: 13px 20px; } body.big .chip { font-size: 15px; padding: 8px 15px; }
body.big .tile-value { font-size: 26px; } body.big .tab { font-size: 12px; } body.big .shelf-item { width: 112px; } body.big .cover-md { width: 112px; }

.addme { margin-top: 12px; text-align: left; } .addme summary { cursor: pointer; text-align: center; padding: 6px; } .addme form { margin-top: 8px; }

.qr-row { display: flex; gap: 14px; flex-wrap: wrap; }
.qr-item { display: flex; flex-direction: column; align-items: center; gap: 6px; } .qr-item img { border-radius: 10px; background: #fff; padding: 4px; }
.qr-url { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------- 读后评分 ---------- */
.rating-line { margin-top: 6px; font-size: 13px; }
.stars { color: #eda100; letter-spacing: 1px; }
.rate-row { display: flex; align-items: center; gap: 2px; margin-top: 4px; flex-wrap: wrap; }
.rate-row .muted { margin-right: 6px; }
.star { background: none; border: 0; font-size: 26px; line-height: 1; color: #d8d9de; padding: 2px; cursor: pointer; transition: transform .08s; }
.star.on { color: #eda100; } .star:active { transform: scale(1.2); }
@media (prefers-color-scheme: dark) { .star { color: #3a3b41; } .star.on { color: #eda100; } }

.rate-row { margin: 8px 0 4px; } .star { font-size: 24px; }
/* ---------- 老设备兜底：不支持 aspect-ratio / inset 时也能正常显示 ---------- */
.cover-sm { min-height: 58px; } .cover-md { min-height: 128px; } .cover-lg { min-height: 160px; } .sample { min-height: 96px; }
@supports (aspect-ratio: 1) { .cover-sm, .cover-md, .cover-lg, .sample { min-height: 0; } }
.cover::after, .ring-text, .modal-wrap, .cover.has-img img, .confetti { top: 0; left: 0; right: 0; bottom: 0; }
/* 有序步骤列表显示数字 */
ol.rules { counter-reset: step; }
ol.rules li { padding-left: 24px; }
ol.rules li::before { counter-increment: step; content: counter(step); width: 16px; height: 16px; top: 6px; left: 0; border-radius: 50%; font-size: 10px; color: #fff; text-align: center; line-height: 16px; background: var(--primary); }

/* 本周阅读之星 */
.star-card { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #fff8e1, #fff); }
.star-badge { font-size: 26px; }
@media (prefers-color-scheme: dark) { .star-card { background: linear-gradient(135deg, #33290f, var(--surface)); } }

/* 老师查看作答明细 */
.rec-details summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.rec-details summary::-webkit-details-marker { display: none; } .rec-details summary .row { flex: 1; border-bottom: 0; }
.rec-details .review { margin: 0 8px 10px 60px; }
/* 书架小卡片：徽章更紧凑，避免"必读 / EN / 赞"折成三行 */
.shelf-item .badge { padding: 0 5px; font-size: 10px; margin-right: 2px; }
.shelf-meta { gap: 3px; flex-wrap: wrap; row-gap: 2px; }

/* iPhone Safari：输入框字号小于 16px 时点进去会自动放大页面，手机上统一 16px */
@media (max-width: 480px) { input, select, textarea, .search input, .q-edit-head select, .qexp { font-size: 16px; } }
@media (max-width: 600px) {
  .icon-btn { width: 44px; height: 44px; }
  .btn-sm, .chip { min-height: 44px; }
  .chip.sm { min-height: 40px; }
}
@media (max-width: 360px) { .rec-grade-books { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .confetti { display: none !important; }
}
/* 长提示不用胶囊形，改圆角矩形、左对齐，多行也好读 */
.toast.long { border-radius: 14px; text-align: left; line-height: 1.45; padding: 12px 16px; }
.tile-sub { display: block; font-size: 11px; color: #8a5a00; margin-top: 3px; text-decoration: underline; text-underline-offset: 2px; } .card.hero .tile-sub { color: #ffe9a8; } /* 蓝色概览卡上用浅黄 */
/* 按钮文字不在按钮内部折行：一行放不下时整个按钮换到下一行（.btn-row 已是 flex-wrap） */
.btn-row .btn, .btn-sm, .chip { white-space: nowrap; }
.c-like.on { color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 8px; } .c-like.on .ic { fill: var(--accent); }
.qtype.needs-choice { border-color: #d28a00; background: var(--warn-soft); color: #7a5200; font-weight: 700; }
.import-issues { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }

/* 320–420px 老师端：表单和多按钮操作区纵向排布，避免大字 / 长文案溢出。 */
@media (max-width: 420px) {
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row > label, .form-row > input, .form-row > select, .form-row > .btn { width: 100%; min-width: 0; }
  .row.static { flex-wrap: wrap; align-items: flex-start; }
  .row-actions { flex: 1 0 100%; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; align-items: stretch; }
  .row-actions > .btn, .row-actions > a.btn, .row-actions > button { width: 100%; min-width: 0; white-space: normal; line-height: 1.3; }
  .result-actions, .modal-foot, .sticky-foot .btn-row { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .result-actions .btn, .modal-foot .btn, .sticky-foot .btn-row .btn { width: 100%; flex: none; min-width: 0; white-space: normal; line-height: 1.35; }
  .modal-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .btn-sm { white-space: normal; }
}

/* ---------- 正式学生验证码登录 ---------- */
.student-code-form { padding-top: 2px; }
.student-code-input { font: 700 28px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .42em; text-align: center; padding-left: calc(12px + .42em); }
.form-error { min-height: 20px; color: var(--danger); font-size: 13px; line-height: 1.45; }
#student-auth-note:not(:empty) { margin: 10px 4px 2px; padding: 8px 10px; border-radius: 10px; background: var(--primary-soft); color: var(--ink-2); }
.comment-locked { display: flex; align-items: center; gap: 7px; padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--primary-soft); color: var(--ink-2); font-size: 13px; }
.meta-strip .meta-estimated b { font-size: 15px; }
.meta-strip .meta-estimated span { max-width: 92px; line-height: 1.25; }

/* ---------- 老师端学生登录码 / 只读 AI 状态 ---------- */
.loading.compact { flex-direction: row; justify-content: center; padding: 16px 8px; }
.access-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.access-summary > div { display: flex; flex-direction: column; gap: 2px; }
.access-student-list { margin-top: 10px; max-height: 390px; overflow: auto; border-top: 1px solid var(--hair); }
.access-student-list .row-actions { flex-wrap: wrap; justify-content: flex-end; }
.access-code-once { max-height: 48vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; }
.access-code-once code { font-size: 20px; letter-spacing: .18em; color: var(--primary); font-weight: 700; white-space: nowrap; }
.source-note { display: inline-flex; align-items: center; width: fit-content; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 600; }
.source-note.warn { background: var(--warn-soft); color: #8a5a00; }
.server-ai-settings { display: flex; flex-direction: column; gap: 10px; }
.ai-server-status { display: flex; gap: 8px; padding: 12px; border-radius: 12px; background: var(--primary-soft); color: var(--ink-2); }
.ai-server-status.ok { background: var(--good-soft); color: var(--good-text); }
.ai-server-status.warn { background: var(--warn-soft); color: #7a5200; }

@media (max-width: 480px) {
  .access-summary { align-items: flex-start; }
  .access-student-list .row { align-items: flex-start; }
  .access-student-list .row-actions { flex-direction: column; align-items: stretch; }
  .access-student-list .row-actions .btn { width: 100%; }
  .access-code-once .row { gap: 8px; }
  .access-code-once code { font-size: 18px; }
}

@media (prefers-color-scheme: dark) {
  .source-note.warn, .ai-server-status.warn { color: #f2c66d; }
}

/* ---------- 双图录书：封面 + 可选版权页，合并后仍只识别一次 ---------- */
.scan-capture-card > p { line-height: 1.55; }
.scan-photo-list { display: grid; gap: 10px; margin: 12px 0; }
.scan-photo-card { position: relative; display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.scan-photo-card img { width: 82px; height: 82px; object-fit: contain; border-radius: 9px; background: #f4f6f8; }
.scan-photo-number { position: absolute; top: 5px; left: 5px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 1px 4px #0003; }
.scan-photo-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.scan-photo-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.scan-photo-actions { display: flex; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.scan-photo-actions .danger { color: var(--danger); }
.scan-add-second { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 13px; border: 1.5px dashed #84b4ee; border-radius: 13px; color: var(--primary); background: var(--primary-soft); cursor: pointer; }
.scan-add-second > span { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.scan-add-second small { color: var(--muted); }
.scan-ready-actions { margin-top: 12px; }
.scan-ready-actions .btn { flex: 1 1 190px; text-align: center; justify-content: center; }
.scan-limit-note { margin: 9px 2px 0; }

@media (max-width: 480px) {
  .scan-photo-card { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
  .scan-photo-card img { width: 72px; height: 82px; grid-row: 1; }
  .scan-photo-actions { grid-column: 1 / -1; justify-content: stretch; }
  .scan-photo-actions .chip { flex: 1 1 auto; text-align: center; }
  .scan-ready-actions { flex-direction: column; }
  .scan-ready-actions .btn { width: 100%; flex-basis: auto; }
}

@media (prefers-color-scheme: dark) {
  .scan-photo-card img { background: #111820; }
}

/* ---------- 一二年级：少文字、大触控、一次一个主动作 ---------- */
.student-age-view.is-early-reader { font-size: 17px; }
.student-age-view.is-early-reader h2 { font-size: 21px; line-height: 1.3; }
.student-age-view.is-early-reader h3 { font-size: 17px; line-height: 1.35; }
.student-age-view.is-early-reader .btn { min-height: 54px; padding: 14px 18px; border-radius: 16px; font-size: 17px; font-weight: 750; }
.student-age-view.is-early-reader .chip { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 15px; font-size: 15px; }
.student-age-view.is-early-reader .link { min-height: 40px; align-items: center; padding: 7px 2px; font-size: 15px; font-weight: 700; }
.student-age-view.is-early-reader .muted.small { font-size: 14px; line-height: 1.5; }
.student-age-view.is-early-reader .card { padding: 16px; border-radius: 18px; }

.login.is-early-reader { padding-top: 24px; }
.login.is-early-reader .login-icon { transform: scale(1.18); margin-bottom: 8px; }
.login.is-early-reader > p { font-size: 17px; line-height: 1.55; }
.login.is-early-reader .chips { margin: 14px 0; }
.login.is-early-reader .list .row { min-height: 62px; padding: 11px 8px; border-radius: 13px; }
.login.is-early-reader .list .row + .row { margin-top: 4px; }
.login.is-early-reader .row-title { font-size: 18px; }
.login.is-early-reader .avatar.sm { width: 42px; height: 42px; font-size: 23px; }
.login.is-early-reader .teacher-entry { margin-top: 20px !important; }
.student-code-early { gap: 14px; font-size: 17px; }
.student-code-early .btn { min-height: 56px; font-size: 18px; }

.is-early-reader .early-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.is-early-reader .early-tiles .tile { min-height: 82px; display: flex; flex-direction: column; justify-content: center; padding: 11px 13px; }
.is-early-reader .early-tiles .tile-label { font-size: 14px; }
.is-early-reader .early-tiles .tile-value { font-size: 29px; }
.is-early-reader .early-tiles .tile-sub { font-size: 12px; text-decoration: none; }
.is-early-reader .hero .chip-btn { min-height: 42px; padding: 9px 13px; font-size: 14px; }
.is-early-reader .sem-goal { font-size: 15px; line-height: 1.45; padding: 11px 12px; }
.is-early-reader .early-assignment-card .row { min-height: 70px; padding: 10px 4px; }
.is-early-reader .tree-card { align-items: center; }
.is-early-reader .tree-wrap { width: 112px; }
.is-early-reader .tree-stage { font-size: 17px; }
.is-early-reader .tree-info > .muted { font-size: 15px; line-height: 1.5; }
.is-early-reader .scan-cta { min-height: 86px; gap: 14px; padding: 17px; border-radius: 18px; }
.is-early-reader .scan-cta b { font-size: 20px; line-height: 1.25; }
.is-early-reader .scan-cta span { margin-top: 3px; font-size: 15px; line-height: 1.35; }
.is-early-reader .recommendations-all { gap: 12px; }
.is-early-reader .recommendations-all > .section-title { align-items: center; }
.is-early-reader .rec-grade-card .card-head { margin-bottom: 9px; }
.is-early-reader .rec-grade-books { gap: 9px; }
.is-early-reader .rec-grade-books .shelf-title { font-size: 14px; }
.is-early-reader .rec-grade-books .shelf-meta .muted { display: none; }
.is-early-reader .rec-note.compact { font-size: 14px; line-height: 1.5; }
.is-early-reader .early-community .feed li { min-height: 54px; align-items: center; font-size: 15px; }

.is-early-reader .scan-capture-card > p { font-size: 17px; line-height: 1.6; }
.is-early-reader .drop { min-height: 190px; justify-content: center; gap: 9px; padding: 30px 18px; border-width: 3px; border-radius: 20px; }
.is-early-reader .drop b { font-size: 21px; }
.is-early-reader .drop .small { font-size: 15px; }
.is-early-reader .scan-add-second { min-height: 68px; padding: 14px; border-radius: 16px; }
.is-early-reader .scan-add-second b { font-size: 16px; }
.is-early-reader .scan-add-second small { margin-top: 3px; font-size: 14px; }
.is-early-reader .scan-photo-card { border-radius: 16px; }
.is-early-reader .scan-photo-copy b { font-size: 15px; line-height: 1.35; }
.is-early-reader .scan-photo-actions .chip { min-height: 44px; }
.is-early-reader .scan-ready-actions { flex-direction: column; align-items: stretch; }
.is-early-reader .scan-ready-actions .btn { width: 100%; flex-basis: auto; }
.is-early-reader .scan-help-card { margin-top: 16px; }
.is-early-reader .early-confirm-card { text-align: center; }
.is-early-reader .early-confirm-card .big-emoji { margin-top: 2px; }
.is-early-reader .early-book-form { margin-top: 16px; text-align: left; gap: 14px; }
.is-early-reader .early-book-form label { font-size: 16px; }
.is-early-reader .early-book-form input { min-height: 52px; font-size: 17px; }

.is-early-reader .early-quiz-book { padding: 12px 4px; }
.is-early-reader .early-quiz-book b { font-size: 18px; line-height: 1.35; }
.is-early-reader .early-challenge-intro { text-align: center; padding: 20px 17px; }
.is-early-reader .early-challenge-intro h2 { font-size: 24px; }
.is-early-reader .early-challenge-steps { display: grid; gap: 9px; margin: 16px 0; text-align: left; }
.is-early-reader .early-challenge-steps li { min-height: 50px; display: flex; align-items: center; gap: 5px; padding: 11px 14px; border-radius: 14px; background: var(--primary-soft); color: var(--ink-2); font-size: 17px; }
.is-early-reader .early-challenge-steps li::before { content: '⭐'; margin-right: 4px; font-size: 18px; }
.is-early-reader .early-challenge-intro #start { min-height: 60px; font-size: 20px; }
.is-early-reader .q-text { font-size: 21px; line-height: 1.5; }
.is-early-reader .opt { min-height: 58px; padding: 15px 14px; font-size: 17px; }
.is-early-reader .opt-letter { width: 34px; height: 34px; font-size: 15px; }

@media (max-width: 360px) {
  .is-early-reader .tree-card { align-items: flex-start; }
  .is-early-reader .tree-wrap { width: 94px; }
  .is-early-reader .rec-grade-books { gap: 7px; }
  .is-early-reader .rec-grade-card { padding-left: 12px; padding-right: 12px; }
}

/* ---------- 待核对书版本选择 ---------- */
.version-review { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--primary-soft); }
.version-review p { margin: 6px 0 10px; line-height: 1.55; }

/* ---------- 个人书架：借鉴成熟阅读产品的信息结构，保留 SASU 自有视觉 ---------- */
.shelf-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.shelf-summary > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shelf-summary .big-emoji { margin: 0; font-size: 42px; }
.shelf-summary h2, .shelf-summary p { margin: 0; }
.shelf-summary p { margin-top: 4px; }
.shelf-filters { margin: 2px 0 12px; }
.shelf-filters .chip { display: inline-flex; align-items: center; gap: 5px; }
.shelf-filters .chip span { min-width: 18px; padding: 1px 5px; border-radius: 999px; background: rgba(0,0,0,.06); font-size: 11px; text-align: center; }
.shelf-filters .chip.on span { background: rgba(255,255,255,.22); }
.shelf-list { padding: 4px 14px; }
.shelf-book { padding: 12px 0; border-bottom: 1px solid var(--hair); }
.shelf-book:last-child { border-bottom: 0; }
.shelf-book-main { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.shelf-state { flex: none; font-size: 23px; }
.shelf-progress { height: 6px; margin: 7px 0 5px; overflow: hidden; border-radius: 999px; background: var(--line); }
.shelf-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.shelf-actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; margin: 9px 0 0 69px; }
.shelf-actions .danger { color: var(--danger); }
.book-shelf-control .card-head { margin-bottom: 9px; }
.shelf-detail-status { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); }
.shelf-detail-emoji { flex: none; font-size: 26px; }
.shelf-detail-actions { margin-top: 10px; }
@media (max-width: 480px) {
  .shelf-summary { align-items: stretch; flex-direction: column; }
  .shelf-summary > .btn { width: 100%; }
  .shelf-actions { justify-content: stretch; margin-left: 0; }
  .shelf-actions .chip { flex: 1 1 auto; }
  .shelf-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shelf-detail-actions .btn { width: 100%; white-space: normal; }
}
@media (prefers-color-scheme: dark) {
  .shelf-filters .chip span { background: rgba(255,255,255,.1); }
}

/* ---------- 题目反馈与校内消息 ---------- */
.question-report-btn { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; }
.question-report-state { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.report-question-preview { padding: 10px 12px; border-radius: 11px; background: var(--primary-soft); color: var(--ink-2); line-height: 1.5; }
.message-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.message-summary > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.message-summary .big-emoji { margin: 0; font-size: 40px; }
.message-summary h2, .message-summary p { margin: 0; }
.message-summary p { margin-top: 4px; }
.message-list { padding-bottom: 4px; }
.message-item { display: flex; gap: 11px; padding: 13px 2px; border-bottom: 1px solid var(--hair); }
.message-item:last-child { border-bottom: 0; }
.message-item.unread { margin: 0 -8px; padding-left: 10px; padding-right: 10px; border-radius: 12px; background: var(--primary-soft); }
.message-icon { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); font-size: 20px; }
.message-item p { margin: 4px 0 5px; line-height: 1.5; }
.unread-dot { display: inline-block; width: 8px; height: 8px; margin-left: 7px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.link-btn.danger { color: var(--danger); }
@media (max-width: 480px) { .message-summary { align-items: stretch; flex-direction: column; } .message-summary > .btn { width: 100%; } }
.chips .chip span { margin-left: 3px; }
.report-list { display: grid; gap: 12px; margin-top: 12px; }
.teacher-report { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.teacher-report.open { border-color: #e1ad38; box-shadow: 0 0 0 2px var(--warn-soft) inset; }
.teacher-report-head { display: flex; align-items: center; gap: 9px; }
.teacher-report-book { display: inline-flex; align-items: center; gap: 4px; margin: 10px 0 8px; color: var(--primary); text-decoration: none; }
.teacher-report p { line-height: 1.5; }
/* 阅读报告沿用 SASU 卡片、色彩和字号。 */
.insights-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: end; }
.insights-table-wrap { overflow-x: auto; }
.insights-table { width: 100%; border-collapse: collapse; text-align: right; }
.insights-table th, .insights-table td { padding: 12px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.insights-table th:first-child { text-align: left; white-space: nowrap; }
