: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: 16px;
  padding: 10px 20px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.topbar .brand { font-weight: 800; font-size: 18px; color: var(--c-main); white-space: nowrap; }
.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: 8px; flex-wrap: wrap; }
nav.tabs button {
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  transition: all .15s;
}
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;
}

.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); }
.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: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px dashed var(--c-main); border-radius: 12px; margin-bottom: 16px; }
.dl-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--c-border); border-radius: 12px; margin: 12px 0; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.03); }
.dl-card .icon { font-size: 30px; }
.dl-card .meta { flex: 1; min-width: 160px; }
.dl-card .meta .t { font-weight: 700; }
.dl-card .meta .d { font-size: 13px; color: var(--c-muted); }
.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; }

/* 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; }
.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; }
  /* 移动端：导航栏直接显示为可横向滚动的一行，无需点击汉堡按钮 */
  .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: 8px;
    -webkit-overflow-scrolling: touch;
  }
  nav.tabs button { width: auto; flex: 0 0 auto; white-space: nowrap; text-align: center; }

  .wrap { margin: 14px auto; padding: 0 12px 50px; }
  .toolbar input[type=text], .toolbar select { flex: 1 1 100%; }
  .dl-card { flex-wrap: wrap; }
  .dl-card .meta { flex: 1 1 100%; }
  .dl-card a.btn, .dl-card button.btn { flex: 1; text-align: center; }
  .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)); }
}

/* ===================== 登录按钮 ===================== */
.auth-btn {
  border: 1px solid var(--c-main);
  background: #fff; color: var(--c-main);
  font-weight: 700; padding: 7px 14px;
  border-radius: 999px; font-size: 14px; 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; }

/* ===================== 资料库：文件名可点击预览 ===================== */
.dl-card .meta .t .fname {
  color: var(--c-main);
  cursor: pointer;
  font-weight: 600;
  border-bottom: 1px dashed var(--c-main);
}
.dl-card .meta .t .fname:hover { color: #1d4ed8; background: var(--c-main-light); }

/* ===================== 预览弹窗 ===================== */
.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:hover,
.qa .a img:hover,
.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; }

/* 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: 10px 0; }
.cat-chapter:first-of-type { margin-top: 0; }
.cat-ch-name { font-size: 14px; font-weight: 700; color: #334155; margin-bottom: 7px; }
.cat-secs { display: flex; flex-wrap: wrap; gap: 8px; }
.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; }
.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; }
.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%; }
}
