:root {
  --c-main: #2563eb;
  --c-main-light: #eff6ff;
  --c-ans: #059669;
  --c-ans-light: #f0fdf4;
  --c-sub: #7c3aed;
  --c-text: #1f2937;
  --c-muted: #6b7280;
  --c-border: #e5e7eb;
  --c-bg: #f3f4f6;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  margin: 0;
  line-height: 1.75;
  font-size: 15px;
}
a { color: var(--c-main); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== 顶部导航栏 ===================== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  flex-wrap: wrap;
}
.topbar .brand { font-weight: 800; font-size: 17px; color: var(--c-main); white-space: nowrap; cursor: pointer; user-select: none; }
.topbar .brand:hover { opacity: .85; }
.nav-toggle { display: none; font-size: 24px; line-height: 1; background: none; border: none; cursor: pointer; color: var(--c-main); padding: 4px 8px; }
nav.tabs {
  display: flex; gap: 7px; flex-wrap: nowrap; align-items: center;
  overflow-x: auto; overscroll-behavior-x: contain; min-width: 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
nav.tabs::-webkit-scrollbar { display: none; }
/* 桌面端：平时不显示滚动条，鼠标悬停时出现细滚动条提示可横滑 */
nav.tabs:hover { scrollbar-width: thin; scrollbar-color: #c3cede transparent; }
nav.tabs:hover::-webkit-scrollbar { display: block; height: 6px; }
nav.tabs:hover::-webkit-scrollbar-thumb { background: #c3cede; border-radius: 999px; }
nav.tabs > button, nav.tabs > .nav-dropdown, nav.tabs > .auth-btn { flex: 0 0 auto; }
nav.tabs button {
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
nav.tabs button:hover { border-color: var(--c-main); color: var(--c-main); }
nav.tabs button.active {
  background: var(--c-main);
  color: #fff;
  border-color: var(--c-main);
  font-weight: 700;
}

/* 学生入口：始终可见的橙色高亮按钮 */
.stu-entry-btn {
  border: none;
  background: linear-gradient(135deg, #f59e0b, #ef7d3b);
  color: #fff;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
  transition: transform .1s, box-shadow .15s;
  flex-shrink: 0;
}
.stu-entry-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,.35); }

/* 桌面端隐藏移动端入口聚合（由 ≤520px 媒体查询显示） */
.mobile-entry { display: none; }

/* 导航下拉菜单（更多 / 管理员）——nav 为横向滚动容器，改用 fixed 定位避免菜单被裁切 */
.nav-dropdown {
  position: static;
  display: inline-flex;
  flex-shrink: 0;
}
.nav-drop-trigger {
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.nav-drop-trigger:hover { border-color: var(--c-main); color: var(--c-main); }
.nav-dropdown.open .nav-drop-trigger { border-color: var(--c-main); color: var(--c-main); background: #eff6ff; }
.nav-drop-menu {
  position: fixed;
  top: auto;
  left: 0;
  right: auto;
  margin-top: 6px;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  padding: 6px;
  display: none;
  z-index: 120;
}
.nav-dropdown.open .nav-drop-menu { display: block; animation: fade .18s ease; }
.nav-drop-menu a {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--c-text);
  cursor: pointer;
  white-space: nowrap;
}
.nav-drop-menu a:hover { background: var(--c-main-light); color: var(--c-main); text-decoration: none; }

.wrap { max-width: 1400px; margin: 26px auto; padding: 0 24px 64px; }
@media (min-width: 1600px) { .wrap { max-width: 1500px; } }

/* Section / view */
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to {opacity:1; transform:none;} }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar select, .toolbar input {
  padding: 8px 12px; border: 1px solid var(--c-border); border-radius: 8px; font-size: 14px;
}
.toolbar input[type=text] { flex: 1; min-width: 180px; }

/* Problem card */
.sec-title { font-size: 22px; font-weight: 800; color: #0f172a; letter-spacing: .5px; border-left: 4px solid var(--c-main); padding-left: 14px; margin: 26px 0 14px; }
.sec-intro { background: #f8fafc; border-left: 4px solid #94a3b8; padding: 10px 14px; border-radius: 6px; color: #374151; font-size: 14px; margin-bottom: 14px; }
.sub-title { font-size: 16px; font-weight: 700; color: var(--c-sub); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 2px solid #e0e7ff; }
.stage-title { margin: 16px 0 8px; }
.stage-badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 6px; color: #fff; letter-spacing: 1px; }
.stage-intro { background: #2563eb; }
.stage-review { background: #16a34a; }
.stage-example { background: #ea580c; }
.stage-practice { background: #7c3aed; }
.stage-breakthrough { background: #dc2626; }
.qa { border: 1px solid var(--c-border); border-radius: 10px; margin: 10px 0; overflow: hidden; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.03); }
.qa .q { padding: 13px 16px; }
.qa .a { padding: 14px 18px; background: var(--c-ans-light); border-top: 1px dashed #bbf7d0; color: #064e3b; display: none; line-height: 1.85; }
.qa.open .a { display: block; }
.qa .a .katex-display { margin: 0.6em 0; }
.qa .a br + br { display: none; }
.qa.highlight { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.25); animation: pulse-highlight 1.2s ease-in-out 2; }
@keyframes pulse-highlight { 0%,100% { box-shadow: 0 0 0 3px rgba(245,158,11,.25); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,.15); } }

/* 题库折叠：按知识点目录体系（章 → 节）折叠，点击展开 */
.chapter-block { margin: 12px 0; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.ch-head { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #eef2f7; font-size: 17px; font-weight: 700; color: #1e293b; border-bottom: 1px solid #e5e7eb; transition: background .15s; }
.ch-head.open { background: #e2e8f0; }
.ch-head:hover { background: #e6edf5; }
.ch-name { flex: 1; }
.ch-cnt { font-size: 13px; font-weight: 600; color: #64748b; }
.ch-head .caret, .ch-head .grade-badge, .ch-head .ch-cnt,
.sec-head .caret, .sec-head .sec-cnt { pointer-events: none; }
.sec-block { border-top: 1px dashed #eef2f7; }
.sec-block:first-child { border-top: none; }
.sec-head { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; padding: 9px 16px 9px 30px; background: #f8fafc; font-size: 15px; font-weight: 600; color: #334155; transition: background .15s; }
.sec-head.open { background: #eef2f7; }
.sec-head:hover { background: #eef4fb; }
.sec-name { flex: 1; }
.sec-cnt { font-size: 12px; font-weight: 600; color: #94a3b8; }
.sec-hint { font-size: 11px; font-weight: 500; color: #2563eb; background: #eff6ff; border-radius: 6px; padding: 1px 7px; }
.caret { display: inline-block; width: 14px; text-align: center; color: #64748b; font-size: 12px; transition: transform .15s; }
.ch-body { padding: 2px 0; }
.sec-body { padding: 2px 0 10px; }
.ch-body .qa:first-child, .sec-body .qa:first-child { margin-top: 6px; }

/* 题库折叠：节内 5 个教学环节（知识引入/知识梳理/精选例题/专项练习/考点突破）同样可折叠 */
.stage-block { border-top: 1px solid #f1f5f9; }
.stage-block:first-child { border-top: none; }
.stage-head { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; padding: 7px 16px 7px 46px; background: #fff; font-size: 14px; font-weight: 600; color: #334155; transition: background .15s; }
.stage-head.open { background: #f8fafc; }
.stage-head:hover { background: #f8fafc; }
.stage-cnt { font-size: 12px; font-weight: 600; color: #94a3b8; }
.stage-head .caret, .stage-head .stage-badge { pointer-events: none; }
.stage-body { padding: 2px 0 8px; }

.qa .toggle { float: right; font-size: 13px; color: var(--c-main); cursor: pointer; user-select: none; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 8px; vertical-align: middle; }
.q .tag { background: var(--c-main-light); color: var(--c-main); }
.a .tag { background: #dcfce7; color: var(--c-ans); }
/* 题头来源序号标签（例1/变式1/练习1…），展示在题目前面 */
.q-label { display: inline-block; font-size: 13px; font-weight: 700; line-height: 1.4; padding: 1px 9px; border-radius: 6px; margin-right: 8px; vertical-align: middle; color: #fff; letter-spacing: .5px; }
.q-label-example { background: #2563eb; }
.q-label-variation { background: #7e22ce; }
.q-label-practice { background: #16a34a; }
.q-label-expand { background: #ea580c; }
.q-label-consolidate { background: #0d9488; }
.q-label-breakthrough { background: #dc2626; }
.q-label-intro { background: #0ea5e9; }
.q-label-review { background: #64748b; }
.q-label-other { background: #475569; }
.q-text .q-label { margin-bottom: 2px; }
.feedback-btn { float: right; font-size: 12px; color: #9ca3af; cursor: pointer; user-select: none; margin-left: 10px; padding: 2px 6px; border-radius: 4px; transition: all .2s; }
.feedback-btn:hover { color: #dc2626; background: #fee2e2; }
.quiz-card .feedback-btn, .paper-q .feedback-btn { float: none; display: inline-block; margin-left: 10px; }

/* 反馈管理面板 */
.fb-admin-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 14px; }
.fb-admin-bar select { margin-left: 4px; padding: 3px 6px; }
.fb-count { color: #6b7280; font-size: 13px; margin-left: auto; }
.fb-list { max-height: 60vh; overflow: auto; }
.fb-item { border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; margin: 10px 0; background: #fafbfc; }
.fb-item-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6b7280; }
.fb-badge { font-size: 12px; padding: 1px 7px; border-radius: 10px; }
.fb-badge.new { background: #fee2e2; color: #cf222e; }
.fb-badge.resolved { background: #dcfce7; color: #1a7f37; }
.fb-type { font-weight: 600; color: #0b62c9; }
.fb-q { margin: 6px 0 2px; font-size: 14px; }
.fb-note { font-size: 13px; color: #374151; background: #fffbe6; border-left: 3px solid #faad14; padding: 4px 8px; border-radius: 4px; margin: 4px 0; }
.fb-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn.small.ok { background: #1a7f37; color: #fff; border-color: #1a7f37; }
.btn.small.danger { background: #fff; color: #cf222e; border-color: #f0b4b4; }

/* Tables */
.ftab { border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.ftab th, .ftab td { border: 1px solid var(--c-border); padding: 6px 10px; text-align: center; }
.ftab th { background: #f9fafb; font-weight: 600; }

/* Quiz */
.quiz-hint { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; color: #92400e; font-size: 14px; line-height: 1.7; }
.quiz-card { border: 1px solid var(--c-border); border-radius: 12px; padding: 18px 20px; margin: 16px 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.quiz-card .qno { font-weight: 700; color: var(--c-main); margin-bottom: 8px; }
.quiz-card .topic { font-size: 12px; color: var(--c-muted); }
.opt { display: block; padding: 9px 12px; margin: 6px 0; border: 1px solid var(--c-border); border-radius: 8px; cursor: pointer; }
.opt:hover { border-color: var(--c-main); }
.opt.sel { background: var(--c-main-light); border-color: var(--c-main); }
.opt.correct { background: #dcfce7; border-color: #16a34a; }
.opt.wrong { background: #fee2e2; border-color: #dc2626; }
.fill-input { width: 100%; padding: 9px 12px; border: 1px solid var(--c-border); border-radius: 8px; font-size: 15px; }
.explain { margin-top: 10px; padding: 10px 12px; background: var(--c-ans-light); border-radius: 8px; color: #064e3b; font-size: 14px; display: none; }
.explain.show { display: block; }
.quiz-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--c-border); padding: 14px 16px; display: flex; gap: 12px; align-items: center; box-shadow: 0 -2px 12px rgba(0,0,0,.06); }
.btn { background: var(--c-main); color: #fff; border: none; padding: 10px 22px; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 700; }
.btn:hover { background: #1d4ed8; }
.btn.ghost { background: #fff; color: var(--c-main); border: 1px solid var(--c-main); }
.btn.ghost:hover { background: var(--c-main-light); }
.score-box { font-size: 18px; font-weight: 700; color: var(--c-ans); }
.q-result { margin-top: 8px; min-height: 4px; }
.fill-row { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.fill-row .fill-input { flex: 1; }
.btn.small { padding: 8px 16px; font-size: 14px; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge.ok { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge.bad { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge.local { background: #eef2ff; color: #4338ca; font-size: 11px; padding: 1px 7px; }

/* Downloads */
.dl-toolbar { display: none; }
.btn.danger { background: #fff; color: #dc2626; border: 1px solid #fca5a5; }
.btn.danger:hover { background: #fee2e2; }
.btn.disabled, .btn:disabled { opacity: .5; cursor: not-allowed; border-color: var(--c-border); color: var(--c-muted); }

/* 年级分组 */
.grade-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.g-初一 { background: #dcfce7; color: #15803d; }
.g-初二 { background: #dbeafe; color: #1d4ed8; }
.g-初三 { background: #f3e8ff; color: #7c3aed; }
.grade-header { display: flex; align-items: center; gap: 10px; margin: 22px 0 8px; }
.grade-count { font-size: 13px; color: var(--c-muted); }

/* Viz */
.viz-box { border: 1px solid var(--c-border); border-radius: 12px; padding: 20px; margin: 16px 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.viz-box h3 { margin-top: 0; color: var(--c-main); }
.viz-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0; }
.viz-row label { font-weight: 600; }
.viz-row input[type=number] { padding: 8px 12px; border: 1px solid var(--c-border); border-radius: 8px; width: 120px; font-size: 16px; }
.viz-row input[type=range] { width: 220px; }
.calc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-top: 14px; }
.calc-card { border: 1px solid var(--c-border); border-radius: 10px; padding: 12px; text-align: center; background: #fafbff; }
.calc-card .label { font-size: 13px; color: var(--c-muted); }
.calc-card .val { font-size: 20px; font-weight: 700; color: var(--c-main); margin-top: 4px; }
.note { font-size: 13px; color: var(--c-muted); margin-top: 8px; }
footer.site { text-align: center; color: #9ca3af; font-size: 12px; padding: 24px 16px; }

/* 分类徽章 & 我的题库标记 */
.cat-badge { display:inline-block; font-size:11px; font-weight:700; padding:1px 8px; border-radius:999px; background:#eef2ff; color:#4338ca; margin-left:6px; vertical-align:middle; }
.tag.mine { background:#fef3c7; color:#b45309; }

/* 新录入题目标记徽章 */
.new-badge { display:inline-block; margin-left:6px; padding:1px 8px; border-radius:10px; font-size:12px; font-weight:700; line-height:18px; vertical-align:middle; background:#e8f5e9; color:#1b7a3d; border:1px solid #b7e1c2; }
.new-badge.hot { background:#fff3e0; color:#d4690a; border-color:#ffd29b; animation: pulseNew 1.6s ease-in-out infinite; }
@keyframes pulseNew { 0%,100% { box-shadow:0 0 0 0 rgba(212,105,10,.35); } 50% { box-shadow:0 0 0 5px rgba(212,105,10,0); } }

/* 题目类型徽章：选择/填空/解答 */
.type-badge { display:inline-block; margin-right:6px; padding:1px 9px; border-radius:10px; font-size:12px; font-weight:700; line-height:18px; vertical-align:middle; }
.type-choice { background:#e0edff; color:#1d4ed8; border:1px solid #b9d4ff; }
.type-fill { background:#dcfce7; color:#15803d; border:1px solid #a7e0bd; }
.type-calc { background:#ffedd5; color:#c2410c; border:1px solid #ffce9e; }

/* 题库“只看新录入”筛选勾选 */
.filter-chk { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#475569; background:#f1f5f9; padding:6px 12px; border-radius:8px; cursor:pointer; user-select:none; }
.filter-chk input { cursor:pointer; }

/* 选择题选项列表（题库浏览/自测通用） */
.opts-wrap { margin:8px 0 2px 4px; }
.qa-opts { list-style:none; margin:4px 0 2px; padding:0; display:grid; gap:4px; }
.qa-opts li { display:flex; align-items:flex-start; gap:8px; padding:5px 10px; border:1px solid #e3e8f0; border-radius:8px; background:#fafbff; font-size:14px; }
.qa-opts .opt-lab { flex-shrink:0; width:20px; height:20px; line-height:20px; text-align:center; border-radius:50%; background:#e0edff; color:#1d4ed8; font-weight:700; font-size:12px; }
.qa.open .qa-opts li, .qa .qa-opts li { background:#fafbff; }

/* 管理员分类控件 */
.adm-type-row { margin:8px 0 2px 4px; }
.adm-type { display:inline-flex; align-items:center; gap:4px; padding:4px 8px; background:#fff7ed; border:1px dashed #fdba74; border-radius:8px; font-size:12px; }
.adm-type-label { color:#c2410c; font-weight:700; margin-right:2px; }
.adm-type-btn { border:1px solid #fed7aa; background:#fff; color:#9a3412; border-radius:6px; padding:2px 9px; font-size:12px; cursor:pointer; font-weight:600; transition:.12s; }
.adm-type-btn:hover { background:#ffedd5; }
.adm-type-btn.on { background:#ea580c; color:#fff; border-color:#ea580c; }
.adm-video-btn { border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; border-radius:6px; padding:2px 9px; font-size:12px; cursor:pointer; font-weight:600; transition:.12s; margin-left:8px; }
.adm-video-btn:hover { background:#dbeafe; }
.adm-video-btn.has { border-color:#86efac; background:#f0fdf4; color:#15803d; }
.adm-figure-btn { border:1px solid #e9d5ff; background:#faf5ff; color:#7e22ce; border-radius:6px; padding:2px 9px; font-size:12px; cursor:pointer; font-weight:600; transition:.12s; margin-left:8px; }
.adm-figure-btn:hover { background:#f3e8ff; }
.rf-edit-btn { border:1px solid #c7d2fe; background:#eef2ff; color:#4338ca; border-radius:6px; padding:2px 9px; font-size:12px; cursor:pointer; font-weight:600; transition:.12s; margin-left:8px; }
.rf-edit-btn:hover { background:#e0e7ff; }
.replace-figure-list { display:flex; flex-direction:column; gap:16px; max-height:60vh; overflow:auto; padding:4px; }
.replace-figure-item { display:flex; gap:14px; align-items:flex-start; padding:12px; border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; }
.replace-figure-item img { max-width:220px; max-height:160px; object-fit:contain; border:1px solid #cbd5e1; border-radius:6px; background:#fff; }
.replace-figure-info { flex:1; min-width:0; }
.replace-figure-name { font-size:13px; color:#334155; font-weight:600; word-break:break-all; margin-bottom:6px; }
.replace-figure-file { font-size:12px; color:#64748b; }
.replace-figure-file input[type=file] { display:none; }
.replace-figure-file label { display:inline-block; padding:5px 12px; background:#fff; border:1px solid #94a3b8; border-radius:6px; cursor:pointer; font-size:12px; }
.replace-figure-file label:hover { background:#f1f5f9; }
.replace-figure-status { margin-top:6px; font-size:12px; min-height:18px; }
.replace-figure-status.ok { color:#15803d; }
.replace-figure-status.err { color:#b91c1c; }
.replace-figure-item.rf-paste-target { cursor:pointer; outline:none; transition:box-shadow .12s, border-color .12s; }
.replace-figure-item.rf-paste-target:hover { border-color:#cbd5e1; }
.replace-figure-item.rf-paste-target.selected { border-color:#7e22ce; box-shadow:0 0 0 2px #e9d5ff; background:#faf5ff; }
.replace-figure-item.rf-paste-target:focus-visible { border-color:#7e22ce; box-shadow:0 0 0 2px #e9d5ff; }
.replace-figure-file .note { color:#94a3b8; }
.rf-enhance-opt { display:inline-flex; align-items:center; gap:4px; margin-left:8px; font-size:12px; color:#475569; cursor:pointer; user-select:none; }
.rf-enhance-opt input[type=checkbox] { width:14px; height:14px; cursor:pointer; accent-color:#7e22ce; }
.rf-fixbg-opt { display:inline-flex; align-items:center; gap:4px; margin-left:8px; font-size:12px; color:#475569; cursor:pointer; user-select:none; }
.rf-fixbg-opt input[type=checkbox] { width:14px; height:14px; cursor:pointer; accent-color:#16a34a; }
.rf-enhance-current-btn { border:1px solid #f0abfc; background:#fdf4ff; color:#a21caf; border-radius:6px; padding:2px 9px; font-size:12px; cursor:pointer; font-weight:600; transition:.12s; margin-left:8px; }
.rf-enhance-current-btn:hover { background:#fae8ff; }
.rf-fixbg-current-btn { border:1px solid #86efac; background:#f0fdf4; color:#15803d; border-radius:6px; padding:2px 9px; font-size:12px; cursor:pointer; font-weight:600; transition:.12s; margin-left:8px; }
.rf-fixbg-current-btn:hover { background:#dcfce7; }
.rf-delete-btn { border:1px solid #fecaca; background:#fef2f2; color:#b91c1c; border-radius:6px; padding:2px 9px; font-size:12px; cursor:pointer; font-weight:600; transition:.12s; margin-left:8px; }
.rf-delete-btn:hover { background:#fee2e2; }
.rf-field-tag { display:inline-block; padding:1px 5px; background:#e2e8f0; color:#475569; border-radius:4px; font-size:11px; font-weight:500; margin-left:4px; }
.replace-figure-add { margin-top:18px; padding:14px; border:2px dashed #cbd5e1; border-radius:10px; background:#f8fafc; }
.replace-figure-add h4 { margin:0 0 10px; font-size:14px; color:#334155; }
/* 增强预览弹窗：左右对比 */
.enhance-preview-wrap { display:flex; gap:14px; margin:10px 0 4px; }
.enhance-preview-col { flex:1; min-width:0; text-align:center; }
.enhance-preview-col span { display:block; font-size:12px; color:#64748b; margin-bottom:6px; }
.enhance-preview-col img { width:100%; max-height:300px; object-fit:contain; border:1px solid #cbd5e1; border-radius:6px; background:#fff; }

/* Modal 弹窗 */
.modal { position: fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:50; }
.modal.open { display:flex; }
.modal .mask { position:absolute; inset:0; background:rgba(15,23,42,.45); }
.modal-box { position:relative; background:#fff; border-radius:14px; padding:22px 24px; width:min(560px, 92vw); max-height:88vh; overflow:auto; box-shadow:0 20px 60px rgba(0,0,0,.25); animation:pop .18s ease; scrollbar-width:none !important; -ms-overflow-style:none !important; }
.modal-box::-webkit-scrollbar,
.modal-box::-webkit-scrollbar-track,
.modal-box::-webkit-scrollbar-thumb,
.modal-box::-webkit-scrollbar-button { display:none !important; width:0 !important; height:0 !important; }
.modal-box.wide { width:min(820px, 94vw); }
@keyframes pop { from { transform:scale(.96); opacity:0; } to { transform:none; opacity:1; } }
.modal-box h3 { margin:0 0 14px; color:var(--c-main); }
.modal .close { position:absolute; top:12px; right:16px; font-size:24px; line-height:1; cursor:pointer; color:var(--c-muted); }
.modal .close:hover { color:var(--c-text); }
.form-row { display:flex; gap:12px; align-items:flex-start; margin:10px 0; }
.form-row > label { width:84px; flex-shrink:0; font-weight:600; padding-top:8px; text-align:right; }
.form-row.checkbox > label { width:auto; text-align:left; padding-top:0; font-weight:400; }
.form-row input[type=text], .form-row input[type=file], .form-row select, .form-row textarea {
  flex:1; padding:8px 10px; border:1px solid var(--c-border); border-radius:8px; font-size:14px; font-family:inherit;
}
.form-row textarea { resize:vertical; }
.modal-actions { margin-top:16px; display:flex; justify-content:flex-end; gap:10px; }

/* 题目编辑弹窗：大双栏可视化编辑 */
.edit-question-box { width:min(1100px, 96vw); max-width:96vw; max-height:92vh; overflow:auto; padding:24px 26px; }
.math-edit-row { margin:14px 0; }
.math-edit-label { font-weight:700; margin-bottom:6px; color:var(--c-text); }
.math-edit-panels { display:flex; gap:14px; }
.math-edit-panel { flex:1; min-width:0; display:flex; flex-direction:column; }
.math-edit-panel textarea { width:100%; box-sizing:border-box; min-height:120px; font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size:14px; line-height:1.6; padding:10px 12px; border:1px solid var(--c-border); border-radius:10px; resize:vertical; }
.math-preview-panel { background:#f8fafc; border:1px solid var(--c-border); border-radius:10px; padding:12px; min-height:120px; }
.math-preview-title { font-size:12px; color:var(--c-muted); margin-bottom:8px; font-weight:600; }
.math-preview-content { overflow:auto; font-size:15px; line-height:1.8; }
.math-preview-content .katex { font-size:1.05em; }
.math-toolbar { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
.math-toolbar button { border:1px solid var(--c-border); background:#fff; border-radius:6px; padding:4px 8px; font-size:13px; cursor:pointer; color:var(--c-text); }
.math-toolbar button:hover { background:#eef2ff; border-color:#c7d2fe; }
.answer-row input { flex:1; }
@media (max-width: 860px) {
  .math-edit-panels { flex-direction:column; }
  .math-edit-panel textarea { min-height:100px; }
  .math-preview-panel { min-height:80px; }
}

/* 错题本 */
.wrong-card { border:1px solid var(--c-border); border-radius:10px; padding:14px 16px; margin:12px 0; background:#fff; }
.wrong-card .q { font-weight:600; margin-bottom:8px; }
.wrong-card .ans-row { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; }
.wrong-actions { margin-top:8px; }

/* ===================== 首页 ===================== */
.hero { position:relative; overflow:hidden; background: radial-gradient(ellipse at 20% 10%, rgba(124,58,237,.12) 0%, transparent 42%), radial-gradient(ellipse at 85% 15%, rgba(236,72,153,.10) 0%, transparent 38%), radial-gradient(ellipse at 50% 95%, rgba(37,99,235,.08) 0%, transparent 42%), linear-gradient(135deg,#f8fafc 0%,#f1f5f9 100%); color:#1e293b; border-radius:24px; padding:52px 40px; text-align:left; box-shadow:0 18px 50px rgba(15,23,42,.08); border:1px solid rgba(255,255,255,.8); }
.hero::before { content:""; position:absolute; inset:0; background-image: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.07'%3E%3Cpath d='M38 36v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-32V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 36v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); opacity:.7; pointer-events:none; }
.hero::after { content:""; position:absolute; inset:0; background:radial-gradient(circle at 30% 30%, rgba(124,58,237,.08) 0%, transparent 26%), radial-gradient(circle at 70% 70%, rgba(37,99,235,.07) 0%, transparent 28%); pointer-events:none; }
.hero h1 { margin:0; font-size:32px; font-weight:800; letter-spacing:.5px; color:#0f172a; }
.hero-sub { color:#475569; margin:10px 0 22px; font-size:14px; }
.hero-inner { position:relative; z-index:1; display:grid; grid-template-columns:1.05fr 0.95fr; gap:36px; align-items:center; }
.hero-left { position:relative; z-index:1; }
.hero-right { display:flex; align-items:center; justify-content:center; position:relative; z-index:0; }
.hero-deco { width:100%; max-width:520px; opacity:.92; pointer-events:none; }
.hero-avatar { width:64px; height:64px; margin:0 0 14px; display:flex; align-items:center; justify-content:center; font-size:32px; border-radius:20px; background:linear-gradient(135deg,#eef2ff,#f5f3ff); box-shadow:0 8px 22px rgba(99,102,241,.22); border:1px solid rgba(255,255,255,.8); }
.hero-eyebrow { display:inline-block; font-size:13px; font-weight:700; letter-spacing:1px; color:#4f46e5; background:#eef2ff; border:1px solid #dbe3ff; padding:4px 14px; border-radius:999px; margin-bottom:14px; }
.hero-title { font-size:38px !important; background:linear-gradient(135deg,#1e293b 0%,#4338ca 100%); -webkit-background-clip:text; background-clip:text; color:transparent; letter-spacing:1px; }
.hero-motto { color:#475569; margin:14px 0 22px; font-size:15.5px; max-width:640px; line-height:1.7; }
.hero-motto strong { color:#4338ca; font-weight:800; }
.global-search { display:flex; gap:10px; max-width:none; margin:0; position:relative; }
.global-search input { flex:1; padding:13px 18px; border:1px solid #e2e8f0; border-radius:999px; font-size:15px; background:#fff; color:var(--c-text); box-shadow:0 4px 16px rgba(15,23,42,.08); }
.global-search input::placeholder { color:#94a3b8; }
.global-search input:focus { outline:none; border-color:#cbd5e1; box-shadow:0 0 0 4px rgba(37,99,235,.15); }
.global-search .btn { background:var(--c-main); color:#fff; border-radius:999px; padding:11px 26px; box-shadow:0 4px 16px rgba(37,99,235,.28); }
.global-search .btn:hover { background:#1d4ed8; transform:translateY(-1px); }
.quick-chips { margin-top:16px; display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-start; }
.chip { background:#fff; color:#475569; padding:6px 15px; border:1px solid #e2e8f0; border-radius:999px; font-size:13px; cursor:pointer; transition:all .15s; box-shadow:0 1px 3px rgba(15,23,42,.04); }
.chip:hover { background:#eff6ff; border-color:#bfdbfe; color:var(--c-main); transform:translateY(-1px); }

.home-stats { display:flex; gap:14px; justify-content:center; margin:26px 0 6px; flex-wrap:wrap; }
.stat { background:#fff; border:1px solid var(--c-border); border-radius:14px; padding:14px 24px; text-align:center; min-width:120px; box-shadow:0 2px 10px rgba(16,24,40,.05); }
.stat-n { font-size:26px; font-weight:800; color:var(--c-main); }
.stat-l { font-size:13px; color:var(--c-muted); }

.home-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; }
.home-card { background:#fff; border:1px solid #e8eaf0; border-radius:16px; padding:18px; cursor:pointer; transition:transform .15s, box-shadow .15s, border-color .15s; box-shadow:0 2px 8px rgba(16,24,40,.04); }
.home-card:hover { border-color:#c7d2fe; transform:translateY(-3px); box-shadow:0 8px 22px rgba(16,24,40,.09); }
.hc-icon { font-size:28px; width:46px; height:46px; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#eef2ff,#f5f3ff); border-radius:12px; margin-bottom:10px; }
.hc-t { font-weight:700; margin:0 0 3px; font-size:15px; color:#1e293b; }
.hc-d { font-size:12.5px; color:#64748b; line-height:1.55; }

.res-title { font-size:18px; color:var(--c-main); margin:22px 0 10px; }
.res-group { margin:14px 0; }
.res-group-t { font-weight:700; color:var(--c-sub); margin-bottom:8px; }
.res-item { display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--c-border); border-radius:10px; padding:12px 14px; margin:8px 0; cursor:pointer; transition:.15s; }
.res-item:hover { border-color:var(--c-main); background:var(--c-main-light); }
.res-icon { font-size:22px; }
.res-main { flex:1; min-width:0; }
.res-name { font-weight:600; }
.res-sub { font-size:12px; color:var(--c-muted); }
.res-go { color:var(--c-main); font-weight:700; white-space:nowrap; }
.res-more { font-size:13px; color:var(--c-muted); margin:6px 0 0; }

/* ===================== 随机组卷 ===================== */
.paper-head { text-align:center; margin-bottom:14px; }
.paper-meta { font-size:13px; color:var(--c-muted); }
.paper-list { padding-left:24px; }
.paper-q { margin:16px 0; }
.paper-q .pq-body { font-weight:600; }
.pq-opts { margin:6px 0 0 4px; }
.pq-opt { padding:3px 0; }
.pq-letter { display:inline-block; width:22px; height:22px; line-height:22px; text-align:center; background:var(--c-main-light); color:var(--c-main); border-radius:50%; font-size:12px; font-weight:700; margin-right:8px; }
.pq-blank { margin-top:6px; color:var(--c-muted); }
.paper-ans { display:none; margin-top:6px; padding:8px 10px; background:var(--c-ans-light); border-radius:8px; color:#064e3b; font-size:14px; }
#paper-output.show-ans .paper-ans { display:block; }

/* ===================== 打印（仅试卷） ===================== */
@media print {
  body * { visibility: hidden; }
  #paper-output, #paper-output * { visibility: visible; }
  #paper-output { position: absolute; left: 0; top: 0; width: 100%; }
  nav.tabs, .topbar, footer.site { display: none !important; }
}

/* ===================== 首页大屏 → 小屏切换 ===================== */
@media (max-width: 900px) {
  .hero { padding: 44px 28px; text-align: center; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-right { display: none; }
  .hero-avatar { margin: 0 auto 14px; }
  .hero-motto { margin: 14px auto 22px; }
  .global-search { margin: 0 auto; max-width: 680px; }
  .quick-chips { justify-content: center; }
}

/* ===================== 移动端适配 ===================== */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; position: relative; gap: 10px; padding: 10px 12px; }
  .topbar .brand { font-size: 16px; }
  .stu-entry-btn { padding: 7px 12px; font-size: 13px; }
  /* 移动端：导航栏直接显示为可横向滚动的一行，无需点击汉堡按钮 */
  .nav-toggle { display: none !important; }
  nav.tabs {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    position: static;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border-top: none;
    margin-top: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs button,
  nav.tabs .nav-drop-trigger {
    width: auto; flex: 0 0 auto; white-space: nowrap; text-align: center;
    padding: 7px 14px; font-size: 14px;
  }
  /* 移动端下拉菜单：避免被滚动容器裁切，改为相对定位 */
  .nav-dropdown { position: static; }
  .nav-drop-menu {
    position: fixed;
    top: auto;
    left: 12px;
    right: 12px;
    margin-top: 8px;
    min-width: auto;
    max-width: none;
    z-index: 120;
  }
  .nav-drop-menu a { text-align: center; }
  .nav-drop-trigger:active { background: #eff6ff; }

  .wrap { margin: 14px auto; padding: 0 12px 50px; }
  .toolbar input[type=text], .toolbar select { flex: 1 1 100%; }
  .quiz-bar { flex-wrap: wrap; }
  .quiz-bar .btn, .quiz-bar .score-box { flex: 1 1 100%; text-align: center; }
  .home-stats { gap:10px; }
  .stat { flex: 1 1 40%; min-width: 0; padding: 12px 10px; }
  .global-search { flex-wrap: wrap; }
  .global-search input { flex: 1 1 100%; }
  .global-search .btn { flex: 1 1 100%; }
  .res-go { font-size: 13px; }
  .modal-box { padding: 18px 16px; }
  .form-row { flex-direction: column; gap: 4px; }
  .form-row > label { width: auto; text-align: left; padding-top: 0; }
  .calc-cards { grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); }
  /* 移动端：演示页（小数点移位法则等）公式卡片不溢出卡片 */
  .viz-box .calc-cards { grid-template-columns: 1fr !important; }
  .viz-box .calc-card { min-width: 0 !important; max-width: 100% !important; }
  .viz-box .calc-card .val { overflow-x: auto; font-size: 13px; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .viz-box .calc-card .val .katex { white-space: nowrap; }
}

/* ===================== 登录按钮 ===================== */
.auth-btn {
  border: 1px solid var(--c-main);
  background: #fff; color: var(--c-main);
  font-weight: 700; padding: 6px 12px;
  border-radius: 999px; font-size: 13px; cursor: pointer;
  white-space: nowrap; margin-left: auto;
}
.auth-btn.on { background: var(--c-ans); border-color: var(--c-ans); color: #fff; }
.auth-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.form-row.err { color: #e0556b; font-size: 14px; }
.form-row.err:empty { display: none; }
.form-row.success { color: #16a34a; font-size: 14px; }
.form-row.success:empty { display: none; }
button.btn:disabled, .btn:disabled { opacity:.6; cursor:not-allowed; }

/* ===================== 演示三：相似三角形 · 影长测高 ===================== */
.sim-wrap { margin: 16px 0 6px; }
.sim-wrap svg {
  width: 100%; height: auto; display: block;
  background: linear-gradient(#fbfdff, #f1f6ff);
  border: 1px solid var(--c-border); border-radius: 12px;
}
.sim-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 12px; }
.sim-controls label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.sim-controls input[type=number] { width: 72px; padding: 5px 7px; border: 1px solid var(--c-border); border-radius: 8px; }
.sim-controls input[type=range] { width: 150px; }
#sim-challenge-box { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#sim-challenge-box input { width: 110px; padding: 6px 8px; border: 1px solid var(--c-border); border-radius: 8px; }
#sim-check-result { font-weight: 700; }

/* ===================== 预览弹窗 ===================== */
.preview-box { max-width: 960px; width: 94vw; }
.preview-body {
  height: 78vh;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}
#preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
#preview-fallback {
  margin: auto;
  color: var(--c-muted);
  font-size: 15px;
}

/* ===================== 上传拖拽区 ===================== */
.dropzone {
  border: 2px dashed var(--c-border, #d8dee9);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
  position: relative;
}
.dropzone.dragover {
  border-color: var(--c-main, #2563eb);
  background: #eef4ff;
}
.dropzone input[type=file] {
  width: 100%;
  font-size: 14px;
}
.dropzone .dz-hint {
  margin-top: 6px;
  color: var(--c-muted, #6b7280);
  font-size: 13px;
}

/* ===================== 全局轻提示 toast ===================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: #1f2937;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #16a34a; }
.toast.err { background: #dc2626; }

/* ===================== UI 美化升级 ===================== */

/* 页面背景：柔和渐变 + 细腻网格 */
body {
  background:
    radial-gradient(circle at 10% 0%, rgba(37,99,235,.06) 0%, transparent 35%),
    radial-gradient(circle at 90% 100%, rgba(124,58,237,.05) 0%, transparent 35%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  background-attachment: fixed;
}

/* 顶部导航：玻璃拟态 + 渐变底边 */
.topbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(37,99,235,.1);
  box-shadow: 0 4px 20px rgba(15,23,42,.08);
  padding: 12px 22px;
}
.topbar .brand {
  background: linear-gradient(135deg, var(--c-main), #4f46e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 20px;
  letter-spacing: .5px;
}

/* 导航按钮：更精致的胶囊 */
nav.tabs button {
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
nav.tabs button:hover {
  background: #e2e8f0;
  color: var(--c-main);
}
nav.tabs button.active {
  background: linear-gradient(135deg, var(--c-main), #3b82f6);
  box-shadow: 0 4px 12px rgba(37,99,235,.28);
}

/* 主按钮渐变 + 微上浮 */
.btn {
  background: linear-gradient(135deg, var(--c-main), #3b82f6);
  box-shadow: 0 4px 12px rgba(37,99,235,.22);
  transition: all .15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,99,235,.32);
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
}
.btn.ghost:hover { transform: translateY(-1px); }

/* 工具栏：白底卡片 + 阴影 */
.toolbar {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.toolbar select, .toolbar input {
  background: #f8fafc;
  border-color: #cbd5e1;
  transition: border-color .15s, box-shadow .15s;
}
.toolbar select:focus, .toolbar input:focus {
  outline: none;
  border-color: var(--c-main);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* 下拉层级：optgroup 与 option 视觉区分 */
select optgroup {
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
}
select option { color: #334155; }

/* 题库题目卡片升级 */
.qa {
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(15,23,42,.05);
  transition: transform .15s, box-shadow .15s;
}
.qa:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15,23,42,.09);
}
.qa .q { padding: 16px 18px; }
.qa .a {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-top: 1px dashed #86efac;
  padding: 14px 18px;
}

/* 自测题目卡片升级 */
.quiz-card {
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15,23,42,.06);
  border: 1px solid #e2e8f0;
  padding: 20px 22px;
}
.quiz-card .qno {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.quiz-card .qno::before {
  content: attr(data-no);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--c-main), #3b82f6);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}
.quiz-card .topic {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
}

/* 选项悬停与选中 */
.opt {
  background: #fff;
  transition: all .12s;
}
.opt:hover {
  background: #f8fafc;
  border-color: #93c5fd;
}
.opt.sel { background: #eff6ff; }

/* 答案/解析区域更突出 */
.explain {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-left: 4px solid #22c55e;
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
}

/* 组卷试卷美化 */
.paper-head {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 22px 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(15,23,42,.05);
}
.paper-head h2 { margin: 0 0 8px; color: #1e293b; }
.paper-q { margin: 18px 0; }
.paper-q .pq-body { font-weight: 600; color: #1f2937; }
.pq-letter {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  box-shadow: 0 2px 4px rgba(0,0,0,.06);
}
.paper-ans {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-left: 4px solid #22c55e;
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
  margin-top: 10px;
}

/* 错题本卡片 */
.wrong-card {
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(15,23,42,.05);
  border: 1px solid #e2e8f0;
}

/* 资料卡片 */
.dl-card {
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(15,23,42,.05);
  transition: transform .15s, box-shadow .15s;
}
.dl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15,23,42,.1);
}

/* 年级徽章 */
.g-初一 { background: #dcfce7; color: #15803d; }
.g-初二 { background: #dbeafe; color: #1d4ed8; }
.g-初三 { background: #f3e8ff; color: #7c3aed; }

/* 统计卡 */
.stat {
  box-shadow: 0 4px 12px rgba(15,23,42,.05);
  transition: transform .15s;
}
.stat:hover { transform: translateY(-2px); }

/* 弹窗 */
.modal-box {
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

/* 底部 */
footer.site {
  margin-top: 20px;
  padding: 28px 16px;
}
.footer-admin { margin-left: 8px; }
.footer-admin a { color: var(--c-muted); text-decoration: underline; }
.footer-admin a:hover { color: var(--c-main); }

/* 选中文字颜色 */
::selection {
  background: rgba(37,99,235,.18);
}

/* ===================== 题目图片点击放大 ===================== */
.qa .q img,
.qa .a img,
.quiz-card img,
.paper-q img,
.wrong-card img,
.res-item img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  cursor: zoom-in;
  transition: transform .15s, box-shadow .15s;
  display: block;
  margin: 8px 0;
}

/* 题库/题目详情中的配图：限制尺寸、居中、留白，使其与文字更协调 */
.qa .q img,
.qa .a img {
  max-width: min(100%, 520px);
  max-height: 300px;
  width: auto;
  margin: 18px auto;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(15,23,42,.06);
  object-fit: contain;
}
.qa .q img:hover,
.qa .a img:hover {
  box-shadow: 0 8px 22px rgba(15,23,42,.12);
  transform: translateY(-1px);
}

.quiz-card img:hover,
.paper-q img:hover,
.wrong-card img:hover,
.res-item img:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
}

/* 图片放大弹窗 */
.img-zoom-modal .modal-box {
  background: transparent;
  box-shadow: none;
  padding: 0;
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-zoom-modal .modal-box img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  background: #fff;
  cursor: zoom-out;
}
.img-zoom-modal .close {
  position: fixed;
  top: 16px;
  right: 24px;
  color: #fff;
  font-size: 32px;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
  z-index: 60;
}
.img-zoom-modal .mask {
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(3px);
}

/* ─────────── 课程讲解视频面板（混合播放） ─────────── */
.video-panel {
  margin: 10px 0 14px;
  padding: 0;
  background: #f3f8ff;
  border: 1px solid var(--c-border, #d9e2ef);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(38, 84, 160, .08);
  overflow: hidden;
}
.vp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  font-weight: 600;
  color: #1f3a68;
}
.vp-icon { font-size: 18px; }
.vp-title { font-size: 15px; }
.vp-screen {
  background: #000;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vp-video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  display: block;
}
.vp-note {
  padding: 8px 12px 10px;
  margin-top: 0;
  font-size: 12px;
  color: #6b7280;
}

/* 题目旁的视频讲解入口 / 复制链接按钮 */
.q .video-tip, .q .q-link {
  flex: 0 0 auto;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  vertical-align: middle;
  transition: all .12s;
}
.q .video-tip { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.q .video-tip:hover { background: #dbeafe; }
.q .q-link { border-color: #e2e8f0; color: #64748b; }
.q .q-link:hover { background: #f1f5f9; }

/* 视频播放弹窗 */
.video-player-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-player-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(2px);
}
.video-player-box {
  position: relative;
  width: 92vw;
  max-width: 960px;
  background: #0f0f0f;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.video-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #1a1a1a;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 500;
}
.video-player-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 10px;
}
.video-player-close {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.video-player-close:hover { color: #fff; }
.video-player-screen {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-player-screen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.video-player-note {
  padding: 10px 14px;
  font-size: 12px;
  color: #94a3b8;
  background: #1a1a1a;
}
@media (max-width: 560px) {
  .video-player-box { width: 100vw; height: 100vh; border-radius: 0; display: flex; flex-direction: column; }
  .video-player-screen { flex: 1; aspect-ratio: auto; }
}

.form-row.ok { color: #1a7f37; font-size: 13px; }

/* ─────────── 视频管理独立页面 ─────────── */
.video-manager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .video-manager { grid-template-columns: 1fr; } }
.video-manager h3 { font-size: 16px; margin: 0 0 12px; color: #1e293b; }
.vm-files, .vm-maps { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; padding: 14px; }
.vm-file, .vm-map {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border: 1px solid #eef2f7; border-radius: 8px; margin-bottom: 8px; background: #fafbfc;
}
.vm-f-info, .vm-m-info { flex: 1; min-width: 0; }
.vm-f-name, .vm-m-title { font-weight: 600; color: #1f293b; font-size: 14px; word-break: break-all; }
.vm-f-meta, .vm-m-meta, .vm-m-key { font-size: 12px; color: #6b7280; margin-top: 2px; }
.vm-m-preview { font-size: 12px; color: #374151; margin-top: 4px; line-height: 1.45; }
.vm-f-maps { font-size: 12px; color: #4b5563; margin-top: 4px; }
.vm-f-maps code { background: #e2e8f0; padding: 1px 5px; border-radius: 4px; font-size: 11px; }
#video-key { width: 100%; }
.vm-f-actions, .vm-m-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#video-local { width: 100%; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 8px; font-size: 14px; }
#modal-video-upload .dropzone { min-height: 120px; }

/* ===================== 首页统一视觉：panel 卡片 + 统一标题 + 柔和阴影 ===================== */
.home-panel {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 20px;
  padding: 24px;
  margin-top: 22px;
  box-shadow: 0 4px 18px rgba(15,23,42,.05);
}
.home-section { margin-top: 22px; }
.home-sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 800; color: #0f172a;
  margin: 0 0 4px; letter-spacing: .3px;
  padding-left: 12px; position: relative;
}
.home-sec-title::before {
  content: "";
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--c-main), #8b5cf6);
  border-radius: 999px;
}
.home-sec-title .hst-i { font-size: 20px; }
.home-sec-sub { font-size: 13px; color: var(--c-muted); margin: 0 0 16px; }

/* 首页学生使用指南 */
.guide-panel { background: linear-gradient(180deg, #eef2ff, #fafaff); border: 1px solid #c7d2fe; }
.guide-steps { display: flex; gap: 18px; flex-wrap: wrap; }
.guide-step { flex: 1; min-width: 210px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 22px 18px 18px; position: relative; }
.gs-num { position: absolute; top: -14px; left: 18px; width: 30px; height: 30px; border-radius: 50%; background: #6366f1; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; box-shadow: 0 4px 10px rgba(99,102,241,.35); }
.gs-ic { font-size: 26px; }
.gs-t { font-weight: 800; font-size: 16px; margin: 8px 0 6px; color: #1e293b; }
.gs-d { font-size: 13.5px; color: #475569; line-height: 1.7; }
@media (max-width: 640px) { .guide-steps { flex-direction: column; } }

/* hero 与下方 panel 更连贯 */
.hero { margin-bottom: 4px; }

/* 统计卡：在一个 panel 内横向均分 */
.home-stats {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between;
}
.stat {
  flex: 1 1 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 120px;
  padding: 18px 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
  border: 1px solid #eef2f7;
  border-radius: 16px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.08); border-color: #dbeafe; }
.stat .stat-ic {
  font-size: 24px; line-height: 1; margin-bottom: 4px; opacity: .95;
  background: linear-gradient(135deg, var(--c-main), #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-n {
  font-size: 26px; font-weight: 800; line-height: 1.1;
  background: linear-gradient(135deg, var(--c-main), #4f46e5);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-l { font-size: 12.5px; color: #64748b; font-weight: 500; }

/* 课程目录：年级卡片网格（在统一 panel 内更轻盈） */
.home-catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cat-grade {
  background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
  border: 1px solid #e8eaf0; border-radius: 16px;
  padding: 16px 18px; box-shadow: 0 2px 8px rgba(15,23,42,.04);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.cat-grade:hover { box-shadow: 0 8px 20px rgba(15,23,42,.08); transform: translateY(-2px); border-color: #dbeafe; }
.cat-grade-h {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px dashed #e2e8f0;
}
.cat-grade-n { font-size: 12px; color: #64748b; }
.cat-chapter { margin: 6px 0; }
.cat-chapter:first-of-type { margin-top: 0; }
.cat-ch-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 10px;
  cursor: pointer; transition: background .12s;
}
.cat-ch-head:hover { background: #f1f5f9; }
.cat-ch-head .caret { font-size: 12px; color: #94a3b8; width: 12px; text-align: center; }
.cat-ch-head.open .caret { color: #64748b; }
.cat-ch-name { font-size: 14px; font-weight: 700; color: #334155; }
.cat-ch-n { font-size: 12px; color: #94a3b8; margin-left: auto; }
.cat-secs { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px 22px; }
.cat-sec {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #e2e8f0; background: #fff; color: #334155;
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
  line-height: 1.5; transition: all .14s; max-width: 100%; box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.cat-sec:hover {
  border-color: var(--c-main); background: var(--c-main-light); color: var(--c-main);
  transform: translateY(-1px); box-shadow: 0 3px 8px rgba(37,99,235,.14);
}
.cat-sec-n {
  font-size: 11px; font-weight: 700; background: #f1f5f9; color: #475569;
  border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center;
}
.cat-sec:hover .cat-sec-n { background: #dbeafe; color: #1d4ed8; }

/* ===================== 录入题目（管理员） ===================== */
.add-header { margin: 6px 0 16px; }
.add-sub { color: var(--c-muted); font-size: 13.5px; line-height: 1.7; margin: 8px 0 0; }
.add-sub code { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px; padding: 1px 6px; font-size: 12.5px; color: #1d4ed8; }
.req { color: #e11d48; font-weight: 700; margin-left: 2px; }

.add-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.add-card { background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 22px 22px 18px; box-shadow: 0 4px 14px rgba(15, 23, 42, .05); }
.add-row { margin-bottom: 14px; }
.add-row > label, .add-optrow > label { display: block; font-size: 13.5px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.add-card select, .add-card input[type="text"], .add-card textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #d8e0ec;
  border-radius: 9px; font-size: 14px; color: #1f2937; background: #fbfdff; transition: border-color .14s, box-shadow .14s;
}
.add-card textarea { resize: vertical; line-height: 1.6; }
.add-card select:focus, .add-card input[type="text"]:focus, .add-card textarea:focus {
  outline: none; border-color: var(--c-main); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); background: #fff;
}
.add-custom { background: #f8fafc; border: 1px dashed #d8e0ec; border-radius: 10px; padding: 12px 14px 2px; margin: -4px 0 14px; }
.add-optrow { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.add-optrow > label { margin-bottom: 0; }
.aq-ans-pick { display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 0; }
.aq-ans-pick label { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; font-weight: 500; }
.add-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--c-border); }
.add-msg { font-size: 13px; min-height: 18px; }
.add-msg.err { color: #e11d48; }
.add-msg.ok { color: #16a34a; }

/* 实时预览 */
.add-preview { position: sticky; top: 16px; }
.preview-head { font-size: 13px; font-weight: 700; color: var(--c-muted); margin-bottom: 8px; letter-spacing: .5px; }
.preview-card { background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 18px 20px; box-shadow: 0 4px 14px rgba(15, 23, 42, .05); min-height: 160px; }
.pc-empty { color: #94a3b8; font-size: 13.5px; text-align: center; padding: 40px 10px; }
.pc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pc-badge { font-size: 12px; font-weight: 700; color: #fff; background: var(--c-main); border-radius: 6px; padding: 2px 9px; }
.pc-grade { font-size: 12px; color: var(--c-muted); background: #f1f5f9; border-radius: 6px; padding: 2px 9px; }
.pc-q { font-size: 16px; color: #1f2937; line-height: 1.7; margin-bottom: 12px; word-break: break-word; }
.pc-ph { color: #cbd5e1; font-size: 14px; }
.pc-opts { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.pc-opt { font-size: 15px; color: #334155; line-height: 1.6; word-break: break-word; }
.pc-opt b { color: var(--c-main); margin-right: 4px; }
.pc-a { background: #f8fafc; border-left: 3px solid var(--c-main); border-radius: 8px; padding: 10px 14px; font-size: 15px; color: #1f2937; line-height: 1.7; word-break: break-word; }
.pc-a-label { font-weight: 700; color: var(--c-main); margin-right: 6px; }

@media (max-width: 860px) {
  .add-layout { grid-template-columns: 1fr; }
  .add-preview { position: static; }
}

@media (max-width: 520px) {
  .home-catalog { grid-template-columns: 1fr; }
  .stat { flex: 1 1 40%; min-width: 0; }
}

/* ===================================================================
   视觉再优化：简洁 · 清爽 · 统一
   （在保留已验收的首页统计卡前提下，统一卡片语言、去除杂乱渐变）
   =================================================================== */

/* 平滑滚动 + 统一聚焦环 */
html { scroll-behavior: smooth; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.18); border-radius: 8px; }

/* 背景：纯净冷灰，去除杂乱渐变网格 */
body { background: #f6f7fb; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* 顶部导航：更轻的毛玻璃，品牌色更克制（覆盖旧版渐变文字） */
.topbar {
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(15,23,42,.07);
  box-shadow: 0 1px 3px rgba(16,24,40,.05);
  padding: 12px 24px;
}
.topbar .brand {
  font-size: 19px; letter-spacing: .3px; color: var(--c-main);
  background: none; -webkit-background-clip: initial; background-clip: initial;
}

/* 导航胶囊：中性底 + 选中实心，去除渐变 */
nav.tabs button {
  border: 1px solid transparent;
  background: #f1f5f9; color: #475569; font-weight: 600;
  box-shadow: none; padding: 8px 16px;
}
nav.tabs button:hover { background: #e8edf5; color: var(--c-main); }
nav.tabs button.active {
  background: var(--c-main); color: #fff; border-color: var(--c-main);
  box-shadow: 0 2px 8px rgba(37,99,235,.28);
}

/* 主按钮：纯色 + 柔和投影，去除渐变 */
.btn {
  background: var(--c-main); border: 1px solid var(--c-main);
  box-shadow: 0 2px 6px rgba(37,99,235,.18);
  transition: background .15s, box-shadow .15s, transform .15s;
}
.btn:hover { background: #1d4ed8; border-color: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.26); }
.btn.ghost { background: #fff; color: var(--c-main); border: 1px solid #c7d2fe; box-shadow: none; }
.btn.ghost:hover { background: #eef3ff; transform: translateY(-1px); }

/* 区块标题：优雅统一（深字 + 细左侧线） */
.home-sec-title { color: #0f172a; }

/* 统一卡片语言：白底 + 细边 + 柔和阴影 */
.qa, .quiz-card, .dl-card, .cat-grade, .paper-head, .wrong-card, .vm-files, .vm-maps, .viz-box, .home-card {
  background: #fff; border: 1px solid #e8eaf0; border-radius: 14px; box-shadow: 0 2px 10px rgba(16,24,40,.05);
}
.qa:hover, .quiz-card:hover, .dl-card:hover, .cat-grade:hover, .home-card:hover { box-shadow: 0 8px 22px rgba(16,24,40,.09); }
.qa, .quiz-card, .dl-card, .cat-grade, .home-card { transition: transform .15s, box-shadow .15s, border-color .15s; }
.qa .q { padding: 16px 18px; }
.qa .a { background: linear-gradient(135deg,#f3fbf6,#eefcf3); border-top: 1px dashed #c7ecd3; padding: 14px 18px; }

/* 内部小卡片 */
.vm-file, .vm-map { border-radius: 10px; }
.qa-opts li { border-radius: 10px; }

/* 选项 / 解析 圆角统一 */
.opt { border-radius: 10px; }
.quiz-card .topic { border-radius: 999px; }
.paper-ans, .explain { border-radius: 0 12px 12px 0; }

/* 统计卡：与卡片语言统一 */
.stat { box-shadow: 0 2px 10px rgba(16,24,40,.05); border-radius: 14px; }
.stat:hover { transform: translateY(-2px); }

/* 弹窗：更克制 */
.modal-box { border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }

/* ===================== 自测板块增强 ===================== */
.quiz-setup { padding: 18px 20px; margin-bottom: 18px; }
.quiz-setup-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.qs-field { display: flex; flex-direction: column; gap: 6px; }
.qs-field label { font-size: 13px; font-weight: 600; color: #475569; }
.qs-field select { padding: 10px 12px; border: 1px solid var(--c-border); border-radius: 10px; font-size: 14px; background: #fff; color: var(--c-text); cursor: pointer; }
.qs-field select:focus { outline: none; border-color: var(--c-main); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.quiz-setup-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.quiz-progress { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.qp-bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.qp-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--c-main), #7c3aed); border-radius: 999px; transition: width .3s ease; }
.qp-text { font-size: 13px; font-weight: 700; color: var(--c-main); min-width: 46px; text-align: right; }
.quiz-empty { text-align: center; padding: 50px 20px; color: #64748b; background: #fff; border: 1px dashed #cbd5e1; border-radius: 16px; font-size: 15px; }
.quiz-card .q-text { margin: 10px 0 14px; }
.quiz-card .opt { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; cursor: pointer; transition: all .15s; }
.quiz-card .opt:hover { border-color: var(--c-main); background: #f8fafc; }
.quiz-card .opt .tag { flex-shrink: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: #eef2ff; color: #4338ca; font-size: 13px; font-weight: 700; }
.quiz-card .opt.sel { background: #eff6ff; border-color: var(--c-main); box-shadow: 0 0 0 1px var(--c-main); }
.quiz-card .opt.correct { background: #f0fdf4; border-color: #16a34a; }
.quiz-card .opt.correct .tag { background: #dcfce7; color: #15803d; }
.quiz-card .opt.wrong { background: #fef2f2; border-color: #dc2626; }
.quiz-card .opt.wrong .tag { background: #fee2e2; color: #b91c1c; }
.quiz-card.done.ok { border-left: 4px solid #16a34a; }
.quiz-card.done.bad { border-left: 4px solid #dc2626; }
.quiz-card .fill-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.quiz-card .fill-row .fill-input { flex: 1; padding: 11px 14px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 15px; }
.quiz-card .fill-row .fill-input:focus { outline: none; border-color: var(--c-main); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.quiz-card .fill-row .btn.small { padding: 10px 18px; }
.math-keypad { margin-top: 8px; padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.mk-hint { font-size: 12px; color: #64748b; margin-bottom: 8px; }
.mk-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-btn { min-width: 36px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #334155; font-size: 16px; line-height: 1; cursor: pointer; transition: all .15s; }
.mk-btn:hover { border-color: var(--c-main); background: #eff6ff; color: var(--c-main); }
.mk-btn:active { transform: translateY(1px); }
.idx-opts { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }

/* ===================== 资料库：最高配新版 UI ===================== */

#view-downloads { padding-bottom: 40px; }

/* 顶部标题区 */
.dl-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.dl-title { display: flex; align-items: center; gap: 14px; }
.dl-title-icon { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(135deg,#3b82f6,#6366f1); color:#fff; font-size: 24px; display:flex; align-items:center; justify-content:center; box-shadow:0 8px 22px rgba(99,102,241,.25); }
.dl-header h2 { margin: 0; font-size: 26px; font-weight: 800; color: #0f172a; letter-spacing: -0.5px; }
.dl-subtitle { margin: 4px 0 0; color: #64748b; font-size: 14px; }
.dl-global-actions .btn { background: linear-gradient(135deg,#3b82f6,#6366f1); color:#fff; border:none; padding:10px 20px; border-radius:12px; font-weight:700; font-size:14px; box-shadow:0 6px 18px rgba(99,102,241,.28); transition:all .2s; }
.dl-global-actions .btn:hover { transform: translateY(-2px); box-shadow:0 10px 24px rgba(99,102,241,.35); }

/* 只读提示 */
.dl-readonly-hint { background:#f8fafc; border:1px dashed #cbd5e1; border-radius:12px; padding:12px 16px; font-size:13px; color:#64748b; margin-bottom:16px; }

/* 控制面板 */
.dl-control-panel { background:#fff; border:1px solid #e2e8f0; border-radius:20px; padding:18px; box-shadow:0 8px 28px rgba(15,23,42,.05); margin-bottom:20px; }
.dl-filter-bar { display:flex; flex-wrap:wrap; gap:18px; align-items:flex-start; }
.dl-filter-cell { display:flex; flex-direction:column; gap:8px; }
.dl-filter-grow { flex:1; min-width:300px; }
.dl-filter-label { font-size:11px; font-weight:800; color:#94a3b8; text-transform:uppercase; letter-spacing:0.8px; }

/* 筛选 Chip */
.dl-chips, .dl-segment { display:flex; flex-wrap:wrap; gap:8px; }
.dl-chip { border:1px solid #e2e8f0; background:#fff; color:#334155; padding:7px 14px; border-radius:999px; font-size:13.5px; font-weight:600; cursor:pointer; transition:all .15s; white-space:nowrap; user-select:none; }
.dl-chip:hover { border-color:#94a3b8; background:#f8fafc; color:#0f172a; transform:translateY(-1px); }
.dl-chip.active { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; font-weight:700; box-shadow:0 2px 8px rgba(37,99,235,.15); }
.dl-chip[data-grade="初一"].active { background:#f0fdf4; color:#15803d; border-color:#bbf7d0; box-shadow:0 2px 8px rgba(22,163,74,.15); }
.dl-chip[data-grade="初二"].active { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; box-shadow:0 2px 8px rgba(37,99,235,.15); }
.dl-chip[data-grade="初三"].active { background:#f5f3ff; color:#6d28d9; border-color:#ddd6fe; box-shadow:0 2px 8px rgba(124,58,237,.15); }
.dl-chip[data-grade="未分类"].active { background:#f8fafc; color:#475569; border-color:#cbd5e1; box-shadow:0 2px 8px rgba(100,116,139,.15); }
.dl-chip[data-cat].active { background:#f1f5f9; color:#334155; border-color:#cbd5e1; box-shadow:0 2px 8px rgba(71,85,105,.12); }

/* 搜索行 */
.dl-search-row { display:flex; gap:10px; align-items:center; margin-top:16px; padding-top:16px; border-top:1px solid #f1f5f9; }
.dl-search-wrap { flex:1; position:relative; }
.dl-search-wrap input { width:100%; padding:10px 14px 10px 38px; border:1px solid #e2e8f0; border-radius:12px; font-size:14px; background:#f8fafc; color:#0f172a; transition:all .15s; }
.dl-search-wrap input:focus { outline:none; border-color:#6366f1; background:#fff; box-shadow:0 0 0 4px rgba(99,102,241,.12); }
.dl-search-icon { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#94a3b8; font-size:14px; pointer-events:none; }
.dl-sort { padding:10px 12px; border:1px solid #e2e8f0; border-radius:12px; font-size:14px; background:#fff; color:#334155; cursor:pointer; }
.dl-view-toggle { display:flex; gap:6px; background:#f1f5f9; padding:4px; border-radius:12px; }
.dl-view-btn { border:none; background:transparent; color:#64748b; padding:7px 11px; border-radius:9px; cursor:pointer; font-size:15px; line-height:1; transition:all .15s; }
.dl-view-btn:hover { color:#2563eb; }
.dl-view-btn.active { background:#fff; color:#2563eb; box-shadow:0 1px 4px rgba(0,0,0,.08); font-weight:700; }

/* 统计概览 */
.dl-stats { display:flex; flex-wrap:wrap; gap:16px 20px; margin-bottom:20px; align-items:stretch; background:#fff; border:1px solid #e2e8f0; border-radius:18px; padding:16px 20px; box-shadow:0 6px 22px rgba(15,23,42,.04); }
.dl-stats-hero { display:flex; flex-direction:column; justify-content:center; padding-right:20px; border-right:1px solid #eef2f7; min-width:90px; }
.dl-hero-num { font-size:24px; font-weight:800; color:#0f172a; line-height:1.1; }
.dl-hero-unit { font-size:13px; color:#64748b; font-weight:600; margin-left:3px; }
.dl-hero-label { font-size:12px; color:#94a3b8; font-weight:700; margin-bottom:5px; letter-spacing:0.3px; }
.dl-stats-rows { flex:1; min-width:240px; display:flex; flex-direction:column; gap:10px; justify-content:center; }
.dl-stats-row { display:flex; align-items:center; gap:10px; }
.dl-stats-row-label { font-size:11px; font-weight:800; color:#94a3b8; text-transform:uppercase; letter-spacing:0.6px; width:42px; flex-shrink:0; }
.dl-mini-chips { display:flex; flex-wrap:wrap; gap:6px; }
.dl-mini-chip { font-size:12px; font-weight:600; padding:3px 10px; border-radius:999px; border:1px solid; }
.dl-mini-chip b { font-weight:800; margin-left:2px; }
.dl-mini-empty { font-size:12px; color:#cbd5e1; }

/* 年级折叠分组 */
.dl-grade-section { background:#fff; border:1px solid #e2e8f0; border-radius:20px; padding:16px; box-shadow:0 6px 22px rgba(15,23,42,.04); margin-bottom:20px; }
.dl-grade-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; cursor:pointer; border-radius:14px; background:#f8fafc; border:1px solid #f1f5f9; transition:all .15s; user-select:none; }
.dl-grade-head:hover { background:#f1f5f9; border-color:#e2e8f0; }
.dl-grade-head-left { display:flex; align-items:center; gap:10px; }
.dl-grade-head .caret { font-size:12px; color:#94a3b8; transition:transform .2s; }
.dl-grade-head.collapsed .caret { transform:rotate(-90deg); }
.dl-grade-head .grade-badge { font-size:13px; font-weight:800; padding:4px 12px; border-radius:999px; }
.dl-sec-count { font-size:13px; color:#64748b; font-weight:600; }
.dl-grade-dist { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.dl-dist-chip { font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; background:rgba(148,163,184,.1); color:#64748b; border:1px solid rgba(148,163,184,.18); }
.dl-grade-body { padding-top:14px; }
.dl-grade-body.collapsed { display:none; }
.dl-uncat-tip { background:#fffbeb; border:1px solid #fde68a; color:#92400e; border-radius:12px; padding:10px 14px; font-size:13px; line-height:1.5; margin-bottom:12px; }

/* 分类子分组 */
.dl-cat-section { margin-bottom:14px; }
.dl-cat-section:last-child { margin-bottom:0; }
.dl-cat-head { display:flex; align-items:center; gap:8px; padding:8px 10px; border-left:4px solid #94a3b8; margin-bottom:10px; cursor:pointer; user-select:none; border-radius:0 10px 10px 0; transition:background .15s; }
.dl-cat-head:hover { background:#f8fafc; }
.dl-cat-head .caret { font-size:12px; color:#94a3b8; transition:transform .2s; }
.dl-cat-head.collapsed .caret { transform:rotate(-90deg); }
.dl-cat-dot { width:8px; height:8px; border-radius:50%; background:#94a3b8; }
.dl-cat-name { font-size:14px; font-weight:700; color:#334155; }
.dl-cat-count { font-size:12px; color:#94a3b8; font-weight:600; margin-left:4px; }
.dl-cat-body { transition:opacity .15s; }
.dl-cat-body.collapsed { display:none; }

/* 网格布局 */
.dl-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px,1fr)); gap:16px; }
.dl-list { display:flex; flex-direction:column; gap:10px; }

/* 资料卡片 */
.dl-card { position:relative; background:#fdfcfa; border:1px solid #ece8e1; border-radius:16px; padding:14px; box-shadow:0 1px 3px rgba(16,24,40,.04); transition:transform .15s, box-shadow .15s, border-color .15s; display:flex; flex-direction:column; gap:12px; }
.dl-card:hover { transform:translateY(-2px); box-shadow:0 12px 26px rgba(16,24,40,.08); border-color:#ddd6fe; z-index:10; }
.dl-list .dl-card { flex-direction:row; align-items:center; gap:14px; padding:12px 14px; }
.dl-card-main { display:flex; align-items:flex-start; gap:12px; flex:1; min-width:0; }
.dl-list .dl-card-main { align-items:center; }

/* 文件图标：柔和马卡龙底色 + 同色系深色标 */
.dl-file-icon { width:46px; height:46px; border-radius:12px; flex-shrink:0; display:flex; align-items:center; justify-content:center; color:#fff; box-shadow:0 4px 10px rgba(99,102,241,.18); }
.dl-file-icon svg { width:23px; height:23px; stroke-width:1.9; }
.dl-list .dl-file-icon { width:40px; height:40px; border-radius:10px; }
.dl-list .dl-file-icon svg { width:20px; height:20px; }
.dl-file-icon.html { background:linear-gradient(135deg,#6366f1,#818cf8); }
.dl-file-icon.pdf { background:linear-gradient(135deg,#f43f5e,#fb7185); }
.dl-file-icon.doc, .dl-file-icon.docx { background:linear-gradient(135deg,#3b82f6,#60a5fa); }
.dl-file-icon.ppt, .dl-file-icon.pptx { background:linear-gradient(135deg,#f97316,#fb923c); }
.dl-file-icon.xls, .dl-file-icon.xlsx { background:linear-gradient(135deg,#10b981,#34d399); }
.dl-file-icon.jpg, .dl-file-icon.jpeg, .dl-file-icon.png, .dl-file-icon.gif, .dl-file-icon.webp { background:linear-gradient(135deg,#8b5cf6,#a78bfa); }
.dl-file-icon.zip, .dl-file-icon.rar, .dl-file-icon.7z { background:linear-gradient(135deg,#f59e0b,#fbbf24); }
.dl-file-icon.other { background:linear-gradient(135deg,#64748b,#94a3b8); }

.dl-card-meta { flex:1; min-width:0; }
.dl-card-title { color:#1c1917; font-weight:700; font-size:15px; line-height:1.4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; transition:color .15s; max-width:100%; }
.dl-card-title:hover { color:#6366f1; }
.dl-card-type { margin-top:4px; font-size:11.5px; font-weight:600; color:#8b857c; letter-spacing:.4px; }
.dl-list .dl-card-title { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:1; overflow:hidden; white-space:normal; }
.dl-card-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.dl-tag { font-size:11.5px; font-weight:700; padding:3px 9px; border-radius:999px; white-space:nowrap; border:1px solid transparent; }
.dl-tag-grade-初一 { background:#dcfce7; color:#15803d; }
.dl-tag-grade-初二 { background:#dbeafe; color:#1d4ed8; }
.dl-tag-grade-初三 { background:#f3e8ff; color:#7c3aed; }
.dl-tag-grade-未分类 { background:#f3f4f6; color:#4b5563; border-color:#e5e7eb; }
.dl-tag-local { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.dl-card-info { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; margin-top:6px; font-size:12px; color:#64748b; font-weight:500; }
.dl-card-info span { display:flex; align-items:center; gap:4px; }
.dl-info-sep { color:#cbd5e1; font-weight:400; }

/* 卡片操作区 */
.dl-card-actions { display:flex; gap:6px; align-items:center; }
.dl-card:hover .dl-card-actions { opacity:1; }
.dl-list .dl-card-actions { opacity:1; }
.dl-action-btn { width:32px; height:32px; border:1px solid #e2e8f0; border-radius:9px; background:#fff; color:#64748b; cursor:pointer; font-size:14px; line-height:1; display:flex; align-items:center; justify-content:center; transition:all .15s; }
.dl-action-btn:hover { border-color:#2563eb; color:#2563eb; background:#eff6ff; }
.dl-action-btn.danger:hover { border-color:#ef4444; color:#ef4444; background:#fef2f2; }
.dl-action-btn.dl-action-primary { width:auto; padding:0 12px 0 10px; gap:5px; font-size:13px; font-weight:700; color:#2563eb; background:#eff6ff; border-color:#bfdbfe; }
.dl-action-btn.dl-action-primary:hover { background:#2563eb; color:#fff; }
.dl-action-btn.dl-action-primary svg { flex-shrink:0; }
.dl-list .dl-action-btn { width:30px; height:30px; font-size:13px; }
.dl-list .dl-action-btn.dl-action-primary { width:auto; padding:0 10px 0 8px; }

/* 更多操作下拉 */
.dl-more { position:relative; display:flex; }
.dl-more-btn { color:#94a3b8; }
.dl-more-btn svg { display:block; }
.dl-more-menu { position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid #e2e8f0; border-radius:12px; box-shadow:0 12px 36px rgba(15,23,42,.18); padding:6px; display:none; flex-direction:column; gap:2px; min-width:128px; z-index:100; }
.dl-more.open .dl-more-menu { display:flex; }
.dl-more-item { display:flex; align-items:center; gap:6px; padding:8px 12px; border:none; background:#fff; color:#334155; font-size:13px; font-weight:600; border-radius:8px; cursor:pointer; text-align:left; white-space:nowrap; }
.dl-more-item:hover { background:#f1f5f9; color:#0f172a; }
.dl-more-item.danger { color:#dc2626; }
.dl-more-item.danger:hover { background:#fef2f2; color:#dc2626; }
.dl-card { position:relative; z-index:1; }
.dl-card-raised { z-index:20; }
.dl-more-btn { min-width:34px; min-height:34px; }
.dl-more-btn svg { pointer-events:none; }

/* 行内编辑器 */
.dl-card .meta-editor { flex-basis:100%; display:none; gap:8px; flex-wrap:wrap; margin-top:4px; padding:12px; background:#f8fafc; border:1px dashed #cbd5e1; border-radius:10px; }
.dl-card .meta-editor.open { display:flex; }
.dl-card .meta-editor .me-label { font-size:12px; color:#64748b; font-weight:700; }
.dl-card .meta-editor select, .dl-card .meta-editor input { padding:6px 10px; border:1px solid #e2e8f0; border-radius:8px; font-size:13px; background:#fff; }
.dl-card .meta-editor .mm-grade { min-width:80px; }
.dl-card .meta-editor .mm-cat { min-width:120px; }
.dl-card .meta-editor .mm-note { flex:1; min-width:140px; }
.dl-card .meta-editor .btn { padding:6px 12px; font-size:13px; }

/* 空状态 */
.dl-empty { text-align:center; padding:60px 20px; background:#fff; border:1px dashed #e2e8f0; border-radius:20px; }
.dl-empty-icon { font-size:56px; margin-bottom:12px; }
.dl-empty h3 { margin:0 0 6px; color:#0f172a; font-size:18px; }
.dl-empty p { margin:0; color:#64748b; font-size:14px; }

@media (max-width: 900px) {
  .dl-filter-bar { flex-direction:column; gap:14px; }
  .dl-filter-grow { min-width:auto; width:100%; }
  .dl-search-row { flex-wrap:wrap; }
  .dl-search-wrap { flex:1 1 100%; }
  .dl-grid { grid-template-columns:minmax(0,1fr); }
  .dl-list .dl-card { flex-wrap:wrap; }
  .dl-card-actions { opacity:1; }
  .dl-grade-head { flex-direction:column; align-items:flex-start; gap:8px; }
  .dl-card, .dl-card-main, .dl-card-meta { min-width:0; max-width:100%; }
  .dl-card-title { max-width:100%; }
}
.idx-opts .opt { width: auto; min-width: 48px; justify-content: center; }
#quiz-bottom-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#quiz-bottom-bar .btn:disabled { opacity: .5; cursor: not-allowed; }
.score-box { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 999px; padding: 8px 16px; font-weight: 700; color: #0f172a; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
@media (max-width: 720px) {
  .quiz-setup-grid { grid-template-columns: repeat(2, 1fr); }
  .quiz-setup-actions .btn { flex: 1 1 45%; }
}
@media (max-width: 480px) {
  .quiz-setup-grid { grid-template-columns: 1fr; }
}

/* 徽章圆角统一 */
.type-choice, .type-fill, .type-calc, .new-badge { border-radius: 999px; }

/* ===================== 首页再升级：人格 / 主张 / 上手路径 ===================== */
/* 老数说：每日一句 */
.home-tip {
  display: flex; align-items: center; gap: 12px;
  margin-top: 18px; padding: 14px 20px;
  background: linear-gradient(135deg, #fffaf0 0%, #fff5fa 100%);
  border: 1px solid #f3e3d3; border-left: 4px solid #f59e0b;
  border-radius: 14px; box-shadow: 0 2px 10px rgba(16,24,40,.05);
}
.ht-badge {
  flex-shrink: 0; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ef7d3b);
  padding: 4px 12px; border-radius: 999px; box-shadow: 0 2px 6px rgba(245,158,11,.3);
}
.ht-text { font-size: 14.5px; color: #6b4f2a; line-height: 1.6; }

/* 教学主张：三承诺 */
.idea-panel .pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 4px 0 18px; }
.pillar {
  background: linear-gradient(180deg,#fbfdff 0%,#f8fafc 100%);
  border: 1px solid #e8eaf0; border-radius: 16px; padding: 20px 18px;
  text-align: center; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pillar:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,23,42,.09); border-color: #dbeafe; }

/* ===================== 账号管理页 ===================== */
.user-manager { max-width: 1100px; margin: 0 auto; padding: 10px 4px 40px; }
.user-manager__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.user-manager__header .sec-title { margin: 0; }
.user-manager__sub { margin: 6px 0 0; font-size: 13px; color: var(--c-muted); }
.user-table-wrap { background: #fff; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.user-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.user-table th { background: #f8fafc; color: #475569; font-weight: 700; font-size: 13px; text-align: left; padding: 14px 16px; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.user-table td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.user-table tbody tr:last-child td { border-bottom: none; }
.user-table tbody tr:nth-child(even) { background: #fafbfc; }
.user-table tbody tr:hover { background: #f1f5f9; }
.user-table .user-name { font-weight: 600; color: #0f172a; word-break: break-all; }
.user-table .user-ops { white-space: nowrap; text-align: right; }
.user-table .user-ops .btn { margin-left: 6px; }
.user-table .user-ops .btn:first-child { margin-left: 0; }
.role-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.4; }
.role-admin { background: #fee2e2; color: #991b1b; }
.role-student { background: #dbeafe; color: #1e40af; }
.role-teacher { background: #d1fae5; color: #065f46; }
.role-parent { background: #fce7f3; color: #9d174d; }
.role-学管 { background: #ede9fe; color: #5b21b6; }
.built-in { font-size: 12px; color: #94a3b8; font-style: italic; }
.current-tag { font-size: 12px; color: #64748b; margin-left: 8px; }
.admin-row { background: #fffbeb !important; }
.admin-row:hover { background: #fef3c7 !important; }
.btn.xs { padding: 5px 12px; font-size: 12px; border-radius: 6px; font-weight: 600; }
.btn.xs.danger { background: #fff; color: #dc2626; border: 1px solid #fecaca; }
.btn.xs.danger:hover { background: #fee2e2; }
@media (max-width: 720px) {
  .user-table-wrap { overflow-x: auto; }
  .user-table { min-width: 720px; }
  .user-manager__header { align-items: flex-start; flex-direction: column; }
}

/* ===================== 账号编辑弹窗 ===================== */
.ue-modal-box { width: min(520px, 92vw); padding: 26px 28px 28px; }
.ue-modal-box h3 { margin: 0; color: #0f172a; font-size: 18px; }
.ue-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.ue-icon { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #dbeafe, #ede9fe); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.ue-sub { margin: 4px 0 0; font-size: 13px; color: #64748b; }
.ue-sub .req { color: #dc2626; }
.ue-form { display: flex; flex-direction: column; gap: 16px; }
.ue-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px; }
.ue-card-title { font-size: 13px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }
.ue-row { display: flex; flex-direction: column; gap: 6px; }
.ue-row > label { font-size: 13px; font-weight: 600; color: #334155; }
.ue-row > label .req { color: #dc2626; margin-left: 2px; }
.ue-row input[type=text], .ue-row select { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff; transition: border-color .15s, box-shadow .15s; }
.ue-row input[type=text]:focus, .ue-row select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.ue-row input[readonly] { background: #f1f5f9; color: #64748b; cursor: not-allowed; }
.ue-row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ue-hint { margin: 4px 0 0; font-size: 12px; color: #64748b; line-height: 1.5; }
.ue-role-group { display: flex; gap: 10px; }
.ue-role-option { flex: 1; cursor: pointer; margin: 0; }
.ue-role-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.ue-role-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; text-align: center; transition: border-color .15s, box-shadow .15s, background .15s; }
.ue-role-card b { font-size: 14px; color: #334155; }
.ue-role-card small { font-size: 11px; color: #94a3b8; line-height: 1.3; }
.ue-role-option input:checked + .ue-role-card { border-color: #3b82f6; background: #eff6ff; box-shadow: 0 0 0 2px rgba(59,130,246,.18); }
.ue-role-option input:checked + .ue-role-card b { color: #1d4ed8; }
.ue-role-option:hover .ue-role-card { border-color: #93c5fd; }
.ue-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.ue-actions .btn { padding: 8px 18px; font-size: 14px; border-radius: 10px; font-weight: 600; }
.ue-actions .btn.primary { background: #2563eb; color: #fff; border: 1px solid #2563eb; }
.ue-actions .btn.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.ue-actions .btn.ghost { background: #fff; color: #475569; border: 1px solid #cbd5e1; }
.ue-actions .btn.ghost:hover { background: #f1f5f9; }
@media (max-width: 560px) {
  .ue-modal-box { padding: 20px 18px 22px; }
  .ue-row-grid { grid-template-columns: 1fr; }
  .ue-role-group { flex-direction: column; }
  .ue-role-card { flex-direction: row; justify-content: flex-start; padding: 10px 12px; gap: 8px; }
  .ue-role-card small { display: none; }
}

.pillar-ic {
  width: 52px; height: 52px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; border-radius: 16px; background: linear-gradient(135deg,#eef2ff,#f5f3ff); box-shadow: 0 4px 12px rgba(99,102,241,.16);
}
.pillar-t { font-size: 17px; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.pillar-d { font-size: 13px; color: #64748b; line-height: 1.6; }

/* 三步上手路径 */
.steps {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px;
  margin-top: 6px; padding: 16px; background: #f8fafc; border: 1px dashed #dbe3f0; border-radius: 14px;
}
.step { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 700; color: #1e293b; background: #fff; border: 1px solid #e2e8f0; padding: 9px 16px; border-radius: 999px; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.step-n {
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c-main), #6366f1); color: #fff; border-radius: 50%; font-size: 13px; font-weight: 800;
}
.step-arrow { color: #cbd5e1; font-size: 18px; font-weight: 700; }

@media (max-width: 680px) {
  .idea-panel .pillars { grid-template-columns: 1fr; }
  .hero-title { font-size: 30px !important; }
  .hero-deco { opacity: .35; max-width: 60%; }
}

/* ───────── 练习记录 / 老师批改 ───────── */
.mine-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 18px; align-items: stretch; }
.ms-card { min-width: 96px; flex: 1 1 96px; background: linear-gradient(135deg, #fff, #f3f6ff); border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 12px; text-align: center; box-shadow: 0 2px 8px rgba(30,41,59,.04); }
.ms-num { font-size: 26px; font-weight: 800; color: var(--c-main, #3b6cff); line-height: 1.1; }
.ms-label { font-size: 12.5px; color: #64748b; margin-top: 4px; }
.ms-weak { margin: 6px 0 12px; font-size: 14px; color: #475569; }
.weak-tag, .ch-tag { display: inline-block; margin: 3px 6px 3px 0; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.ch-tag { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.mine-records { display: flex; flex-direction: column; gap: 10px; }
.rec-item { background: #fff; border: 1px solid #e6ebf3; border-radius: 12px; padding: 12px 14px; }
.rec-q { font-size: 15px; color: #1e293b; word-break: break-word; line-height: 1.7; }
.rec-meta { font-size: 12.5px; color: #64748b; margin-top: 6px; }

/* 管理员练习记录：按学生折叠 */
.stu-group { background: #fff; border: 1px solid #e6ebf3; border-radius: 12px; overflow: hidden; }
.stu-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; background: #f8fafc; border-bottom: 1px solid transparent; transition: background .15s; }
.stu-head:hover { background: #f1f5f9; }
.stu-group.open .stu-head { border-bottom-color: #e6ebf3; }
.stu-name { font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 8px; }
.stu-name::before { content: '▶'; font-size: 11px; color: #94a3b8; transition: transform .2s; }
.stu-group.open .stu-name::before { transform: rotate(90deg); }
.stu-stat { font-size: 12.5px; color: #64748b; white-space: nowrap; }
.stu-body { display: none; padding: 10px 14px 14px; }
.stu-group.open .stu-body { display: block; }
.stu-body .rec-item { margin-bottom: 8px; }
.stu-body .rec-item:last-child { margin-bottom: 0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: #dcfce7; color: #15803d; }
.badge.bad { background: #fee2e2; color: #b91c1c; }

/* 老师批改 */
.grade-pending, .grade-done { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.sub-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(30,41,59,.05); }
.sub-card.graded { background: #f8fafc; }
.sub-head { font-size: 14px; color: #334155; margin-bottom: 6px; }
.sub-q { font-size: 14.5px; color: #1e293b; margin-bottom: 8px; word-break: break-word; line-height: 1.7; }
.sub-imgs { display: flex; flex-wrap: wrap; gap: 10px; }
.sub-img { width: 150px; max-height: 200px; object-fit: cover; border-radius: 10px; border: 1px solid #e2e8f0; cursor: zoom-in; }
.sub-grade { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.sub-score { width: 90px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; }
.sub-comment { flex: 1 1 160px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; }
.sub-comment { min-width: 140px; }
.sub-save { background: #16a34a; }
.photo-row { margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.file-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.photo-hint { font-size: 12.5px; color: #16a34a; }

/* =========================================================================
   移动端适配增强层（2026-08-11 新增，铁律：只增不改）
   原则：全部包裹在 @media 内，桌面端（>768px）绝不触发；不改动任何既有规则，
   仅新增/覆盖移动端表现。所有改动以"不削弱桌面功能与观感"为前提。
   ========================================================================= */

/* ---------- 平板及以下（≤768px） ---------- */
@media (max-width: 768px) {
  /* 横向溢出总闸：防止任何元素撑出导致整页横向滚动条 */
  html, body { max-width: 100%; overflow-x: hidden; }

  /* 容器与卡片内边距收紧 */
  .wrap { padding: 0 14px 44px; margin: 16px auto; }
  .qa .q { padding: 12px 14px; }
  .qa .a { padding: 12px 16px; }
  .quiz-card { padding: 16px 16px; }

  /* 顶部导航：保留横向滚动胶囊行，仅隐藏滚动条，体验更干净（不动既有交互） */
  nav.tabs { scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px; }
  nav.tabs::-webkit-scrollbar { display: none; height: 0; }

  /* 工具栏控件整行铺满 */
  .toolbar { gap: 8px; }
  .toolbar select, .toolbar input { flex: 1 1 100%; }

  /* 首页课程目录：300px 最小列在窄屏会溢出，改单列 */
  .home-catalog { grid-template-columns: 1fr; }

  /* 资料库统计概览：竖排，去掉 hero 右侧分隔线 */
  .dl-stats { flex-direction: column; gap: 12px; }
  .dl-stats-hero { border-right: none; padding-right: 0; min-width: auto; }
  .dl-stats-rows { min-width: auto; }

  /* 过宽的数学公式：在自身范围内横向滚动，不撑破页面 */
  .katex-display { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .qa .a table { width: 100%; table-layout: fixed; font-size: 13px; word-break: break-word; }

  /* 视频播放器：桌面端 100vw 在移动端会撑出横向滚动，改回 100% */
  .video-player-box { width: 100%; }

  /* 通用图片/媒体约束，避免被原始尺寸撑破 */
  img, svg, video { max-width: 100%; height: auto; }
}

/* ---------- 手机（≤480px） ---------- */
@media (max-width: 480px) {
  .wrap { padding: 0 12px 36px; margin: 12px auto; }

  /* 字号收敛，避免拥挤 */
  body { font-size: 14px; }
  .sec-title { font-size: 19px; }
  .sub-title { font-size: 15px; }
  .qa .q, .qa .a { font-size: 14px; }
  .quiz-card { padding: 14px 14px; }

  /* 触控友好：按钮最小高度与整行铺满 */
  .btn { min-height: 42px; }
  .toolbar .btn, .quiz-setup-actions .btn { flex: 1 1 100%; }
  nav.tabs button { padding: 7px 14px; }

  /* 弹窗在超小屏铺满 */
  .modal { padding: 12px; }
  .modal-box { width: 100%; }
}

/* ---------- 手机顶栏高端化（≤520px）：单行顶栏 + 入口聚合下拉 ----------
   参考主流 App 做法：品牌居左，用户入口收敛为「登录」文字按钮；
   隐藏原来两个橙色大按钮与 hero 冗余大标题，并大幅收紧顶栏/导航/hero
   之间的空白，让首屏信息更紧凑。仅影响 ≤520px。 */
@media (max-width: 520px) {
  /* 移动端顶栏：固定悬浮，下滑隐藏、上滑显示 */
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand entry" "nav nav";
    gap: 1px 6px;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 4px 10px 3px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(37,99,235,.1);
    box-shadow: 0 2px 12px rgba(15,23,42,.08);
    transform: translateY(0);
    transition: transform .25s ease, box-shadow .25s ease;
  }
  .topbar.is-hidden { transform: translateY(-100%); }
  /* 为固定顶栏留出空间，避免内容被遮挡 */
  body { padding-top: 74px; }
  .topbar .brand {
    grid-area: brand;
    justify-self: start;
    font-size: 14px;
    padding: 0;
    white-space: nowrap;
  }
  /* 桌面端的两个橙色入口按钮在移动端收进下拉 */
  .topbar .stu-entry-btn { display: none; }

  /* 移动端入口聚合：「登录」文字按钮 + 下拉菜单 */
  .mobile-entry {
    grid-area: entry;
    display: block;
    position: relative;
    justify-self: end;
  }
  .mobile-entry-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid var(--c-border, #e2e8f0);
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-main, #2563eb);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
    transition: transform .1s, box-shadow .15s, background .15s;
  }
  .mobile-entry-trigger:active { transform: scale(.96); background: #f8fafc; }
  .mobile-entry-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border: 1px solid rgba(37,99,235,.12);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15,23,42,.12);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .15s, transform .15s, visibility .15s;
    z-index: 50;
  }
  .mobile-entry-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .mobile-entry-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    color: var(--c-text, #334155);
    cursor: pointer;
    text-align: left;
  }
  .mobile-entry-menu button:active { background: #f1f5f9; }

  .topbar nav.tabs { grid-area: nav; width: 100%; margin-top: 0; padding-bottom: 0; gap: 5px; }
  .topbar nav.tabs button,
  .topbar nav.tabs a.nav-link { padding: 3px 8px; font-size: 12px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; min-height: 20px; }
  .topbar nav.tabs a.nav-link { color: var(--c-text); text-decoration: none; }

  /* hero 区大标题与顶栏品牌重复，移动端隐藏；恢复原有渐变/SVG背景 */
  .hero-title { display: none; }
  /* 移动端 hero 保持原有精美背景，仅做紧凑化 */
  .hero {
    position: relative;
    overflow: hidden;
    padding: 14px 14px 18px;
    border-radius: 18px;
    background:
      radial-gradient(ellipse at 20% 10%, rgba(124,58,237,.12) 0%, transparent 42%),
      radial-gradient(ellipse at 85% 15%, rgba(236,72,153,.10) 0%, transparent 38%),
      radial-gradient(ellipse at 50% 95%, rgba(37,99,235,.08) 0%, transparent 42%),
      linear-gradient(135deg,#f8fafc 0%,#f1f5f9 100%);
    color:#1e293b;
    box-shadow: 0 12px 34px rgba(15,23,42,.08);
    border: 1px solid rgba(255,255,255,.8);
  }
  .hero::before {
    content:"";
    position:absolute;
    inset:0;
    background-image: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.07'%3E%3Cpath d='M38 36v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-32V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 36v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity:.7;
    pointer-events:none;
  }
  .hero::after {
    content:"";
    position:absolute;
    inset:0;
    background:
      radial-gradient(circle at 30% 30%, rgba(124,58,237,.08) 0%, transparent 26%),
      radial-gradient(circle at 70% 70%, rgba(37,99,235,.07) 0%, transparent 28%);
    pointer-events:none;
  }
  .hero-left { position: relative; z-index: 1; padding-top: 0; }
  .hero-avatar { position: relative; z-index: 1; width: 36px; height: 36px; font-size: 18px; margin: 0 auto 4px; border-radius: 10px; }
  .hero-eyebrow { position: relative; z-index: 1; margin-bottom: 4px; font-size: 11.5px; padding: 2px 9px; }
  .hero-motto { position: relative; z-index: 1; margin: 4px auto 8px; font-size: 13.5px; }
  .global-search { position: relative; z-index: 1; }
  .global-search input {
    padding: 10px 14px;
    font-size: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15,23,42,.06);
  }
  .global-search .btn { padding: 9px 18px; }
  .quick-chips { position: relative; z-index: 1; margin-top: 8px; }
}

/* ===== 2026-09-28 全站表格单元格防溢出（系统性修复） =====
   根因：各页表格单元格此前无统一折行策略，长文本（自定义分类、长串字符）
   在密集表格里把行撑高、视觉上溢到相邻列/行。
   本层只影响"放不下的长内容"，不改变正常排版： */
th, td { overflow-wrap: break-word; }
/* 通用两行截断工具类：密集表格里的长文本最多两行，超出省略；
   完整内容请放 title 提示或详情弹层 */
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 2026-09-28 全站统一行内操作按钮（图标+文字） =====
   规范：图标管美观、文字管说明；彩色胶囊底色区分动作类型：
   蓝=查看/凭证(.evi) 绿=编辑(.edit) 红=删除(.del) 灰=默认。
   所有页面的表格行/卡片行内操作统一用本组件。 */
.rowact, .hf-rowact{ display:inline-flex; align-items:center; gap:3px; font:inherit; font-size:11.5px; line-height:1; cursor:pointer; white-space:nowrap; padding:3.5px 8px; margin:0 3px 3px 0; border-radius:14px; border:1px solid #d7dde8; background:#fff; color:#46506a; transition:box-shadow .12s; }
.rowact:hover, .hf-rowact:hover{ box-shadow:0 1px 4px rgba(20,40,90,.16); }
.rowact.evi, .hf-rowact.evi{ color:#2b5fb3; border-color:#c9d9f2; background:#f6f9ff; }
.rowact.evi:hover, .hf-rowact.evi:hover{ border-color:#9fbce8; }
.rowact.edit{ color:#1e8e3e; border-color:#bfe3c8; background:#f4fbf6; }
.rowact.del, .hf-rowact.del{ color:#d93025; border-color:#f0c4c0; background:#fdf4f3; }
.rowact.del:hover, .hf-rowact.del:hover{ border-color:#e8a49e; }
