:root {
  --bg: #f4f7f6;
  --card: #ffffff;
  --border: #e6ebe9;
  --text: #1f2d28;
  --muted: #6b7f77;
  --primary: #10b981;
  --primary-600: #059669;
  --primary-bg: #ecfdf5;
  --primary-300: #6ee7b7;
  --primary-700: #047857;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --blue: #0ea5e9;
  --blue-bg: #f0f9ff;
  --purple: #8b5cf6;
  --purple-bg: #f4f1fe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .10);
  /* 扩展主题变量 */
  --surface: #ffffff;      /* 侧栏/抽屉/输入框/表头底色 */
  --surface-2: #fafcfb;    /* 悬停/交替行/浅灰块 */
  --well-bg: #f8fafc;      /* 引用/内容/语音面板底色 */
  --login-bg: linear-gradient(160deg, #ecfdf5 0%, #f4f7f6 45%, #f0f9ff 100%);
  --brand-grad: linear-gradient(135deg, #10b981, #059669);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* ===== 主题：奶油风 ===== */
html[data-theme="cream"] {
  --bg: #faf5ec;
  --card: #fffdf7;
  --surface: #fffdf7;
  --surface-2: #f6ecdc;
  --well-bg: #fbf3e5;
  --border: #f0e2cd;
  --text: #4d4238;
  --muted: #a28f77;
  --primary: #e09b5a;
  --primary-600: #c98038;
  --primary-bg: #fbeedb;
  --primary-300: #f0c99a;
  --primary-700: #b06a26;
  --login-bg: linear-gradient(160deg, #fdf3e3 0%, #faf5ec 45%, #f7ead8 100%);
  --brand-grad: linear-gradient(135deg, #e09b5a, #c98038);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(120, 90, 50, .05), 0 4px 14px rgba(120, 90, 50, .07);
  --shadow-lg: 0 10px 30px rgba(120, 90, 50, .14);
}

/* ===== 主题：古典风 ===== */
html[data-theme="classic"] {
  --bg: #f6efe2;
  --card: #fdfaf2;
  --surface: #fdfaf2;
  --surface-2: #f3e9d5;
  --well-bg: #f8f0df;
  --border: #e5d5b8;
  --text: #3c3024;
  --muted: #90795a;
  --primary: #b5482f;
  --primary-600: #98351f;
  --primary-bg: #f7e7de;
  --primary-300: #d89a80;
  --primary-700: #8a2e1a;
  --login-bg: linear-gradient(160deg, #f7e9d6 0%, #f6efe2 45%, #ece0c8 100%);
  --brand-grad: linear-gradient(135deg, #b5482f, #8a2e1a);
  --radius: 8px;
  --shadow: 0 1px 2px rgba(80, 60, 30, .06), 0 3px 10px rgba(80, 60, 30, .07);
  --shadow-lg: 0 10px 28px rgba(80, 60, 30, .16);
  --font: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Microsoft YaHei", serif;
}

/* ===== 主题：暗黑风 ===== */
html[data-theme="dark"] {
  --bg: #12181c;
  --card: #1c2429;
  --surface: #1c2429;
  --surface-2: #232d33;
  --well-bg: #172026;
  --border: #2b363d;
  --text: #e6ecef;
  --muted: #8b98a0;
  --primary: #34d399;
  --primary-600: #10b981;
  --primary-bg: #0e2f26;
  --primary-300: #0f766e;
  --primary-700: #6ee7b7;
  --green-bg: #12301f;
  --red-bg: #3a1c1c;
  --amber-bg: #3a2c14;
  --blue-bg: #10283a;
  --purple-bg: #2a1f45;
  --login-bg: linear-gradient(160deg, #0e2f26 0%, #12181c 45%, #0f2530 100%);
  --brand-grad: linear-gradient(135deg, #34d399, #059669);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
}

/* ===== 主题：西洋古典宫廷风 ===== */
html[data-theme="royal"] {
  --bg: #f3ede1;
  --card: #fbf8f1;
  --surface: #fbf8f1;
  --surface-2: #efe7d6;
  --well-bg: #f6f0e3;
  --border: #dccfb2;
  --text: #2e2620;
  --muted: #8a7a5f;
  --primary: #8c6d3f;
  --primary-600: #75592f;
  --primary-bg: #f4ead6;
  --primary-300: #c8ab77;
  --primary-700: #5d4522;
  --login-bg: linear-gradient(160deg, #f6efdd 0%, #f3ede1 45%, #e9dfc8 100%);
  --brand-grad: linear-gradient(135deg, #b08d4c 0%, #7c5f2f 55%, #3b4a7a 100%);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(90, 70, 30, .08), 0 4px 12px rgba(90, 70, 30, .09);
  --shadow-lg: 0 10px 28px rgba(90, 70, 30, .18);
  --font: Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", "SimSun", serif;
}

/* ===== 主题：漫画风 ===== */
html[data-theme="comic"] {
  --bg: #f2f6ff;
  --card: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef3ff;
  --well-bg: #f6f9ff;
  --border: #c9d3ec;
  --text: #17233f;
  --muted: #6b7794;
  --primary: #4f7cff;
  --primary-600: #3a63e0;
  --primary-bg: #e9efff;
  --primary-300: #9db8ff;
  --primary-700: #2c4cb8;
  --login-bg: linear-gradient(160deg, #fff5d6 0%, #f2f6ff 50%, #e6f0ff 100%);
  --brand-grad: linear-gradient(135deg, #ffd43b, #ff9f43);
  --radius: 18px;
  --shadow: 0 2px 0 rgba(23, 35, 63, .9);
  --shadow-lg: 6px 6px 0 rgba(23, 35, 63, .9);
}
/* 漫画风：粗描边 + 硬阴影 */
html[data-theme="comic"] .card,
html[data-theme="comic"] .q-card,
html[data-theme="comic"] .theme-card {
  border: 2px solid #17233f;
  box-shadow: 4px 4px 0 rgba(23, 35, 63, .9);
}
html[data-theme="comic"] .btn.primary,
html[data-theme="comic"] .btn.danger {
  border: 2px solid #17233f;
  box-shadow: 3px 3px 0 rgba(23, 35, 63, .9);
}
html[data-theme="comic"] .btn.primary:active,
html[data-theme="comic"] .btn.danger:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(23, 35, 63, .9);
}

/* ===== 主题：音乐风 ===== */
html[data-theme="music"] {
  --bg: #faf7f2;
  --card: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3edf9;
  --well-bg: #f7f2fc;
  --border: #e6dced;
  --text: #332e3f;
  --muted: #857d96;
  --primary: #7b3fa0;
  --primary-600: #653386;
  --primary-bg: #f3e9fa;
  --primary-300: #b995d1;
  --primary-700: #4f2869;
  --login-bg: linear-gradient(160deg, #f3e9fa 0%, #faf7f2 50%, #f0f6ff 100%);
  --brand-grad: linear-gradient(135deg, #7b3fa0 0%, #4f2869 60%, #caa14f 100%);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 40, 80, .06), 0 4px 12px rgba(60, 40, 80, .07);
  --shadow-lg: 0 10px 30px rgba(60, 40, 80, .16);
}

/* ===== 主题：马卡龙粉 ===== */
html[data-theme="pink"] {
  --bg: #fdf2f6;
  --card: #fffafc;
  --surface: #fffafc;
  --surface-2: #fbe7ef;
  --well-bg: #fdf0f5;
  --border: #f3d4e0;
  --text: #4a2e3a;
  --muted: #b0839a;
  --primary: #ec4899;
  --primary-600: #db2777;
  --primary-bg: #fde7f1;
  --primary-300: #f9a8d4;
  --primary-700: #be185d;
  --login-bg: linear-gradient(160deg, #fde7f1 0%, #fdf2f6 50%, #f0f9ff 100%);
  --brand-grad: linear-gradient(135deg, #ec4899, #db2777);
  --radius: 20px;
  --shadow: 0 1px 2px rgba(190, 24, 93, .05), 0 4px 12px rgba(190, 24, 93, .06);
  --shadow-lg: 0 10px 30px rgba(190, 24, 93, .14);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--uff, var(--font));
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs, 14px);
  font-weight: var(--fw, 400);
  line-height: var(--lh, 1.65);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-600); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; background: var(--surface); color: var(--text);
  display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--border);
}
.sidebar .brand {
  padding: 22px 20px; font-size: 17px; font-weight: 800; color: var(--primary-600);
  border-bottom: 1px solid var(--border); letter-spacing: .5px; display:flex; align-items:center; gap:8px;
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand-grad);
  color: #fff; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0;
}
.sidebar .brand small { display:block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.nav { padding: 12px 12px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 14px; color: var(--muted);
  font-size: 14px; border-radius: 10px; transition: .15s; margin-bottom: 2px; font-weight: 500;
}
.nav a:hover { background: var(--primary-bg); color: var(--primary-600); }
.nav a.active { background: var(--primary-bg); color: var(--primary-600); font-weight: 700; }
.nav .icon { width: 20px; text-align: center; font-size: 16px; }
.main { flex: 1; padding: 28px 32px; max-width: 1180px; }
.page { display: none; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page.active { display: block; }
.page h1 { font-size: 22px; margin-bottom: 4px; font-weight: 800; }
.page .sub { color: var(--muted); margin-bottom: 22px; font-size: 13px; }

/* 顶部栏（移动端） */
.mobile-topbar { display: none; }

/* 卡片与统计 */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3 .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.stat .value.blue { color: var(--blue); }
.stat .value.green { color: var(--green); }
.stat .value.red { color: var(--red); }
.stat .value.amber { color: var(--amber); }
.stat .desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; transition: .15s; font-weight: 500; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.btn.primary:hover { background: var(--primary-600); }
.btn.danger { background: var(--surface); border-color: #fecaca; color: var(--red); }
.btn.danger:hover { background: var(--red-bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary-600); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.field textarea { min-height: 80px; resize: vertical; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; }
tr:hover td { background: var(--surface-2); }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.gray { background: var(--surface-2); color: var(--muted); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }

/* 进度条 */
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.bar.green > span { background: var(--green); }
.bar.red > span { background: var(--red); }
.bar.blue > span { background: var(--blue); }
.bar.amber > span { background: var(--amber); }

/* 等宽小字（IP、邀请码等机器可读内容） */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 进度环 */
.ring { display: flex; align-items: center; justify-content: center; }

/* 答题区 */
.q-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.q-stem { font-size: 16px; font-weight: 600; margin-bottom: 14px; line-height: 1.7; }
.q-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: .12s; }
.opt:hover { border-color: var(--primary); background: var(--primary-bg); }
.opt .key { font-weight: 700; color: var(--primary-600); min-width: 20px; }
.opt.sel { border-color: var(--primary); background: var(--primary-bg); }
.opt.correct { border-color: var(--green); background: var(--green-bg); }
.opt.wrong { border-color: var(--red); background: var(--red-bg); }
.feedback { margin-top: 10px; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.feedback.ok { background: var(--green-bg); color: var(--green); }
.feedback.no { background: var(--red-bg); color: var(--red); }
/* 答错后展示的解析：浅色底 + 左侧色条，和「错误」反馈区分开，避免糊成一片 */
.explain { margin-top: 8px; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.75;
  background: var(--surface-2); color: var(--text); border-left: 3px solid var(--amber); }
.explain b { display: block; margin-bottom: 4px; color: var(--amber); }

/* 登录 tab */
.login-tabs { display: flex; gap: 6px; background: var(--surface-2); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.login-tab { flex: 1; padding: 8px 0; border: none; background: transparent; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.login-tab.active { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow); }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--login-bg); padding: 20px; }
.login-card { width: 400px; background: var(--card); border-radius: 20px; padding: 36px 34px; box-shadow: var(--shadow-lg); }
.login-card .logo-big { width: 62px; height: 62px; border-radius: 18px; background: var(--brand-grad); color: #fff; font-size: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; font-weight: 800; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 13px; }

/* 提示条 */
.toast { position: fixed; top: 18px; left: 50%; transform: translate(-50%, -12px); z-index: 999; background: #1f2d28; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.18); opacity: 0; transition: .25s; max-width: 86vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 排行 */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.rank-item:last-child { border-bottom: none; }
.rank-num { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.rank-num.top1 { background: #fbbf24; color: #fff; }
.rank-num.top2 { background: #9ca3af; color: #fff; }
.rank-num.top3 { background: #d97706; color: #fff; }
.rank-item .gname { flex: 1; font-weight: 600; min-width: 0; }
.rank-item .gacc { font-weight: 800; color: var(--primary-600); }
/* 小组排行 · 组内同学明细 */
.rank-toggle { flex-shrink: 0; white-space: nowrap; }
.rank-group:last-child .rank-item { border-bottom: none; }
.rank-members { padding: 4px 0 14px 40px; }
.rm-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 0 8px; }
.rm-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.rm-row + .rm-row { margin-top: 4px; }
.rm-row.me { background: var(--primary-bg); border: 1px solid var(--primary-300); }
.rm-rank { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.rm-row.me .rm-rank { background: var(--primary); color: #fff; }
.rm-body { flex: 1; min-width: 0; }
.rm-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rm-name { font-weight: 600; font-size: 14px; }
.rm-acc { font-weight: 800; color: var(--primary-600); font-size: 14px; }
.rm-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.rm-meta b { color: var(--text); font-weight: 600; }
.rm-last { margin-left: auto; color: var(--muted); }
.rm-bar { height: 5px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.rm-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
@media (max-width: 720px) {
  .rank-members { padding-left: 0; }
  .rm-last { margin-left: 0; }
}

/* 图表容器 */
.chart-box { width: 100%; }
.chart-box svg { width: 100%; height: auto; }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 44px 20px; }
.empty .big { font-size: 42px; margin-bottom: 10px; }

/* 小组加入卡片 */
.group-join-card { text-align: center; padding: 8px 4px; }
.group-join-card .gbig { font-size: 46px; margin-bottom: 8px; }
.invite-box { text-align: center; background: var(--primary-bg); border: 1px dashed var(--primary); border-radius: 14px; padding: 18px; }
.invite-code { font-size: 30px; font-weight: 800; letter-spacing: 8px; color: var(--primary-600); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.dot.off { background: var(--muted); }

.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bold { font-weight: 600; }
.right { text-align: right; }

/* 模态 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--card); border-radius: 16px; width: 560px; max-width: 100%; max-height: 88vh; overflow-y: auto; padding: 24px; }
.modal h3 { margin-bottom: 16px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---- 背诵模块 ---- */
.recite-modal { width: 720px; }
/* 学生详情弹窗：要放下「刷题 / 背诵 / 访问监测 / 登录记录」四块，窄了会挤成一条 */
.stu-modal { width: 840px; }
.stu-modal .log-tb td, .stu-modal .log-tb th { padding: 6px 8px; font-size: 12px; }
.stepper-val {
  display: inline-block; min-width: 44px; text-align: center;
  font-size: 16px; font-weight: 800; color: var(--primary-600);
}
.r-card { padding: 16px 18px; margin-bottom: 12px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.r-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); border-color: var(--primary-300); }
.r-term { font-weight: 800; font-size: 16px; color: var(--text); }
.r-bd { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bd-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--primary-bg); color: var(--primary-700);
  font-size: 12px; font-weight: 500; line-height: 1.6;
}
.bd-chip.miss { background: var(--red-bg); color: var(--red); font-weight: 700; }
/* 考点等级微型标记：用于紧凑芯片列表（如每日背诵词条），随主题自适应配色 */
.lv-chip {
  display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 6px;
  font-size: 10px; font-weight: 700; line-height: 16px; vertical-align: 1px;
  letter-spacing: .3px; white-space: nowrap;
}
.lv-chip.lv-1 { background: var(--red-bg); color: var(--red); }
.lv-chip.lv-2 { background: var(--amber-bg); color: var(--amber); }
.lv-chip.lv-3 { background: var(--blue-bg); color: var(--blue); }
.lv-chip.lv-0 { background: var(--surface-2); color: var(--muted); }
.r-hint { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--primary-bg); border: 1px dashed var(--primary-300); }
.r-content {
  margin-top: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--well-bg); border: 1px solid var(--border);
  font-size: 14px; line-height: 2; color: var(--text); white-space: pre-wrap; word-break: break-all;
}
.r-blank {
  display: inline-block; min-width: 72px; width: auto; padding: 2px 8px; margin: 0 2px;
  border: none; border-bottom: 2px solid var(--primary);
  background: var(--surface); font-size: 14px; text-align: center; color: var(--text);
  outline: none; border-radius: 4px 4px 0 0;
}
.r-blank:focus { background: var(--primary-bg); }
.r-blank.ok { border-bottom-color: var(--green); background: var(--green-bg); }
.r-blank.no { border-bottom-color: var(--red); background: var(--red-bg); color: var(--red); }
.r-result {
  display: flex; align-items: center; gap: 16px; margin-top: 14px;
  padding: 14px 18px; border-radius: 14px;
}
.r-result.pass { background: var(--green-bg); border: 1px solid #bbf7d0; }
.r-result.fail { background: var(--amber-bg); border: 1px solid #fde68a; }
.r-score { font-size: 40px; font-weight: 900; line-height: 1; }
.r-result.pass .r-score { color: var(--green); }
.r-result.fail .r-score { color: var(--amber); }
.r-score small { font-size: 14px; font-weight: 600; margin-left: 2px; }
.voice-panel { margin-top: 12px; }
.voice-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.voice-dot.rec { background: var(--red); animation: voicePulse 1.2s infinite; }
@keyframes voicePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, .4); }
  50% { opacity: .6; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.voice-live {
  margin-top: 12px; min-height: 96px; max-height: 240px; overflow-y: auto;
  padding: 12px 14px; border-radius: 12px; background: var(--well-bg); border: 1px solid var(--border);
  font-size: 14px; line-height: 1.9; color: var(--text);
}
.voice-interim { color: var(--muted); }

/* ---- 背诵：分页签 + 分栏浏览 ---- */
.rtabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: var(--surface-2); padding: 4px; border-radius: 12px;
  width: fit-content; max-width: 100%;
}
.rtab {
  border: none; background: transparent; padding: 9px 18px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--muted); transition: .15s; white-space: nowrap;
}
.rtab.active { background: var(--card); color: var(--primary-600); box-shadow: var(--shadow); font-weight: 700; }
.recite-browser { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.recite-side { min-width: 0; }
.recite-filter { padding: 14px; margin-bottom: 12px; }
.recite-filter .grid { gap: 2px 12px; }
.recite-filter .field { margin-bottom: 10px; }
.recite-filter .field:last-child { margin-bottom: 0; }
.recite-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 68vh; overflow-y: auto; padding-right: 4px;
}
.recite-list::-webkit-scrollbar { width: 6px; }
.recite-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.r-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border);
  transition: border-color .12s, background .12s;
}
.r-item:hover { border-color: var(--primary-300); }
.r-item.active { border-color: var(--primary); background: var(--primary-bg); }
.r-item-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: none; }
.r-item-dot.doing { background: var(--blue); }
.r-item-dot.done { background: var(--green); }
.r-item-term { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recite-main { min-width: 0; }
.recite-main .actions { display: flex; gap: 10px; margin-top: 16px; }
.rp-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
@media (max-width: 860px) {
  .recite-browser { grid-template-columns: 1fr; }
  .recite-main { display: none; }
  .recite-list { max-height: none; }
  .rtabs { width: 100%; }
  .rtab { flex: 1; text-align: center; }
}

/* 挖空范围/数量选择 */
.blk-opts { margin-top: 12px; }
.scope-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.scope-chip {
  display: flex; flex-direction: column; gap: 2px; cursor: pointer;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); transition: border-color .12s ease, background .12s ease;
}
.scope-chip.on { border-color: var(--primary); background: var(--primary-bg); box-shadow: 0 0 0 3px var(--primary-bg); }
.scope-name { font-weight: 700; font-size: 14px; color: var(--text); }
.scope-desc { font-size: 12px; color: var(--muted); }

/* 全文默写 */
.dict-area {
  width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; line-height: 2; resize: vertical; outline: none;
}
.dict-area:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.part-block { margin-top: 12px; }
.part-head { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.part-sims { display: flex; flex-wrap: wrap; gap: 8px; }
.sim-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.sim-pill.ok { background: var(--green-bg); color: var(--green); }
.sim-pill.no { background: var(--red-bg); color: var(--red); }
.dict-original {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--well-bg); border: 1px dashed var(--primary-300);
  font-size: 13px; line-height: 2; color: var(--text); white-space: pre-wrap; word-break: break-all;
}

/* 左侧抽屉导航（移动端） */
.drawer-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); font-size: 17px; color: var(--text); cursor: pointer; flex: none;
  -webkit-tap-highlight-color: transparent;
}
.drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 120; display: none; }
.drawer-mask.open { display: block; }
.drawer {
  display: none; position: fixed; left: 0; top: 0; bottom: 0; width: 212px; z-index: 130;
  background: var(--surface); flex-direction: column;
  transform: translateX(-100%); transition: transform .25s ease;
  box-shadow: 2px 0 18px rgba(0, 0, 0, .10);
}
.drawer.open { transform: translateX(0); }
.drawer .d-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px; border-bottom: 1px solid var(--border);
  font-weight: 800; font-size: 15px; color: var(--primary-600);
}
.drawer .d-brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.drawer .nav { padding: 10px; }
.drawer .nav a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; }
.drawer .nav a.active { background: var(--primary-bg); color: var(--primary-600); font-weight: 700; }
.drawer .d-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

/* 移动端适配 */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .mobile-topbar .mtb-brand { font-weight: 800; font-size: 16px; color: var(--primary-600); }
  .drawer-toggle { display: flex; }
  .drawer { display: flex; }
  .main { padding: 16px 16px 24px; max-width: none; width: 100%; }
  .page h1 { font-size: 20px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; }
  .login-card { width: 100%; }
}
@media (max-width: 420px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: 1fr 1fr; }
}

/* ===== 考试倒计时横幅 ===== */
.exam-banner {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: linear-gradient(120deg, var(--primary-bg) 0%, var(--card) 60%);
  border: 1px solid var(--primary-300); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 20px; box-shadow: var(--shadow);
  transition: .15s;
}
.exam-banner:hover { border-color: var(--primary); transform: translateY(-1px); }
.exam-banner .eb-icon { font-size: 26px; line-height: 1; }
.exam-banner .eb-body { flex: 1; min-width: 0; }
.exam-banner .eb-title { font-size: 16px; font-weight: 700; color: var(--text); }
.exam-banner .eb-title b { color: var(--primary-600); font-size: 20px; font-weight: 900; margin: 0 2px; }
.exam-banner .eb-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.exam-banner .eb-edit { color: var(--muted); font-size: 16px; }
.exam-banner[data-state="soon"] .eb-title b { color: var(--amber); }
.exam-banner[data-state="past"] .eb-title b { color: var(--red); }

/* ===== 带背模块 ===== */
.guide-day { margin-bottom: 14px; }
.guide-day.done { border-color: var(--primary-300); }
.guide-date {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 13px;
  padding: 3px 12px; border-radius: 8px; letter-spacing: .5px; flex: none;
}
.guide-player { margin: 14px 0 6px; }
.guide-player audio { width: 100%; height: 40px; outline: none; }
.guide-note {
  margin: 8px 0 14px; padding: 10px 14px; border-radius: 10px;
  background: var(--well-bg); border: 1px solid var(--border);
  font-size: 13px; color: var(--text); line-height: 1.8; white-space: pre-wrap;
}
.guide-tasks-label { font-size: 13px; font-weight: 700; color: var(--primary-600); margin: 12px 0 8px; }
.guide-task {
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; background: var(--surface); transition: .12s;
}
.guide-task:hover { border-color: var(--primary-300); background: var(--primary-bg); }

/* ===== 教师端：词条多选列表 ===== */
.guide-pick-list {
  max-height: 300px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px; background: var(--surface);
}
.guide-pick-item {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; transition: .1s;
}
.guide-pick-item:hover { background: var(--surface-2); }
.guide-pick-item.on { background: var(--primary-bg); }
.guide-pick-item input { flex: none; }

/* ===== 设置页：界面风格选择器 ===== */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px; }
.theme-card {
  border: 2px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer;
  background: var(--card); transition: .15s; position: relative; overflow: hidden;
}
.theme-card:hover { border-color: var(--primary-300); transform: translateY(-1px); }
.theme-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.theme-card .t-check {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff; display: none; align-items: center; justify-content: center; font-size: 13px;
}
.theme-card.active .t-check { display: flex; }
.theme-swatch { height: 62px; border-radius: 10px; margin-bottom: 11px; overflow: hidden; border: 1px solid var(--border); }
.theme-swatch .sw-bg { height: 50%; }
.theme-swatch .sw-fg { height: 50%; display: flex; gap: 4px; padding: 6px; align-items: flex-end; }
.theme-swatch .sw-chip { width: 22px; height: 12px; border-radius: 4px; }
.theme-card .t-name { font-weight: 700; font-size: 14px; color: var(--text); }
.theme-card .t-desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ===== 作业模块（学生端 + 教师端） ===== */
.hw-day { margin-bottom: 14px; }
.hw-date {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 13px;
  padding: 3px 12px; border-radius: 8px; letter-spacing: .5px; flex: none;
}
.hw-desc {
  margin: 12px 0 4px; padding: 12px 14px; border-radius: 10px;
  background: var(--well-bg); border: 1px solid var(--border);
  font-size: 14px; color: var(--text); line-height: 1.8; white-space: pre-wrap;
}
.hw-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hw-file {
  display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); font-size: 13px; color: var(--text);
}
.hw-file a.hw-fname { color: var(--primary-600); font-weight: 600; text-decoration: none; }
.hw-file a.hw-fname:hover { text-decoration: underline; }
.hw-file .hw-dl { color: var(--blue); font-weight: 600; text-decoration: none; font-size: 12px; }
.hw-file .hw-dl:hover { text-decoration: underline; }
.hw-note {
  margin-top: 8px; padding: 10px 14px; border-radius: 10px;
  background: var(--well-bg); border: 1px dashed var(--border);
  font-size: 13px; color: var(--text); line-height: 1.8; white-space: pre-wrap;
}
.hw-my { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.hw-feedback {
  margin-top: 10px; padding: 12px 14px; border-radius: 10px;
  background: var(--green-bg); border: 1px solid var(--green);
}
.hw-score {
  display: inline-flex; align-items: baseline; font-size: 26px; font-weight: 800; color: var(--primary-600); line-height: 1;
}
.hw-score small { font-size: 13px; font-weight: 600; margin-left: 2px; }
.hw-sub { margin-bottom: 12px; }



/* ===== 设置：字体与排版 / 翻阅习惯 ===== */
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.set-row:last-child { border-bottom: none; }
.set-row .set-label { min-width: 84px; font-weight: 600; font-size: 13px; color: var(--text); }
.set-row .set-desc { font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg-btn {
  padding: 5px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px; transition: all .15s;
}
.seg-btn:hover { border-color: var(--primary-300); }
.seg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pick-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.pick-card {
  position: relative; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; transition: all .15s;
}
.pick-card:hover { border-color: var(--primary-300); transform: translateY(-1px); }
.pick-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.pick-card .pk-icon { font-size: 22px; }
.pick-card .pk-name { font-weight: 700; font-size: 14px; margin-top: 4px; }
.pick-card .pk-desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ===== 刷题：逐题翻页 ===== */
.p-single .p-prog { text-align: right; margin-bottom: 8px; }
.p-nav { gap: 10px; align-items: center; }
.p-nav .p-ind { font-size: 13px; color: var(--muted); min-width: 70px; text-align: center; }

/* ===== 云资料 ===== */
.cloud-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.cloud-toolbar .seg-btn { font-size: 12px; padding: 4px 12px; }
.cloud-card { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); margin-bottom: 12px; transition: box-shadow .15s, transform .15s; }
.cloud-card:hover { box-shadow: var(--shadow-lg); }
.cloud-card .cc-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.cloud-card .cc-title { font-weight: 700; font-size: 15px; color: var(--text); flex: 1; min-width: 180px; }
.cloud-card .cc-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.cloud-card .cc-desc { font-size: 13px; color: var(--text); line-height: 1.7; white-space: pre-wrap; margin-bottom: 8px; }
.cloud-files { display: flex; flex-direction: column; gap: 6px; }
.cloud-file { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--well-bg); border: 1px dashed var(--border); border-radius: 10px; }
.cloud-file .cf-icon { font-size: 18px; }
.cloud-file .cf-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-file .cf-size { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cloud-file a.cf-dl { font-size: 12px; color: var(--primary-600); text-decoration: none; font-weight: 600; }
.cloud-file a.cf-dl:hover { text-decoration: underline; }
.cloud-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.cloud-tags .tag { cursor: pointer; }
.cloud-tags .tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cloud-empty { padding: 32px; text-align: center; color: var(--muted); }
.cloud-toolbar input[type=text] { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--surface); color: var(--text); }
.cloud-pin { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }

/* ===== 设置：分组行 ===== */
.set-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.set-row:first-child { border-top: none; padding-top: 0; }
.set-row .set-label { min-width: 80px; font-weight: 700; font-size: 14px; color: var(--text); }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.switch input { accent-color: var(--primary); transform: scale(1.1); }

/* ===== 带背播放器 ===== */
.guide-player-modal { padding: 18px 22px; }
.gp-body { display: grid; grid-template-columns: 320px 1fr; gap: 22px; flex: 1; min-height: 0; }
.gp-side { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; background: var(--well-bg); border-radius: 12px; }
.gp-cover { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-300)); color: #fff; }
.gp-title { font-weight: 700; font-size: 15px; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-date { font-size: 12px; color: var(--muted); }
.gp-progress { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 12px; color: var(--muted); }
.gp-bar { flex: 1; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.gp-bar > div { height: 100%; background: var(--primary); }
.gp-controls { display: flex; gap: 8px; align-items: center; justify-content: center; }
.gp-controls .btn { min-width: 56px; }
.gp-settings { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.gp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gp-row .small.muted { min-width: 60px; }
.gp-list-wrap { display: flex; flex-direction: column; min-height: 0; }
.gp-list { flex: 1; overflow-y: auto; max-height: 360px; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.gp-row-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: all .15s; }
.gp-row-item:hover { border-color: var(--primary-300); }
.gp-row-item.cur { background: var(--primary-bg); border-color: var(--primary); }
.gp-row-item .gpr-num { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--well-bg); font-size: 13px; color: var(--muted); flex-shrink: 0; }
.gp-row-item.cur .gpr-num { background: var(--primary); color: #fff; }
@media (max-width: 720px) {
  .gp-body { grid-template-columns: 1fr; }
}

/* ===== 历年真题 全真模拟训练 ===== */
.exam-paper-card { transition: border-color .15s, box-shadow .15s; }
.exam-paper-card:hover { border-color: var(--primary-300); box-shadow: var(--shadow); }
.exam-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: flex-start; }
@media (max-width: 900px) { .exam-layout { grid-template-columns: 1fr; } }
.timer-box { font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace; font-size: 26px; font-weight: 700; padding: 8px 18px; border-radius: 12px; background: var(--primary-bg); color: var(--primary-700); border: 1px solid var(--primary-300); }
.timer-box.urgent { background: var(--red-bg); color: var(--red); border-color: var(--red); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%,100%{opacity:1;} 50%{opacity:0.7;} }
.exam-question .exam-stem { font-size: 16px; line-height: 1.8; padding: 12px 14px; background: var(--well-bg); border-radius: 10px; margin-bottom: 14px; color: var(--text); white-space: pre-wrap; }
.exam-options { display: flex; flex-direction: column; gap: 8px; }
.exam-opt { display: flex; gap: 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: all .15s; }
.exam-opt:hover { border-color: var(--primary-300); }
.exam-opt.sel { border-color: var(--primary); background: var(--primary-bg); }
.exam-opt input { display: none; }
.exam-opt .k { font-weight: 700; min-width: 22px; color: var(--primary-600); }
.exam-opt .v { flex: 1; }
.exam-input, .exam-textarea { width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; }
.exam-input:focus, .exam-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.exam-side { background: var(--well-bg); border-radius: 12px; padding: 12px; max-height: calc(100vh - 220px); overflow-y: auto; position: sticky; top: 76px; }
.exam-side-title { font-weight: 700; margin-bottom: 10px; }
.exam-q-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.exam-q-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; cursor: pointer; transition: all .15s; }
.exam-q-chip:hover { border-color: var(--primary-300); }
.exam-q-chip.done { background: var(--green-bg); color: var(--green); border-color: var(--green); }

/* ===== 词条真题主标签 ===== */
.exam-tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--primary-bg); color: var(--primary-700); border: 1px solid var(--primary-300); cursor: pointer; }
.exam-tag:hover { background: var(--primary-bg); filter: brightness(.95); }
.exam-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.exam-tags .exam-tag { margin-left: 0; }


/* ===== 题库导入：文件自动识别 ===== */
.import-modal { width: 900px; }
.import-modal .modal { width: 900px; }
.import-modal table { width: 100%; border-collapse: collapse; }
.import-modal th, .import-modal td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.import-modal thead th { position: sticky; top: 0; background: var(--card); z-index: 1; font-size: 12px; color: var(--muted); }
.import-modal details summary { user-select: none; }
.mh-ok { background: var(--green-bg); color: var(--green); border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.7; }
.mh-warn { background: var(--amber-bg); color: var(--amber); border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.7; }

/* ===== ICP 备案号（首页底部中央，链接到工信部备案系统） =====
   固定贴底：管理端审核时看的是网站首页（本例是登录页），
   放在文档流里会被 100vh 的登录页推到折叠线以下，所以固定定位。
   容器不吃点击，只有那个小胶囊可点，避免挡住页面按钮。 */
.site-beian {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; align-items: center;
  font-size: 12px; line-height: 1.6;
  pointer-events: none; z-index: 40;
}
.site-beian a {
  display: inline-block; pointer-events: auto;
  color: var(--muted); background: rgba(255, 255, 255, .88);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 12px; backdrop-filter: blur(4px);
}
.site-beian a:hover { color: var(--primary-600); border-color: var(--primary-300); }
/* 公安备案：图标 + 编号同行显示（2026-10-17 挂上） */
.site-beian a.beian-police { display: inline-flex; align-items: center; gap: 4px; }
.site-beian a.beian-police .beian-badge { display: block; flex: none; }

/* ---------- 真题卷答案编辑（教师端 #page-papers，2026-10-16） ---------- */
.paper-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.paper-chip { cursor: pointer; padding: 6px 14px; border: 1px solid transparent; transition: .15s; }
.paper-chip:hover { opacity: .82; }
.paper-chip.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
/* 表格默认 white-space:nowrap，题干要折行否则会把表格撑爆 */
.pq-stem { white-space: normal; min-width: 240px; line-height: 1.6; }
.pq-no { font-weight: 700; color: var(--muted); }
.pq-ans-cell { white-space: normal; }
.pq-ans {
  width: 100%; min-width: 200px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 13px;
}
.pq-ans:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
tr.pq-missing td { background: var(--amber-bg); }
tr.pq-missing:hover td { background: var(--amber-bg); }
tr.pq-dirty td { background: var(--primary-bg); }

/* ---------- 作业推送小组选择（教师端发布/编辑作业弹窗，2026-10-17） ---------- */
.hw-group-pick {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2);
}
.hw-group-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); cursor: pointer; font-size: 13px; transition: .15s;
}
.hw-group-item:hover { border-color: var(--primary); }
.hw-group-item.on { background: var(--primary-bg); border-color: var(--primary); color: var(--primary-600); font-weight: 600; }
.hw-group-item.all { border-style: dashed; }
.hw-group-item input { margin: 0; accent-color: var(--primary); }
.hw-group-actions { display: flex; gap: 8px; width: 100%; margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--border); }
