:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 顶部导航 ===== */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: none;
}
.brand-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 800;
}

/* 返回总站：跨站导航，与站内导航做视觉区分（Issue #57） */
.brand-group {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex-wrap: wrap;
}
/* 移动端窄屏：品牌文字换成不换行省略，别再被压成一列 */
.brand { min-width: 0; }
.brand > span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-home {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.site-home:hover { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }

/* 导航：窄屏允许换行；极端窄屏（<360px）退化为横向滑动，绝不竖排挤压 */
.topbar-nav {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topbar-nav::-webkit-scrollbar { display: none; }
.nav-link { white-space: nowrap; flex: 0 0 auto; }
.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 14px;
}
.nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-link.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

/* 搜索框 */
.search-box {
  display: flex; align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  margin-left: 12px;
}
.search-box input {
  border: none; background: none; outline: none;
  width: 180px; font-size: 14px; color: var(--text);
}

/* ===== 主容器 ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* 英雄区 */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius);
  color: #fff;
  padding: 40px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero p { font-size: 16px; opacity: .95; max-width: 720px; }

/* 进度卡片 */
.progress-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--primary-dark); }
.stat-card .label { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* 阶段卡片 */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.stage-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stage-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.stage-num {
  font-size: 12px; font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 20px;
  align-self: flex-start;
}
.stage-title { font-size: 18px; font-weight: 700; }
.stage-goal { font-size: 13px; color: var(--text-light); flex: 1; }
.stage-meta {
  display: flex; gap: 14px;
  font-size: 12px; color: var(--text-light);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 10px;
  transition: width .4s ease;
}
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.badge.locked { background: var(--warning-light); color: var(--warning); }

/* 章节列表 */
.chapter-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.chapter-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .15s;
}
.chapter-item:hover { border-color: var(--primary); }
.chapter-index {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.chapter-item.done .chapter-index { background: var(--success-light); color: var(--success); }
.chapter-info { flex: 1; }
.chapter-info h4 { font-size: 15px; }
.chapter-info p { font-size: 12px; color: var(--text-light); }

/* 学习内容 */
.content-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.content-card h2 { font-size: 24px; margin-bottom: 8px; }
.content-card h3 { font-size: 18px; margin: 20px 0 10px; color: var(--primary-dark); }
.content-card h4 { font-size: 16px; margin: 16px 0 8px; }
.content-card p { margin-bottom: 12px; }
.content-card ul, .content-card ol { margin: 8px 0 16px 22px; }
.content-card li { margin-bottom: 6px; }
.content-card code {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 13px;
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
}
.content-card pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
}
.content-card pre code { background: none; border: none; color: inherit; padding: 0; }
.doc-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  margin-top: 6px;
}
.doc-link:hover { text-decoration: none; background: var(--primary); color: #fff; }

.nav-buttons {
  display: flex; justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
}
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 14px; font-weight: 500;
  color: var(--text);
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn.primary:hover { background: var(--primary-dark); }
.btn.success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn.success:hover { background: #15803d; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* 测试 */
.quiz-container { margin-top: 16px; }
.question {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.question-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.q-type {
  font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary-dark);
}
.q-type.multi { background: var(--warning-light); color: var(--warning); }
.q-type.judge { background: var(--success-light); color: var(--success); }
.question h5 { font-size: 15px; }
.options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.option {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all .15s;
  font-size: 14px;
}
.option:hover { border-color: var(--primary); background: var(--primary-light); }
.option.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 500; }
.option.correct { border-color: var(--success); background: var(--success-light); }
.option.wrong { border-color: var(--danger); background: var(--danger-light); }
.option-key {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.option.selected .option-key { border-color: var(--primary); background: var(--primary); color: #fff; }
.option.correct .option-key { border-color: var(--success); background: var(--success); color: #fff; }
.option.wrong .option-key { border-color: var(--danger); background: var(--danger); color: #fff; }

.answer-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}
.answer-feedback.show { display: block; }
.answer-feedback.correct { background: var(--success-light); color: var(--success); }
.answer-feedback.wrong { background: var(--danger-light); color: var(--danger); }

/* 只看错题筛选栏 */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.filter-label { font-size: 13px; color: var(--text-light); }
.filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-hint { font-size: 12px; color: var(--warning); }

/* 答案解析明细 */
.answer-detail {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.8;
}
.tag-correct { color: var(--success); font-weight: 600; }
.tag-wrong { color: var(--danger); font-weight: 600; }

/* 错题卡片高亮 */
.question-wrong {
  border: 2px solid var(--danger) !important;
  background: var(--danger-light);
}
@keyframes flashHighlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.0); }
  50% { box-shadow: 0 0 0 6px rgba(220,38,38,.25); }
}
.highlight-flash { animation: flashHighlight 1.2s ease 2; }

/* 测试结果 */
.quiz-result {
  text-align: center;
  padding: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.quiz-result .score {
  font-size: 56px; font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.quiz-result .pass { font-size: 20px; font-weight: 700; margin: 12px 0 6px; }
.quiz-result .pass.yes { color: var(--success); }
.quiz-result .pass.no { color: var(--danger); }

/* 章节导航抽屉 */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-light);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }

/* 成就/徽章 */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.badge-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.badge-item .badge-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 10px;
  background: var(--primary-light);
}
.badge-item.unlocked .badge-icon { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.badge-item.locked .badge-icon { filter: grayscale(1); opacity: .5; }
.badge-item .badge-name { font-weight: 600; font-size: 14px; }
.badge-item.locked .badge-name { color: var(--text-light); }

/* 搜索下拉 */
.search-results {
  position: absolute;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 8px;
  z-index: 200;
  right: 0;
  padding: 6px;
}
.search-results .sr-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.search-results .sr-item:hover { background: var(--bg); }
.search-results .sr-item .sr-type {
  font-size: 11px; color: var(--primary); font-weight: 600;
}
.search-wrap { position: relative; }

/* 页脚 */
.footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}
.footer a { color: var(--primary); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 860px;
  margin: 0 auto;
  text-align: left;
}
.footer-qr { flex: 0 0 auto; text-align: center; }
.footer-info { flex: 1 1 280px; min-width: 240px; }

