/* =========================================================================
 * 初中物理教师工作台 · 样式（冰淇淋配色 / 护眼 / 深色模式 / 双端响应式）
 * ========================================================================= */
:root {
  --bg: #FBF8F2; --surface: #FFFFFF; --surface-2: #F3EEE6; --surface-3: #EDE6DA;
  --text: #3A3A44; --muted: #8A8694; --border: #ECE6DC;
  --primary: #9C8AC4; --primary-d: #8270AC; --peach: #F4A48B; --lav: #B7A6E0; --sky: #8FC7E8;
  --danger: #E57373; --warn: #E0A458; --ok: #9C8AC4;
  --shadow: 0 6px 24px rgba(120,110,90,.10); --radius: 14px;
  --chip: #F0E9DE;
}
[data-theme="dark"] {
  --bg: #1E1E28; --surface: #262633; --surface-2: #2E2E3D; --surface-3: #34343F;
  --text: #E8E6F0; --muted: #9A97A8; --border: #383845;
  --primary: #B5A3DF; --primary-d: #9C8AC4; --peach: #EBA98F; --lav: #B9A8E6; --sky: #93CDEE;
  --danger: #E57373; --warn: #E0A458; --ok: #B5A3DF;
  --shadow: 0 6px 24px rgba(0,0,0,.35); --chip: #33333f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
/* v58：应用内容始终位于背景层之上（背景层 z-index:0） */
#app { position: relative; z-index: 1; }

/* 未同步警告条 */
.warn-banner { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #FFF3E0; color: #9A5B00; font-size: 13px; line-height: 1.5; border-bottom: 1px solid #FFD9A0; }
[data-theme="dark"] .warn-banner { background: #3A2E1E; color: #F0C089; border-bottom-color: #5A4528; }
.warn-banner .b-ic { flex: 0 0 auto; }
.warn-banner.hidden, .warn-banner.banner-hidden { display: none; }
body {
  font-family: "PingFang SC","Microsoft YaHei",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }

/* —— 布局 —— */
.layout { display: flex; height: 100vh; height: 100dvh; }
.sidebar {
  width: 224px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; flex-shrink: 0;
  transition: width .18s ease, padding .18s ease;
}
/* 折叠态：只显示图标，悬停 title 提示文字 */
.sidebar.collapsed { width: 64px; padding: 14px 8px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
.sidebar.collapsed .nav-label, .sidebar.collapsed .nav-badge { display: none; }
.nav-flex { flex: 1; }
.sidebar-toggle {
  border: none; background: var(--surface-2); color: var(--muted); cursor: pointer;
  height: 34px; border-radius: 10px; font-size: 16px; font-weight: 800; transition: .15s;
}
.sidebar-toggle:hover { background: var(--surface-3); color: var(--text); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; transition: .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(156,138,196,.35); }
/* v74：自定义导航标签入口按钮（侧边栏底部） */
.nav-label-edit { width: calc(100% - 0px); border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; }
.nav-label-edit:hover { background: var(--surface-2); color: var(--text); }
/* v74：自定义标签弹窗行 */
.nl-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.nl-def { width: 78px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-row .inp { flex: 1; }
/* v75：标签顺序调整按钮 */
.nl-ord-btns { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; width: 24px; align-items: center; }
.nl-ord { width: 22px; height: 18px; line-height: 16px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--text); font-size: 11px; cursor: pointer; }
.nl-ord:hover:not(:disabled) { background: var(--primary); color: #fff; border-color: var(--primary); }
.nl-ord:disabled { opacity: .3; cursor: default; }
.nl-ord-none { color: var(--muted); font-size: 11px; opacity: .5; }
.nav-ic { display: inline-flex; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }
.nav-badge { background: var(--danger); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 6px; margin-left: auto; }
.layout-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg,var(--primary),var(--sky)); color:#fff; display:inline-flex; align-items:center; justify-content:center; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; border: none; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.warn { color: var(--warn); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 20px; background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--lav); color:#fff; display:inline-flex; align-items:center; justify-content:center; }
.main { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.view { max-width: 1180px; margin: 0 auto; }
.module { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* —— 通用组件 —— */
.btn { border: none; border-radius: 11px; padding: 9px 16px; font-weight: 700; font-size: 14px; cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(156,138,196,.3); }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; margin-top: 10px; padding: 12px; }
.inp { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: .15s; }
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(156,138,196,.15); }
textarea.inp { resize: vertical; }
.search-inline { max-width: 280px; }
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.sec-title { font-weight: 800; font-size: 15px; margin: 18px 0 10px; color: var(--text); }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; }
.empty { padding: 30px; text-align: center; }
.chip { display: inline-block; background: var(--chip); color: var(--muted); border-radius: 8px; padding: 1px 8px; font-size: 12px; margin: 2px 4px 2px 0; }
.badge { background: var(--surface-2); color: var(--primary-d); border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
.badge-blue { background: rgba(143,199,232,.25); color: var(--sky); }
.badge-green { background: rgba(156,138,196,.25); color: var(--primary-d); }
.arrow { display: inline-flex; color: var(--muted); transform: rotate(180deg); }
.mono { font-family: "JetBrains Mono",Consolas,monospace; }

/* 子标签 */
.subtabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.subtab { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 8px 16px; border-radius: 11px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.subtab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.subtab .ic { display: inline-flex; }

/* 列表/卡片 */
.list-items { display: flex; flex-direction: column; gap: 10px; }
.list-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; cursor: pointer; transition: .15s; }
.list-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.list-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(156,138,196,.2); }
.li-title { font-weight: 700; font-size: 15px; }
.li-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
/* 条目备注（所有教学进度条目均可编写并显示） */
.li-note { font-size: 13px; color: #4b7fa8; margin-top: 3px; line-height: 1.5; word-break: break-all; }
[data-theme="dark"] .li-note { color: #8fc4e8; }
.li-tags { margin-top: 6px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 14px; }
.mat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; cursor: pointer; transition: .15s; }
.mat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.mat-thumb { height: 120px; background: linear-gradient(135deg,var(--surface-2),var(--surface-3)); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.mat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mat-meta { padding: 10px 12px; }
.mat-title { font-weight: 700; font-size: 14px; }
.mat-icon { color: var(--lav); }

/* —— 备课：教案布局 —— */
.plan-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.plan-list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; max-height: calc(100vh - 170px); overflow-y: auto; }
.list-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.plan-editor { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; min-height: 400px; }
.plan-editor.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.editor-bar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.eb-row { display: flex; gap: 8px; }
.eb-actions { flex-wrap: wrap; }
.title-inp { font-size: 17px; font-weight: 700; }
.rte-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rte-col { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rte-label { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 10px; background: var(--surface-2); }
.rte-toolbar { display: flex; gap: 4px; padding: 6px; background: var(--surface-2); flex-wrap: wrap; }
.rte-btn { border: none; background: var(--surface); border-radius: 7px; padding: 5px 9px; cursor: pointer; font-weight: 700; color: var(--text); min-width: 30px; }
.rte-btn:hover { background: var(--primary); color: #fff; }
.rte { padding: 12px; min-height: 280px; outline: none; font-size: 14px; }
.rte-preview { padding: 12px; min-height: 280px; background: var(--bg); overflow-y: auto; }
.rte:empty:before, .rte-preview:empty:before { content: attr(data-ph); color: var(--muted); }
.preview .rte-preview { display: block; }
.formula { font-style: italic; color: var(--primary-d); font-family: "Cambria Math",Georgia,serif; }
.frac { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; margin: 0 2px; }
.frac .num { border-bottom: 1px solid currentColor; padding: 0 4px; }
.frac .den { padding: 0 4px; }

/* —— 班级/成绩 —— */
.student-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(110px,1fr)); gap: 12px; }
.student-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; cursor: pointer; transition: .15s; }
.student-card:hover { box-shadow: var(--shadow); }
.student-card.add { color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-style: dashed; }
.st-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg,var(--lav),var(--sky)); color: #fff; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.st-name { font-weight: 700; font-size: 14px; }
.exam-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.exam-head { display: flex; align-items: center; gap: 10px; }
.exam-head .li-title { flex: 1; }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.stat { flex: 1 0 88px; background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: center; }
.stat-val { font-size: 20px; font-weight: 800; color: var(--primary-d); }
.stat-label { font-size: 12px; color: var(--muted); }
/* v72：不合格率 >40% 标红（统计卡 + 学生姓名） */
.stat-danger .stat-val { color: var(--danger, #d9534f); }
.stat-danger { box-shadow: inset 0 0 0 1px var(--danger, #d9534f); }
.st-name.name-bad { color: var(--danger, #d9534f); }
.bad-rate-warn { background: rgba(217, 83, 79, .1); border: 1px solid var(--danger, #d9534f); color: var(--danger, #d9534f); border-radius: 10px; padding: 8px 12px; margin-top: 4px; font-weight: 600; font-size: 13px; }
.dist { display: flex; gap: 10px; align-items: flex-end; height: 100px; margin-top: 12px; }
.dist-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
/* 人数标记：显示在柱体上方（不放在柱体内） */
.dist-count { font-size: 11px; font-weight: 700; color: var(--primary); line-height: 1.2; margin-bottom: 2px; min-height: 13px; }
.dist-bar { width: 70%; background: linear-gradient(var(--sky),var(--primary)); border-radius: 6px 6px 0 0; min-height: 4px; }
.dist-label { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.score-rows { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.score-row { display: flex; align-items: center; gap: 10px; }
.score-inp { max-width: 110px; }
.record-roster { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.record-row { display: flex; align-items: center; gap: 8px; }
.perf-inp { flex: 1; padding: 6px 10px; }
/* v120：逐生表现可选标签 + 课堂记录搜索框 */
.record-stu { padding: 5px 2px; border-bottom: 1px solid var(--border); }
.perf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 5px 0 1px; }
.perf-tag { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; transition: .15s; font-family: inherit; }
.perf-tag:hover { border-color: var(--primary); color: var(--text); }
.perf-tag.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.search-inp { flex: 1; min-width: 180px; }
.mini-toggle { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; min-width: 48px; }
.mini-toggle.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.mini-toggle.miss { background: var(--danger); color: #fff; border-color: var(--danger); }
.photo-prev { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--surface-2) center/cover no-repeat; border: 1px solid var(--border); }
/* v128：课堂照片缩略图可点击查看大图 */
.photo-thumb { cursor: zoom-in; }
/* v128：图片大图查看灯箱（课堂记录照片点击查看） */
.img-viewer { position: fixed; inset: 0; z-index: 200; background: rgba(15, 14, 20, .88); display: flex; align-items: center; justify-content: center; padding: 24px; animation: imgViewerIn .18s ease-out; }
@keyframes imgViewerIn { from { opacity: 0; } to { opacity: 1; } }
.img-viewer-img { max-width: min(96vw, 1100px); max-height: 86vh; border-radius: 12px; box-shadow: 0 12px 48px rgba(0, 0, 0, .5); background: #fff; object-fit: contain; }
.img-viewer-close { position: absolute; top: 14px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.img-viewer-hint { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .75); font-size: 13px; pointer-events: none; }

/* —— 笔记 —— */
.note-item .note-preview { font-size: 13px; color: var(--muted); margin: 4px 0; }
.note-area { font-family: inherit; line-height: 1.7; }

/* —— 工具 —— */
.const-table { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.const-row { display: grid; grid-template-columns: 1.4fr .8fr 1fr .9fr 1.4fr; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; }
.const-row:last-child { border-bottom: none; }
.const-head { background: var(--surface-2); font-weight: 800; }
.const-row:nth-child(even) { background: var(--surface-2); }
.unit-result { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; text-align: center; font-size: 18px; margin: 14px 0; }
.unit-result .hl { color: var(--primary-d); font-size: 24px; }
.exp-grid .exp-card { padding: 14px; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.todo-item.done { opacity: .6; }
.todo-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.todo-check.done { background: var(--primary); border-color: var(--primary); }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-weight: 700; }
.todo-item.done .todo-title { text-decoration: line-through; }
.todo-cat { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; }
.cat-green { background: rgba(156,138,196,.2); color: var(--primary-d); }
.cat-blue { background: rgba(143,199,232,.2); color: var(--sky); }
.cat-orange { background: rgba(244,164,139,.25); color: var(--peach); }

/* —— 冲突 —— */
.conflict-card { background: var(--surface); border: 1px solid var(--danger); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.conflict-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.conf-side { background: var(--surface-2); border-radius: 10px; padding: 10px; }
.conf-side pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; margin: 4px 0 0; max-height: 160px; overflow: auto; }
.conflict-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* v59 批量处理冲突 */
.conflict-batch { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 12px; background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; }

/* —— Modal / Toast —— */
.modal-overlay { position: fixed; inset: 0; background: rgba(40,36,32,.45); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; transition: .25s; padding: 16px; backdrop-filter: blur(2px); }
.modal-overlay.show { opacity: 1; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transform: scale(.96); transition: .25s; }
.modal-overlay.show .modal { transform: scale(1); }
.modal-head { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-close { border: none; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 14px 18px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--border); }
.confirm-text { margin: 0; }

.toast-box { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 400; /* v112：高于登录遮罩(300)，否则登录失败提示会被盖住看不见 */ display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--surface); color: var(--text); padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(-10px); transition: .3s; border: 1px solid var(--border); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--primary); }
.toast-error { border-color: var(--danger); color: var(--danger); }
.toast-warn { border-color: var(--warn); color: var(--warn); }

/* —— 登录 —— */
.login-overlay { position: fixed; inset: 0; background: linear-gradient(135deg,#F7F4FC,#EAF4FB); display: flex; align-items: center; justify-content: center; z-index: 300; opacity: 0; transition: .3s; padding: 16px; }
.login-overlay.show { opacity: 1; }
.login-card { background: var(--surface); border-radius: 22px; padding: 30px 28px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.login-logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg,var(--primary),var(--sky)); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.login-card h2 { text-align: center; margin: 0 0 6px; font-size: 20px; }
.login-card .seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; margin: 16px 0; }
.seg-btn { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg-btn.active { background: var(--surface); color: var(--primary-d); box-shadow: var(--shadow); }
.login-box { display: flex; flex-direction: column; }
.login-box label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 0 4px; }
.remember-row { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; cursor: pointer; }
.remember-row input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--ice-blue); }

/* —— 移动端抽屉 —— */
.drawer { position: fixed; inset: 0; z-index: 90; display: none; }
.drawer.open { display: block; }
.drawer-mask { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 260px; background: var(--surface); box-shadow: var(--shadow); padding: 18px; transform: translateX(100%); transition: .25s; }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { font-weight: 800; font-size: 16px; margin-bottom: 14px; }
.drawer-row { display: flex; align-items: center; gap: 12px; padding: 13px 10px; border-radius: 11px; cursor: pointer; font-weight: 600; }
.drawer-row:hover { background: var(--surface-2); }

/* —— 底部导航（手机） —— */
.bottomnav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 10px; }
.bn-item.active { color: var(--primary-d); }
.only-mobile { display: none; }

/* —— 响应式 —— */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .only-mobile { display: inline-flex; }
  .bottomnav { display: flex; }
  .main { padding: 14px 14px 80px; }
  .brand-name { display: none; }
  .plan-layout { grid-template-columns: 1fr; }
  .plan-list { max-height: 220px; }
  .rte-split { grid-template-columns: 1fr; }
  .const-row { grid-template-columns: 1fr 1fr; }
  .conflict-cols { grid-template-columns: 1fr; }
  .top-actions .user-chip .uname { display: none; }
}
@media (min-width: 861px) { .only-mobile { display: none !important; } }

/* —— 导入名单 / 作业登记 —— */
.import-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 4px 0; }
.import-preview { margin-top: 8px; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: var(--surface-2); }
.imp-table { display: flex; flex-direction: column; gap: 4px; }
.imp-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; background: var(--surface); border-radius: 9px; font-size: 13px; }
.import-cols label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 6px 0 2px; }
.hw-entry { display: flex; gap: 8px; align-items: center; }
.hw-entry .inp { flex: 1; }
.hw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.hw-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff; border-radius: 20px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.hw-chip .x { cursor: pointer; font-weight: 800; opacity: .85; }
.hw-chip .x:hover { opacity: 1; }
.hw-missing { margin: 6px 0; }
.hw-miss-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hw-miss { background: var(--chip); color: var(--muted); border-radius: 8px; padding: 3px 9px; font-size: 12px; }
.hw-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; background: var(--surface-2); margin-bottom: 5px; font-size: 14px; cursor: pointer; }
.hw-row input { width: 16px; height: 16px; }
@media (max-width: 860px) { .import-cols { grid-template-columns: 1fr; } }

/* —— 作业管理：逐生状态 + 板块 + 周统计 —— */
.hw-roster { display: flex; flex-direction: column; gap: 5px; max-height: 360px; overflow-y: auto; }
.hw-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 9px; background: var(--surface-2); margin-bottom: 4px; font-size: 14px; }
.hw-row .st-name { font-weight: 600; }
.hw-sel-wrap { flex: 0 0 auto; }
.hw-status-sel { width: 130px; padding: 5px 8px; font-size: 13px; }
.hw-boards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.hw-board { border: 1px solid var(--border); border-radius: 11px; padding: 8px 10px; background: var(--surface); }
.hb-head { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.hb-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.hb-members { font-size: 12px; line-height: 1.6; color: var(--text); }
.hw-stats { margin-top: 4px; overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border-radius: 10px; overflow: hidden; }
.stats-table th, .stats-table td { padding: 7px 9px; text-align: center; border-bottom: 1px solid var(--border); }
.stats-table th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.stats-table td:first-child, .stats-table td:nth-child(2), .stats-table th:first-child, .stats-table th:nth-child(2) { text-align: left; white-space: nowrap; }
.stats-table .totals-row td { font-weight: 800; background: var(--surface-2); }
.st-cell { font-weight: 700; }

/* 状态色（冰淇淋护眼配色，浅色/深色均适配） */
.st-submitted  { color: #2f9e6f; } .st-submitted.hb-dot,  .hb-dot.st-submitted  { background: #2f9e6f; }
.st-excellent  { color: #e8833a; } .st-excellent.hb-dot,  .hb-dot.st-excellent  { background: #e8833a; }
.st-late       { color: #6a8cff; } .st-late.hb-dot,       .hb-dot.st-late       { background: #6a8cff; }
.st-unfinished { color: #d9534f; } .st-unfinished.hb-dot, .hb-dot.st-unfinished { background: #d9534f; }
.st-correct    { color: #b06ad6; } .st-correct.hb-dot,    .hb-dot.st-correct    { background: #b06ad6; }
.st-pass       { color: #2aa7c4; } .st-pass.hb-dot,       .hb-dot.st-pass       { background: #2aa7c4; }
.st-leave      { color: #8a7d9b; } .st-leave.hb-dot,      .hb-dot.st-leave      { background: #8a7d9b; }
.st-notsubmitted { color: #b5651d; } .st-notsubmitted.hb-dot, .hb-dot.st-notsubmitted { background: #b5651d; }
[data-theme="dark"] .st-submitted { color: #5fd6a0; } [data-theme="dark"] .st-excellent { color: #ffb070; }
[data-theme="dark"] .st-late { color: #93acff; } [data-theme="dark"] .st-unfinished { color: #ff8a86; }
[data-theme="dark"] .st-correct { color: #d29bf0; } [data-theme="dark"] .st-pass { color: #6fd6ee; } [data-theme="dark"] .st-leave { color: #c3b6d6; } [data-theme="dark"] .st-notsubmitted { color: #e0a060; }

/* —— 卡片（录入/概览容器） —— */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.card-title { font-weight: 800; font-size: 15px; margin-bottom: 12px; color: var(--text); }

/* —— 状态徽标（软底色胶囊，复用作色） —— */
.st-badge { display: inline-flex; align-items: center; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-badge.st-submitted { color: #2f9e6f; background: rgba(47,158,111,.14); }
.st-badge.st-excellent { color: #e8833a; background: rgba(232,131,58,.14); }
.st-badge.st-late { color: #6a8cff; background: rgba(106,140,255,.14); }
.st-badge.st-unfinished { color: #d9534f; background: rgba(217,83,79,.14); }
.st-badge.st-notsubmitted { color: #b5651d; background: rgba(181,101,29,.14); }
[data-theme="dark"] .st-badge.st-submitted { background: rgba(95,214,160,.16); }
[data-theme="dark"] .st-badge.st-excellent { background: rgba(255,176,112,.16); }
[data-theme="dark"] .st-badge.st-late { background: rgba(147,172,255,.16); }
[data-theme="dark"] .st-badge.st-unfinished { background: rgba(255,138,134,.16); }
[data-theme="dark"] .st-badge.st-notsubmitted { background: rgba(224,160,96,.16); }

/* —— 笔记抽查 —— */
.insp-status { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.btn-status { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 8px 16px; border-radius: 11px; font-weight: 700; cursor: pointer; transition: .15s; }
.btn-status.active.st-submitted { background: #2f9e6f; color: #fff; border-color: #2f9e6f; }
.btn-status.active.st-excellent { background: #e8833a; color: #fff; border-color: #e8833a; }
.btn-status.active.st-unfinished { background: #d9534f; color: #fff; border-color: #d9534f; }
.btn-status.active.st-notsubmitted { background: #b5651d; color: #fff; border-color: #b5651d; }
.insp-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.stat-pill { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.stat-pill b { font-size: 18px; }
.stat-pill.st-submitted b { color: #2f9e6f; } .stat-pill.st-excellent b { color: #e8833a; }
.stat-pill.st-unfinished b { color: #d9534f; } .stat-pill.st-notsubmitted b { color: #b5651d; }
/* 每日抽查统计：复用全班模板，缩小间距以贴合日期区块 */
.insp-stats-day { margin: 4px 0 2px; }
.insp-stats-day .stat-pill { padding: 6px 12px; font-size: 12px; }
.insp-stats-day .stat-pill b { font-size: 16px; }

/* —— 教学进度 —— */
.kind-tabs { margin-top: 4px; }
.prog-summary { margin: 6px 0 14px; }
.prog-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #9C8AC4, #BBAADF); transition: width .3s; }
[data-theme="dark"] .prog-fill { background: linear-gradient(90deg, #B5A3DF, #9C8AC4); }
.prog-meta { margin-top: 6px; }
.item-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.inp-sm { width: auto; padding: 4px 8px; font-size: 13px; }
.status-sel { min-width: 92px; }

/* 章节折叠 / 小节 */
.chapter-head { background: var(--surface-2); border-left: 4px solid var(--primary); }
.chapter-head .chev { font-size: 13px; min-width: 30px; padding: 4px 8px; }
.chapter-head.collapsed { opacity: .92; }
.section-row { margin-left: 16px; border-left: 2px dashed var(--border); }
.section-row .li-title { color: var(--text); font-weight: 700; }
/* 半完成小节：新课教学已完成但课后习题未完成 → 天空蓝突出 */
.section-row.sec-half-done {
  background: linear-gradient(90deg, rgba(104, 176, 235, 0.16), rgba(104, 176, 235, 0.05));
  border-left: 3px solid #68b0eb;
  border-radius: 8px;
}
.section-row.sec-half-done .li-title::after {
  content: '待巩固习题';
  display: inline-block; margin-left: 8px; padding: 1px 7px;
  font-size: 11px; font-weight: 700; color: #22659e;
  background: rgba(104, 176, 235, 0.22); border-radius: 999px; vertical-align: 1px;
}
[data-theme="dark"] .section-row.sec-half-done {
  background: linear-gradient(90deg, rgba(104, 176, 235, 0.18), rgba(104, 176, 235, 0.05));
  border-left-color: #5aa4dd;
}
[data-theme="dark"] .section-row.sec-half-done .li-title::after { color: #9fd2f5; background: rgba(104, 176, 235, 0.18); }
.two-cols { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.two-cols .col { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.col-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.add-section { margin-left: 16px; }
.section-empty { margin-left: 16px; padding: 4px 0; }

/* 笔记抽查：学生名单按状态分类 */
.insp-cat { margin: 8px 0; }
.cat-head { display: inline-block; font-weight: 800; font-size: 13px; padding: 3px 12px; border-radius: 999px; margin-bottom: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.cat-head.st-submitted { color: #2f9e6f; background: rgba(47,158,111,.14); }
.cat-head.st-excellent { color: #e8833a; background: rgba(232,131,58,.14); }
.cat-head.st-unfinished { color: #d9534f; background: rgba(217,83,79,.14); }
.cat-head.st-notsubmitted { color: #b5651d; background: rgba(181,101,29,.14); }
.cat-head.st-none { color: #b3474a; background: rgba(179,71,74,.12); }
.cat-members { font-size: 13px; line-height: 1.7; color: var(--text); padding: 2px 0 6px; }
/* 笔记抽查·每日按状态分组名单 */
.insp-day-cats { margin-top: 4px; }
.insp-day-cats .insp-cat { margin: 6px 0; }
.day-mem { display: inline-flex; align-items: center; gap: 2px; margin-right: 10px; }
.mem-del { padding: 1px 5px; font-size: 11px; opacity: .55; line-height: 1.2; }
.mem-del:hover { opacity: 1; }

@media (max-width: 860px) {
  .two-cols { flex-direction: column; gap: 8px; }
  .section-row, .add-section, .section-empty { margin-left: 10px; }
}


@media (max-width: 860px) {
  .hw-boards { grid-template-columns: 1fr; }
  .hw-status-sel { width: 110px; }
  /* 子页签改为横向滚动一行：保证「作业管理」等末位页签在窄屏一定可达 */
  .subtabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .subtab { flex: 0 0 auto; white-space: nowrap; }
}

/* 拍照识别登记 */
.ocr-preview img { max-width: 100%; max-height: 260px; border-radius: 10px; display: block; margin: 6px 0; }
.ocr-actions { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.hb-import { margin-left: auto; padding: 2px 8px; font-size: 12px; }
.ocr-legend { margin: 8px 0 4px; padding: 10px 12px; background: rgba(127,127,127,0.12); border-radius: 10px; }
.ocr-legend .ol-t { font-weight: 700; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ocr-legend .ol-grid { display: flex; flex-wrap: wrap; gap: 5px 16px; font-size: 13px; color: var(--text); line-height: 1.7; }
.ocr-legend .ol-wide { flex-basis: 100%; }

/* —— 统计补充：已交总数 / 未提交 —— */
.st-none { color: #b3474a; }
[data-theme="dark"] .st-none { color: #ff9a97; }
.range-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 2px 0 8px; }
.range-row .inp { max-width: 160px; }

/* —— 表扬图片预览 —— */
.cert-preview { width: 100%; max-width: 100%; border: 1px solid var(--border); border-radius: 10px; display: block; }

/* —— 每日表扬 —— */
.praise-date-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.praise-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.praise-thumb { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; aspect-ratio: 4 / 3; transition: .15s; }
.praise-thumb:hover { box-shadow: var(--shadow); }
.praise-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.praise-thumb .pt-tag { position: absolute; left: 6px; top: 6px; background: rgba(42, 160, 220, .92); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 99px; }
.pt-tag.pt-photo { background: rgba(47, 158, 111, .92); }

@media (max-width: 860px) {
  /* 底部导航 7 项：收紧字号保证不换行 */
  .bn-item { font-size: 10px; padding: 3px 1px; }
  .praise-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
}

/* ============ 首页（仪表盘） ============ */
.home-module { max-width: 980px; margin: 0 auto; }
.home-clock { text-align: center; padding: 28px 16px 22px; background: linear-gradient(135deg, var(--primary), var(--sky)); color: #fff; border-radius: 18px; box-shadow: 0 10px 30px rgba(156,138,196,.28); margin-bottom: 18px; }
.hc-greet { font-size: 16px; font-weight: 700; opacity: .95; margin-bottom: 6px; }
.hc-date { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.hc-time { font-size: 40px; font-weight: 900; letter-spacing: 2px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 10px rgba(0,0,0,.12); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.home-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hch-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--text); }
.hch-ic { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--primary-d); }
.hch-link { font-size: 13px; color: var(--primary-d); font-weight: 700; cursor: pointer; }
.hch-link:hover { text-decoration: underline; }
.home-card-body { display: flex; flex-direction: column; gap: 8px; }
/* 听课课表（v44）：从周课表抽取「听课」单独罗列 */
.listen-card { margin-top: 16px; }
/* v122：听课课表（左小） + 课程时间（右大）两栏 */
.home-duo { display: grid; grid-template-columns: 2fr 3fr; gap: 16px; margin-top: 16px; }
.home-duo .listen-card { margin-top: 0; }
.periods-body { gap: 6px; } /* v123：移除 max-height/overflow，完整展示全部节次与晚自习，不再滚动 */
.ptime-evening { margin-top: 6px; }
.ptime-evening .ptime-no { color: var(--warn, #b8860b); }
.ptime-midday { display: flex; align-items: center; gap: 12px; padding: 8px 11px; margin-top: 6px; background: linear-gradient(135deg, rgba(255,179,71,.16), rgba(255,179,71,.07)); border: 1px dashed rgba(184,134,11,.45); border-radius: 10px; }
.ptime-midday .ptime-no { color: #b8860b; }
.ptime-row { display: flex; align-items: center; gap: 12px; padding: 8px 11px; background: var(--surface-2); border-radius: 10px; }
.ptime-no { font-weight: 800; font-size: 13px; color: var(--primary-d); min-width: 48px; }
.ptime-time { font-weight: 600; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .ptime-no { color: #9fd0ff; }
@media (max-width: 860px) { .home-duo { grid-template-columns: 1fr; } }
.listen-row { display: flex; align-items: center; gap: 12px; padding: 9px 11px; background: var(--surface-2); border-radius: 11px; }
.listen-row.is-today { background: var(--primary-soft, rgba(156,138,196,.14)); border: 1px solid var(--primary); }
.listen-when { font-weight: 800; font-size: 13px; color: var(--primary-d); min-width: 92px; }
.listen-period { font-weight: 700; color: var(--muted); margin-left: 4px; font-size: 12px; }
.listen-subject { font-weight: 700; color: var(--text); }
.listen-place { font-size: 12px; }
.listen-today-badge { margin-left: auto; font-size: 11px; font-weight: 800; color: #fff; background: var(--primary); padding: 2px 9px; border-radius: 99px; }
/* 临时换课：跨日期字段 */
.sw-date-a, .sw-date-b { max-width: 140px; }
.sw-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.sw-rule { flex-wrap: wrap; align-items: center; gap: 6px; }
.sched-row { display: flex; align-items: center; gap: 12px; padding: 9px 11px; background: var(--surface-2); border-radius: 11px; }
.sched-period { font-weight: 800; font-size: 13px; color: var(--primary-d); min-width: 54px; }
.sched-subject { font-weight: 700; color: var(--text); }
.sched-place { font-size: 12px; }
.home-add { display: flex; gap: 8px; margin-bottom: 12px; }
.home-todo-list { display: flex; flex-direction: column; gap: 8px; }
.home-todo-list .todo-item { padding: 10px 12px; }

/* ============ 教学进度：班级选择器 ============ */
.class-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; }
.cb-label { font-size: 13px; font-weight: 800; color: var(--muted); margin-right: 2px; }
.cb-chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 6px 14px; border-radius: 99px; font-weight: 700; font-size: 13px; cursor: pointer; transition: .15s; }
.cb-chip:hover { color: var(--text); }
.cb-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 12px rgba(156,138,196,.3); }
.cb-empty { font-size: 13px; color: var(--muted); }

/* ============ 教学进度：已完成隐藏开关 / 折叠摘要（v42） ============ */
.toggle-done { white-space: nowrap; }
.ch-sum { color: var(--primary); font-weight: 700; }
[data-theme="dark"] .ch-sum { color: #7fd6b8; }

/* ============ 课表编辑网格 ============ */
.tt-wrap { overflow-x: auto; }
.tt-grid { display: inline-block; min-width: 100%; }
.tt-row { display: flex; align-items: stretch; }
.tt-head .tt-cell { font-weight: 800; color: var(--muted); background: var(--surface-2); }
.tt-cell { width: 130px; min-width: 110px; padding: 6px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.tt-corner, .tt-pno { justify-content: center; align-items: center; font-weight: 800; color: var(--muted); background: var(--surface-2); }
.tt-day { text-align: center; }
.tt-subj { font-weight: 700; }
.tt-place { font-size: 12px; }

/* —— 今日课表增强（v34）—— */
.hch-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sched-plan { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; background: var(--surface-2); border-radius: 11px; flex-wrap: wrap; }
.sp-text { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sp-text b { color: var(--text); font-size: 14px; }
.sp-badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 800; margin-left: 4px; }
.sp-normal { background: rgba(156,138,196,.18); color: var(--primary-d); }
.sp-tiaoxiu { background: rgba(240,173,78,.2); color: #b9770d; }
.sp-override { background: rgba(95,134,216,.2); color: #3a5bb0; }
.sp-swap { background: rgba(149,117,205,.2); color: #6a4aa8; }
[data-theme="dark"] .sp-swap { background: rgba(149,117,205,.3); color: #c9b3ef; }

/* —— 临时换课（v43）—— */
.swap-preview { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; margin-bottom: 10px; }
.swap-row { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.swap-row b { min-width: 52px; color: var(--muted); font-size: 13px; }
.swap-row .swap-subj { font-weight: 700; }
.swap-cap { margin: 0 0 2px; }
.sw-rule .sw-arrow { color: var(--muted); display: inline-flex; }
.sw-rule select { width: auto; min-width: 86px; }
.teach-day-sel { width: auto; min-width: 120px; }

.sched-holiday { display: flex; align-items: center; gap: 8px; padding: 12px; background: rgba(240,173,78,.14); color: #b9770d; border-radius: 11px; font-weight: 700; }
.sched-holiday svg { color: #d99a1e; }

/* 课前 10 分钟醒目提醒横幅 */
.class-reminder { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 12px; background: linear-gradient(135deg, #ffb347, #ff8c42); color: #fff; font-weight: 800; box-shadow: 0 8px 22px rgba(255,140,66,.34); animation: remindPulse 1.4s ease-in-out infinite; }
.class-reminder .cr-ic { display: inline-flex; }
.class-reminder .cr-text { font-size: 14px; }
.class-reminder .cr-time { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 900; }
.class-reminder.reminder-hidden { display: none; }
@keyframes remindPulse { 0%,100% { transform: translateY(0); box-shadow: 0 8px 22px rgba(255,140,66,.34); } 50% { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(255,140,66,.5); } }

/* 晚自习行 */
.sched-evening { background: linear-gradient(135deg, rgba(95,134,216,.16), rgba(95,134,216,.08)); border: 1px dashed rgba(95,134,216,.5); }
.sched-evening .sched-period { color: #3a5bb0; display: flex; align-items: center; gap: 6px; }
.sched-parity { font-size: 10px; padding: 1px 6px; border-radius: 99px; background: rgba(95,134,216,.22); color: #3a5bb0; font-weight: 800; }
.sched-evening-unknown .sched-subject { color: var(--muted); }
.sched-midday { display: flex; align-items: center; gap: 12px; padding: 9px 11px; background: linear-gradient(135deg, rgba(255,179,71,.16), rgba(255,179,71,.07)); border: 1px dashed rgba(184,134,11,.45); border-radius: 11px; }
.sched-midday .sched-period { color: #b8860b; }
.sched-time { font-variant-numeric: tabular-nums; font-size: 12px; margin-left: auto; white-space: nowrap; }

/* 课表编辑：每节时间 + 晚自习 */
.tt-times { margin-top: 14px; }
.tt-evening { margin-top: 14px; padding: 12px; background: var(--surface-2); border-radius: 12px; }
.tt-time-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.tt-time-no { font-weight: 800; color: var(--muted); min-width: 48px; font-size: 13px; }
.tt-tilde { color: var(--muted); }
.tt-ev-enable-row { display: flex; align-items: center; gap: 6px; font-weight: 700; margin: 6px 0 8px; cursor: pointer; }
.tt-ev-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.tt-ev-lab { font-weight: 800; color: #3a5bb0; min-width: 32px; }
.tt-ev-days { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.tt-ev-day-lab { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; cursor: pointer; white-space: nowrap; }
/* —— 待办·催缴作业 —— */
.urge-item { border: 1px dashed var(--warn, #e8a23a); background: color-mix(in srgb, var(--warn, #e8a23a) 8%, transparent); border-radius: 12px; }
.urge-item.urge-clear { border-color: var(--border); background: transparent; }
.urge-ic { display: inline-flex; align-items: center; justify-content: center; background: var(--warn, #e8a23a); color: #fff; border-radius: 50%; width: 24px; height: 24px; flex-shrink: 0; }
.urge-detail { max-height: 60vh; overflow-y: auto; }
.urge-cls { margin: 10px 0 6px; font-size: 15px; }
.urge-hw { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.urge-hw-title { font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.urge-hw-title .urge-hw-add { margin-left: auto; font-weight: 400; }
.urge-hw-title .urge-hw-clear { font-weight: 400; margin-left: 6px; }
.urge-manual-content { font-size: 13px; font-weight: 500; color: var(--text); background: var(--chip); border-radius: 8px; padding: 2px 10px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urge-st { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; flex-wrap: wrap; }
.urge-n { font-size: 11px; opacity: .85; }
.urge-names { color: var(--muted); font-size: 13px; line-height: 1.7; word-break: break-all; }
/* 催缴明细：学生芯片（学号 姓名 + 改/移除） */
.urge-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.urge-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.urge-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 2px 4px 2px 10px; font-size: 13px; font-weight: 600; line-height: 1.6; }
.urge-chip-name { white-space: nowrap; }
.uc-btn { border: none; cursor: pointer; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: .12s; }
.uc-edit { background: transparent; color: var(--muted); font-weight: 700; width: auto; padding: 0 4px; border-radius: 8px; }
.uc-edit:hover { background: var(--surface-3); color: var(--primary); }
.uc-off { background: transparent; color: var(--muted); }
.uc-off:hover { background: var(--danger); color: #fff; }
.urge-manual { border-style: dashed; }
/* v62：全部待办模态框 */
.todos-all { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; }
.todos-all-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.todos-all-add .inp { flex: 1 1 160px; min-width: 120px; }
.todos-all-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.todos-all-list .todo-item { margin: 0; }
.tt-ev-no { font-weight: 800; color: var(--muted); min-width: 44px; font-size: 13px; }
.tt-ev-add { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* 教学进度：完成时间 / 编辑弹窗状态行 */
.done-date { margin-left: 2px; white-space: nowrap; }
.col-done { margin-top: 2px; }
.es-st { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.es-st label { font-weight: 700; color: var(--muted); font-size: 13px; }

/* 学期 / 教学历设置表单 */
.term-form { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.tf-h { margin: 12px 0 4px; font-size: 14px; color: var(--primary-d); }
.tf-row { display: flex; align-items: center; gap: 10px; }
.tf-row label { min-width: 96px; font-weight: 700; color: var(--muted); font-size: 13px; }
.tf-upload-row { margin-bottom: 4px; }
.tf-list { display: flex; flex-direction: column; gap: 6px; }
.tf-item { display: flex; align-items: center; gap: 8px; }
.tf-item .inp { flex: 1; }
.ocr-btns { display: flex; gap: 8px; margin-bottom: 10px; }
.ocr-preview { margin: 8px 0; }
.ocr-preview img { max-width: 100%; max-height: 240px; border-radius: 12px; border: 1px solid var(--border); }

/* ===== v48 备课文件库（教案/课件/素材 · 章节目录） ===== */
.lib-tip { margin: -6px 0 14px; }
.lib-grade { margin-bottom: 20px; }
.lib-grade-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.lib-grade-name { font-weight: 800; font-size: 15px; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.dir-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; transition: .15s; display: flex; flex-direction: column; gap: 6px; }
.dir-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--primary); }
.dir-ic { color: var(--primary); display: inline-flex; }
.dir-name { font-weight: 700; font-size: 14px; line-height: 1.4; }
.crumb { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.crumb-path { font-weight: 700; }
.file-row { display: flex; align-items: center; gap: 12px; cursor: default; }
.file-main { flex: 1; min-width: 0; }
.file-name { font-weight: 700; font-size: 14px; word-break: break-all; }
.file-acts { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.fk-chip { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: #fff; flex-shrink: 0; }
.fk-word { background: #4a89dc; }
.fk-excel { background: #37a96c; }
.fk-ppt { background: #e8734a; }
.fk-pdf { background: #d9534f; }
.fk-image { background: #8a7cd8; }
.fk-video { background: #34a4a4; }
.fk-audio { background: #b88a44; }
.fk-text { background: #8a929e; }
.fk-other { background: #8a929e; }

/* ===== v51 备课自定义目录（我的目录 / 子目录） ===== */
.fol-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; transition: .15s; display: flex; flex-direction: column; gap: 6px; }
.fol-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--primary); }
.fol-del { position: absolute; top: 8px; right: 8px; border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; line-height: 1; }
.fol-del:hover { color: var(--danger, #d9534f); background: rgba(217,83,79,.12); }
.crumb-link { background: none; border: none; color: var(--primary); cursor: pointer; font-weight: 700; padding: 0; font-size: inherit; }
.crumb-link:hover { text-decoration: underline; }
.crumb-sep { color: var(--muted); }
/* ===== v52 备课文件移动对话框 ===== */
.move-modal { display: flex; flex-direction: column; gap: 4px; }
.move-sec { margin-top: 6px; }
.move-sec-title { font-weight: 700; font-size: 13px; margin: 6px 0 6px; color: var(--text); }
.move-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; padding-right: 2px; }
.move-item { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 14px; color: var(--text); }
.move-item:hover:not(.cur) { border-color: var(--primary); background: var(--primary-soft, rgba(74,137,220,.08)); }
.move-item.cur { opacity: .55; cursor: default; }
.move-item .move-indent { flex: 0 0 auto; }
.move-item .dir-ic { display: inline-flex; color: var(--primary); flex: 0 0 auto; }
.move-empty { padding: 6px 2px; }
/* ===== v53 移动弹窗：章节内子目录标注 ===== */
.move-ch-hint { margin-left: auto; flex: 0 0 auto; }

/* ===== v55 教学反思附件 / 工具面板（实验卡片 · 知识拓展 · 常用网站） ===== */
.note-file-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 1px 7px; border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--primary); background: rgba(74,137,220,.12); vertical-align: middle; }
.note-files { display: flex; flex-direction: column; gap: 6px; }
.note-file-empty { margin: 2px 0 0; }
.note-attach-bar, .note-export-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-file-row { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface); }

/* 实验卡片 */
.exp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.exp-cat-chip, .pit-cat-chip, .know-cat-chip { flex: 0 0 auto; margin-left: auto; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; background: rgba(74,137,220,.12); color: var(--primary); }
.pit-cat-chip { background: rgba(217,83,79,.12); color: var(--danger, #d9534f); }
.exp-pit { color: var(--danger, #d9534f); }
.exp-conc { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 6px; }
.exp-card, .pit-card, .know-card { display: flex; flex-direction: column; gap: 4px; }
.pit-content, .exp-card .li-sub { line-height: 1.6; }

/* 知识拓展空态 */
.know-empty { border: 1px dashed var(--border); border-radius: 12px; padding: 18px 16px; background: var(--surface); }

/* 常用网站 */
.site-list { display: flex; flex-direction: column; gap: 8px; }
.site-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.site-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: var(--text); }
.site-link:hover .site-name { color: var(--primary); text-decoration: underline; }
.site-ic { display: inline-flex; color: var(--primary); flex: 0 0 auto; }
.site-name { font-weight: 700; font-size: 14px; flex: 0 0 auto; }
.site-url-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-link-bad { cursor: default; }
.site-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.site-tip { margin: -4px 0 10px; }
.preset-list { display: flex; flex-direction: column; gap: 6px; }
.preset-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; font-size: 14px; color: var(--text); }
.preset-item:hover:not(.done) { border-color: var(--primary); }
.preset-item.done { opacity: .55; cursor: default; }
.preset-url { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== v56 资料库（教学反思 / 知识拓展：文件夹 + 文件） ===== */
.filelib { margin-bottom: 18px; }
.fl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 2px; }
.fl-head .sec-title { margin: 0; flex: 1; }
.fl-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.fl-body { margin-top: 8px; }
.fl-grid { margin-bottom: 6px; }
.fol-top { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fol-meta { margin-top: 2px; }
.fol-btns { display: flex; gap: 6px; margin-top: 8px; }
.fl-files { margin-top: 10px; }
.fl-nosub, .fl-nofile { margin: 6px 0 0; }

/* ===== v56 常用网站：账号密码 ===== */
.site-cred { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 2px 8px; border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--primary); background: rgba(74,137,220,.12); flex: 0 0 auto; }
.site-cred svg { width: 13px; height: 13px; }
.site-inline-label { display: flex; align-items: center; gap: 6px; font-weight: 400; }

/* ===== v57 文件重命名（全工作台统一弹窗） + 知识拓展参考链接 ===== */
.rename-tip { margin: 8px 0 0; }
.know-link-box { margin-top: 20px; }
.know-link-bar { flex-wrap: wrap; }
.know-link-list { margin-top: 10px; }
.know-link-item { flex-wrap: wrap; }
.know-src-chip { flex: 0 0 auto; margin-left: auto; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; background: rgba(55,169,108,.14); color: #2f8f5c; }
.know-link-note { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-inline-label input[type="checkbox"] { width: 16px; height: 16px; }

/* ===== v58 通用文件预览（Word / Excel / PPT / PDF / 文本 / 媒体 全类型直接显示内容） ===== */
.pv-loading, .pv-error { padding: 20px 0; }
.pv-media { display: flex; justify-content: center; }
.pv-img { max-width: 100%; max-height: 68vh; border-radius: 10px; }
.pv-video { max-width: 100%; width: 100%; max-height: 68vh; border-radius: 10px; background: #000; }
.pv-audio { width: 100%; margin-top: 8px; }
.pv-frame { width: 100%; height: 68vh; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.pv-tip { margin: 8px 0 0; }
/* v80：预览正文字号放大到与标题一致（16px → 20px），表格内文字同步放大 */
.pv-doc { max-height: 66vh; overflow: auto; line-height: 1.75; font-size: 20px; word-break: break-word; }
.pv-doc img { max-width: 100%; height: auto; }
.pv-doc table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.pv-doc table td, .pv-doc table th { border: 1px solid var(--border); padding: 6px 9px; font-size: 18px; }
.pv-sheet table td, .pv-sheet table th { border: 1px solid var(--border); padding: 5px 8px; font-size: 13px; }
/* v79：预览弹窗标题（文件名）字号大 2 号（17px → 20px），仅作用于预览弹窗，不影响其它弹窗 */
.pv-modal .modal-head h3 { font-size: 20px; font-weight: 800; }
.pv-excel { max-height: 66vh; display: flex; flex-direction: column; }
.pv-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pv-tab { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 5px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; }
.pv-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pv-sheet { flex: 1; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.pv-sheet table { border-collapse: collapse; }
.pv-ppt { max-height: 66vh; overflow: auto; }
.pv-slide { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
.pv-slide-no { font-size: 12px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.pv-textwrap { max-height: 66vh; overflow: auto; }
.pv-text { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.7; font-family: inherit; }

/* ===== v58 工作台背景（每次打开随机换一张） ===== */
.app-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: 0; transition: opacity .5s ease;
}
.app-bg.on { opacity: 1; }
.app-bg::after { content: ''; position: absolute; inset: 0; background: rgba(251,248,242,.74); }
[data-theme="dark"] .app-bg::after { background: rgba(26,26,34,.76); }

/* ===== v81：照片编辑器（裁剪范围 / 旋转方向 / 添加标注） ===== */
.ie-wrap { display: flex; flex-direction: column; gap: 8px; }
.ie-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ie-tool.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }
.ie-colors { gap: 8px; }
.ie-sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.ie-sw.is-on { outline: 2px solid var(--primary); outline-offset: 2px; }
.ie-text { width: 100%; }
.ie-stage { display: flex; justify-content: center; align-items: center; background: rgba(127,127,127,.12); border-radius: 8px; padding: 8px; overflow: auto; }
.ie-canvas { max-width: 100%; border-radius: 4px; touch-action: none; cursor: crosshair; background: #fff; }
.ie-tip { margin: 0; }
.ie-skip { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .8; cursor: pointer; }

/* ===== v82：待办「开始时间」提醒（开始前 10 分钟） ===== */
/* 待办卡片的即将开始横幅（与课前提醒同款醒目，改用紫色系区分：紫色=待办，橙色=上课） */
.todo-reminder { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; padding: 10px 14px; border-radius: 12px; background: linear-gradient(135deg, #B7A6E0, #9C8AC4); color: #fff; font-weight: 800; box-shadow: 0 8px 22px rgba(156,138,196,.34); animation: todoRemindPulse 1.6s ease-in-out infinite; }
.todo-reminder .tr-ic { display: inline-flex; }
.todo-reminder .tr-text { font-size: 14px; }
.todo-reminder .tr-time { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 900; }
.todo-reminder.reminder-hidden { display: none; }
@keyframes todoRemindPulse { 0%,100% { transform: translateY(0); box-shadow: 0 8px 22px rgba(156,138,196,.34); } 50% { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(156,138,196,.5); } }
/* 待办行的「设置开始时间」按钮：已设置时高亮 */
.todo-clk { padding: 4px 6px; opacity: .55; }
.todo-clk.has-start { opacity: 1; color: var(--primary); background: rgba(156,138,196,.14); }
/* 开始时间设置弹窗 */
.tr-form { display: flex; flex-direction: column; gap: 10px; }
.tr-row { display: flex; align-items: center; gap: 10px; }
.tr-lab { min-width: 64px; font-weight: 700; }
.tr-row .tr-inp { flex: 1; min-width: 0; }
.tr-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-snd { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.tr-perm { display: flex; align-items: center; gap: 8px; }
.tr-perm-ok { color: var(--ok); font-size: 13px; font-weight: 700; }

/* ===== v83：听课课表每条补上该节次的起止时间 ===== */
.listen-time { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.listen-row.is-today .listen-time { color: var(--primary-d); }

/* ===== v85：待办新增「日常」分类（青绿色标签，与备课绿/教研蓝/通知橙区分） ===== */
.cat-daily { background: rgba(122,190,178,.22); color: #47907F; }
[data-theme="dark"] .cat-daily { background: rgba(122,190,178,.16); color: #8FD4C6; }

/* ===== v86：作业新增「免做」状态（青色系，与请假灰紫/未提交橙区分） ===== */
.st-exempt { color: #2a9d8f; } .st-exempt.hb-dot, .hb-dot.st-exempt { background: #2a9d8f; }
[data-theme="dark"] .st-exempt { color: #7fd8c8; }

/* v93 相似练习：云端检索真题候选卡片 */
.sim-fetch-box { margin-bottom: 12px; }
.sim-candidate { border: 1px solid var(--bd, #e3e0f0); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--card2, rgba(127,127,127,.05)); }
.sim-c-title { font-weight: 600; margin-bottom: 4px; }
.sim-c-analysis { margin: 4px 0; }
.sim-c-src { font-size: 12px; margin-bottom: 8px; }

/* v96 笔记抽查：本班抽查汇总页内展示 */
.note-sum-body .note-sum-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.note-sum-body .note-sum-stats .stat { flex: 1 1 80px; text-align: center; }
.note-sum-table-wrap { max-height: 55vh; overflow: auto; border-radius: 10px; }

/* v97 相似练习：匹配规则说明与命中维度标签 */
.sim-rule-box { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; background: var(--surface-2, rgba(127,127,127,.05)); }
.sim-rule-box p { margin: 2px 0; font-size: 13px; line-height: 1.7; }
.sim-c-match { margin: 4px 0; font-size: 12px; }
.sim-c-match .chip { margin-right: 6px; }

/* ===== v155 相似练习：多选批量保存 + 考察内容相似度 ===== */
/* 候选卡片头部：勾选 / 序号 / 相似度 / 状态 */
.sim-c-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.sim-c-pick { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; user-select: none; }
.sim-c-pick .sim-ck { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary, #6b7cff); }
.sim-c-idx { font-size: 12px; color: var(--muted, #888); }
.sim-score { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(127,127,127,.14); }
.sim-level { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border, #e3e0f0); }
.sim-st { margin-left: auto; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: rgba(127,127,127,.12); color: var(--muted, #888); }
.sim-st.st-sel { background: rgba(107,124,255,.16); color: var(--primary, #6b7cff); font-weight: 600; }
.sim-st.st-saved { background: rgba(58,170,120,.16); color: #2f9e6a; font-weight: 600; }
/* 相似度量级配色 */
.sim-score.lv-high, .sim-level.lv-high { color: #2f9e6a; }
.sim-score.lv-high { background: rgba(58,170,120,.16); }
.sim-score.lv-mid, .sim-level.lv-mid { color: #b07d1a; }
.sim-score.lv-mid { background: rgba(214,158,46,.18); }
.sim-score.lv-low, .sim-level.lv-low { color: #9a6bd6; }
.sim-score.lv-low { background: rgba(154,107,214,.16); }
.sim-score.lv-weak, .sim-level.lv-weak { color: var(--muted, #888); }
/* 相似度分项与理由（可解释） */
.sim-c-sim { margin: 2px 0 6px; }
.sim-c-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.sim-p { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: rgba(107,124,255,.10); color: var(--text, inherit); }
.sim-p-aux { background: rgba(127,127,127,.10); color: var(--muted, #888); }
.sim-c-reasons { font-size: 12px; color: var(--muted, #777); line-height: 1.7; }
.sim-c-warn { font-size: 12px; color: #b07d1a; margin: 4px 0; }
.sim-c-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
/* 选中 / 已保存的卡片外观 */
.sim-candidate.is-sel { border-color: var(--primary, #6b7cff); box-shadow: 0 0 0 1px var(--primary, #6b7cff) inset; }
.sim-candidate.is-saved { opacity: .72; border-style: dashed; }
/* 选择条（已选 N 题 / 全选 / 清空 / 保存所选） */
.sim-selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0 8px; margin-bottom: 4px; border-bottom: 1px dashed var(--border, #e3e0f0); }
.sim-sel-count { font-size: 13px; font-weight: 600; }
.sim-sel-sp { flex: 1 1 auto; }
.sim-save-btn:disabled { opacity: .5; cursor: not-allowed; }
[data-theme="dark"] .sim-score.lv-high { color: #7fd8b0; }
[data-theme="dark"] .sim-st.st-saved { color: #7fd8b0; }
[data-theme="dark"] .sim-score.lv-mid { color: #e6c06a; }

/* =========================================================================
   v98 统一题目排版（题库主列表详情 / 错题本 / 相似练习 / 组卷预览 共用）
   字段顺序：题号 → 题型·难度·分类标签 → 题干 → 题图 → 选项 → 答案 → 解析 → 元信息 → 操作区
   ========================================================================= */
.qn { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface); line-height: 1.85; }
.qn + .qn { margin-top: 12px; }
.qn-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.qn-no { font-weight: 800; font-size: 15px; color: var(--primary-d, #2b93cd); }
.qn-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.qn-badge { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2, rgba(127,127,127,.1)); color: var(--text-2, #556); white-space: nowrap; }
.qn-badge-kind { background: rgba(43,147,205,.12); color: #2b93cd; }
.qn-badge-diff { background: rgba(255,152,0,.14); color: #b45f04; }
.qn-badge-dim { background: rgba(102,102,204,.1); color: #5566cc; }
.qn-content { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.qn-figure { margin: 10px 0 2px; }
.qn-img { display: block; max-width: min(100%, 420px); width: auto; border-radius: 8px; border: 1px solid var(--border); }
.qn-options { margin: 10px 0 4px; padding-left: 26px; }
.qn-option { margin: 6px 0; word-break: break-word; }
.qn-option.is-correct { font-weight: 700; color: #2f8a4d; }
.qn-opt-mark { display: inline-flex; margin-left: 8px; padding: 0 8px; border-radius: 999px; font-size: 11px; background: rgba(47,138,77,.14); color: #2f8a4d; vertical-align: middle; }
.qn-answer, .qn-analysis, .qn-source { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, rgba(127,127,127,.06)); font-size: 14px; }
.qn-answer-wrong .qn-v { color: #c0392b; text-decoration: line-through; }
.qn-answer { background: rgba(47,138,77,.08); }
.qn-analysis { background: var(--surface-2, rgba(127,127,127,.06)); color: var(--text-2, #556); }
.qn-k { display: inline-block; min-width: 62px; margin-right: 8px; font-weight: 700; color: var(--text-1, #333); }
.qn-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--text-2, #777); }
.qn-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qn-compact { padding: 10px 12px; }
.qn-compact .qn-content { font-size: 13.5px; }
.qn-brief { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; font-size: 13.5px; color: var(--text-2, #556); }
/* 响应式：移动端收紧间距、选项与标签换行，元信息与操作区堆叠 */
@media (max-width: 640px) {
  .qn { padding: 12px 12px; border-radius: 10px; line-height: 1.75; }
  .qn-content { font-size: 14px; }
  .qn-options { padding-left: 22px; }
  .qn-option { margin: 5px 0; }
  .qn-k { min-width: 56px; display: block; margin-bottom: 2px; }
  .qn-meta { gap: 8px; font-size: 12px; }
  .qn-img { max-width: 100%; }
}

/* v99 列表内联题目内容：无需点击即可在页面内查看完整题目 */
.qn-list-item { cursor: pointer; position: relative; padding-right: 40px; }
/* v101：列表卡片内直接删除按钮（触屏常显，悬停/聚焦变红；不遮挡标题与题目正文） */
.qn-del { position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--border, #e2e2e2); border-radius: 8px; background: var(--surface-2, rgba(127,127,127,.06)); color: var(--muted, #888); cursor: pointer; opacity: .75; transition: opacity .15s, color .15s, border-color .15s; }
.qn-del:hover { opacity: 1; color: #c0392b; border-color: rgba(192,57,43,.4); }
.qn-del:focus-visible { opacity: 1; outline: 2px solid rgba(192,57,43,.35); }
.qn-del svg { width: 14px; height: 14px; }
@media (max-width: 640px) { .qn-del { width: 34px; height: 34px; } .qn-list-item { padding-right: 44px; } }
.qn-inline { margin: 8px 0 6px; user-select: text; -webkit-user-select: text; }
.qn-inline .qn { padding: 12px 14px; border-radius: 10px; background: var(--surface-2, rgba(127,127,127,.05)); }
.qn-inline .qn-head { margin-bottom: 6px; }
.qn-inline .qn-content { font-size: 14px; }
.qn-inline .qn-img { max-width: min(100%, 320px); }
.qn-inline .qn-options { margin: 8px 0 2px; }
.qn-inline .qn-meta { display: none; } /* 列表内已由底部摘要行展示元信息，避免重复 */
@media (max-width: 640px) {
  .qn-inline .qn { padding: 10px 10px; }
  .qn-inline .qn-img { max-width: 100%; }
}

/* v100 题目完整性与归档：残缺标记、图片兜底 */
.qn-flag { display: inline-flex; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(192,57,43,.12); color: #c0392b; vertical-align: middle; }
.qn-flag-ok { background: rgba(47,138,77,.12); color: #2f8a4d; }
.qn-list-incomplete { border-left: 3px solid rgba(192,57,43,.45); }
.qn-figure-failed .qn-img-fallback { display: inline-block; padding: 10px 14px; border: 1px dashed var(--border, #ddd); border-radius: 8px; font-size: 13px; color: #b45f04; background: rgba(255,152,0,.08); }

/* v105 题库「上传文件识别题目」：文件队列 + 逐题校对卡片 */
.import-files { border: 1px solid var(--border); border-radius: 10px; padding: 8px; max-height: 26vh; overflow: auto; background: var(--surface-2, rgba(127,127,127,.05)); }
.import-file { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px dashed var(--border); font-size: 13px; }
.import-file:last-child { border-bottom: 0; }
.import-fname { max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-results { margin-top: 8px; max-height: 46vh; overflow: auto; padding-right: 4px; }
.import-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2, rgba(127,127,127,.05)); }
.import-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.import-card-head .import-src { flex: 1; font-size: 12px; color: var(--muted, #888); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-warn { font-size: 12px; line-height: 1.6; color: #b45f04; margin-bottom: 6px; }
.import-warn:empty { display: none; }

/* v106 题库元素设置：内置 + 自定义清单（支持层级缩进） */
.dict-list { max-height: 40vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--surface-2, rgba(127,127,127,.05)); }
.dict-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px dashed var(--border); }
.dict-item:last-child { border-bottom: 0; }
.dict-item.builtin { opacity: .78; }
.dict-main { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.dict-name { font-weight: 600; white-space: nowrap; }
.dict-ops { display: flex; gap: 6px; flex-shrink: 0; }
.dict-form { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2, rgba(127,127,127,.04)); }
.dict-form .row { margin-top: 10px; }

/* v107 题库「章节 / 考点」级联目录控件：父级章节、子级考点，逐级展开，当前项高亮 */
.cas { position: relative; display: inline-block; }
.cas-btn { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.cas-btn.cas-on { border-color: var(--accent, #6c5ce7); color: var(--accent, #6c5ce7); font-weight: 600; }
.cas-panel { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; display: none; width: 320px; max-height: 62vh; overflow: auto; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface, #fff); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.cas.open .cas-panel { display: block; }
.cas-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; line-height: 1.5; }
.cas-row:hover { background: var(--surface-2, rgba(127,127,127,.08)); }
.cas-caret { flex-shrink: 0; width: 14px; color: var(--muted, #888); font-size: 12px; }
.cas-name { flex: 1; }
.cas-cnt { flex-shrink: 0; font-size: 11px; color: var(--muted, #999); }
.cas-kp { padding-left: 26px; }
.cas-line { flex-shrink: 0; width: 12px; height: 18px; border-left: 1px dashed var(--border); border-bottom: 1px dashed var(--border); margin-bottom: 6px; }
.cas-root { font-weight: 600; color: var(--muted, #666); }
.cas-ch { font-weight: 600; }
.cas-ch.cas-path { color: var(--accent, #6c5ce7); }
.cas-row.cas-active { background: var(--accent, #6c5ce7); color: #fff; }
.cas-row.cas-active .cas-caret, .cas-row.cas-active .cas-cnt { color: rgba(255,255,255,.85); }
.cas-extra { color: var(--muted, #888); font-style: italic; }
@media (max-width: 640px) {
  .cas-panel { width: min(86vw, 320px); }
  .cas-btn { max-width: 48vw; }
}

/* v108 题库目录管理：小节层级、排序按钮与目录入口 */
.cas-sec { padding-left: 18px; }
.cas-kp2 { padding-left: 46px; }
.cas-row.cas-sec .cas-name { font-weight: 600; color: var(--accent, #6c5ce7); }
.cas-row.cas-kp2 .cas-name { font-weight: 400; }
.cas-manage { margin-top: 4px; border-top: 1px dashed var(--border); padding-top: 8px; color: var(--accent, #6c5ce7); font-weight: 600; }
.dir-list .dict-ops .btn-sm { min-width: 30px; }

/* v109 可搜索下拉（解题方法 / 解题模型）：输入即筛选，支持中英文关键词 */
.combo { position: relative; }
.combo-box { position: relative; }
.combo-input { padding-right: 30px; }
.combo-clear { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted, #999); font-size: 14px; line-height: 1; cursor: pointer; }
.combo-clear:hover { background: var(--surface-2, rgba(127,127,127,.12)); color: #c0392b; }
.combo-list { display: none; position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0; max-height: 240px; overflow: auto; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface, #fff); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.combo.open .combo-list { display: block; }
.combo-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.combo-item:hover { background: var(--surface-2, rgba(127,127,127,.1)); }
.combo-item.active { background: var(--accent, #6c5ce7); color: #fff; }
.combo-item.none { color: var(--muted, #888); font-style: italic; }
.combo-item.active.none { color: #fff; }
.combo-en { flex-shrink: 0; font-size: 11px; opacity: .6; }
.combo-none { display: none; padding: 10px; font-size: 12px; color: var(--muted, #999); text-align: center; }

/* v109 题库 → 错题本：批量勾选列表 + 卡片上的单题导入按钮 */
.imp-list { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.imp-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 6px; border-bottom: 1px dashed var(--border); }
.imp-item:last-child { border-bottom: 0; }
.imp-item.dup { opacity: .55; }
.imp-body { flex: 1; min-width: 0; }
.qn-act { position: absolute; top: 8px; right: 44px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--border, #e2e2e2); border-radius: 8px; background: var(--surface-2, rgba(127,127,127,.06)); color: var(--muted, #888); cursor: pointer; opacity: .75; transition: opacity .15s, color .15s, border-color .15s; }
.qn-act:hover { opacity: 1; color: var(--accent, #6c5ce7); border-color: rgba(108,92,231,.4); }
.qn-act svg { width: 14px; height: 14px; }
@media (max-width: 640px) { .qn-act { width: 34px; height: 34px; right: 52px; } }

/* v110 组卷纸质试卷版式：题干 / 题图 / 选项分行，图片完整不裁剪不变形不溢出 */
.pp-view { color: var(--text, #222); }
.pp-view .pp-title { text-align: center; }
.pp-view .pp-no { font-weight: 600; }
.pp-view .pp-item { page-break-inside: avoid; break-inside: avoid; }
.pp-view .pp-figure { line-height: 0; }   /* 图下不留空行 */
.pp-view .pp-img { max-width: 100%; height: auto; object-fit: contain; object-position: left center; background: transparent; }
.pp-view .pp-options { display: block; }
.pp-view .pp-option { display: block; }
.pp-view .pp-answers { margin-top: 22px; padding-top: 12px; border-top: 1px dashed var(--border, #ddd); }
@media (max-width: 640px) {
  .pp-view .pp-stem { font-size: 14px !important; }
  .pp-view .pp-options { padding-left: 1.6em !important; }
  .pp-view .pp-figure { margin-left: 0 !important; }
}
@media print {
  .pp-view { color: #000; }
  .pp-view .pp-img { max-width: 100% !important; height: auto !important; object-fit: contain !important; page-break-inside: avoid; }
  .pp-view .pp-item, .pp-view .pp-sec, .pp-view .pp-title { page-break-inside: avoid; break-inside: avoid; }
  .pp-view .pp-answers { page-break-before: auto; }
}

/* v112 登录页：错误提示与本机模式入口 */
.login-err { margin: 10px 0 0; padding: 9px 12px; border: 1px solid rgba(192,57,43,.35); border-radius: 10px; background: rgba(192,57,43,.07); color: #c0392b; font-size: 13px; line-height: 1.6; word-break: break-word; }
.login-card .btn-block { margin-top: 12px; }

/* v118 题图裁剪：自动裁剪后手动微调 + 手动录入题图裁剪 */
.figcrop { display: flex; flex-direction: column; gap: 8px; }
.figcrop-stage { position: relative; display: inline-block; max-width: 100%; max-height: 60vh; overflow: visible; border-radius: 8px; background: var(--surface-2, rgba(127,127,127,.12)); line-height: 0; user-select: none; touch-action: none; }
.figcrop-img { display: block; max-width: 100%; max-height: 60vh; border-radius: 8px; }
.figcrop-sel { position: absolute; border: 2px solid #2aa0dc; box-shadow: 0 0 0 9999px rgba(20,26,34,.42); cursor: move; }
.figcrop-hd { position: absolute; width: 16px; height: 16px; background: #fff; border: 2px solid #2aa0dc; border-radius: 4px; }
.figcrop-hd-nw { left: -9px; top: -9px; cursor: nwse-resize; }
.figcrop-hd-ne { right: -9px; top: -9px; cursor: nesw-resize; }
.figcrop-hd-sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.figcrop-hd-se { right: -9px; bottom: -9px; cursor: nwse-resize; }
/* 批量导入卡片里的题图预览 + 按钮 */
.import-fig { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.import-fig-pv { max-height: 92px; max-width: 140px; border-radius: 8px; border: 1px solid var(--border, rgba(127,127,127,.3)); object-fit: contain; background: var(--surface-2, rgba(127,127,127,.06)); }

/* =======================================================================
   v135 媒体加载降级占位
   云端被限流 / 额度用尽 / 断网时，用带说明的占位块代替破图与空白。
   ======================================================================= */
.media-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px 12px; min-width: 96px; min-height: 72px;
  border: 1px dashed var(--border, rgba(127,127,127,.35));
  border-radius: 10px;
  background: var(--surface-2, rgba(127,127,127,.08));
  color: var(--muted, #8a8f98);
  text-align: center; line-height: 1.5;
  /* 作为 <img> 的兄弟节点出现时，撑满原图位置 */
  width: 100%; height: 100%;
}
.media-ph-image { min-height: 88px; }
.media-ph-video { min-height: 140px; }
.media-ph-icon { opacity: .62; display: flex; }
.media-ph-title { font-size: 13px; font-weight: 500; color: var(--text, #3a4048); }
.media-ph-hint { font-size: 11.5px; opacity: .82; max-width: 22em; }
.media-ph-retry { margin-top: 2px; }
/* 缩略图场景（小方块）用更紧凑的排版 */
.photo-thumb .media-placeholder,
.media-ph-compact { min-height: 0; padding: 6px 4px; gap: 2px; }
.photo-thumb .media-ph-title,
.media-ph-compact .media-ph-title { font-size: 11px; }
.photo-thumb .media-ph-hint,
.media-ph-compact .media-ph-hint { display: none; }

/* v135 媒体缓存管理面板 */
.media-cache-entry { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border, rgba(127,127,127,.22)); }
.media-cache-stat { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.media-cache-num { font-size: 20px; font-weight: 500; color: var(--text, #3a4048); }
.media-cache-lbl { font-size: 12px; color: var(--muted, #8a8f98); margin-right: 12px; }
.media-cache-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.media-cache-list { max-height: 240px; overflow: auto; border: 1px solid var(--border, rgba(127,127,127,.22)); border-radius: 10px; padding: 4px; }
.media-cache-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; }
.media-cache-item:hover { background: var(--surface-2, rgba(127,127,127,.08)); }
.media-cache-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.muted-warn { color: #b3730f; }

/* v135 每日提醒设置（自动待办的显示偏好） */
.auto-pref-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.auto-pref-item { display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 10px; border: 1px solid var(--border, rgba(127,127,127,.22));
  border-radius: 8px; font-size: 13px; }
.auto-pref-item:hover { background: var(--surface-2, rgba(127,127,127,.08)); }
.auto-pref-item input { width: 15px; height: 15px; accent-color: var(--primary-d); }

/* v135「每日提醒」入口：与「全部管理」区分开（不占用 .hch-link，避免抢第一个匹配） */
.hch-quiet { font-size: 12.5px; color: var(--muted, #8a8f98); cursor: pointer; }
.hch-quiet:hover { color: var(--primary-d); text-decoration: underline; }

/* v142：选择题选项行（编辑弹窗）横向排布，含删除按钮 */
.opt-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.opt-row .opt-key { font-weight: 600; min-width: 1.2em; text-align: center; flex: 0 0 auto; }
.opt-row .inp { flex: 1 1 auto; }
.opt-row .opt-del { flex: 0 0 auto; padding: 2px 7px; line-height: 1.2; }
.opts-box .btn { margin-top: 6px; }

/* v144：统一「编辑题目」面板 —— 顶部工具行的紧凑学生下拉；弹窗底部按钮多时自动换行不溢出 */
.row-inline { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.row-inline .stu-sel { width: auto; min-width: 150px; flex: 0 0 auto; padding: 7px 10px; }
.modal-foot { flex-wrap: wrap; }

/* v145：课堂记录按「日期 + 第几节课 + 时间段」归档 —— 日期分组 / 行内操作 / 课段说明 */
.rec-day-group { margin-bottom: 4px; }
.rec-day-group .sec-title { margin: 16px 0 6px; font-size: 14px; }
.rec-acts { display: flex; gap: 8px; margin-top: 6px; }
.rec-slot-line { font-weight: 800; font-size: 15px; color: var(--text); padding: 2px 0 4px; }

/* v146：题目唯一编码 + 重复提醒 —— 卡片编码行 / 重复标记 / 顶部重复统计条 */
.qn-code-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.qn-code-line-edit { margin: 0 0 6px; padding: 6px 9px; border-radius: 9px; background: var(--surface-2, rgba(127,127,127,.08)); }
.qn-qcode { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; letter-spacing: .2px; color: var(--text-2, #77808c); word-break: break-all; }
.qn-dup-badge { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(192,57,43,.12); color: #c0392b; white-space: nowrap; }
.dup-bar { margin: 0 0 4px; }
.dup-bar-inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 11px; border-radius: 10px; background: rgba(192,57,43,.07); border: 1px solid rgba(192,57,43,.18); }
.dup-bar-text { font-size: 13px; font-weight: 600; color: #c0392b; }
.dup-bar:empty { display: none; }

/* v156：题目自动归档（错题本 / 相似练习 → 题库）—— 题库卡片来源标记 */
.qn-src-tag { display: inline-flex; align-items: center; margin-left: 8px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(47,138,77,.10); color: #2f8a4d; vertical-align: middle; white-space: nowrap; }
[data-theme="dark"] .qn-src-tag { background: rgba(95,214,160,.16); color: #7fd6a4; }