/* 响应式 */
@media (max-width: 900px) {
  /* 顶栏改为两行：品牌行 / 导航行，导航溢出时横滑 —— 不再互挤成竖排乱码 */
  .topbar-inner {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 6px;
    padding: 8px 16px;
  }
  .brand-group { flex: 1 1 auto; }
  .brand { max-width: 100%; }
  .topbar-nav { order: 3; flex: 1 0 100%; }
  .search-box { display: none; }
}
@media (max-width: 640px) {
  .stage-grid { grid-template-columns: 1fr; }
  .content-card { padding: 20px; }
  .hero { padding: 24px; }
  .hero h1 { font-size: 24px; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
  .brand-group { gap: 8px; }
  .site-home { padding: 4px 8px; font-size: 12px; }
}

/* 通用 */
.empty { text-align: center; padding: 40px; color: var(--text-light); }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ===== 登录/注册弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 45, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  padding: 28px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--danger); }

.auth-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 18px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
}

.auth-tab.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}

.auth-form label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin: 14px 0 6px;
}

.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  border-color: var(--primary);
}

.auth-msg {
  margin-top: 12px;
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
}

.auth-submit {
  width: 100%;
  margin-top: 12px;
}

/* 答题历史面板 */
.history-panel {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hp-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.history-record {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.hr-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.hr-date { font-size: 13px; color: var(--text-light); }
.hr-score { font-size: 14px; font-weight: 700; }
.hr-score.ok { color: var(--success); }
.hr-score.no { color: var(--danger); }
.hr-result { font-size: 13px; font-weight: 600; }
.hr-result.ok { color: var(--success); }
.hr-result.no { color: var(--danger); }
.hr-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 8px;
}
.history-question {
  border-left: 3px solid var(--danger);
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--danger-light);
  border-radius: 0 6px 6px 0;
}
.hq-text { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.hq-ans { font-size: 13px; line-height: 1.7; }
.hq-explain { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.history-empty {
  text-align: center;
  color: var(--success);
  padding: 16px;
  font-size: 14px;
}

/* ===== 评论区 ===== */
.chapter-comments {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.chapter-comments h3 {
  font-size: 17px;
  margin-bottom: 4px;
}
.comments-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.comment-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.comment-user { font-weight: 600; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--text-light); }
.comment-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.comment-body { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.comment-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  padding: 24px 0;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.comment-ai {
  margin-top: 10px;
  border-left: 3px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
}
.comment-ai-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.comment-ai-body { font-size: 13px; line-height: 1.7; white-space: pre-wrap; color: var(--text); }
.comment-ai-pending { color: var(--text-light); font-style: italic; display: flex; align-items: center; gap: 8px; }
.comment-ai-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: comment-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes comment-spin {
  to { transform: rotate(360deg); }
}
.comment-form { margin-top: 8px; }
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.comment-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.comment-atnpc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
}
.comment-login-tip {
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ===== 课件内容：表格 / 引用 / 代码块（FDE 子站新增） ===== */
.content-card table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
.content-card th, .content-card td { border: 1px solid #e2e8f0; padding: 10px 12px; text-align: left; vertical-align: top; line-height: 1.7; }
.content-card th { background: #f5f8ff; font-weight: 700; }
.content-card tr:nth-child(even) td { background: #fafbfe; }
.content-card blockquote { border-left: 4px solid var(--primary, #0067ff); background: #f5f8ff; padding: 10px 14px; margin: 14px 0; border-radius: 6px; }
.content-card blockquote p { margin: 4px 0; }
.content-card pre { background: #0f1a2b; color: #e6edf7; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.content-card pre code { background: none; color: inherit; padding: 0; }
.content-card code { background: #eef2fa; padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.content-card h3 { margin-top: 22px; }
/* 课件媒体：默认小尺寸（移动端 + 桌面端自适应），点击放大看细节 */
.content-card img {
  max-width: 320px;
  height: auto;
  display: block;
  margin: 14px 0;
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  background: #fff;
}
.content-card video {
  max-width: 360px;
  width: 100%;
  height: auto;
  display: block;
  margin: 14px 0;
  border-radius: 10px;
  background: #000;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.media-zoom {
  display: inline-block;
  margin: 0 0 16px;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
.media-zoom:hover { background: #f1f5f9; }
/* 页内 lightbox 弹层：点击媒体即放大，再点关闭 */
#fdeLightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#fdeLightbox img, #fdeLightbox video {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
  cursor: zoom-out;
}

/* ===== 微信扫码登录（Issue #44）=====
 * 二维码固定在 200px：够手机扫，又不会把弹窗撑得过高。
 * 过期遮罩盖在二维码上，点击即刷新 —— 比让用户自己找刷新按钮更直接。
 */
.wx-qr-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 8px auto 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
}

.wx-qr {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.wx-qr-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  color: var(--text-light);
}

.wx-tip {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.wx-follow-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin: 10px 0;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
}

/* 关注引导（Issue #60）：固定底部、可关掉的一行，不占位、不挡内容。
 * 用 fixed 而不是普通块：引导要在任何页面都看得到，但不能把内容挤下去。 */
.wx-follow-tip {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  z-index: 900;
  max-width: min(560px, calc(100vw - 24px));
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  background: #fff;
  border: 1px solid var(--border);
}

.wx-follow-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wx-follow-text {
  line-height: 1.45;
}

/* 站点在页面里放的公众号二维码（id=wxFollowGuide 的容器），小尺寸够扫即可 */
#wxFollowGuide img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  display: block;
}

.wx-follow-tip .btn {
  flex: none;
  white-space: nowrap;
}
