/* ============================================================
 * 王欧文的知识分享 · 全站样式
 * ============================================================ */
:root {
  --bg: #f7f8fc;
  --bg-2: #fafbff;
  --card: #ffffff;
  --text: #1f2533;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --line: #ebeef4;
  --line-2: #f0f3f8;
  --primary: #4a7de0;
  --primary-dark: #3560b8;
  --accent: #9c56d4;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 2px 10px rgba(30, 50, 90, 0.06);
  --shadow-md: 0 4px 18px rgba(30, 50, 90, 0.08);
  --shadow-lg: 0 8px 28px rgba(30, 50, 90, 0.12);
  --text-1: #1f2533;   /* 主文字（与 --text 同义，供 cc-/lg- 区块引用） */
  --bg-1: #fafbff;      /* 轻微抬升的底色（选项/输入框/卡片内层） */
  --bd-1: #ebeef4;      /* 常规描边 */
  --bd-2: #ebeef4;      /* 行分隔线 */
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(196, 215, 255, 0.35), transparent 60%),
    radial-gradient(900px 500px at 95% 5%, rgba(225, 200, 255, 0.32), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(255, 220, 220, 0.28), transparent 60%),
    linear-gradient(180deg, #fbfcff 0%, #f5f7fc 100%);
  background-attachment: fixed;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px 0 8px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; margin-left: 4px; }
.logo-icon { font-size: 26px; }
.logo-text { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.logo-text b { color: var(--primary); }
.top-nav { display: flex; gap: 6px; }
.nav-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 15px; color: var(--text-2); padding: 8px 16px; border-radius: 6px;
  transition: all .18s;
}
.nav-btn:hover { background: #eef2fb; color: var(--text); }
.nav-btn.active { background: var(--primary); color: #fff; font-weight: 600; }

.sidebar-toggle {
  display: none; border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 14px; color: var(--text); padding: 7px 12px; border-radius: 6px;
}

/* 顶栏：登录/注册按钮 / 已登录用户区 */
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  margin-left: 0; flex-shrink: 0;
}

/* 右侧工具组：调色 + 铃铛 + 头像，整体靠右（头像在最右） */
.topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

/* 主内容区包裹（只一个 main） */
.main-wrap { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* ---------- 主题切换按钮（顶栏·头像左侧·纯圆形） ---------- */
.theme-toggle {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: transparent; border: none;
  border-radius: 8px;
  cursor: pointer; user-select: none;
  color: var(--text-2);
  flex-shrink: 0;
  transition: transform .15s, background .15s, color .15s;
}
.theme-toggle:hover { background: #eef0f3; color: var(--primary); transform: scale(1.04); }
.theme-toggle:active { transform: scale(.94); }
body.theme-dark .theme-toggle:hover { background: #2a2f3a; color: var(--text); }

/* 极简 icon 容器：无底色，跟随主题色 */
.theme-icons {
  position: relative;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: inherit;
  transition: color .35s;
}
/* 深色模式：仅微调色相，保持极简 */
body.theme-dark .theme-icons { background: transparent; color: inherit; }

.theme-icon {
  display: block;
  line-height: 1;
  position: absolute;
  transition: transform .4s cubic-bezier(.5, 1.6, .5, 1), opacity .25s;
}
/* 浅色：太阳被隐藏，月亮显示（提示"点击进入深色"） */
.theme-icon-sun  { opacity: 0; transform: scale(.4) rotate(-90deg); }
.theme-icon-moon { opacity: 1; transform: scale(1)  rotate(0deg); }
/* 深色：太阳显示，月亮隐藏（提示"点击进入浅色"） */
body.theme-dark .theme-icon-sun  { opacity: 1; transform: scale(1)  rotate(0deg); }
body.theme-dark .theme-icon-moon { opacity: 0; transform: scale(.4) rotate(90deg); }
.theme-toggle:hover .theme-icon { transform: scale(1.12) rotate(-12deg); }
body.theme-dark .theme-toggle:hover .theme-icon { transform: scale(1.12) rotate(12deg); }

/* 主题按钮光晕已移除，保持极简线稿风 */

/* 已登录用户按钮：白底+边框+阴影，更突出 */
.auth-user-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: all .15s;
}
.auth-user-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, .15);
}
.auth-btn {
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff; border: none; border-radius: 6px;
  font-size: 14px; font-weight: 600; letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.28);
  transition: all .2s;
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4); }
.auth-btn-primary {
  padding: 8px 18px; background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff; border: none; border-radius: 6px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.28);
}
.auth-user-wrap { position: relative; }
.auth-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1;
  flex-shrink: 0;
}
.auth-nickname {
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #1f2533 !important; font-weight: 500; font-size: 13px; display: inline-block;
}
.auth-caret { font-size: 10px; opacity: 0.5; color: var(--text-2); }
.auth-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px; padding: 8px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,0.15);
  z-index: 200;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .15s;
  pointer-events: none;
}
.auth-user-menu.open {
  opacity: 1; visibility: visible; transform: translateY(0);
  pointer-events: auto;
}
.auth-user-menu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.auth-avatar-lg {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #e0e7ff, #fce7f3);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
  flex-shrink: 0;
}
.auth-user-info { min-width: 0; flex: 1; }
.auth-user-name { font-size: 14px; font-weight: 600; color: var(--text); }
.auth-user-handle { font-size: 12px; color: var(--text-2); }
.auth-menu-item {
  width: 100%; text-align: left;
  padding: 8px 10px; border: none; background: transparent;
  font-size: 13px; color: var(--text);
  border-radius: 8px; cursor: pointer;
  transition: background .12s;
}
.auth-menu-item:hover { background: var(--bg); }
.auth-menu-item.danger { color: #ef4444; }
.auth-menu-item.danger:hover { background: #fef2f2; }

/* ---------- 布局：侧边栏 + 主区 ---------- */
/* 桌面端侧边栏为 fixed 浮层，正文用 margin 预留 56px 栏位，展开时正文不位移（洛谷风） */
.layout {
  flex: 1; width: 100%;
  display: flex; align-items: flex-start; gap: 0;
  margin-left: 56px;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 258px; flex-shrink: 0; align-self: stretch;
  position: fixed; left: 0; top: 64px; bottom: 0; height: auto;
  overflow: hidden;
  background: #fff; border-right: 1px solid var(--line);
  padding: 16px 12px 40px;
  transition: width .2s cubic-bezier(.4, 0, .2, 1), padding .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s cubic-bezier(.4, 0, .2, 1);
  white-space: nowrap;  /* 收缩时文字裁切而非换行，过渡更顺 */
  isolation: isolate;  /* 创建独立 stacking context，hover tooltip 浮在上 */
  z-index: 50;
  will-change: width;  /* 提示浏览器优化宽度动画，减少掉帧 */
  contain: layout paint style;  /* 限制重排范围，仅侧边栏内部重算 */
  display: flex; flex-direction: column;
}
.sb-subj-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: visible; }
.sb-func-section { flex-shrink: 0; background: #fff; margin-top: auto; padding-top: 8px; }
body.theme-dark .sb-func-section { background: var(--card); }
body.sb-collapsed .sidebar {
  width: 56px; padding: 16px 4px 40px;
  box-shadow: none;
}
/* 展开态：浮层盖在正文上方，加阴影制造纵深（洛谷风） */
body:not(.sb-collapsed) .sidebar {
  box-shadow: 2px 0 18px rgba(20, 22, 40, .12);
}
.sb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 12px;
  transition: padding .26s cubic-bezier(.4, 0, .2, 1);
}
body.sb-collapsed .sb-header { padding: 0 4px 12px; }
.sb-title {
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
  letter-spacing: 1px; padding: 4px 10px 12px;
  flex: 1; transition: opacity .26s cubic-bezier(.4, 0, .2, 1), transform .26s cubic-bezier(.4, 0, .2, 1), max-height .26s cubic-bezier(.4, 0, .2, 1);
}
body.sb-collapsed .sb-title { opacity: 0; max-height: 0; transform: translateX(-6px); margin: 0; padding: 0; overflow: hidden; }
.sb-collapse-btn {
  width: 24px; height: 24px; border-radius: 6px;
  background: transparent; border: 1px solid var(--line);
  color: var(--text-2); font-size: 14px; line-height: 1;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-collapse-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
body.sb-collapsed .sb-collapse-btn { display: none; }
.sb-expand-btn {
  display: none;
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary); color: #fff; border: none;
  font-size: 16px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: all .15s;
}
.sb-expand-btn:hover { transform: translateX(-50%) scale(1.08); }
body.sb-collapsed .sb-expand-btn { display: flex; align-items: center; justify-content: center; }
.sb-list { list-style: none; }
.sb-subject { margin-bottom: 2px; }

/* 收起态：图标左对齐不动（与展开态同坐标），文字仅被宽度裁切——零位移，最丝滑 */
body.sb-collapsed .sb-subj-head {
  padding: 4px 4px 4px 6px; align-items: center;
}
/* 收缩态保持左对齐，图标不位移（更丝滑） */
body.sb-collapsed .sb-name,
body.sb-collapsed .sb-arrow {
  opacity: 0; transform: translateX(-8px);
  pointer-events: none;
}
body.sb-collapsed .sb-icon { font-size: 20px; }
body.sb-collapsed .sb-vols {
  max-height: 0 !important; opacity: 0 !important; margin: 0 !important;
  padding-left: 0 !important; border-left-width: 0 !important; overflow: hidden !important;
}
body.sb-collapsed .sb-func { padding: 9px 10px; }
body.sb-collapsed .sb-func .sb-name {
  opacity: 0; transform: translateX(-8px);
  pointer-events: none;
}
body.sb-collapsed .sb-func .sb-icon { font-size: 20px; }
body.sb-collapsed .sb-section-title { opacity: 0; max-height: 0; transform: translateX(-6px); margin: 0; padding: 0; overflow: hidden; }
body.sb-collapsed .sb-divider { margin: 4px 6px; }
body.sb-collapsed .sb-vol { display: none; }

/* 收起态的 tooltip 提示（用实 DOM 元素，更稳定） */
body.sb-collapsed .sb-tooltip {
  position: fixed;
  background: #1e1b4b; color: #fff;
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; white-space: nowrap;
  z-index: 9999; pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  display: none;
  transform: translateY(-50%);
}
body.sb-collapsed .sb-tooltip.show { display: block; }

/* 功能区段标题（在学科目录之上、之下都可用） */
.sb-section-title {
  font-size: 11.5px; font-weight: 700; color: var(--text-3);
  letter-spacing: 1.5px; padding: 4px 10px 8px;
  text-transform: uppercase;
  transition: opacity .2s cubic-bezier(.4, 0, .2, 1), transform .2s cubic-bezier(.4, 0, .2, 1), max-height .2s cubic-bezier(.4, 0, .2, 1);
}
.sb-divider {
  height: 1px; background: var(--line); margin: 10px 6px;
  border-radius: 1px;
}
body.theme-dark .sb-section-title { color: var(--text-3); }
body.theme-dark .sb-divider { background: var(--line); }
.sb-func {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 9px 10px; border-radius: 6px; user-select: none;
  transition: background .15s, padding .26s cubic-bezier(.4, 0, .2, 1); margin-bottom: 2px;
}
.sb-func:hover { background: #f2f5fb; }
.sb-func .sb-icon { background: #eef1f7; color: var(--text-2); }
.sb-func.active .sb-icon { background: color-mix(in srgb, var(--primary) 14%, #fff); color: var(--primary); }
.sb-func.active { background: color-mix(in srgb, var(--primary) 12%, #fff); }
.sb-func.active .sb-name { color: var(--primary); font-weight: 700; }
.sb-subj-head {
  display: flex; align-items: center; gap: 4px; cursor: pointer;
  padding: 4px 4px 4px 6px; border-radius: 6px; user-select: none;
  transition: background .15s, padding .26s cubic-bezier(.4, 0, .2, 1);
}
.sb-subj-head:hover { background: #f2f5fb; }
.sb-subject.current > .sb-subj-head { background: color-mix(in srgb, var(--sc, var(--primary)) 12%, #fff); }
.sb-subject.current > .sb-subj-head .sb-name { color: var(--sc, var(--primary)); font-weight: 700; }

.sb-subj-nav {
  flex: 1; display: flex; align-items: center; gap: 9px;
  min-width: 0; cursor: pointer; padding: 5px 4px;
  border-radius: 4px;
}
.sb-subj-nav:hover { background: color-mix(in srgb, var(--sc, var(--primary)) 6%, #fff); }
.sb-icon {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--sc, var(--primary)) 14%, #fff);
  color: var(--sc, var(--primary));
}
.sb-icon svg { width: 18px; height: 18px; display: block; }
.sb-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; max-width: 220px; opacity: 1; transition: opacity .2s cubic-bezier(.4, 0, .2, 1), transform .2s cubic-bezier(.4, 0, .2, 1); }
.sb-arrow {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 10px;
  border-radius: 4px;
  cursor: pointer; user-select: none;
  overflow: hidden; transition: background .15s, color .15s, transform .2s cubic-bezier(.4, 0, .2, 1), opacity .2s cubic-bezier(.4, 0, .2, 1);
}
.sb-arrow:hover { background: color-mix(in srgb, var(--sc, var(--primary)) 18%, #fff); color: var(--sc, var(--primary)); }
.sb-subject.open .sb-arrow { transform: rotate(90deg); }
.sb-vols {
  display: none; margin: 2px 0 6px 39px;
  border-left: 2px solid var(--line); padding-left: 8px;
  overflow: hidden;
  transition: max-height .26s cubic-bezier(.4, 0, .2, 1), opacity .26s cubic-bezier(.4, 0, .2, 1), margin .26s;
}
.sb-subject.open .sb-vols { display: block; max-height: 800px; opacity: 1; }
.sb-vol {
  font-size: 13px; color: var(--text-2); cursor: pointer;
  padding: 7px 10px; border-radius: 8px; transition: all .15s;
}
.sb-vol:hover { background: #f2f5fb; color: var(--text); }
.sb-vol.is-empty { opacity: .5; font-style: italic; }
.sb-vol.is-empty .n { color: #b97614; }
.sb-vol-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sb-vol .n { font-size: 11px; color: #b0b6c0; flex-shrink: 0; }
.sb-vol.is-progress .n { color: var(--sc, var(--primary)); font-weight: 600; }
.sb-vol.is-done .n { color: #047857; font-weight: 600; }
.sb-vol-bar { height: 3px; background: var(--line-2); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.sb-vol-bar i { display: block; height: 100%; background: var(--sc, var(--primary)); border-radius: 2px; transition: width .4s; }
.sb-vol.is-done .sb-vol-bar i { background: #10b981; }
.sb-lesson {
  font-size: 12.5px; color: var(--text-2); cursor: pointer;
  padding: 6px 10px 6px 20px; border-radius: 8px; transition: all .15s;
}
.sb-lesson:hover { background: #f2f5fb; color: var(--primary); }
.sb-empty { font-size: 12px; color: #b0b6c0; padding: 5px 10px; font-style: italic; }
.sidebar-mask { display: none; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; padding: 28px 30px 60px; }
.main > * { max-width: 1040px; margin-left: auto; margin-right: auto; }

/* ---------- Hero ---------- */
.home-top {
  display: flex; align-items: stretch; gap: 20px;
  margin-bottom: 32px;
}
.home-top .hero { flex: 1; min-width: 0; margin-bottom: 0; }
.checkin-section { flex: 0 0 320px; display: flex; }
.checkin-section .checkin-card { width: 100%; }

.hero {
  position: relative; overflow: hidden;
  border-radius: 8px;
  padding: 52px 50px;
  color: var(--text);
  background:
    radial-gradient(600px 320px at 100% 0%, rgba(225, 210, 255, 0.55), transparent 65%),
    radial-gradient(700px 380px at 0% 100%, rgba(200, 220, 255, 0.55), transparent 65%),
    linear-gradient(135deg, #ffffff 0%, #f7f9ff 50%, #faf5ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-md);
}
.hero::before {
  content: ""; position: absolute; right: -120px; top: -120px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(156, 86, 212, 0.10) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: 30%; bottom: -160px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 125, 224, 0.10) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 34px; font-weight: 800; margin-bottom: 12px; letter-spacing: 1px;
  background: linear-gradient(120deg, #1f2533 0%, #4a7de0 60%, #9c56d4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block;
}
.hero p { font-size: 15.5px; color: var(--text-2); max-width: 640px; line-height: 1.8; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; justify-content: center; }
.hero-chip {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px; font-size: 13.5px;
  color: var(--text-2);
  backdrop-filter: blur(4px);
}
.hero-stats { display: flex; gap: 38px; margin-top: 28px; position: relative; z-index: 1; }
.hero-stat b {
  font-size: 28px; font-weight: 800; display: block; line-height: 1.1;
  background: linear-gradient(135deg, #4a7de0 0%, #9c56d4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stat span { font-size: 12.5px; color: var(--text-2); margin-top: 2px; display: block; }

/* ---------- 每日签到卡片（参考洛谷签到） ---------- */
.checkin-card {
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.10);
  border: 1px solid var(--line);
  color: var(--text);
  display: flex; flex-direction: column; width: 100%;
  transition: box-shadow .25s;
}
.checkin-card:hover { box-shadow: 0 8px 28px rgba(99, 102, 241, 0.16); }
@media (min-width: 1080px) {
  .checkin-card { max-width: 320px; }
}
.checkin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.checkin-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.checkin-body { display: flex; flex-direction: column; gap: 8px; }

/* 未签到前 hook 装饰区 */
.checkin-hook {
  text-align: center;
  padding: 12px 0 4px;
}
.checkin-hook-emoji {
  font-size: 48px; line-height: 1;
  display: inline-block;
  animation: checkin-hook-bounce 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.25));
}
@keyframes checkin-hook-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-6px) scale(1.05); }
}
.checkin-hook-text {
  font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
  margin: 8px 0 2px;
}
.checkin-hook-hint {
  font-size: 11px; color: var(--text-2);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.checkin-date-big {
  text-align: center;
  font-size: 28px; font-weight: 800;
  color: var(--text); letter-spacing: 2px;
  font-family: ui-monospace, "SF Mono", monospace;
  padding: 14px 0 4px;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.checkin-date-weekday {
  text-align: center;
  font-size: 13px; color: var(--text-2);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

/* 签到按钮：紫蓝渐变 + 阴影 + hover 抬升 */
.checkin-btn {
  width: 100%; padding: 11px 0;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff;
  border: none; border-radius: 4px;
  font-size: 15px; font-weight: 700; letter-spacing: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.32);
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.checkin-btn::after {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: checkin-btn-shine 2.4s linear infinite;
}
@keyframes checkin-btn-shine {
  0%   { left: -100%; }
  100% { left: 100%; }
}
.checkin-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(99, 102, 241, 0.45); }
.checkin-btn:active { transform: translateY(0); }
.checkin-stat-divider { width: 1px; height: 30px; background: var(--line); }
.checkin-week { display: flex; gap: 6px; justify-content: space-between; margin-bottom: 12px; }
.checkin-cell {
  flex: 1; aspect-ratio: 1 / 1; max-width: 36px; height: 36px;
  border-radius: 8px; background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
.checkin-cell-mark { font-size: 13px; line-height: 1; color: var(--text-2); }
.checkin-cell-day { font-size: 9.5px; color: var(--text-2); margin-top: 2px; line-height: 1; }
.checkin-cell.signed {
  background: linear-gradient(135deg, #4a7de0 0%, #9c56d4 100%);
  border-color: transparent;
}
.checkin-cell.signed .checkin-cell-mark { color: #fff; font-weight: 700; }
.checkin-cell.signed .checkin-cell-day { color: rgba(255, 255, 255, 0.85); }
.checkin-cell.today { border-color: var(--primary); border-width: 2px; }
.checkin-cell.today:not(.signed) .checkin-cell-mark { color: var(--primary); font-weight: 700; }
.checkin-tip {
  font-size: 12px; color: var(--text-2); text-align: center;
  background: var(--bg); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px;
  line-height: 1.5;
}

/* 已签到时显示的「今日运势」横条 */
.checkin-luck {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 10px;
  background: color-mix(in srgb, var(--luck-color, #6366f1) 10%, white);
  border: 1px solid color-mix(in srgb, var(--luck-color, #6366f1) 35%, white);
  border-radius: 6px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  font-size: 13px;
  color: var(--text);
}
.checkin-luck:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--luck-color, #6366f1) 25%, transparent);
}
.checkin-luck-emoji { font-size: 18px; line-height: 1; }
.checkin-luck-text { flex: 1; }
.checkin-luck-text b { color: var(--luck-color, var(--primary)); }
.checkin-luck-arrow { font-size: 12px; color: var(--text-2); }

/* ====== 运势卡（洛谷风格：极简，无外框，运势放大） ====== */
.luck-card-inline {
  position: relative;
  border-radius: 6px;
  padding: 18px 14px 12px;
  background: var(--card);
  color: var(--text);
}
.luck-card-center {
  text-align: center;
  padding: 4px 0 14px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 12px;
}
.luck-card-emoji {
  font-size: 56px; line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.12));
}
.luck-card-name {
  font-size: 32px; font-weight: 900;
  color: var(--luck-color, var(--text));
  letter-spacing: 6px;
  line-height: 1.1;
  margin-bottom: 6px;
  text-indent: 6px;  /* 抵消 letter-spacing 让居中更精准 */
}
.luck-card-sub {
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.luck-card-meaning {
  font-size: 13px;
  color: var(--text);
  font-style: italic;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* 2×2 宜/忌 网格 */
.luck-card-grid {
  display: flex; flex-direction: column; gap: 8px;
}
.luck-grid-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.luck-cell {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px; line-height: 1.3;
  background: var(--bg);
  min-height: 36px;
}
.luck-cell-tag {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  letter-spacing: 0;
}
.luck-cell-yi { background: rgba(16, 185, 129, 0.08); }
.luck-cell-yi .luck-cell-tag { background: #10b981; }
.luck-cell-ji { background: rgba(239, 68, 68, 0.08); }
.luck-cell-ji .luck-cell-tag { background: #ef4444; }
.luck-cell-text {
  flex: 1; color: var(--text);
  word-break: break-all;
}

/* 签到卡底部：按钮/状态 + 重置 */
.checkin-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
}
.checkin-foot .checkin-btn { flex: 1; }
.checkin-foot .checkin-status { flex: 1; text-align: center; font-size: 13px; color: var(--text-2); }
.checkin-reset-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--line);
  border-radius: 8px; color: var(--text-2);
  cursor: pointer; transition: all .15s;
  font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.checkin-reset-btn:hover {
  color: #ef4444; border-color: #ef4444; background: rgba(239, 68, 68, 0.06);
}
.checkin-btn {
  width: 100%; padding: 12px 0; border: none; border-radius: 6px;
  background: linear-gradient(135deg, #4a7de0 0%, #9c56d4 100%);
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 6px;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 12px rgba(74, 125, 224, 0.35);
  margin-top: auto;
}
.checkin-btn:hover:not(.signed) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(74, 125, 224, 0.45); }
.checkin-btn:active:not(.signed) { transform: translateY(0); }
.checkin-btn.signed {
  background: linear-gradient(135deg, #e8eaf0 0%, #d4d8e3 100%);
  color: #8a93a6; cursor: default; letter-spacing: 2px;
  box-shadow: none;
}

/* ---------- 首页每日一言（长条状，直角风格） ---------- */
.quote-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); border-radius: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow); padding: 15px 22px;
}
.quote-bar-label {
  font-size: 13px; font-weight: 700; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, #fff);
  padding: 3px 10px; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
  letter-spacing: 1px;
}
.quote-bar-text {
  font-size: 16.5px; font-weight: 600; color: var(--text);
  letter-spacing: .5px; flex: 1; min-width: 200px;
}
.quote-bar-line { width: 1px; height: 22px; background: var(--line); flex-shrink: 0; }
.quote-bar-who { font-size: 14.5px; color: var(--text-2); font-weight: 600; white-space: nowrap; flex-shrink: 0; }

/* ---------- 首页板块（今日推荐 / 最近学习） ---------- */
.home-section { margin-top: 28px; }
.home-section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.home-section-title { font-size: 19px; font-weight: 800; color: var(--text); }
.home-section-sub { font-size: 13px; color: var(--text-2); }
.home-refresh {
  margin-left: auto; border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; color: var(--text-2); padding: 5px 12px;
  border-radius: 999px; cursor: pointer; transition: all .15s;
}
.home-refresh:hover { border-color: var(--primary); color: var(--primary); background: #f0f5ff; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lesson-card {
  display: block; text-decoration: none; background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px;
  border-top: 3px solid var(--sc, var(--primary));
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lesson-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.lesson-card-subj { font-size: 12.5px; font-weight: 700; color: var(--sc, var(--primary)); }
.lesson-card-vol { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.lesson-card-name { font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.5; }
.lesson-card-chapter { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
/* 占位（暂无课时） */
.lesson-card.is-empty {
  border-top-color: var(--line); background: var(--card);
  display: flex; flex-direction: column; gap: 10px; justify-content: center;
  min-height: 96px; cursor: default; border-style: dashed;
}
.lesson-card.is-empty:hover { transform: none; box-shadow: none; }
.lesson-card-ph { height: 10px; width: 60%; border-radius: 4px; background: var(--line); opacity: .6; }
.lesson-card-hint { font-size: 12.5px; color: var(--text-2); }

/* ---------- 区块标题 ---------- */
.section-title { font-size: 21px; font-weight: 800; margin: 8px 0 18px; display: flex; align-items: center; gap: 8px; }

/* ---------- 学科网格 ---------- */
.subject-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px;
}
.subject-card {
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); cursor: pointer; border: 1.5px solid transparent;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  position: relative; overflow: hidden;
}
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--sc, var(--primary)); }
.subject-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--sc, var(--primary));
}
.subject-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.subject-icon {
  width: 48px; height: 48px; border-radius: 6px; font-size: 25px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--sc, var(--primary)) 13%, #fff);
}
.subject-name { font-size: 18px; font-weight: 800; }
.subject-vols { font-size: 12.5px; color: var(--text-2); }
.subject-desc { font-size: 13.5px; color: var(--text-2); min-height: 42px; }
.subject-foot { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; }
.badge-coming {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: #fff4e2; color: #b97614; font-weight: 600;
}
.badge-count {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: #eef2fb; color: var(--sc, var(--primary)); font-weight: 600;
}
.badge-progress-sm {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--sc, var(--primary)) 12%, #fff);
  color: var(--sc, var(--primary)); font-weight: 700;
}
.badge-done-sm {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: #d1fae5; color: #047857; font-weight: 700;
}
.go-arrow { color: var(--sc, var(--primary)); font-weight: 700; font-size: 14px; }

/* ---------- 学科详情页 ---------- */
.crumb { font-size: 14px; color: var(--text-2); margin-bottom: 18px; }
.crumb a { color: var(--primary); text-decoration: none; cursor: pointer; }
.crumb a:hover { text-decoration: underline; }
.subject-hero {
  display: flex; align-items: center; gap: 18px;
  background: var(--card); border-radius: var(--radius); padding: 26px 28px;
  box-shadow: var(--shadow); margin-bottom: 24px; border-left: 6px solid var(--sc, var(--primary));
}
.subject-hero .subject-icon { width: 64px; height: 64px; font-size: 34px; border-radius: 8px; }
.subject-hero h2 { font-size: 24px; font-weight: 800; }
.subject-hero p { color: var(--text-2); font-size: 14px; margin-top: 4px; }

/* ---------- 年级分组 ---------- */
.grade-group { margin-bottom: 26px; }
.grade-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.grade-tag {
  font-size: 14px; font-weight: 800; color: #fff;
  background: var(--sc, var(--primary)); padding: 3px 14px; border-radius: 6px;
  letter-spacing: 2px;
}
.grade-group .grade-tag { background: var(--primary); }
.grade-sub { font-size: 13px; color: var(--text-2); }
.grade-note {
  font-size: 14px; color: var(--text-2); background: var(--card);
  border: 1.5px dashed var(--line); border-radius: 8px; padding: 16px 20px;
}
/* 侧边栏年级小徽标 */
.sb-grade {
  font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--sc, var(--primary));
  border: 1px solid color-mix(in srgb, var(--sc, var(--primary)) 45%, #fff);
  background: color-mix(in srgb, var(--sc, var(--primary)) 8%, #fff);
  border-radius: 4px; padding: 0 4px; margin-right: 6px; vertical-align: 1px;
}

.volume-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.volume-card {
  background: var(--card); border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow); border: 1.5px solid var(--line);
  transition: border-color .18s, box-shadow .18s;
  position: relative; overflow: hidden;
}
.volume-card:hover { border-color: var(--sc, var(--primary)); box-shadow: var(--shadow-lg); }
.volume-card.is-empty { opacity: .6; border-style: dashed; background: repeating-linear-gradient(135deg, transparent, transparent 8px, var(--line-2) 8px, var(--line-2) 9px); cursor: not-allowed; }
.volume-card.is-empty:hover { opacity: .85; }
.volume-card.is-all-done { border-color: #10b981; background: linear-gradient(180deg, #f0fdf4 0%, #fff 60%); }
.volume-card.is-part-done { border-color: var(--sc, var(--primary)); }
.volume-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.volume-name { font-size: 16.5px; font-weight: 700; }
.volume-desc { font-size: 13px; color: var(--text-2); }
.volume-progress { height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; margin-top: 12px; }
.volume-progress i { display: block; height: 100%; background: var(--sc, var(--primary)); border-radius: 2px; transition: width .4s; }
.volume-card.is-all-done .volume-progress i { background: #10b981; }
.badge-building {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: #eef2fb; color: var(--primary); font-weight: 600;
}
.badge-progress {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--sc, var(--primary)) 15%, #fff);
  color: var(--sc, var(--primary)); font-weight: 700;
}
.badge-done {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: #d1fae5; color: #047857; font-weight: 700;
}

/* 课时目录完成态 */
.vol-progress {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.vol-progress-head { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--text-2); margin-bottom: 8px; }
.vol-progress-head b { color: var(--text); font-size: 14px; font-weight: 700; }
.vol-progress-bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.vol-progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width .6s; }

.lesson-pill { position: relative; }
.lesson-pill.is-done { background: #f0fdf4; border-color: #bbf7d0; }
.lesson-pill.is-done .lp-name { color: #047857; }
.lesson-pill.is-done .lp-go { color: #10b981; }
.lesson-pill.is-done:hover { border-color: #10b981; }
.lp-done-badge {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #10b981; color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(16,185,129,.3);
}

/* 首页「继续学习」CTA */
.home-continue { margin: 18px auto 0; }
.continue-cta {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--sc, var(--primary)) 8%, #fff), #fff);
  border: 2px solid color-mix(in srgb, var(--sc, var(--primary)) 30%, #fff);
  border-radius: 8px; padding: 18px 24px;
  text-decoration: none; color: var(--text);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--sc, var(--primary)) 12%, transparent);
  transition: all .2s; position: relative; overflow: hidden;
}
.continue-cta::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--sc, var(--primary));
}
.continue-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px color-mix(in srgb, var(--sc, var(--primary)) 22%, transparent); border-color: var(--sc, var(--primary)); }
.cc-left { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 0 1 auto; }
.cc-icon {
  width: 56px; height: 56px; border-radius: 8px; font-size: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--sc, var(--primary)) 12%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--sc, var(--primary)) 22%, #fff);
}
.cc-info { min-width: 0; flex: 1; }
.cc-eyebrow { font-size: 12.5px; font-weight: 700; color: var(--sc, var(--primary)); margin-bottom: 4px; letter-spacing: .5px; }
.cc-name { font-size: 18px; font-weight: 800; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.cc-go {
  flex-shrink: 0; padding: 10px 20px; border-radius: 999px;
  background: var(--sc, var(--primary)); color: #fff; font-weight: 700; font-size: 14px;
  transition: transform .15s;
}
.continue-cta:hover .cc-go { transform: translateX(3px); }

/* 答题反馈强化 */
.quiz-feedback { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 6px; }
.quiz-feedback.ok { background: #f0fdf4; border: 1px solid #bbf7d0; }
.quiz-feedback.no { background: #fef2f2; border: 1px solid #fecaca; }
.quiz-result-icon {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900; color: #fff;
}
.quiz-result-icon.ok { background: #10b981; }
.quiz-result-icon.no { background: #ef4444; }
.quiz-result-text { font-size: 14px; font-weight: 700; }
.quiz-result-text.ok { color: #047857; }
.quiz-result-text.no { color: #b91c1c; }
.quiz-compare {
  display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0;
}
.qc-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.qc-label { font-size: 11.5px; color: var(--text-2); flex-shrink: 0; min-width: 64px; }
.qc-val { font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.qc-val.mine { background: #fee2e2; color: #b91c1c; text-decoration: line-through; }
.qc-val.right { background: #d1fae5; color: #047857; }

.opt.is-correct-opt { border-color: #10b981 !important; background: #f0fdf4 !important; }
.opt.is-correct-opt .opt-key { background: #10b981 !important; color: #fff !important; }
.opt.is-wrong-opt { border-color: #ef4444 !important; background: #fef2f2 !important; }
.opt.is-wrong-opt .opt-key { background: #ef4444 !important; color: #fff !important; }

.quiz-wrongbook-note {
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 13px;
}
.quiz-wrongbook-note a { color: #c2410c; font-weight: 700; cursor: pointer; text-decoration: underline; }
.quiz-exp-label { font-size: 13px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.quiz-exp-body { font-size: 14px; line-height: 1.85; color: #444; }

/* 返回顶部按钮 */
.to-top {
  position: fixed; right: 24px; bottom: 80px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border: none; font-size: 22px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(74,125,224,.3);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all .25s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(74,125,224,.45); }

@media (max-width: 700px) {
  .continue-cta {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
  }
  .cc-icon { width: 44px; height: 44px; font-size: 24px; }
  .cc-go { padding: 7px 14px; font-size: 13px; }
  .cc-name { font-size: 15px; }
  .cc-eyebrow { font-size: 11.5px; }
  .cc-meta { font-size: 11.5px; }
  .quiz-feedback { flex-direction: column; align-items: flex-start; gap: 8px; }
  .quiz-compare { width: 100%; }
}

/* ---------- 关于 / 占位 ---------- */
.panel {
  background: var(--card); border-radius: var(--radius); padding: 30px 32px;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 20px; margin-bottom: 12px; }
.panel p { color: var(--text-2); font-size: 14.5px; margin-bottom: 8px; }
.empty-tip {
  text-align: center; padding: 60px 20px; color: var(--text-2);
}
.empty-tip .big { font-size: 44px; margin-bottom: 12px; }

/* ---------- 课时懒加载骨架 ---------- */
.lesson-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 80px 20px; color: var(--text-2);
}
.lesson-loading p { margin: 0; font-size: 15px; }
.lesson-loading .spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid var(--border, #e5e9f2);
  border-top-color: var(--primary, #4a7de0);
  animation: gz-spin .8s linear infinite;
}
@keyframes gz-spin { to { transform: rotate(360deg); } }

/* ---------- 题库（精简版） ---------- */

/* 简洁页头 */
.bank-head { margin-bottom: 20px; }
.bank-head .bh-title { display: flex; align-items: center; gap: 10px; }
.bank-head .bh-icon { font-size: 26px; line-height: 1; }
.bank-head h2 { font-size: 22px; font-weight: 800; margin: 0; color: var(--text); letter-spacing: .5px; }
.bank-head .bh-sub { font-size: 13.5px; color: var(--text-2); margin: 6px 0 0; line-height: 1.6; }

/* 横向数据条：4 个数字 + 标签，中间分隔线 */
.bank-stats-strip {
  display: flex; align-items: stretch;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 8px;
  box-shadow: var(--shadow);
}
.bss-item {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 4px 8px;
  position: relative;
}
.bss-item.has-divider::after {
  content: ""; position: absolute; right: 0; top: 12%; bottom: 12%;
  width: 1px; background: var(--line);
}
.bss-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.bss-item.amber .bss-icon { background: rgba(245, 158, 11, .12); color: #d97706; }
.bss-item.blue .bss-icon { background: rgba(74, 125, 224, .12); color: #4a7de0; }
.bss-item.red .bss-icon { background: rgba(239, 68, 68, .12); color: #ef4444; }
.bss-item.purple .bss-icon { background: rgba(156, 86, 212, .12); color: #9c56d4; }
.bss-body { line-height: 1.2; }
.bss-num { font-size: 22px; font-weight: 800; color: var(--text); }
.bss-lbl { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* 两个快速入口（并排） */
.bank-entries {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 20px;
}
.bank-entry {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
}
.bank-entry:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.be-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(74, 125, 224, .18);
}
.be-body { flex: 1; min-width: 0; }
.be-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.be-num {
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
  background: var(--bg-2); padding: 2px 8px; border-radius: 999px;
}
.be-sub { font-size: 13px; color: var(--text-2); }
.be-arrow {
  font-size: 22px; color: var(--text-3); font-weight: 400;
  flex-shrink: 0; transition: transform .15s, color .15s;
}
.bank-entry:hover .be-arrow { transform: translateX(4px); color: var(--primary); }

/* 通用 section 标题 */
.bank-section { margin-top: 28px; }
.bank-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.bank-section-head h3 { font-size: 15.5px; font-weight: 700; color: var(--text); margin: 0; }
.bank-section-more { font-size: 13px; color: var(--primary); cursor: pointer; }
.bank-section-more:hover { text-decoration: underline; }
.bank-section-tip { font-size: 12.5px; color: var(--text-2); }

/* 学科卡网格（干净版） */
.bank-subj-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px;
}
.bank-subj-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  border-left: 3px solid var(--sc);
}
.bank-subj-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--sc); }
.bsc-top {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.bsc-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--sc); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.bsc-name { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; }
.bsc-count {
  font-size: 11.5px; color: var(--text-2);
  background: var(--bg-2); padding: 2px 8px; border-radius: 999px;
}
.bsc-cats {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 12px; color: var(--text-2);
}
.bsc-cats span {
  background: var(--bg-2); padding: 2px 8px; border-radius: 4px;
}
.bsc-cats .bsc-more { color: var(--sc); font-weight: 600; background: transparent; padding: 2px 0; }

/* 最近收藏（垂直列表） */
.bank-recent-list { display: flex; flex-direction: column; gap: 8px; }
.bank-recent-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--sc);
  border-radius: 8px; cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
}
.bank-recent-item:hover { transform: translateX(2px); box-shadow: var(--shadow-md); }
.bri-icon {
  font-size: 22px; flex-shrink: 0;
  width: 32px; text-align: center;
}
.bri-body { flex: 1; min-width: 0; }
.bri-meta {
  font-size: 12.5px; color: var(--sc); font-weight: 600;
  margin-bottom: 3px; display: flex; align-items: center; gap: 8px;
}
.bri-type {
  font-size: 11px; padding: 1px 7px; border-radius: 4px;
  background: var(--bg-2); color: var(--text-2); font-weight: 500;
}
.bri-q {
  font-size: 13.5px; color: var(--text); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.bri-time { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; }

/* 高中常考题型 - 学科 tab */
.bank-subj-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 24px; padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.bank-subj-tab {
  font-size: 13.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text-2); cursor: pointer;
  transition: all .15s ease;
}
.bank-subj-tab:hover { color: var(--sc); border-color: var(--sc); background: color-mix(in srgb, var(--sc) 8%, #fff); }

/* 学科块 */
.bank-common-block {
  margin-top: 24px; padding: 22px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.bank-common-block::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--sc);
}
.bank-common-block-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px dashed var(--line);
}
.bank-common-block-icon {
  width: 48px; height: 48px; border-radius: 6px;
  background: color-mix(in srgb, var(--sc) 12%, #fff);
  color: var(--sc); font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bank-common-block-title { font-size: 17px; font-weight: 800; color: var(--text); }
.bank-common-block-tip { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* 题型网格 */
.bank-cat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
}
.bank-cat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all .15s ease;
  overflow: hidden;
}
.bank-cat-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--sc); opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.bank-cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--sc) 18%, transparent);
  border-color: var(--sc);
}
.bank-cat-card:hover::after { opacity: 0.08; transform: scale(1.5); }
.bank-cat-card-icon {
  width: 38px; height: 38px; border-radius: 6px;
  background: color-mix(in srgb, var(--sc) 12%, #fff);
  color: var(--sc); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s ease;
  position: relative; z-index: 1;
}
.bank-cat-card:hover .bank-cat-card-icon { background: var(--sc); color: #fff; }
.bank-cat-card-name {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.bank-cat-hot {
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  padding: 1px 7px; border-radius: 999px;
  letter-spacing: .3px;
}
.bank-cat-card-arrow {
  font-size: 16px; color: var(--text-3); flex-shrink: 0;
  transition: transform .15s ease, color .15s ease;
  position: relative; z-index: 1;
}
.bank-cat-card:hover .bank-cat-card-arrow { transform: translateX(3px); color: var(--sc); }

/* 高中常考题型分类芯片 */
.bank-cat-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bank-cat-chip {
  font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--text-2); cursor: pointer;
  transition: all .15s ease;
}
.bank-cat-chip:hover, .bank-cat-chip.active {
  background: var(--sc, var(--primary));
  color: #fff; border-color: var(--sc, var(--primary));
}

/* 题目卡（收藏/常考通用） */
.bank-q-list { margin-top: 16px; }
.bank-q {
  border: 1px solid var(--line); border-radius: 6px;
  padding: 14px 18px; margin-bottom: 12px;
  background: var(--card);
  transition: box-shadow .15s ease, border-color .15s ease;
  position: relative; overflow: hidden;
}
.bank-q::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--sc, var(--primary));
  opacity: 0.7;
}
.bank-q:hover { box-shadow: var(--shadow-md); border-color: var(--sc, rgba(74, 125, 224, 0.25)); }
.bank-q-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bank-q-meta { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.bank-q-subj {
  font-size: 11.5px; font-weight: 700; color: var(--sc, var(--primary));
  background: color-mix(in srgb, var(--sc, var(--primary)) 10%, #fff);
  padding: 1px 8px; border-radius: 4px;
  margin-right: 4px;
}
.bank-q-text { font-size: 14.5px; font-weight: 600; line-height: 1.7; }
.bank-q-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13.5px; color: #555; }
.bank-q-ans { margin-top: 8px; font-size: 13px; font-weight: 700; color: #2e9e57; }
.bank-q-exp { margin-top: 6px; font-size: 13px; color: var(--text-2); line-height: 1.6; background: var(--bg); padding: 8px 12px; border-radius: 4px; }

/* 练习题收藏按钮 */
.quiz-fav {
  margin-left: auto; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff;
  font-size: 18px; line-height: 1; color: var(--text-3);
  cursor: pointer; transition: all .15s ease;
  display: flex; align-items: center; justify-content: center;
}
.quiz-fav:hover { color: #f59e0b; border-color: #f59e0b; background: #fff8e8; }
.quiz-fav.is-fav { color: #f59e0b; border-color: #f59e0b; background: #fff8e8; }
.quiz-fav.is-fav:hover { background: #ffeed4; }

/* 响应式 */
@media (max-width: 720px) {
  .bank-stats { grid-template-columns: repeat(2, 1fr); }
  .bank-hero { padding: 22px 20px; }
  .bank-hero-deco { font-size: 56px; }
  .bank-hero-title { font-size: 20px; }
  .bank-subj-grid, .bank-recent-grid, .bank-cat-grid { grid-template-columns: 1fr; }
}

/* ---------- 错题本 ---------- */
.wrong-item {
  position: relative;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 14px 16px; margin-bottom: 10px;
  padding-right: 48px;
}
.wrong-remove {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 4px;
  border: 1px solid var(--line); background: #fff;
  color: var(--text-3); font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.wrong-remove:hover { color: #ef4444; border-color: #ef4444; background: #fef2f2; }
.wrong-q { font-size: 14.5px; font-weight: 600; margin-bottom: 6px; padding-right: 8px; }
.wrong-meta { font-size: 13px; color: var(--text-2); }
.wrong-mine { font-size: 12.5px; color: #b91c1c; margin: 4px 0 6px; text-decoration: line-through; opacity: .85; }
.wrong-toolbar { display: flex; gap: 8px; margin-top: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.wrong-clear-btn { color: #ef4444 !important; border-color: #fecaca !important; }
.wrong-clear-btn:hover { background: #fef2f2 !important; }

/* ---------- 学习进度 ---------- */
.prog-section-title {
  margin: 26px 0 14px; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.prog-section-title::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

/* 顶部 4 个汇总卡 */
.prog-overview {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px;
}
.prog-ov-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); transition: all .2s;
}
.prog-ov-card[onclick]:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.pov-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.pov-info { flex: 1; min-width: 0; }
.pov-val { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--text); }
.pov-lbl { font-size: 13px; color: var(--text); font-weight: 600; margin-top: 2px; }
.pov-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* 学科卡片网格 */
.prog-subj-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.prog-subj-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  text-decoration: none; color: var(--text);
  transition: all .2s; cursor: pointer;
  position: relative; overflow: hidden;
}
.prog-subj-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--sc, var(--primary)); opacity: .8;
}
.prog-subj-card:hover {
  border-color: var(--sc, var(--primary));
  transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.psc-top { display: flex; align-items: center; gap: 10px; }
.psc-icon {
  width: 36px; height: 36px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: color-mix(in srgb, var(--sc, var(--primary)) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--sc, var(--primary)) 20%, #fff);
}
.psc-name { font-size: 15.5px; font-weight: 700; }

.psc-ring-wrap { position: relative; width: 100px; height: 100px; margin: 4px auto 0; }
.psc-ring { width: 100%; height: 100%; display: block; }
.psc-ring-bg { fill: none; stroke: var(--line-2); stroke-width: 8; }
.psc-ring-fg {
  fill: none; stroke: var(--sc, var(--primary)); stroke-width: 8; stroke-linecap: round;
  transition: stroke-dasharray .6s ease;
}
.psc-ring-txt {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.psc-pct { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.psc-pct i { font-size: 12px; font-weight: 600; color: var(--text-2); font-style: normal; }
.psc-lbl { font-size: 11px; color: var(--text-2); margin-top: 2px; letter-spacing: .5px; }

.psc-meta {
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.psc-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--text-2);
}
.psc-meta-row b { color: var(--text); font-weight: 700; font-size: 13.5px; }
.psc-meta-row b.has-warn { color: #e5484d; }
.psc-last { font-size: 12px; }
.psc-last.no-study { color: var(--text-3); }
.psc-last.has-study { color: var(--sc, var(--primary)); font-weight: 600; }

/* 图表区（2 列） */
.prog-charts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px;
}
.prog-chart-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 22px; box-shadow: var(--shadow);
}
.pcc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.pcc-head h4 { font-size: 15px; font-weight: 700; }
.pcc-sub { font-size: 12px; color: var(--text-2); }

/* ---------- 7 天节奏图：柱（课时数）+ 折线（做题数） ---------- */
.week-chart-wrap { position: relative; padding: 4px 0 0; }
.week-chart { display: block; width: 100%; height: 200px; overflow: visible; }
.week-grid { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
.week-grid.is-base { stroke: var(--line); stroke-dasharray: none; stroke-width: 1.2; }
.week-bar { fill: var(--line-2); transition: fill .25s, opacity .25s; }
.week-bar.is-active {
  fill: url(#weekBarGrad);
  filter: drop-shadow(0 -1px 4px rgba(74, 125, 224, .35));
}
.week-bar.is-today.is-active {
  fill: url(#weekBarGradToday);
  filter: drop-shadow(0 -1px 5px rgba(156, 86, 212, .45));
}
.week-line {
  fill: none; stroke: #f59e0b; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(245, 158, 11, .25));
}
.week-dot { fill: var(--bg); stroke: #f59e0b; stroke-width: 2; transition: r .2s; }
.week-dot.is-active { fill: #f59e0b; stroke: #f59e0b; }
.week-dot.is-today.is-active { fill: #d97706; stroke: #d97706; }
.week-x-wd { font-size: 11.5px; fill: var(--text-2); font-weight: 600; }
.week-x-dt { font-size: 10.5px; fill: var(--text-3); }
.week-x-wd.is-today, .week-x-dt.is-today { fill: var(--accent); font-weight: 700; }

/* 双 Y 轴标签 */
.week-y-l { font-size: 10.5px; fill: #4a7de0; font-weight: 600; }
.week-y-r { font-size: 10.5px; fill: #d97706; font-weight: 600; }
.week-y-title-l { font-size: 10.5px; fill: #4a7de0; font-weight: 700; letter-spacing: .5px; }
.week-y-title-r { font-size: 10.5px; fill: #d97706; font-weight: 700; letter-spacing: .5px; }

/* 悬浮区（SVG 内 rect，自带高亮 backdrop） */
.week-hover { cursor: pointer; }
.week-hover:hover { fill: rgba(74, 125, 224, 0.08) !important; }

/* tooltip */
.week-tip {
  position: absolute; z-index: 20;
  background: rgba(35, 40, 53, .96); color: #fff;
  padding: 8px 12px; border-radius: 8px;
  font-size: 12px; line-height: 1.7; min-width: 140px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  pointer-events: none;
}
.week-tip::after {
  content: ''; position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: rgba(35, 40, 53, .96);
}
.week-tip .wt-date { font-weight: 700; font-size: 12.5px; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.week-tip .wt-row { display: flex; align-items: center; gap: 6px; }
.week-tip .wt-row b { font-weight: 700; }
.week-tip .wt-row b.muted { color: rgba(255, 255, 255, .5); font-weight: 500; }

/* ---------- 英语单词悬停查词 ---------- */
.wdict {
  cursor: help;
  border-bottom: 1px dashed #9c56d4;
  color: #7a3fb0;
  transition: background .15s;
}
.wdict:hover { background: rgba(156, 86, 212, .1); }
.wdict-tip {
  position: fixed; z-index: 99998;
  background: rgba(35, 40, 53, .97); color: #fff;
  padding: 9px 13px; border-radius: 9px;
  font-size: 13px; line-height: 1.75; max-width: 320px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .3);
  pointer-events: none;
  display: none;
}
.wdict-tip .wt-word { font-weight: 700; font-size: 15px; color: #ffd9a8; display: block; margin-bottom: 3px; }
.wdict-tip .wt-pos { color: #8fd0ff; margin-right: 8px; font-style: italic; }
.wdict-tip .wt-ph { color: #c9c9c9; margin-right: 8px; font-family: "Lucida Sans Unicode", "Segoe UI", sans-serif; }
.wdict-tip .wt-tr { color: #fff; }
.wt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wt-dot-bar { background: linear-gradient(180deg, var(--primary), #4a7de0); }
.wt-dot-line { background: #f59e0b; }
.wt-dot-empty { background: rgba(255, 255, 255, .25); }

/* 图例 */
.week-legend {
  display: flex; gap: 22px; justify-content: center;
  padding: 8px 0 0; font-size: 12.5px; color: var(--text-2);
}
.wl-item { display: inline-flex; align-items: center; gap: 6px; }
.wl-bar {
  display: inline-block; width: 14px; height: 12px; border-radius: 2px;
  background: linear-gradient(180deg, #5e8dee 0%, #4a7de0 100%);
  box-shadow: 0 1px 3px rgba(74, 125, 224, .35);
}
.wl-line {
  display: inline-block; width: 18px; height: 0;
  border-top: 2px solid #f59e0b;
  position: relative;
}
.wl-line::after {
  content: ''; position: absolute; left: 50%; top: -4px;
  transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 2px var(--card);
}

/* 难度分布 */
.pdiff { display: flex; flex-direction: column; gap: 16px; padding: 6px 0; }
.pdiff-row { display: flex; flex-direction: column; gap: 6px; }
.pdiff-head { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.pdiff-head b { font-size: 13.5px; color: var(--text); }
.pdiff-head b i { font-style: normal; color: var(--text-2); font-weight: 500; font-size: 12px; }
.pdiff-bar { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.pdiff-bar i {
  display: block; height: 100%; border-radius: 999px;
  transition: width .6s ease; min-width: 2px;
}

/* 进度页通用空态 */
.prog-empty { padding: 30px 20px; text-align: center; color: var(--text-2); font-size: 14px; background: var(--bg-2); border-radius: var(--radius); border: 1px dashed var(--line); }
.prog-empty-mini { padding: 22px 16px; text-align: center; color: var(--text-2); font-size: 13.5px; background: var(--bg-2); border-radius: 6px; border: 1px dashed var(--line); }
.prog-empty-mini a { color: var(--primary); font-weight: 600; cursor: pointer; }

/* 响应式 */
@media (max-width: 900px) {
  .prog-overview { grid-template-columns: repeat(2, 1fr); }
  .prog-charts { grid-template-columns: 1fr; }
  .week-chart { height: 180px; }
}
@media (max-width: 560px) {
  .prog-overview { grid-template-columns: 1fr 1fr; gap: 10px; }
  .prog-ov-card { padding: 14px 12px; }
  .pov-val { font-size: 22px; }
  .prog-subj-grid { grid-template-columns: 1fr; }
}

/* ---------- 勋章墙 ---------- */
.medal-wall { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.medal-wall-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.medal-wall-head h4 { font-size: 17px; font-weight: 800; }
.mwh-stats { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 240px; }
.mwh-progress { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.mwh-progress b { color: var(--tier-gold, #e5a82e); font-size: 18px; font-weight: 800; }
.mwh-bar { flex: 1; height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; max-width: 280px; }
.mwh-bar i { display: block; height: 100%; background: linear-gradient(90deg, #cd7f32, #e5a82e); border-radius: 999px; transition: width .5s; }

.medal-section { margin-bottom: 22px; }
.medal-section:last-child { margin-bottom: 0; }
.medal-cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.mch-icon { font-size: 16px; }
.mch-name { font-size: 14.5px; font-weight: 700; }
.mch-count { font-size: 12px; color: var(--text-2); margin-left: auto; background: var(--bg-2); padding: 2px 10px; border-radius: 999px; }

.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.medal-card {
  position: relative; padding: 16px 14px 12px; border-radius: 12px;
  background: #fff; border: 1.5px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; transition: all .2s;
  overflow: hidden;
}
.medal-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, var(--tier-glow, transparent) 0%, transparent 70%);
  transition: opacity .3s;
}
.medal-card.is-unlocked {
  border-color: var(--tier);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tier) 8%, #fff) 0%, #fff 70%);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--tier) 18%, transparent);
}
.medal-card.is-unlocked::before { opacity: 1; }
.medal-card.is-locked { opacity: .55; filter: grayscale(.55); }
.medal-card.is-locked.is-progress { opacity: 1; filter: grayscale(.3); border-style: dashed; }
.medal-card:hover { transform: translateY(-2px); }
.medal-card.is-unlocked:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--tier) 28%, transparent); }

.medal-tier-badge {
  position: absolute; top: 6px; right: 8px;
  font-size: 13px; line-height: 1; opacity: .85;
}
.medal-card.is-locked .medal-tier-badge { opacity: .35; }

.medal-icon {
  font-size: 38px; line-height: 1; margin-top: 8px;
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tier) 12%, #fff), color-mix(in srgb, var(--tier) 4%, #fff));
  border: 2px solid color-mix(in srgb, var(--tier) 30%, #fff);
  position: relative; z-index: 1;
}
.medal-card.is-locked .medal-icon {
  background: var(--line-2); border-color: var(--line);
  filter: grayscale(1) brightness(1.1);
}

.medal-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.medal-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.45; min-height: 32px; }

.medal-foot {
  font-size: 11.5px; color: var(--text-2); width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin-top: 6px; min-height: 22px;
}
.medal-foot.ok { color: #047857; font-weight: 700; justify-content: center; }
.medal-foot.muted { color: var(--text-3); font-style: italic; justify-content: center; }
.medal-prog { flex: 1; height: 5px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.medal-prog i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--tier), color-mix(in srgb, var(--tier) 50%, #fff));
  border-radius: 999px; transition: width .5s;
}

@media (max-width: 560px) {
  .medal-grid { grid-template-columns: repeat(2, 1fr); }
  .medal-icon { font-size: 32px; width: 54px; height: 54px; }
  .medal-name { font-size: 13px; }
  .medal-desc { font-size: 11px; min-height: 28px; }
}

/* ---------- 设置 ---------- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 4px; border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-row b { font-size: 15px; }
.setting-row p { font-size: 13px; color: var(--text-2); margin: 4px 0 0; }
.btn-danger {
  border: 1px solid #e5484d; color: #e5484d; background: #fff; cursor: pointer;
  font-size: 13.5px; padding: 8px 18px; border-radius: 8px; flex-shrink: 0; transition: all .15s;
}
.btn-danger:hover { background: #e5484d; color: #fff; }
.btn-plain {
  border: 1px solid var(--line); color: var(--text); background: #fff; cursor: pointer;
  font-size: 13.5px; padding: 8px 18px; border-radius: 8px; flex-shrink: 0; transition: all .15s;
}
.btn-plain:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line); background: #fff;
  text-align: center; padding: 20px; font-size: 13px; color: var(--text-2);
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%) translateY(20px);
  background: #2b3445; color: #fff; padding: 10px 22px; border-radius: 6px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 登录/注册 / 账号设置 Modal ---------- */
.auth-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.auth-modal.show { opacity: 1; pointer-events: auto; }
.auth-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.auth-card {
  position: relative;
  width: min(420px, 92vw);
  max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  padding: 28px 24px 22px;
  transform: translateY(20px) scale(0.96);
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-modal.show .auth-card { transform: translateY(0) scale(1); }
.auth-card.profile-card { width: min(480px, 94vw); }
.auth-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); color: var(--text-2);
  border: none; font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.auth-close:hover { background: #e2e8f0; color: var(--text); }
.auth-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg); border-radius: 6px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 8px 0; border: none; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  border-radius: 9px; cursor: pointer; transition: all .2s;
}
.auth-tab.active {
  background: #fff; color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.auth-title {
  font-size: 22px; font-weight: 800; color: var(--text);
  margin-bottom: 4px; letter-spacing: 0.5px;
}
.auth-subtitle {
  font-size: 13px; color: var(--text-2); margin-bottom: 18px;
}
.auth-field {
  display: block; margin-bottom: 12px;
}
.auth-field > span {
  display: block; font-size: 12px; color: var(--text-2);
  margin-bottom: 4px; font-weight: 500;
}
.auth-field > input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; color: var(--text);
  background: var(--bg);
  transition: all .15s;
  box-sizing: border-box;
}
.auth-field > input:focus {
  outline: none; border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.auth-msg {
  font-size: 13px; min-height: 18px; margin: 4px 0 8px;
}
.auth-msg.err { color: #ef4444; }
.auth-msg.ok  { color: #10b981; }
.auth-submit {
  width: 100%; padding: 11px 0;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: #fff; border: none; border-radius: 6px;
  font-size: 15px; font-weight: 700; letter-spacing: 4px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.32);
  transition: all .2s;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-hint {
  text-align: center; font-size: 12px; color: var(--text-2);
  margin-top: 14px;
}
.auth-hint a { color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 500; }
.auth-hint a:hover { text-decoration: underline; }

/* 账号设置 modal */
.profile-head {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
  border-radius: 6px; margin-bottom: 18px;
}
.profile-avatar-big {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #e0e7ff, #fce7f3);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px; line-height: 1; flex-shrink: 0;
}
.profile-name { font-size: 18px; font-weight: 700; color: var(--text); }
.profile-handle { font-size: 12px; color: var(--text-2); }
.profile-joined { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.profile-section { margin-bottom: 14px; }
.profile-section-title {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px; letter-spacing: 0.5px;
}
.profile-avatar-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px; background: var(--bg); border-radius: 6px;
}
.profile-avatar-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line);
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.profile-avatar-btn:hover { transform: scale(1.1); border-color: var(--primary); }
.profile-avatar-btn.active {
  background: var(--primary); border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* 设置页：账号区 */
.account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.account-info {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1;
}
.account-avatar-lg {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #e0e7ff, #fce7f3);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; flex-shrink: 0;
}
.account-avatar-lg.guest { background: var(--bg); opacity: 0.6; }
.account-name { font-size: 15px; font-weight: 700; color: var(--text); }
.account-handle { font-size: 12px; color: var(--text-2); font-weight: 400; }
.account-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.account-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.setting-section {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin: 22px 0 12px;
  padding-left: 6px; border-left: 3px solid var(--primary);
}
.setting-hint {
  font-size: 12px; color: var(--text-2);
  background: var(--bg); border-radius: 8px;
  padding: 8px 12px; margin: -4px 0 12px;
}

@media (max-width: 600px) {
  .auth-nickname { display: none; }
  .account-actions { width: 100%; }
  .account-row { flex-direction: column; align-items: stretch; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar-toggle { display: inline-block; }
  .layout { margin-left: 0; }
  .sidebar {
    position: fixed; top: 64px; left: 0; z-index: 90;
    height: calc(100vh - 64px); width: 260px;
    transform: translateX(-100%); transition: transform .25s;
    box-shadow: 4px 0 20px rgba(0,0,0,.12);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-mask {
    display: block; position: fixed; inset: 64px 0 0 0; z-index: 80;
    background: rgba(0,0,0,.35);
  }
  .main { padding: 22px 16px 50px; }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 0 14px 0 4px; }
  .logo { margin-left: 2px; }
  .logo-text { font-size: 17px; }
  .top-nav { display: none; }
  .home-top { flex-direction: column; gap: 16px; }
  .checkin-section { flex: 0 0 auto; }
  .hero { padding: 30px 24px; }
  .hero h1 { font-size: 24px; }
  .hero-stats { gap: 22px; }
  .quote-bar { padding: 14px 16px; gap: 10px; }
  .quote-bar-text { font-size: 15px; min-width: 100%; }
  .quote-bar-line { display: none; }
  .lesson-grid { grid-template-columns: 1fr; }
  .prog-row { flex-wrap: wrap; gap: 8px; }
  .prog-name { width: auto; }
  .prog-bar { flex-basis: 100%; order: 3; }
  .prog-num { width: auto; margin-left: auto; }
  /* 主题按钮：移动端圆形图标（桌面端已是纯圆形，此处统一尺寸） */
  .theme-toggle { width: 36px; height: 36px; padding: 0; justify-content: center; }
}

/* ============================================================
 * 课时内容管线：册次页 / 课时页 / 内容块 / 答题 / 题库
 * ============================================================ */

/* ---------- 册次页：单元（可折叠）+ 课时长条列表 ---------- */
.vol-units-head { display: flex; align-items: baseline; justify-content: flex-start; margin: 22px 0 14px; flex-wrap: wrap; gap: 8px; }
.vol-units-head .section-title { margin: 0; }
.vol-units-count { font-size: 13.5px; color: var(--text-2); }
.vol-units-count b { color: var(--text); font-size: 15px; font-weight: 800; padding: 0 2px; }

.vol-units { display: flex; flex-direction: column; gap: 12px; }
.vol-unit {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.vol-unit.is-open { border-color: color-mix(in srgb, var(--sc, var(--primary)) 30%, var(--line)); }
.vol-unit.is-done { border-color: #10b981; }

.vol-unit-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; cursor: pointer; user-select: none;
  transition: background .15s;
}
.vol-unit-head:hover { background: var(--bg-2); }
.vol-unit-chevron {
  width: 22px; height: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-2);
  transition: transform .25s;
}
.vol-unit-chevron.is-open { transform: rotate(90deg); color: var(--sc, var(--primary)); }
.vol-unit-info { flex: 1; min-width: 0; }
.vol-unit-title { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.vol-unit-meta { font-size: 12.5px; color: var(--text-2); }
.vol-unit-bar { width: 100px; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.vol-unit-bar i { display: block; height: 100%; background: var(--sc, var(--primary)); border-radius: 3px; transition: width .4s; }
.vol-unit.is-done .vol-unit-bar i { background: #10b981; }
.vol-unit.is-done .vol-unit-meta { color: #047857; font-weight: 600; }

/* 课时长条（单列） */
.vol-unit-body { display: flex; flex-direction: column; border-top: 1px solid var(--line-2); background: var(--bg-2); }
.lesson-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--line-2); transition: all .15s;
  position: relative;
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: color-mix(in srgb, var(--sc, var(--primary)) 6%, #fff); }
.lesson-row.is-done .lr-name { color: #047857; }

/* 圆圈：未完成 = 空心灰；已完成 = 实心绿+勾 */
.lr-circle {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 2.5px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: transparent;
  transition: all .25s;
}
.lr-circle.is-done {
  border-color: #10b981; background: #10b981; color: #fff;
  box-shadow: 0 0 0 4px #d1fae5;
}

.lr-name {
  flex: 1; min-width: 0; font-size: 15px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lr-info { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lr-meta-item { font-size: 12.5px; color: var(--text-2); }
.lr-diff {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--dc, #10b981) 12%, #fff);
  color: var(--dc, #10b981); white-space: nowrap;
}
.lr-arrow { color: var(--text-3); font-size: 18px; font-weight: 700; flex-shrink: 0; transition: color .15s, transform .15s; }
.lesson-row:hover .lr-arrow { color: var(--sc, var(--primary)); transform: translateX(2px); }
.lesson-row.is-done .lr-arrow { color: #10b981; }

@media (max-width: 640px) {
  .vol-unit-bar { width: 60px; }
  .lr-info { gap: 6px; }
  .lr-meta-item { display: none; }
  .vol-unit-head { padding: 14px 16px; }
  .lesson-row { padding: 12px 16px; gap: 12px; }
}

/* 兼容老 lesson-pill（如果别处用到） */
.lesson-pill { position: relative; }
.lesson-pill.is-done { background: #f0fdf4; border-color: #bbf7d0; }
.lesson-pill.is-done .lp-name { color: #047857; }
.lesson-pill.is-done .lp-go { color: #10b981; }
.lesson-pill.is-done:hover { border-color: #10b981; }
.lp-done-badge {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #10b981; color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(16,185,129,.3);
}

/* ---------- 课时详情 ---------- */
.lesson { background: var(--card); border-radius: 8px; box-shadow: var(--shadow);
  padding: 34px 40px 40px; max-width: 860px; }
.lesson-cover { width: 100%; aspect-ratio: 16 / 7; overflow: hidden; border-radius: 12px; margin-bottom: 22px; background: var(--bg-2); border: 1px solid var(--line); }
.lesson-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lesson-head { border-bottom: 2px solid var(--line); padding-bottom: 18px; margin-bottom: 24px; }
.lesson-kicker { font-size: 13px; font-weight: 700; color: var(--sc, var(--primary)); letter-spacing: .5px; margin-bottom: 8px; }
.lesson-title { font-size: 27px; font-weight: 800; line-height: 1.35; }
.lesson-author { font-size: 15px; color: var(--text-2); margin-top: 6px; }
.lesson-head .lp-diff { display: inline-block; margin-top: 12px; }
.lesson-read { margin-top: 14px; }
.read-toggle {
  border: 1.5px dashed var(--sc, var(--primary));
  background: #fff; color: var(--sc, var(--primary));
  font-size: 13px; font-weight: 600; padding: 8px 16px;
  border-radius: 999px; cursor: pointer; transition: all .15s;
}
.read-toggle:hover { background: color-mix(in srgb, var(--sc, var(--primary)) 8%, #fff); }
.read-toggle.is-done {
  border-style: solid; border-color: #10b981; background: #d1fae5; color: #047857;
  display: inline-flex; align-items: center; gap: 4px;
}
.lesson-body { font-size: 15.5px; }

/* ---------- 内容块 ---------- */
.b-heading {
  font-size: 19px; font-weight: 800; margin: 30px 0 12px; padding-left: 12px;
  border-left: 5px solid var(--sc, var(--primary)); line-height: 1.4;
}
.b-heading:first-child { margin-top: 0; }
.b-subheading {
  font-size: 16px; font-weight: 800; margin: 22px 0 10px; padding-left: 10px;
  border-left: 4px solid var(--sc, var(--primary)); line-height: 1.4; color: #1f2733;
}
.b-paragraph { margin: 12px 0; line-height: 1.95; color: #2f3540; }
.b-paragraph strong, .b-keypoint strong, .b-tip strong, .b-warn strong,
.b-list strong, .b-example strong, .b-reading strong {
  color: #c0392b; font-weight: 800; padding: 0 1px;
}
.b-list { margin: 12px 0 12px 4px; padding-left: 22px; line-height: 1.9; }
.b-list li { margin: 5px 0; }

/* 框式块（重点 / 提示 / 注意 / 例题 / 阅读） */
.b-keypoint, .b-tip, .b-warn, .b-example, .b-reading {
  margin: 18px 0; padding: 14px 16px 14px 44px; border-radius: 6px; position: relative;
  line-height: 1.9; font-size: 15px;
}
.b-keypoint .box-label, .b-tip .box-label, .b-warn .box-label,
.b-example .box-label, .b-reading .box-label {
  position: absolute; left: 0; top: 0; bottom: 0; width: 34px;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 15px;
  writing-mode: vertical-rl; letter-spacing: 2px; font-size: 12px; font-weight: 800;
  color: #fff; border-radius: 10px 0 0 10px;
}
.b-keypoint { background: #fdf3f2; border: 1px solid #f6d7d3; }
.b-keypoint .box-label { background: #e05d44; }
.b-tip { background: #eef6ff; border: 1px solid #cfe4fb; }
.b-tip .box-label { background: #4a7de0; }
.b-warn { background: #fff8e9; border: 1px solid #f6e4b8; }
.b-warn .box-label { background: #e0a72e; }
.b-example { background: #f1f9f2; border: 1px solid #d3ecd8; }
.b-example .box-label { background: #3fa45a; }
.b-reading { background: #f7f4fb; border: 1px solid #e2d7f0; }
.b-reading .box-label { background: #8a5cd0; }

/* 公式 / 诗词 */
.b-formula {
  margin: 16px 0; padding: 14px 18px; text-align: center; font-size: 17px;
  background: #f6f8fc; border: 1px dashed var(--line); border-radius: 6px;
  font-family: "Cambria Math", Georgia, serif; letter-spacing: .5px;
}
.b-poem {
  margin: 18px auto; padding: 20px 24px; max-width: 560px; text-align: center;
  background: linear-gradient(180deg, #fbf9f4, #f7f3ea); border: 1px solid #ece3d3;
  border-radius: 6px; font-size: 16.5px; line-height: 2.2; white-space: pre-line;
  color: #4a3f2e; font-family: "Kaiti SC", "STKaiti", "PingFang SC", serif; letter-spacing: 1px;
}

/* 课时「原文」区块：置于课时开头，仿古籍笺注风格 */
.b-original {
  margin: 20px 0 24px; padding: 18px 22px;
  background: linear-gradient(180deg, #fcf8f0, #f7f1e4);
  border: 1px solid #e7dcc6; border-left: 4px solid #b9893f;
  border-radius: 8px; position: relative;
}
.b-original .box-label {
  display: inline-block; font-size: 12px; font-weight: 800; color: #fff;
  background: #b9893f; padding: 3px 12px; border-radius: 20px;
  margin-bottom: 12px; letter-spacing: 2px;
}
.b-original-title { font-size: 17px; font-weight: 700; color: #6b4f1d; margin-bottom: 10px;
  font-family: "Kaiti SC", "STKaiti", "PingFang SC", serif; }
.b-original-text {
  font-size: 16px; line-height: 2.1; color: #3c3322; text-align: justify;
  font-family: "Kaiti SC", "STKaiti", "PingFang SC", serif; letter-spacing: .5px; white-space: pre-line;
}
.b-original-src { margin-top: 12px; font-size: 12.5px; color: #9a8759; text-align: right; font-style: italic; }
body.theme-dark .b-original { background: rgba(184,137,63,.10); border-color: rgba(184,137,63,.35); border-left-color: #c79a4f; }
body.theme-dark .b-original .box-label { background: #c79a4f; color: #2a2417; }
body.theme-dark .b-original-title { color: #e3c98f; }
body.theme-dark .b-original-text { color: #e8e0cf; }
body.theme-dark .b-original-src { color: #b8a06a; }

/* 原文：分段 + 逐段分析 + 完整全文（折叠） */
.orig-segs { margin: 14px 0 4px; }
.orig-seg { padding: 12px 14px; margin-bottom: 14px; background: rgba(255,255,255,.55); border: 1px solid #ece0c6; border-radius: 8px; }
.orig-seg-idx { font-size: 12px; font-weight: 700; color: #b9893f; margin-bottom: 6px; letter-spacing: 1px; }
.orig-seg-text { font-family: "Kaiti SC","STKaiti","PingFang SC",serif; font-size: 16px; line-height: 2.05; color: #3c3322; text-align: justify; letter-spacing: .5px; white-space: pre-line; }
.orig-seg-note { margin-top: 10px; padding: 9px 12px; background: #eef4fb; border-left: 3px solid #4a7de0; border-radius: 0 6px 6px 0; font-size: 14px; line-height: 1.85; color: #34465e; }
.orig-note-label { font-weight: 700; color: #4a7de0; margin-right: 6px; }
.orig-full { margin-top: 8px; border: 1px dashed #d8c79f; border-radius: 8px; background: rgba(255,255,255,.4); }
.orig-full-label { cursor: pointer; font-size: 14px; font-weight: 700; color: #6b4f1d; padding: 10px 14px; list-style: none; }
.orig-full-label::-webkit-details-marker { display: none; }
.orig-full > .b-original-text { padding: 0 14px 12px; }
body.theme-dark .orig-seg { background: rgba(255,255,255,.05); border-color: rgba(184,137,63,.3); }
body.theme-dark .orig-seg-text { color: #e8e0cf; }
body.theme-dark .orig-seg-note { background: rgba(74,125,224,.14); border-left-color: #6f9bf0; color: #cdd8ec; }
body.theme-dark .orig-full { background: rgba(255,255,255,.04); border-color: rgba(184,137,63,.35); }
body.theme-dark .orig-full-label { color: #e3c98f; }
.orig-cr-banner {
  margin: 10px 0 2px; padding: 10px 13px; font-size: 13px; line-height: 1.75;
  color: #8a5a17; background: #fdf3e0; border: 1px solid #eccf9a; border-left: 3px solid #d99a36;
  border-radius: 0 7px 7px 0;
}
.orig-cr-banner b { color: #b9791f; }
body.theme-dark .orig-cr-banner { color: #e6cfa0; background: rgba(217,154,54,.13); border-color: rgba(217,154,54,.4); border-left-color: #d99a36; }
body.theme-dark .orig-cr-banner b { color: #f0c878; }

/* 图示 */
.b-figure { margin: 24px 0; text-align: center; }
/* 图文并排：图浮在讲解内容一侧，不再堆在底部 */
.b-figure.b-float-right { float: right; width: 42%; margin: 6px 0 16px 20px; text-align: center; }
.b-figure.b-float-left  { float: left;  width: 42%; margin: 6px 20px 16px 0; text-align: center; }
.b-figure.b-float-right .b-svg, .b-figure.b-float-right .b-img,
.b-figure.b-float-left .b-svg, .b-figure.b-float-left .b-img { width: 100%; max-width: 100%; margin: 0 auto; display: block; }
.b-figure.b-float-right .b-svg, .b-figure.b-float-left .b-svg { margin: 0; }
.b-svg { display: block; width: 100%; max-width: 1000px; margin: 24px auto; padding: 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.b-svg svg { width: 100%; max-width: 100%; height: auto; display: block; }
.b-img { display: inline-block; max-width: 100%; padding: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.b-img img { max-width: 100%; height: auto; display: block; border-radius: 4px; }
.b-figure figcaption { margin-top: 10px; font-size: 13.5px; color: var(--text-2); }

/* 表格 */
.b-table-wrap { margin: 18px 0; overflow-x: auto; }
.b-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 420px; }
.b-table th, .b-table td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; line-height: 1.7; }
.b-table th { background: #f2f6fc; font-weight: 800; }
.b-table tr:nth-child(even) td { background: #fafbfe; }
.b-empty { color: var(--text-2); padding: 12px 0; }

/* ---------- 练习 / 答题 ---------- */
.exercises { margin-top: 40px; border-top: 2px dashed var(--line); padding-top: 26px; }
.ex-title { font-size: 20px; font-weight: 800; margin-bottom: 18px; }
.quiz { background: #fafbfe; border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; margin-bottom: 16px; }
.quiz.is-correct { border-color: #9ed3ac; background: #f2fbf4; }
.quiz.is-wrong { border-color: #f0b6ae; background: #fef4f2; }
.quiz-q { display: flex; gap: 10px; font-size: 15.5px; font-weight: 600; line-height: 1.8; margin-bottom: 14px; }
.quiz-no { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--primary);
  color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.opt {
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 6px;
  padding: 10px 14px; font-size: 14.5px; color: var(--text); transition: all .15s; width: 100%;
}
.opt:hover { border-color: var(--primary); }
.opt.sel { border-color: var(--primary); background: #eef4ff; }
.opt.disabled { cursor: default; opacity: .92; }
.opt-key { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; background: #eef1f6;
  color: var(--text-2); font-weight: 800; font-size: 12.5px; display: flex; align-items: center; justify-content: center; }
.opt.sel .opt-key { background: var(--primary); color: #fff; }
.fill-input { width: 100%; max-width: 340px; padding: 10px 14px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 6px; }
.fill-input:focus { outline: none; border-color: var(--primary); }
.quiz-actions { display: flex; align-items: center; gap: 14px; }
.quiz-submit { border: none; background: var(--primary); color: #fff; font-size: 14px; font-weight: 700;
  padding: 8px 22px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.quiz-submit:hover { background: var(--primary-dark); }
.quiz-submit:disabled { background: #b9c4d6; cursor: default; }
.quiz-feedback { font-size: 14px; font-weight: 800; }
.quiz-feedback.ok { color: #2e9e57; }
.quiz-feedback.no { color: #d0402b; }
.quiz-exp { margin-top: 0; max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.quiz.is-correct .quiz-exp, .quiz.is-wrong .quiz-exp { max-height: 600px; margin-top: 14px; }
.quiz-exp-label { font-size: 12.5px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.quiz-status { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; }
.quiz-status.ok { background: #10b981; }
.quiz-status.no { background: #ef4444; }
.ex-progress { font-size: 14px; font-weight: 700; color: #6b7280; margin-left: 10px; }
.read-toggle.in-progress { background: #fff7ed; border: 1px dashed #f59e0b; color: #b45309; cursor: default; }
.read-toggle.in-progress:hover { background: #fff7ed; }
.quiz-exp > div:last-child { font-size: 14px; line-height: 1.85; color: #444; }
.quiz-ans { margin-top: 8px; font-size: 13.5px; font-weight: 700; color: #d0402b; }

/* ---------- 课时上下导航 ---------- */
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px;
  border-top: 1px solid var(--line); padding-top: 20px; }
.lesson-nav a, .lesson-nav span { font-size: 14px; text-decoration: none; color: var(--primary);
  max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-nav a:hover { text-decoration: underline; }
.lesson-nav .disabled { color: var(--text-2); cursor: default; }
.nav-next { text-align: right; margin-left: auto; }

/* ---------- 旧版题库列表样式已迁移到顶部 .bank-modes / .bank-q ---------- */

/* ---------- 错题「去重做」按钮 ---------- */
.wrong-go { margin-top: 8px; border: 1px solid var(--primary); background: #fff; color: var(--primary);
  font-size: 13px; padding: 5px 14px; border-radius: 8px; cursor: pointer; }
.wrong-go:hover { background: var(--primary); color: #fff; }

/* ---------- 讨论区 ---------- */
.cm-page { padding: 32px 32px 40px; }
.cm-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.cm-head-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  box-shadow: 0 6px 18px rgba(74, 125, 224, 0.25);
}
.cm-title { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; }
.cm-sub { font-size: 13.5px; color: var(--text-2); margin-top: 3px; }

.cm-stats {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 28px;
  margin-bottom: 22px;
}
.cm-stat { flex: 1 1 0; text-align: center; }
.cm-stat-num { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; letter-spacing: 0.5px; }
.cm-stat-avg { background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cm-stat-good { color: #f59e0b; }
.cm-stat-stars { display: flex; justify-content: center; gap: 2px; margin: 4px 0 6px; }
.cm-stat-lbl { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cm-stat-sep { width: 1px; height: 36px; background: var(--line); }

.cm-form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.cm-form-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.cm-form-row { margin-bottom: 14px; }
.cm-form-lbl { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }

.cm-star-picker { display: inline-flex; gap: 4px; padding: 4px 0; }
.cm-pick-star {
  background: transparent; border: 0; padding: 2px; cursor: pointer;
  display: inline-flex; transition: transform .15s;
}
.cm-pick-star:hover { transform: scale(1.15); }
.cm-pick-star svg { display: block; transition: fill .15s, transform .15s; }
.cm-star-word {
  display: inline-block; margin-left: 10px; font-size: 12.5px; color: var(--text-3);
  transition: color .2s;
}
.cm-star-word.has { color: #f59e0b; font-weight: 500; }

.cm-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  resize: vertical;
  min-height: 84px;
  max-height: 240px;
  line-height: 1.6;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cm-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 125, 224, 0.12); background: var(--card); }
.cm-counter { text-align: right; font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

.cm-form-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
  gap: 12px; flex-wrap: wrap;
}
.cm-form-id { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.cm-form-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff;
}
.cm-form-avatar-anon { background: var(--line); color: var(--text-2); font-size: 18px; }
.cm-form-name b { color: var(--text); font-weight: 600; }
.cm-anon { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.cm-anon input { accent-color: var(--primary); cursor: pointer; }
.cm-name-input {
  flex: 1 1 140px; min-width: 120px;
  font-family: inherit; font-size: 13px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.cm-name-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,125,224,0.12); background: var(--card); }
.cm-form-id-top { margin-bottom: 14px; flex-wrap: wrap; }

.cm-submit {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border: 0; border-radius: 999px;
  padding: 9px 22px; font-size: 14px; font-weight: 500;
  cursor: pointer; opacity: 0.45;
  transition: opacity .2s, transform .15s, box-shadow .2s;
}
.cm-submit.ready, .cm-submit:not([disabled]) { opacity: 1; }
.cm-submit.ready:hover, .cm-submit:not([disabled]):hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(74, 125, 224, 0.3); }
.cm-submit[disabled] { cursor: not-allowed; }
.cm-submit.sending { opacity: 0.7; }

/* 附件上传控件 + 预览 + 展示 */
.cm-file-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.cm-file-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; transition: border-color .15s, color .15s, background .15s;
}
.cm-file-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--card); }
.cm-file-btn input[type="file"] { display: none; }
.cm-file-hint { font-size: 11.5px; color: var(--text-3); }
.cm-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.cm-previews:empty { display: none; }
.ds-prev {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px 6px 8px; font-size: 12.5px; color: var(--text-2); max-width: 230px;
}
.ds-prev.is-img img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; }
.ds-prev-ico { font-size: 18px; }
.ds-prev-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; color: var(--text); }
.ds-prev-size { color: var(--text-3); flex: none; }
.ds-prev-x {
  flex: none; width: 18px; height: 18px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--line); color: var(--text-2); font-size: 13px; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.ds-prev-x:hover { background: #ef4444; color: #fff; }

.ds-attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ds-att { display: inline-flex; }
.ds-att-img {
  width: 132px; height: 132px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2);
}
.ds-att-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.ds-att-img:hover img { transform: scale(1.04); }
.ds-att-file {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; max-width: 260px; transition: border-color .15s, box-shadow .15s;
}
.ds-att-file:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(74,125,224,.15); }
.ds-att-ico { font-size: 20px; }
.ds-att-name { color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.ds-att-size { color: var(--text-3); font-size: 11.5px; flex: none; }
.ds-att-ind { display: inline-flex; align-items: center; font-size: 12px; color: var(--text-2); }


.cm-list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 4px 14px; }
.cm-list-title { font-size: 15px; font-weight: 600; color: var(--text); }
.cm-list-count { font-size: 12.5px; color: var(--text-2); }

.cm-list { list-style: none; display: flex; flex-direction: column; gap: 12px; padding: 0; margin: 0; }
.cm-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; gap: 14px;
  transition: transform .15s, box-shadow .2s, border-color .15s;
}
.cm-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: rgba(74, 125, 224, 0.25); }
.cm-card-avatar {
  flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff; line-height: 1;
}
.cm-card-anon-glyph { font-size: 24px; color: var(--text-3); font-weight: 700; }
.cm-card-body { flex: 1 1 auto; min-width: 0; }
.cm-card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.cm-card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.cm-card-tag {
  font-size: 10.5px; padding: 2px 7px; border-radius: 4px;
  background: rgba(74, 125, 224, 0.1); color: var(--primary);
}
.cm-card-tag-anon { background: var(--line); color: var(--text-2); }
.cm-card-stars { display: inline-flex; gap: 1px; }
.cm-card-time { font-size: 12px; color: var(--text-3); margin-left: auto; }
.cm-card-text {
  font-size: 14px; color: var(--text); line-height: 1.65;
  word-break: break-word; white-space: pre-wrap;
}

.cm-empty {
  text-align: center; padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.cm-empty-title { font-size: 16px; color: var(--text); font-weight: 500; margin-top: 8px; }
.cm-empty-sub { font-size: 13px; color: var(--text-2); }

/* 讨论区移动端 */
@media (max-width: 720px) {
  .cm-page { padding: 22px 16px 30px; }
  .cm-stats { padding: 14px 12px; }
  .cm-stat-num { font-size: 22px; }
  .cm-form-card { padding: 18px 16px; }
  .cm-form-foot { flex-direction: column; align-items: stretch; }
  .cm-form-id { font-size: 12.5px; }
  .cm-submit { width: 100%; padding: 11px; }
  .cm-card { padding: 14px; gap: 10px; }
  .cm-card-avatar { width: 34px; height: 34px; font-size: 16px; }
  .cm-card-time { margin-left: 0; }
}

/* 讨论区（洛谷风格：左侧板块导航 + 右侧帖子列表） */
.ds-page { padding: 0; overflow: hidden; border-radius: var(--radius-lg); max-width: 1320px; }
.ds-layout { display: flex; align-items: flex-start; gap: 24px; padding: 26px 40px 44px; }
.ds-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 30px 32px;
  background: linear-gradient(120deg, #eef4fb 0%, #f2edfb 52%, #eef9f1 100%);
  border-bottom: 1px solid var(--line);
}
.ds-hero-icon {
  width: 54px; height: 54px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(135deg, #4a7de0, #8e5cd9);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; box-shadow: 0 8px 22px rgba(74,125,224,0.28);
}
.ds-hero-title { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: .5px; }
.ds-hero-sub { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }

.ds-layout { display: flex; align-items: flex-start; gap: 20px; padding: 22px 32px 36px; }

/* 左侧板块导航 */
.ds-sidebar { flex: 0 0 288px; width: 288px; position: sticky; top: 14px; align-self: flex-start; }
.ds-sidebar-title {
  font-size: 13px; font-weight: 700; color: var(--text-3);
  letter-spacing: 1px; padding: 0 6px 10px;
}
.ds-nav {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 16px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid transparent; border-radius: 13px;
  cursor: pointer; text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .2s, border-color .15s, background .15s;
}
.ds-nav:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.ds-nav.active { background: var(--bg-2); border-left-color: var(--bc, var(--primary)); box-shadow: var(--shadow); }
.ds-nav-icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: var(--bg-2); background: color-mix(in srgb, var(--bc, #4a7de0) 14%, var(--card));
}
.ds-nav-body { flex: 1 1 auto; min-width: 0; }
.ds-nav-name { display: block; font-size: 16px; font-weight: 600; color: var(--text); }
.ds-nav-desc {
  display: block; font-size: 12.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ds-nav-count {
  flex-shrink: 0; min-width: 28px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--text-2);
  background: var(--bg-2); border-radius: 999px; padding: 3px 9px;
}
.ds-nav.active .ds-nav-count { color: var(--bc, var(--primary)); background: rgba(74,125,224,0.12); background: color-mix(in srgb, var(--bc, #4a7de0) 12%, transparent); }

/* 右侧内容 */
.ds-content { flex: 1 1 auto; min-width: 0; }
.ds-board-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 18px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--bc, var(--primary));
  border-radius: 12px; box-shadow: var(--shadow);
}
.ds-board-head-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
  background: var(--bg-2); background: color-mix(in srgb, var(--bc, #4a7de0) 16%, var(--card));
}
.ds-board-head-body { flex: 1 1 auto; min-width: 0; }
.ds-board-head-name { font-size: 17px; font-weight: 700; color: var(--text); }
.ds-board-head-desc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.ds-newbtn {
  flex-shrink: 0; border: 0; cursor: pointer; color: #fff;
  font-size: 13.5px; font-weight: 600; padding: 9px 16px; border-radius: 999px;
  background: var(--primary);
  background: linear-gradient(135deg, var(--bc, #4a7de0), color-mix(in srgb, var(--bc, #4a7de0) 70%, #8e5cd9));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--bc, #4a7de0) 30%, transparent);
  transition: transform .15s, box-shadow .2s;
}
.ds-newbtn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--bc, #4a7de0) 40%, transparent); }
.ds-compose { margin-bottom: 18px; }

/* 主题列表 */
.ds-topic-list { list-style: none; display: flex; flex-direction: column; gap: 10px; padding: 0; margin: 0; }
.ds-topic {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; transition: transform .15s, box-shadow .2s, border-color .15s;
}
.ds-topic:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: rgba(74,125,224,0.25); }
.ds-topic-main { flex: 1 1 auto; min-width: 0; }
.ds-topic-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-topic-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.ds-topic-author { color: var(--text-2); }
.ds-dot { color: var(--text-3); }
.ds-topic-stat { flex-shrink: 0; text-align: center; min-width: 52px; }
.ds-topic-stat-n { font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.1; }
.ds-topic-stat-l { font-size: 11px; color: var(--text-3); }
.ds-topic.has-del { position: relative; }
.ds-del {
  flex-shrink: 0; margin-left: 6px; border: 1px solid var(--line); background: transparent;
  color: var(--text-3); font-size: 12px; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.ds-del:hover { color: #e5484d; border-color: rgba(229,72,77,0.4); background: rgba(229,72,77,0.08); }
.ds-del-sm { font-size: 11.5px; padding: 2px 10px; }

.ds-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  color: var(--bc, var(--primary));
  background: rgba(74,125,224,0.12); background: color-mix(in srgb, var(--bc, #4a7de0) 12%, transparent);
}

.ds-empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.ds-empty-icon { font-size: 40px; }
.ds-empty-title { font-size: 16px; color: var(--text); font-weight: 600; margin-top: 10px; }
.ds-empty-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* 帖子详情 */
.ds-topic-back { margin-bottom: 12px; }
.ds-topic-head {
  padding: 18px 20px; margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--bc, var(--primary));
  border-radius: 12px; box-shadow: var(--shadow);
}
.ds-topic-title-lg { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.4; }
.ds-topic-by { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.ds-topic-author { color: var(--text-2); }

/* ===== 洛谷风格站务板徽章 / 统计 / 管理 ===== */
.ds-topic.pinned { border-color: rgba(224,133,43,0.5); background: linear-gradient(90deg, rgba(224,133,43,0.06), var(--card) 40%); }
.ds-topic-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.ds-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; line-height: 1.6; }
.ds-badge-pin { background: #fff3e0; color: #c9700f; border: 1px solid #ffd9a8; }
.ds-badge-official { background: linear-gradient(135deg,#7b5cff,#a06bff); color: #fff; border: 1px solid #8e6bff; }
.ds-badge-tag { background: color-mix(in srgb, var(--bc) 14%, #fff); color: var(--bc); border: 1px solid color-mix(in srgb, var(--bc) 40%, #fff); }
.ds-badge-essence { background: #fff8e1; color: #b58900; border: 1px solid #ffe9a8; }
.ds-topic-views { flex-shrink: 0; text-align: center; min-width: 56px; font-size: 12px; color: var(--text-3); }
.ds-topic-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ds-like {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  font-size: 13px; padding: 5px 14px; border-radius: 999px; transition: all .15s;
}
.ds-like:hover { border-color: rgba(74,125,224,0.4); color: var(--primary); }
.ds-like.liked { background: rgba(74,125,224,0.12); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.ds-admin-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.ds-tool {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2);
  font-size: 12px; padding: 4px 10px; border-radius: 8px; cursor: pointer; transition: all .15s;
}
.ds-tool:hover { border-color: var(--primary); color: var(--primary); }
.ds-tool-sel { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; background: var(--card); color: var(--text); }

/* 发帖框内的站务管理行 */
.cm-manage-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 2px; padding: 10px 12px; background: var(--bg-2); border: 1px dashed var(--line); border-radius: 10px; }
.cm-manage-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.cm-tag-sel { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 13px; background: var(--card); color: var(--text); }
.cm-manage-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* 站务板筛选 chips */
.ds-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.ds-filter-label { font-size: 13px; color: var(--text-3); }
.ds-filter {
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  font-size: 12.5px; padding: 4px 14px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.ds-filter:hover { border-color: rgba(74,125,224,0.4); color: var(--primary); }
.ds-filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }


.ds-post {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 20px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.ds-post-body { font-size: 14.5px; color: var(--text); line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
/* 帖/回复正文里的轻量 Markdown 渲染（renderMarkdown 输出） */
.ds-post-body .cm-h, .ds-reply-text .cm-h { margin: .9em 0 .45em; line-height: 1.35; font-weight: 700; color: var(--text); }
.ds-post-body .cm-h1, .ds-reply-text .cm-h1 { font-size: 1.6em; border-bottom: 2px solid var(--line); padding-bottom: .25em; }
.ds-post-body .cm-h2, .ds-reply-text .cm-h2 { font-size: 1.34em; }
.ds-post-body .cm-h3, .ds-reply-text .cm-h3 { font-size: 1.17em; }
.ds-post-body .cm-h4, .ds-reply-text .cm-h4 { font-size: 1.05em; }
.ds-post-body .cm-h5, .ds-reply-text .cm-h5 { font-size: .98em; }
.ds-post-body .cm-h6, .ds-reply-text .cm-h6 { font-size: .92em; color: var(--text-2); }
.ds-post-body .cm-p, .ds-reply-text .cm-p { margin: .55em 0; }
.ds-post-body .cm-ul, .ds-post-body .cm-ol, .ds-reply-text .cm-ul, .ds-reply-text .cm-ol { margin: .5em 0; padding-left: 1.5em; }
.ds-post-body .cm-ul, .ds-reply-text .cm-ul { list-style: disc; }
.ds-post-body .cm-ol, .ds-reply-text .cm-ol { list-style: decimal; }
.ds-post-body .cm-ul li, .ds-post-body .cm-ol li, .ds-reply-text .cm-ul li, .ds-reply-text .cm-ol li { margin: .25em 0; }
.ds-post-body .cm-quote, .ds-reply-text .cm-quote { margin: .6em 0; padding: 8px 14px; border-left: 3px solid var(--primary); background: var(--bg-2); border-radius: 0 8px 8px 0; color: var(--text-2); }
.ds-post-body .cm-quote-line, .ds-reply-text .cm-quote-line { margin: 0; }
.ds-post-body code, .ds-reply-text code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }

/* 发帖/回复编辑框的实时预览区 */
.cm-preview { margin: 8px 0 2px; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg-2); padding: 10px 12px; }
.cm-preview-label { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.cm-preview-body { white-space: normal; min-height: 18px; }
.cm-preview-body .cm-h { margin: .8em 0 .4em; }
.cm-preview-body .cm-h:first-child { margin-top: 0; }
/* 讨论区发帖/回复：格式化工具条 */
.cm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.cm-tool-btn { font-size: 13px; line-height: 1; padding: 6px 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); border-radius: 7px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.cm-tool-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--card); }
.cm-tool-btn b { font-weight: 800; }
.cm-tool-btn i { font-style: italic; }
.cm-tool-hint { font-size: 11.5px; color: var(--text-2); margin-left: 4px; }

/* 回复 */
.ds-reply-list { list-style: none; display: flex; flex-direction: column; gap: 10px; padding: 0; margin: 0; }
.ds-reply { display: flex; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ds-reply-avatar {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff;
}
.ds-reply-avatar.anon { background: var(--line); color: var(--text-2); font-size: 20px; }
.ds-reply-body { flex: 1 1 auto; min-width: 0; }
.ds-reply-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ds-reply-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ds-reply-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 4px; background: rgba(74,125,224,0.1); color: var(--primary); }
.ds-reply-tag.anon { background: var(--line); color: var(--text-2); }
.ds-reply-time { font-size: 12px; color: var(--text-3); margin-left: auto; }
.ds-reply-text { font-size: 14px; color: var(--text); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.ds-list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 4px 14px; }
.ds-list-head span:first-child { font-size: 15px; font-weight: 600; color: var(--text); }
.ds-list-head span:last-child { font-size: 12.5px; color: var(--text-2); }

.ds-back {
  display: inline-flex; align-items: center;
  font-size: 13px; color: var(--text-2); text-decoration: none;
  padding: 4px 10px; border-radius: 8px; cursor: pointer; margin-right: 4px;
  background: var(--bg-2); transition: background .15s, color .15s;
}
.ds-back:hover { background: var(--line); color: var(--text); }

/* 讨论区移动端：侧栏堆叠到顶部 */
@media (max-width: 760px) {
  .ds-hero { padding: 22px 16px; }
  .ds-hero-title { font-size: 20px; }
  .ds-layout { flex-direction: column; gap: 16px; padding: 16px 16px 28px; }
  .ds-sidebar { position: static; width: 100%; flex-basis: auto; }
  .ds-nav-desc { display: none; }
  .ds-board-head { flex-wrap: wrap; }
}

.cm-card-avatar-anon { background: var(--line); color: var(--text-2); }
.cm-title-input {
  width: 100%; font-family: inherit; font-size: 15px; font-weight: 600;
  color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 14px; margin-bottom: 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cm-title-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,125,224,0.12); background: var(--card); }

/* ---------- 课时页移动端 ---------- */
@media (max-width: 720px) {
  .lesson { padding: 22px 18px 28px; border-radius: 6px; }
  .lesson-title { font-size: 22px; }
  .lesson-body { font-size: 15px; }
  .lesson-list { grid-template-columns: 1fr; }
  .b-keypoint, .b-tip, .b-warn, .b-example, .b-reading { padding-left: 40px; }
}

/* ============================================================
 * 深色模式
 * ============================================================ */
body.theme-dark {
  --bg: #0f1117;
  --bg-2: #1a1d26;
  --card: #1a1d26;
  --text: #e5e7eb;
  --text-2: #9ca3af;
  --text-3: #6b7280;
  --line: #2a2f3a;
  --line-2: #232831;
  --primary: #7c9aed;
  --primary-dark: #5b7ad8;
  --accent: #b888e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.4);
  --text-1: #e5e7eb;
  --bg-1: #232831;
  --bd-1: #2a2f3a;
  --bd-2: #2a2f3a;
  background: var(--bg);
  color: var(--text);
}
body.theme-dark .topbar { background: rgba(20, 22, 30, 0.85); border-bottom-color: var(--line); }
body.theme-dark .sidebar { background: #15171f; border-right-color: var(--line); }
body.theme-dark .sidebar::-webkit-scrollbar-thumb { background: #2a2f3a; }
body.theme-dark .sb-subj-head:hover { background: #232831; }
body.theme-dark .sb-subj-nav:hover { background: #232831; }
body.theme-dark .sb-arrow:hover { background: rgba(124, 154, 237, 0.18); }
body.theme-dark .sb-vol:hover { background: #232831; }
body.theme-dark .sb-func { color: var(--text-2); }
body.theme-dark .sb-func:hover { background: #232831; color: var(--text); }
body.theme-dark .main { color: var(--text); }
body.theme-dark .hero { background: linear-gradient(135deg, #1a1d26 0%, #232831 100%); }
body.theme-dark .hero::before { background: radial-gradient(ellipse at top right, rgba(124, 154, 237, 0.15), transparent 60%); }
body.theme-dark .hero h1 { color: #f3f4f6; }
body.theme-dark .hero-sub { color: var(--text-2); }
body.theme-dark .feature-pill { background: #1a1d26; border-color: var(--line); color: var(--text-2); }
body.theme-dark .stat-card,
body.theme-dark .checkin,
body.theme-dark .subject-card,
body.theme-dark .volume-card,
body.theme-dark .lesson,
body.theme-dark .bank-stats-strip,
body.theme-dark .bank-entry,
body.theme-dark .bank-subj-card,
body.theme-dark .bank-recent-item,
body.theme-dark .quiz-card,
body.theme-dark .wrongbook-card,
body.theme-dark .continue-card,
body.theme-dark .psc-card,
body.theme-dark .home-card,
body.theme-dark .modal-card,
body.theme-dark .auth-card,
body.theme-dark .auth-user-menu,
body.theme-dark .profile-card,
body.theme-dark .cm-form-card,
body.theme-dark .cm-card,
body.theme-dark .cm-stats { background: var(--card); border-color: var(--line); }
body.theme-dark .cm-stats { background: #15171f; }
body.theme-dark .cm-textarea { background: #15171f; }
body.theme-dark .cm-textarea:focus { background: var(--card); }
body.theme-dark .cm-card-tag { background: rgba(124, 154, 237, 0.15); color: var(--primary); }
body.theme-dark .cm-card-tag-anon { background: var(--line); color: var(--text-2); }
body.theme-dark .stat-num,
body.theme-dark .checkin-title,
body.theme-dark .volume-name,
body.theme-dark .lesson-title,
body.theme-dark .bss-num,
body.theme-dark .be-title,
body.theme-dark .bsc-name,
body.theme-dark .bri-q,
body.theme-dark .home-section-title { color: var(--text); }
body.theme-dark .stat-label,
body.theme-dark .volume-desc,
body.theme-dark .lesson-meta,
body.theme-dark .bss-lbl,
body.theme-dark .be-sub,
body.theme-dark .bsc-count,
body.theme-dark .bri-meta,
body.theme-dark .bri-time,
body.theme-dark .bsc-cats span,
body.theme-dark .home-section-sub { color: var(--text-2); }
body.theme-dark .bss-item.has-divider::after { background: var(--line); }
body.theme-dark .be-num,
body.theme-dark .bsc-count,
body.theme-dark .bri-type { background: var(--bg-2); color: var(--text-2); }
body.theme-dark .theme-toggle {
  background: transparent;
  color: var(--text);
}
body.theme-dark .auth-user-btn { background: #232831; border-color: var(--line); color: var(--text); }
body.theme-dark .auth-avatar { background: linear-gradient(135deg, #2a2f3a 0%, #1a1d26 100%); }
body.theme-dark .auth-nickname { color: var(--text) !important; }
body.theme-dark .auth-btn { color: #fff; }
body.theme-dark .auth-btn-primary { color: #fff; }
body.theme-dark .auth-close { color: var(--text-2); }
body.theme-dark .auth-field input,
body.theme-dark .auth-field textarea { background: #15171f; border-color: var(--line); color: var(--text); }
body.theme-dark .quiz-q { color: var(--text); }
body.theme-dark .quiz-opts label { background: #15171f; border-color: var(--line); color: var(--text); }
body.theme-dark .quiz-opts label:hover { background: #1f232c; }
body.theme-dark .quiz-opt-num { color: var(--text-2); }
body.theme-dark .quiz-exp { background: #15171f; border-color: var(--line); }
body.theme-dark .b-keypoint { background: #1a2332; border-color: rgba(124, 154, 237, 0.3); color: var(--text); }
body.theme-dark .b-tip { background: #2a2a1a; border-color: rgba(220, 180, 80, 0.3); color: var(--text); }
body.theme-dark .b-warn { background: #2a1f1f; border-color: rgba(220, 100, 100, 0.3); color: var(--text); }
body.theme-dark .b-example { background: #1a2a1f; border-color: rgba(100, 200, 130, 0.3); color: var(--text); }
body.theme-dark .b-reading { background: #1a2332; border-color: rgba(124, 154, 237, 0.3); color: var(--text); }
body.theme-dark .lesson-pill { background: #15171f; border-color: var(--line); color: var(--text); }
body.theme-dark .lesson-pill:hover { background: #1f232c; }
body.theme-dark .footer { background: #15171f; border-top-color: var(--line); color: var(--text-2); }
body.theme-dark .nav-btn { color: var(--text-2); }
body.theme-dark .nav-btn:hover { background: #232831; }
body.theme-dark .nav-btn.active { color: var(--primary); }
body.theme-dark .sidebar-toggle { background: #232831; border-color: var(--line); color: var(--text); }
body.theme-dark .to-top { background: var(--primary); }
body.theme-dark .week-bar { fill: var(--line-2); }
body.theme-dark .week-bar.is-active { fill: url(#weekBarGrad); }
body.theme-dark .week-grid { stroke: var(--line); }
body.theme-dark .week-grid.is-base { stroke: var(--line-2); }
body.theme-dark .week-line { stroke: #fbbf24; filter: drop-shadow(0 1px 2px rgba(251, 191, 36, .3)); }
body.theme-dark .week-dot { fill: var(--bg-2); stroke: #fbbf24; }
body.theme-dark .week-dot.is-active { fill: #fbbf24; }
body.theme-dark .week-tip { background: rgba(20, 24, 32, .98); }
body.theme-dark .week-tip::after { border-top-color: rgba(20, 24, 32, .98); }
body.theme-dark .wl-line::after { box-shadow: 0 0 0 2px var(--card); }
body.theme-dark .week-hover:hover { fill: rgba(124, 154, 237, .14) !important; }
body.theme-dark .week-y-l { fill: #7c9aed; }
body.theme-dark .week-y-r { fill: #fbbf24; }
body.theme-dark .week-y-title-l { fill: #7c9aed; }
body.theme-dark .week-y-title-r { fill: #fbbf24; }
body.theme-dark .modal-mask { background: rgba(0, 0, 0, 0.6); }
body.theme-dark select, body.theme-dark input, body.theme-dark textarea { background: #15171f; color: var(--text); border-color: var(--line); }
body.theme-dark .quiz-wrongbook-note { background: #2a1f1f; border-color: rgba(220, 100, 100, 0.3); }
body.theme-dark .continue-card { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }
body.theme-dark .checkin-btn { color: #fff; }
body.theme-dark .psc-card { background: var(--card); }
body.theme-dark .pdiff-row { color: var(--text); }
body.theme-dark .vol-progress-bar { background: var(--line-2); }
body.theme-dark .auth-user-menu { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5); }
body.theme-dark .auth-menu-item { color: var(--text); }
body.theme-dark .auth-menu-item:hover { background: #232831; }
body.theme-dark .auth-menu-item.danger { color: #f87171; }
body.theme-dark .auth-user-handle { color: var(--text-2); }
body.theme-dark .modal-mask { background: rgba(0, 0, 0, 0.65); }
body.theme-dark .cc-eyebrow { color: var(--primary); }
body.theme-dark .cc-meta { color: var(--text-2); }
body.theme-dark .cc-go { color: var(--text); }
body.theme-dark .lesson { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }

/* ---- 首页 Hero / 标签 / 按钮 ---- */
body.theme-dark .hero-chip { background: rgba(35, 40, 49, 0.7); color: var(--text); border-color: var(--line); }
body.theme-dark .home-refresh { background: #232831; color: var(--text-2); border-color: var(--line); }
body.theme-dark .home-refresh:hover { background: #2a2f3a; color: var(--primary); }
body.theme-dark .badge-count { background: #232831; color: var(--primary); }
body.theme-dark .badge-coming { background: #2a2618; color: #d4a64a; }
body.theme-dark .badge-progress-sm { background: #232831; color: var(--primary); }
body.theme-dark .badge-done-sm { background: #14352a; color: #34d399; }
body.theme-dark .volume-card.is-all-done { background: linear-gradient(180deg, #14352a 0%, #1a1d26 60%); border-color: #10b981; }

/* ---- 学习进度页 ---- */
body.theme-dark .prog-ov-card,
body.theme-dark .prog-subj-card,
body.theme-dark .prog-chart-card { background: var(--card); border-color: var(--line); }
body.theme-dark .prog-ov-num { color: var(--text); }
body.theme-dark .prog-ov-label { color: var(--text-2); }

/* ---- 勋章墙 ---- */
body.theme-dark .medal-wall,
body.theme-dark .medal-card { background: var(--card); border-color: var(--line); }
body.theme-dark .medal-name { color: var(--text); }
body.theme-dark .medal-desc { color: var(--text-2); }

/* ---- 登录/注册/设置 Modal 内部控件 ---- */
body.theme-dark .auth-tab.active { background: #232831; color: var(--text); }
body.theme-dark .auth-tab:not(.active) { color: var(--text-2); }
body.theme-dark .auth-field input:focus,
body.theme-dark .auth-field textarea:focus { background: #1f232c; border-color: var(--primary); }
body.theme-dark .profile-avatar-btn { background: #232831; border-color: var(--line); }
body.theme-dark .profile-avatar-btn:hover { background: #2a2f3a; }
body.theme-dark .btn-danger { background: #2a1f1f; color: #f87171; border-color: rgba(220, 100, 100, 0.4); }
body.theme-dark .btn-danger:hover { background: #3a1f1f; }
body.theme-dark .btn-plain { background: #232831; color: var(--text); border-color: var(--line); }
body.theme-dark .btn-plain:hover { background: #2a2f3a; }
body.theme-dark .auth-menu-item.danger:hover { background: #2a1f1f; }

/* ---- 题目选项 / 错题本 ---- */
body.theme-dark .opt { background: var(--card); border-color: var(--line); color: var(--text); }
body.theme-dark .opt:hover { background: #232831; }
body.theme-dark .opt.sel { background: rgba(124, 154, 237, 0.18); border-color: var(--primary); }
body.theme-dark .opt-key { background: #232831; color: var(--text-2); }
body.theme-dark .opt.is-correct-opt { background: rgba(16, 185, 129, 0.18) !important; border-color: #10b981 !important; color: var(--text) !important; }
body.theme-dark .opt.is-wrong-opt { background: rgba(239, 68, 68, 0.18) !important; border-color: #ef4444 !important; color: var(--text) !important; }
body.theme-dark .quiz-fav { background: #232831; border-color: var(--line); color: var(--text-2); }
body.theme-dark .quiz-fav:hover { background: #2a2f3a; }
body.theme-dark .quiz-fav.is-fav { background: rgba(220, 180, 80, 0.18); color: #fbbf24; }
body.theme-dark .wrong-remove { background: #2a1f1f; color: #f87171; }
body.theme-dark .wrong-remove:hover { background: #3a1f1f; }
body.theme-dark .wrong-clear-btn:hover { background: #2a1f1f !important; }
body.theme-dark .wrong-go { background: #232831; color: var(--primary); border-color: var(--line); }
body.theme-dark .qc-val.mine { background: rgba(239, 68, 68, 0.18); color: #f87171; }
body.theme-dark .qc-val.right { background: rgba(16, 185, 129, 0.18); color: #34d399; }
body.theme-dark .quiz-exp-body,
body.theme-dark .quiz-exp > div:last-child { color: var(--text); }
body.theme-dark .bank-q-opts { color: var(--text-2); }

/* ---- 课时详情 / 圆圈 / 阅读按钮 ---- */
body.theme-dark .lesson-pill.is-done { background: #14352a; border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
body.theme-dark .lr-circle { background: #232831; border-color: var(--line); color: var(--text-2); }
body.theme-dark .lr-circle.is-done { background: #14352a; border-color: #10b981; color: #34d399; }
body.theme-dark .read-toggle { background: #232831; border-color: var(--line); color: var(--primary); }
body.theme-dark .read-toggle:hover { background: #2a2f3a; }

/* ---- 一些可能漏掉的容器 ---- */
body.theme-dark .quote-bar,
body.theme-dark .footer,
body.theme-dark .checkin,
body.theme-dark .home-card { background: var(--card); border-color: var(--line); }
body.theme-dark .stat-num,
body.theme-dark .checkin-title { color: var(--text); }
body.theme-dark .stat-label,
body.theme-dark .checkin-sub { color: var(--text-2); }
body.theme-dark .auth-card { background: var(--card); border-color: var(--line); }
body.theme-dark .auth-close { color: var(--text-2); }
body.theme-dark select,
body.theme-dark input,
body.theme-dark textarea { background: #15171f; color: var(--text); border-color: var(--line); }
body.theme-dark .modal-card { background: var(--card); border-color: var(--line); }

/* 平滑切换动画 */
body, .topbar, .sidebar, .card, .hero, .subject-card, .volume-card, .lesson,
.stat-card, .checkin, .bank-hero, .bank-stat, .bank-mode, .quiz-card,
.wrongbook-card, .continue-card, .psc-card, .auth-card, .modal-card,
.auth-user-menu, .theme-toggle, .auth-user-btn, .cm-card, .cm-form-card, .cm-stats {
  transition: background-color .25s, color .25s, border-color .25s, box-shadow .25s;
}

/* ============================================================
 * 新题库UI设计样式
 * ============================================================ */

/* ---------- 题库标签页导航 ---------- */
.bank-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  position: relative;
}
.bank-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
}
.bank-tab:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, transparent);
}
.bank-tab.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: var(--line);
}
.bank-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}
.bank-tab .bt-icon {
  font-size: 16px;
  line-height: 1;
}
.bank-tab .bt-text {
  font-size: 14px;
  font-weight: 600;
}
.bank-tab .bt-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  margin-left: 4px;
  line-height: 1.2;
}
.bank-tab .bt-badge.red {
  background: #ef4444;
}

/* ---------- 题库新设计容器 ---------- */
.bank-new-design {
  background: var(--card);
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}

/* ---------- 欢迎区域 ---------- */
.bank-welcome {
  background: linear-gradient(135deg, rgba(74, 125, 224, 0.08) 0%, rgba(156, 86, 212, 0.08) 100%);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 28px;
  border: 1px solid rgba(74, 125, 224, 0.15);
  position: relative;
  overflow: hidden;
}
.bank-welcome::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(156, 86, 212, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.bank-welcome-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bank-welcome-title .emoji {
  font-size: 28px;
}
.bank-welcome-subtitle {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ---------- 数据统计卡片网格 ---------- */
.bank-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--sc, var(--primary));
  opacity: 0.8;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sc, var(--primary));
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--sc, var(--primary)) 12%, #fff);
  color: var(--sc, var(--primary));
}
.stat-content {
  flex: 1;
  min-width: 0;
}
.stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.stat-trend {
  font-size: 11px;
  color: #10b981;
  font-weight: 600;
  margin-top: 2px;
}

/* ---------- 快速入口卡片 ---------- */
.bank-quick-entry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.bqe-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.bqe-card::after {
  content: '→';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-3);
  transition: all 0.25s;
  opacity: 0;
}
.bqe-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sc, var(--primary));
}
.bqe-card:hover::after {
  opacity: 1;
  right: 16px;
  color: var(--sc, var(--primary));
}
.bqe-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--sc, var(--primary)) 0%, color-mix(in srgb, var(--sc, var(--primary)) 70%, #fff) 100%);
  color: white;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--sc, var(--primary)) 30%, transparent);
}
.bqe-content {
  flex: 1;
  min-width: 0;
}
.bqe-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.bqe-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ---------- 错题本新样式 ---------- */
.wrong-header-new {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(249, 115, 22, 0.08) 100%);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 24px;
  border: 1px solid rgba(239, 68, 68, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.whn-content {
  flex: 1;
  min-width: 0;
}
.whn-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.whn-subtitle {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.whn-stats {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}
.whn-stat {
  text-align: center;
}
.whs-number {
  font-size: 32px;
  font-weight: 800;
  color: #ef4444;
  line-height: 1;
  margin-bottom: 4px;
}
.whs-label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

/* 错题本操作栏 */
.wrong-toolbar-new {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}
.wrong-toolbar-new .btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(74, 125, 224, 0.3);
}
.wrong-toolbar-new .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 125, 224, 0.4);
}
.wrong-toolbar-new .btn-danger {
  background: white;
  color: #ef4444;
  border: 1px solid #ef4444;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.wrong-toolbar-new .btn-danger:hover {
  background: #ef4444;
  color: white;
}

/* 错题列表 */
.wrong-list-new {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wrong-card-new {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  position: relative;
  transition: all 0.25s;
  border-left: 4px solid #ef4444;
}
.wrong-card-new:hover {
  box-shadow: var(--shadow-md);
  border-color: #ef4444;
  transform: translateX(2px);
}
.wcn-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.wcn-remove:hover {
  color: #ef4444;
  border-color: #ef4444;
  background: #fef2f2;
}
.wcn-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.wcn-fav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  transition: all .15s ease;
}
.wcn-fav-btn:hover { border-color: #f59e0b; color: #d97706; }
.wcn-fav-btn.is-fav { background: #fff8e8; border-color: #f59e0b; color: #d97706; }
body.theme-dark .wcn-fav-btn { background: var(--bg-2); }
body.theme-dark .wcn-fav-btn.is-fav { background: rgba(220, 180, 80, .18); color: #fbbf24; }
.wcn-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 12px;
  padding-right: 40px;
}
.wcn-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.wcn-subject {
  background: color-mix(in srgb, var(--sc, var(--primary)) 10%, #fff);
  color: var(--sc, var(--primary));
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.wcn-lesson {
  color: var(--text-2);
}
.wcn-answer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 6px;
}
.wcn-label {
  color: var(--text-2);
  font-weight: 500;
}
.wcn-value {
  color: #10b981;
  font-weight: 700;
}
.wcn-value.wrong {
  color: #ef4444;
  text-decoration: line-through;
}
.wcn-my-answer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.wrong-redo-btn {
  margin-top: 12px;
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.wrong-redo-btn:hover {
  background: var(--primary);
  color: white;
}

/* 空状态 */
.empty-state-new {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}
.esn-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.6;
}
.empty-state-new h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state-new p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ---------- 深色模式适配 ---------- */
body.theme-dark .bank-tabs {
  border-bottom-color: var(--line);
}
body.theme-dark .bank-tab {
  color: var(--text-2);
}
body.theme-dark .bank-tab:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
body.theme-dark .bank-tab.active {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  border-color: var(--line);
}
body.theme-dark .bank-new-design {
  background: var(--card);
  border-color: var(--line);
}
body.theme-dark .bank-welcome {
  background: linear-gradient(135deg, rgba(74, 125, 224, 0.12) 0%, rgba(156, 86, 212, 0.12) 100%);
  border-color: rgba(74, 125, 224, 0.2);
}
body.theme-dark .stat-card {
  background: var(--card);
  border-color: var(--line);
}
body.theme-dark .stat-card:hover {
  border-color: var(--sc, var(--primary));
}
body.theme-dark .stat-icon {
  background: color-mix(in srgb, var(--sc, var(--primary)) 20%, var(--bg-2));
}
body.theme-dark .stat-number {
  color: var(--text);
}
body.theme-dark .bqe-card {
  background: var(--card);
  border-color: var(--line);
}
body.theme-dark .bqe-card:hover {
  border-color: var(--sc, var(--primary));
}
body.theme-dark .wrong-header-new {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(249, 115, 22, 0.12) 100%);
  border-color: rgba(239, 68, 68, 0.2);
}
body.theme-dark .wrong-card-new {
  background: var(--card);
  border-color: var(--line);
}
body.theme-dark .wrong-card-new:hover {
  border-color: #ef4444;
}
body.theme-dark .wcn-remove {
  background: var(--bg-2);
  border-color: var(--line);
  color: var(--text-2);
}
body.theme-dark .wcn-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
body.theme-dark .wrong-redo-btn {
  background: var(--bg-2);
  border-color: var(--primary);
  color: var(--primary);
}
body.theme-dark .wrong-redo-btn:hover {
  background: var(--primary);
  color: white;
}
body.theme-dark .wcn-subject {
  background: color-mix(in srgb, var(--sc, var(--primary)) 20%, var(--bg-2));
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 768px) {
  .bank-tabs {
    flex-wrap: wrap;
    gap: 2px;
  }
  .bank-tab {
    padding: 8px 12px;
    font-size: 13px;
  }
  .bank-tab .bt-text {
    font-size: 13px;
  }
  .bank-new-design {
    padding: 20px 16px;
  }
  .bank-welcome {
    padding: 20px;
  }
  .bank-welcome-title {
    font-size: 20px;
  }
  .bank-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-number {
    font-size: 24px;
  }
  .bank-quick-entry {
    grid-template-columns: 1fr;
  }
  .wrong-header-new {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .whn-stats {
    width: 100%;
    justify-content: space-around;
  }
  .wrong-toolbar-new {
    flex-wrap: wrap;
  }
  .wrong-toolbar-new button {
    flex: 1;
    min-width: 120px;
  }
}

/* ============================================================
 * 精致版题库首页设计
 * ============================================================ */

/* ---------- 精致版题库容器 ---------- */
.bank-refined-design {
  background: var(--card);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}

/* ---------- 精致版Hero区域 ---------- */
/* ---------- 题库模块共用背景板 ---------- */
/* 题库固定视口背景层：由 app.js 注入/移除，比例以 viewport 为准，各子页面一致 */
#bank-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
body.bank-view .main {
  position: relative;
  z-index: 1;
  background: transparent;
}
body.theme-dark.bank-view .main {
  background: transparent;
}

.bank-hero-refined {
  position: relative;
  background: linear-gradient(135deg, rgba(74, 125, 224, 0.08) 0%, rgba(156, 86, 212, 0.08) 100%);
  border-radius: 16px;
  padding: 36px 40px;
  margin-bottom: 32px;
  border: 1px solid rgba(74, 125, 224, 0.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 40px;
}
body.bank-view .bank-hero-refined {
  /* hero 透明，让 .main 顶部的背景图透出来 */
  background: transparent;
  border-color: rgba(74, 125, 224, 0.18);
  box-shadow: 0 8px 32px rgba(74, 125, 224, 0.08);
}
body.theme-dark.bank-view .bank-hero-refined {
  background: transparent;
  border-color: rgba(74, 125, 224, 0.22);
}
body.bank-view .bhr-circle { display: none; }
.bhr-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.bhr-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
}
.bhr-circle.c1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(74, 125, 224, 0.3) 0%, transparent 70%);
  top: -100px;
  right: -50px;
  animation: float 20s ease-in-out infinite;
}
.bhr-circle.c2 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(156, 86, 212, 0.3) 0%, transparent 70%);
  bottom: -80px;
  left: -60px;
  animation: float 25s ease-in-out infinite reverse;
}
.bhr-circle.c3 {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  animation: float 18s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.1); }
}
.bhr-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.bhr-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid rgba(74, 125, 224, 0.2);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(74, 125, 224, 0.1);
}
.bhr-badge-icon {
  font-size: 16px;
}
.bhr-badge-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.bhr-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.2;
  text-shadow: 0 1px 16px rgba(255, 255, 255, 0.75);
}
.bhr-subtitle {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 20px;
}
.bhr-stats-mini {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 14px 20px;
  width: fit-content;
}
.bsm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bsm-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.bsm-label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.bsm-divider {
  width: 1px;
  height: 32px;
  background: rgba(74, 125, 224, 0.2);
}
.bhr-illustration {
  flex-shrink: 0;
  width: 240px;
  height: 200px;
  position: relative;
  z-index: 1;
}
.bhr-illustration svg {
  width: 100%;
  height: 100%;
}

/* ---------- 精致版统计卡片 ---------- */
.bank-stats-refined {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.bsr-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.bsr-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-color);
  opacity: 0;
  transition: opacity 0.3s;
}
.bsr-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--card-color);
}
.bsr-card:hover::before {
  opacity: 1;
}
.bsr-card.fav {
  --card-color: #f59e0b;
}
.bsr-card.done {
  --card-color: #10b981;
}
.bsr-card.wrong {
  --card-color: #ef4444;
}
.bsr-card.streak {
  --card-color: #9c56d4;
}
.bsr-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--card-color) 12%, #fff);
  color: var(--card-color);
  transition: all 0.3s;
}
.bsr-card:hover .bsr-icon-wrap {
  transform: scale(1.1) rotate(5deg);
}
.bsr-icon {
  width: 24px;
  height: 24px;
}
.bsr-content {
  flex: 1;
  min-width: 0;
}
.bsr-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.bsr-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.bsr-trend {
  font-size: 11px;
  font-weight: 600;
  color: var(--card-color);
  background: color-mix(in srgb, var(--card-color) 10%, #fff);
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ---------- 精致版快速入口 ---------- */
.bank-entries-refined {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.ber-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.ber-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--entry-color) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.ber-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--entry-color);
}
.ber-card:hover::before {
  opacity: 0.05;
}
.ber-card.fav {
  --entry-color: #f59e0b;
}
.ber-card.common {
  --entry-color: #4a7de0;
}
.ber-card.wrong {
  --entry-color: #ef4444;
}
.ber-icon-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  z-index: 1;
}
.ber-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, var(--entry-color) 0%, color-mix(in srgb, var(--entry-color) 70%, #fff) 100%);
  color: white;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--entry-color) 30%, transparent);
  transition: all 0.3s;
}
.ber-icon-ring {
  position: absolute;
  inset: -4px;
  border: 2px solid var(--entry-color);
  border-radius: 18px;
  opacity: 0;
  transition: all 0.3s;
}
.ber-card:hover .ber-icon {
  transform: scale(1.05);
}
.ber-card:hover .ber-icon-ring {
  opacity: 0.3;
  inset: -6px;
}
.ber-content {
  flex: 1;
  min-width: 0;
  z-index: 1;
}
.ber-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.ber-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 10px;
}
.ber-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ber-count {
  font-size: 20px;
  font-weight: 800;
  color: var(--entry-color);
  line-height: 1;
}
.ber-unit {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.ber-arrow {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--entry-color) 10%, #fff);
  color: var(--entry-color);
  flex-shrink: 0;
  z-index: 1;
  transition: all 0.3s;
}
.ber-arrow svg {
  width: 18px;
  height: 18px;
}
.ber-card:hover .ber-arrow {
  background: var(--entry-color);
  color: white;
  transform: translateX(4px);
}

/* ---------- 精致版区块标题 ---------- */
.bank-section-refined {
  margin-bottom: 32px;
}
.bsr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.bsr-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.bsr-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.bsr-subtitle {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.bsr-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
}
.bsr-more:hover {
  gap: 10px;
}
.bsr-more svg {
  width: 14px;
  height: 14px;
}

/* ---------- 精致版学科网格 ---------- */
.bank-subj-refined {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.bsr-card-subj {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.bsr-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--sc) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.bsr-card-subj:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sc);
}
.bsr-card-subj:hover .bsr-card-bg {
  opacity: 0.05;
}
.bsr-card-content {
  position: relative;
  padding: 20px;
  z-index: 1;
}
.bsr-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.bsr-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}
.bsr-card-subj:hover .bsr-card-icon-wrap {
  transform: scale(1.1);
}
.bsr-card-icon {
  font-size: 22px;
}
.bsr-card-info {
  flex: 1;
  min-width: 0;
}
.bsr-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.bsr-card-count {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.bsr-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bsr-card-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.bsr-card-subj:hover .bsr-card-tag {
  background: color-mix(in srgb, var(--sc) 10%, #fff);
  color: var(--sc);
}
.bsr-card-tag.more {
  color: var(--sc);
  background: color-mix(in srgb, var(--sc) 10%, #fff);
}

/* ---------- 精致版时间线 ---------- */
.bank-timeline-refined {
  position: relative;
  padding-left: 24px;
}
.btr-item {
  position: relative;
  padding-bottom: 20px;
  padding-left: 20px;
}
.btr-item:last-child {
  padding-bottom: 0;
}
.btr-line {
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--sc) 0%, rgba(74, 125, 224, 0.2) 100%);
}
.btr-item:last-child .btr-line {
  display: none;
}
.btr-dot {
  position: absolute;
  left: -5px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sc);
  border: 2px solid white;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 20%, transparent);
}
.btr-content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.3s;
}
.btr-content:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--sc);
}
.btr-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.btr-icon {
  font-size: 14px;
}
.btr-subject {
  font-weight: 600;
  color: var(--sc);
}
.btr-vol {
  color: var(--text-2);
}
.btr-type {
  color: var(--text-2);
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 4px;
  font-weight: 500;
}
.btr-question {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 6px;
}
.btr-time {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

/* ---------- 深色模式适配 ---------- */
body.theme-dark .bank-refined-design {
  background: var(--card);
  border-color: var(--line);
}
body.theme-dark .bank-hero-refined {
  background: linear-gradient(135deg, rgba(74, 125, 224, 0.12) 0%, rgba(156, 86, 212, 0.12) 100%);
  border-color: rgba(74, 125, 224, 0.2);
}
body.theme-dark.bank-view .bank-hero-refined {
  background: transparent;
}
body.theme-dark .bhr-badge {
  background: var(--bg-2);
  border-color: rgba(74, 125, 224, 0.3);
}
body.theme-dark .bhr-stats-mini {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.1);
}
body.theme-dark .bsr-card {
  background: var(--card);
  border-color: var(--line);
}
body.theme-dark .bsr-card:hover {
  border-color: var(--card-color);
}
body.theme-dark .bsr-icon-wrap {
  background: color-mix(in srgb, var(--card-color) 20%, var(--bg-2));
}
body.theme-dark .bsr-trend {
  background: color-mix(in srgb, var(--card-color) 20%, var(--bg-2));
}
body.theme-dark .ber-card {
  background: var(--card);
  border-color: var(--line);
}
body.theme-dark .ber-card:hover {
  border-color: var(--entry-color);
}
body.theme-dark .ber-arrow {
  background: color-mix(in srgb, var(--entry-color) 20%, var(--bg-2));
}
body.theme-dark .ber-card:hover .ber-arrow {
  background: var(--entry-color);
}
body.theme-dark .bsr-card-subj {
  background: var(--card);
  border-color: var(--line);
}
body.theme-dark .bsr-card-subj:hover {
  border-color: var(--sc);
}
body.theme-dark .bsr-card-icon-wrap {
  background: color-mix(in srgb, var(--sc) 20%, var(--bg-2));
}
body.theme-dark .bsr-card-tag {
  background: var(--bg-2);
}
body.theme-dark .bsr-card-subj:hover .bsr-card-tag {
  background: color-mix(in srgb, var(--sc) 20%, var(--bg-2));
}
body.theme-dark .btr-content {
  background: var(--card);
  border-color: var(--line);
}
body.theme-dark .btr-content:hover {
  border-color: var(--sc);
}
body.theme-dark .btr-dot {
  border-color: var(--card);
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 768px) {
  .bank-refined-design {
    padding: 20px 16px;
  }
  .bank-hero-refined {
    flex-direction: column;
    padding: 24px 20px;
    gap: 24px;
  }
  .bhr-title {
    font-size: 24px;
  }
  .bhr-illustration {
    width: 180px;
    height: 150px;
  }
  .bhr-stats-mini {
    width: 100%;
    justify-content: space-around;
  }
  .bank-stats-refined {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }
  .bsr-card {
    padding: 16px;
  }
  .bsr-number {
    font-size: 22px;
  }
  .bank-entries-refined {
    grid-template-columns: 1fr;
  }
  .ber-card {
    padding: 18px;
  }
  .bank-subj-refined {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  /* 私信在平板/大屏手机也全屏，避免聊天框被挤没 */
  .mc-modal .mc-card { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .mc-body { flex-direction: column; }
  .mc-side { width: 100%; flex-direction: row; padding: 6px 8px; gap: 6px; border-right: none; border-bottom: 1px solid #ebedf0; flex-shrink: 0; }
  .mc-nav { width: auto; flex: 1; flex-direction: row; justify-content: center; padding: 10px 8px; }
  .mc-nav .mc-badge { position: static; margin-left: 6px; }
  .mc-main { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
  .mc-list, .mc-disc-list { flex: 1; min-height: 0; overflow: auto; }
  .mc-dm { flex: 1; min-height: 0; flex-direction: column; }
  .mc-conv-list { width: 100%; max-height: 32vh; flex-shrink: 0; border-right: none; border-bottom: 1px solid #ebedf0; }
  .mc-chat { flex: 1; min-height: 0; }
  .mc-chat-body { flex: 1; min-height: 0; overflow: auto; }
  .mc-chat-input { flex-shrink: 0; }
  .mc-chat-input input { font-size: 16px; }
}

/* ===== 头像图片（data:image）通用裁切 ===== */
  .ua-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
  .auth-avatar img.ua-img, .auth-avatar-lg img.ua-img, .profile-avatar-big img.ua-img,
  .ds-reply-avatar img.ua-img, .mc-conv-av img.ua-img, .mc-chat-av img.ua-img,
  .mc-disc-av img.ua-img, .up-avatar img.ua-img, .account-avatar-lg img.ua-img,
  .cm-form-avatar img.ua-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
  .clickable { cursor: pointer; transition: color .12s; }
  .clickable:hover { color: var(--primary); text-decoration: underline; }

  /* ===== 顶栏铃铛（洛谷风格） ===== */
  .topbar-bell {
    position: relative; margin: 0 4px 0 2px;
    width: 36px; height: 36px; border-radius: 8px;
    border: none; background: transparent; color: var(--text-2);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
  }
  .topbar-bell .bell-svg { width: 20px; height: 20px; display: block; }
  .topbar-bell:hover { background: #eef0f3; color: var(--primary); }
  .bell-badge {
    position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
    background: #f5483b; color: #fff; border-radius: 999px; font-size: 10px; line-height: 16px;
    text-align: center; font-weight: 600; box-shadow: 0 0 0 2px #fff;
  }

  /* ===== 消息中心 modal（洛谷风格） ===== */
  .mc-modal .mc-mask { position: absolute; inset: 0; z-index: 0; background: rgba(0,0,0,.45); }
  .mc-modal .mc-card {
    position: relative; z-index: 5;
    /* 微信 PC 那种三栏：窄导航条 | 会话列表 | 聊天区，整体固定高、内部各自滚动 */
    width: 980px; max-width: 96vw; height: 660px; max-height: 88vh;
    background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
    display: flex; flex-direction: column; overflow: hidden; color: #1f2329;
  }
  .mc-head {
    height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px; border-bottom: 1px solid #ebedf0; background: #fff;
  }
  .mc-head-title { font-size: 16px; font-weight: 700; color: #1f2329; }
  .mc-close {
    width: 28px; height: 28px; border: none; background: transparent; color: #8a919f; font-size: 22px;
    line-height: 1; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  .mc-close:hover { background: #f2f3f5; color: #1f2329; }
  .mc-body { flex: 1; display: flex; min-height: 0; }
  .mc-side {
    width: 62px; flex-shrink: 0; background: #f7f8fa; border-right: 1px solid #ebedf0;
    padding: 10px 6px; display: flex; flex-direction: column; gap: 6px;
  }
  .mc-nav {
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px;
    width: 100%; text-align: center; position: relative;
    padding: 9px 2px; border: none; background: transparent; border-radius: 8px;
    font-size: 11px; color: #4e5969; cursor: pointer; transition: background .12s, color .12s;
  }
  .mc-nav:hover { background: #eef0f3; }
  .mc-nav.active { background: #e8f3ff; color: #2080f0; font-weight: 600; }
  .mc-nav-ic { font-size: 19px; line-height: 1; }
  .mc-badge {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: #f5483b; color: #fff; font-size: 11px; line-height: 18px; text-align: center;
  }
  /* 竖排导航里未读数挂到右上角，不占一行 */
  .mc-nav .mc-badge { position: absolute; top: 2px; right: 5px; margin-left: 0; }
  /* ⚠️ 主区必须 overflow:hidden：让它自己滚动的话，消息一多整页往下顶，
     变成「消息一直往下翻」，聊天区内部滚动才是对的。 */
  .mc-main { flex: 1; min-width: 0; min-height: 0; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
  .mc-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; padding: 30px; color: #8a919f; }
  .mc-empty-ic { font-size: 40px; }
  .mc-empty-txt { font-size: 14px; }
  .mc-empty.small { height: auto; padding: 24px; }
  .mc-login-btn { border: none; background: #2080f0; color: #fff; font-size: 14px; font-weight: 600; padding: 9px 22px; border-radius: 8px; cursor: pointer; }
  .mc-login-btn:hover { background: #1a6fd6; }
  .mc-composer { padding: 12px 16px; border-bottom: 1px solid #ebedf0; background: #fafbfc; display: flex; gap: 8px; }
  .mc-composer-input { flex: 1; resize: none; height: 38px; padding: 8px 10px; border: 1px solid #dcdfe6; border-radius: 8px; font-size: 13px; font-family: inherit; }
  .mc-composer-send { padding: 0 16px; border: none; border-radius: 8px; background: #2080f0; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
  .mc-composer-send:hover { background: #1a6fd6; }
  /* 主区改成 overflow:hidden 后，各列表自己必须能滚，否则内容会被裁掉 */
  .mc-list { padding: 8px 0; flex: 1; min-height: 0; overflow-y: auto; }
  .mc-composer { flex-shrink: 0; }
  .mc-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #f2f3f5; }
  .mc-item-av { width: 40px; height: 40px; border-radius: 50%; background: #eef3ff; color: #2080f0; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
  .mc-item-av.official { background: #fff3e8; color: #ff8c2e; }
  .mc-item-body { flex: 1; min-width: 0; }
  .mc-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
  .mc-item-name { font-size: 14px; font-weight: 600; color: #1f2329; }
  .mc-item-time { margin-left: auto; font-size: 12px; color: #a9aeb8; }
  .mc-item-del { margin-left: 8px; border: 1px solid #f0dcd2; background: #fff; color: #c96a4a; font-size: 11px; padding: 1px 7px; border-radius: 4px; cursor: pointer; flex-shrink: 0; }
  .mc-item-del:hover { background: #fff3ee; }
  .mc-tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #fff3e8; color: #ff8c2e; }
  .mc-item-text { font-size: 14px; color: #4e5969; line-height: 1.6; word-break: break-word; }

  /* 好友私信：会话列表 + 聊天 */
  .mc-dm-head { padding: 10px 16px; border-bottom: 1px solid #ebedf0; }
  .mc-discover-btn { border: 1px dashed #2080f0; background: #fff; color: #2080f0; font-size: 13px; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
  .mc-discover-btn:hover { background: #e8f3ff; }
  /* 私信页顶部的云端连通状态条：跨设备看不到私信时，先看这一行 */
  .mc-syncbar { font-size: 12px; line-height: 1.6; padding: 7px 16px; border-bottom: 1px solid #ebedf0; }
  .mc-syncbar.ok { background: #f0f9f2; color: #2c7a4b; }
  .mc-syncbar.warn { background: #fff8e6; color: #a56a00; }
  .mc-syncbar.err { background: #fdeeed; color: #b5382c; }
  .mc-syncbar b { font-weight: 700; }
  .mc-syncbar-btn { margin-left: 8px; border: 1px solid currentColor; background: #fff; color: inherit; font-size: 11px; padding: 2px 9px; border-radius: 6px; cursor: pointer; }
  /* 会话对象不是云端账号时的标记 */
  .mc-conv-local { margin-left: 6px; font-size: 10px; font-weight: 500; padding: 1px 5px; border-radius: 4px; background: #fdeeed; color: #b5382c; }
  .mc-dm { flex: 1; display: flex; min-height: 0; }
  .mc-conv-list { width: 250px; flex-shrink: 0; border-right: 1px solid #ebedf0; overflow-y: auto; }
  .mc-conv {
    width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; padding: 12px 14px;
    border: none; background: transparent; border-bottom: 1px solid #f2f3f5; cursor: pointer; transition: background .12s;
  }
  .mc-conv:hover { background: #f7f8fa; }
  .mc-conv.active { background: #e8f3ff; }
  .mc-conv-av { width: 40px; height: 40px; border-radius: 50%; background: #f2f3f5; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; overflow: hidden; }
  .mc-conv-info { min-width: 0; flex: 1; }
  /* 会话行：上排「昵称 … 时间」，下排「最后一条消息 … 未读红点」——微信 PC 的排布 */
  .mc-conv-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .mc-conv-name { font-size: 14px; font-weight: 600; color: #1f2329; display: flex; align-items: center; gap: 6px; min-width: 0; }
  .mc-conv-nick { font-size: 14px; font-weight: 600; color: #1f2329; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mc-conv-time { margin-left: auto; font-size: 11px; color: #a9aeb8; flex-shrink: 0; }
  .mc-conv-last { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #a9aeb8; }
  .mc-conv-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mc-conv-last .mc-dot { flex-shrink: 0; }
  .mc-dot { width: 8px; height: 8px; border-radius: 50%; background: #f5483b; display: inline-block; }
  .mc-conv-last { font-size: 12px; color: #a9aeb8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 管理员（king）删除聊天记录：会话行 wrapper（button 不能嵌 button） */
  .mc-conv-wrap { display: flex; align-items: stretch; border-bottom: 1px solid #f2f3f5; }
  .mc-conv-wrap.active { background: #e8f3ff; }
  .mc-conv-wrap .mc-conv { flex: 1; min-width: 0; border-bottom: none; background: transparent; }
  .theme-dark .mc-conv-wrap .mc-conv:hover, body.theme-dark .mc-conv-wrap .mc-conv:hover { background: rgba(255,255,255,.06); }
  .mc-conv-del { width: 30px; flex-shrink: 0; border: none; background: transparent; color: #c96a4a; font-size: 14px; cursor: pointer; opacity: 0; transition: opacity .12s; }
  .mc-conv-wrap:hover .mc-conv-del { opacity: 1; }
  .mc-conv-del:hover { background: #fdeeed; }
  .mc-admin-clear { margin-left: 8px; border: 1px solid #f0dcd2; background: #fff; color: #c96a4a; font-size: 13px; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
  .mc-admin-clear:hover { background: #fff3ee; }
  .mc-adm-tip { margin: 0; padding: 8px 16px; font-size: 12px; line-height: 1.6; color: #a56a00; background: #fff8e6; border-bottom: 1px solid #ebedf0; }
  .mc-chat-del { margin-left: auto; border: 1px solid #f0dcd2; background: #fff; color: #c96a4a; font-size: 12px; padding: 4px 10px; border-radius: 6px; cursor: pointer; flex-shrink: 0; }
  .mc-chat-del:hover { background: #fff3ee; }
  .mc-msg-row { display: flex; align-items: center; gap: 6px; max-width: 100%; }
  .mc-msg.me .mc-msg-row { flex-direction: row-reverse; }
  .mc-msg-del { border: none; background: transparent; color: #c96a4a; font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 4px; cursor: pointer; opacity: 0; transition: opacity .12s; flex-shrink: 0; }
  .mc-msg:hover .mc-msg-del { opacity: 1; }
  .mc-msg-del:hover { background: #fdeeed; }
  /* 私信二级密码锁屏 */
  .mc-lock { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px 24px; text-align: center; }
  .mc-lock-ic { font-size: 40px; line-height: 1; }
  .mc-lock-t { font-size: 16px; font-weight: 600; color: #1f2329; }
  .mc-lock-s { font-size: 12.5px; color: #86909c; line-height: 1.6; max-width: 280px; }
  .mc-lock-input { width: 240px; padding: 10px 12px; border: 1px solid #dcdfe6; border-radius: 8px; font-size: 14px; text-align: center; letter-spacing: 2px; }
  .mc-lock-input:focus { outline: none; border-color: #2080f0; }
  .mc-lock-btn { width: 240px; padding: 10px 14px; border: none; border-radius: 8px; background: #2080f0; color: #fff; font-size: 14px; cursor: pointer; }
  .mc-lock-btn:hover { background: #1a6fd6; }
  .mc-lock-btn.ghost { background: #fff; color: #4e5969; border: 1px solid #dcdfe6; }
  .mc-lock-btn.ghost:hover { background: #f7f8fa; }
  .mc-lock-entry { margin-left: 8px; border: 1px solid #dcdfe6; background: #fff; color: #4e5969; font-size: 13px; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
  .mc-lock-entry:hover { background: #f2f7ff; border-color: #2080f0; color: #2080f0; }
  .theme-dark .mc-lock-entry, body.theme-dark .mc-lock-entry { background: #232831; border-color: var(--line); color: var(--text); }
  /* 在线状态：头像右下角小圆点 + 名字后的状态文字 */
  .presence-dot { width: 9px; height: 9px; border-radius: 50%; background: #c9cdd4; display: inline-block; flex-shrink: 0; }
  .presence-dot.on { background: #00b42a; box-shadow: 0 0 0 2px rgba(0,180,42,.18); }
  .mc-conv-av, .mc-chat-av, .mc-disc-av { position: relative; }
  .mc-conv-av .presence-dot, .mc-chat-av .presence-dot, .mc-disc-av .presence-dot { position: absolute; right: 0; bottom: 0; border: 2px solid #fff; }
  .mc-conv-av .presence-dot.on, .mc-chat-av .presence-dot.on, .mc-disc-av .presence-dot.on { border-color: #fff; }
  .presence-text { margin-left: 6px; font-size: 11px; font-weight: 400; color: #a9aeb8; }
  .presence-text.on { color: #00b42a; }
  /* 当前在线汇总条：只靠小圆点看不出来，必须有个明确人数 */
  .mc-pre-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 7px 10px; margin: 6px 0 2px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: #4e5969; }
  .mc-pre-t { font-weight: 600; }
  .mc-pre-t b { color: #00b42a; font-size: 13px; }
  .mc-pre-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .mc-pre-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; background: #fff; border: 1px solid var(--line); border-radius: 999px; line-height: 1; }
  .mc-pre-chip .ua-img { width: 18px; height: 18px; border-radius: 50%; display: block; }
  .mc-pre-chip b { font-weight: 600; font-size: 11.5px; color: #1d2129; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mc-pre-chip.me { background: #eafff0; border-color: #aff0b5; }
  .mc-pre-none { color: #86909c; }
  .mc-pre-hint { margin-left: auto; color: #a9aeb8; font-size: 11px; }
  .theme-dark .mc-pre-bar, body.theme-dark .mc-pre-bar { background: #232831; color: var(--text-2); }
  .theme-dark .mc-pre-chip, body.theme-dark .mc-pre-chip { background: #1f2329; border-color: var(--line); }
  .theme-dark .mc-pre-chip b, body.theme-dark .mc-pre-chip b { color: #e5e6eb; }
  .theme-dark .mc-pre-chip.me, body.theme-dark .mc-pre-chip.me { background: #16341f; border-color: #2c6b3a; }
  .theme-dark .mc-conv-av .presence-dot, body.theme-dark .mc-conv-av .presence-dot,
  .theme-dark .mc-chat-av .presence-dot, body.theme-dark .mc-chat-av .presence-dot,
  .theme-dark .mc-disc-av .presence-dot, body.theme-dark .mc-disc-av .presence-dot { border-color: #1f2329; }
  .mc-lock-msg { min-height: 18px; font-size: 12.5px; color: #d03050; }
  .mc-lock-links { display: flex; gap: 16px; margin-top: 2px; }
  .mc-lock-links a, .mc-lock-link { font-size: 12.5px; color: #86909c; cursor: pointer; }
  .mc-lock-links a:hover, .mc-lock-link:hover { color: #2080f0; }
  .theme-dark .mc-lock-t, body.theme-dark .mc-lock-t { color: #e5e6eb; }
  .theme-dark .mc-lock-input, body.theme-dark .mc-lock-input { background: #171a1f; color: #e5e6eb; border-color: #2a2f37; }
  .mc-chat { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
  .mc-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #ebedf0; font-weight: 600; color: #1f2329; flex-shrink: 0; }
  .mc-chat-av { width: 32px; height: 32px; border-radius: 50%; background: #f2f3f5; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; overflow: hidden; }
  /* 消息区固定高度、内部滚动，永远贴在底部：不再出现「一直往下翻」 */
  .mc-chat-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; background: #f5f6f7; scroll-behavior: auto; }
  .mc-chat-empty { color: #a9aeb8; text-align: center; padding: 30px; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .mc-msg { display: flex; flex-direction: column; max-width: 78%; }
  .mc-msg.them { align-self: flex-start; }
  .mc-msg.me { align-self: flex-end; align-items: flex-end; }
  /* 微信式：头像贴着气泡，我的在右、对方的在左 */
  .mc-msg-line { display: flex; align-items: flex-start; gap: 8px; max-width: 100%; }
  .mc-msg.me .mc-msg-line { flex-direction: row-reverse; }
  .mc-msg-col { display: flex; flex-direction: column; min-width: 0; }
  .mc-msg.me .mc-msg-col { align-items: flex-end; }
  .mc-msg-av { width: 34px; height: 34px; border-radius: 4px; background: #e8eaed; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; overflow: hidden; }
  .mc-msg-av img.ua-img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; }
  /* 时间间隔 > 5 分钟插一条居中时间，跟微信一样，不用每条都挂时间 */
  .mc-msg-sep { align-self: center; font-size: 11px; color: #a9aeb8; background: rgba(0,0,0,.05); padding: 2px 8px; border-radius: 4px; margin: 6px 0 2px; max-width: 78%; }
  .mc-msg-bubble { padding: 9px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-break: break-word; }
  .mc-msg.them .mc-msg-bubble { background: #fff; color: #1f2329; border: 1px solid #ebedf0; border-bottom-left-radius: 4px; }
  .mc-msg.me .mc-msg-bubble { background: #95ec69; color: #1f2329; border: 1px solid #84d95e; border-bottom-right-radius: 4px; }
  .mc-msg-time { font-size: 11px; color: #a9aeb8; margin-top: 3px; }
  .mc-chat-input { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid #ebedf0; background: #f5f6f7; flex-shrink: 0; }
  .mc-chat-input input { flex: 1; padding: 10px 12px; border: 1px solid #dcdfe6; border-radius: 8px; font-size: 14px; background: #fff; }
  .mc-chat-input input:focus { outline: none; border-color: #2080f0; }
  .mc-send { padding: 9px 20px; border: none; border-radius: 8px; background: #2080f0; color: #fff; font-size: 14px; cursor: pointer; }
  .mc-send:hover { background: #1a6fd6; }
  .theme-dark .mc-msg.me .mc-msg-bubble { background: #4b7a34; color: #eafff0; border-color: #5d9440; }
  .theme-dark .mc-msg-sep, body.theme-dark .mc-msg-sep { background: rgba(255,255,255,.08); color: #86909c; }

  /* 发现用户 */
  .mc-disc-head { padding: 12px 16px; font-size: 14px; font-weight: 700; color: #1f2329; border-bottom: 1px solid #ebedf0; }
  .mc-disc-list { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow-y: auto; }
  .mc-disc-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #ebedf0; border-radius: 10px; }
  .mc-disc-av { width: 40px; height: 40px; border-radius: 50%; background: #f2f3f5; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; overflow: hidden; }
  .mc-disc-info { flex: 1; min-width: 0; }
  .mc-disc-name { font-size: 14px; font-weight: 600; color: #1f2329; }
  .mc-disc-handle { font-size: 12px; color: #a9aeb8; }
  .mc-disc-actions { display: flex; gap: 6px; }
  .mc-mini { padding: 6px 14px; border: 1px solid #dcdfe6; border-radius: 999px; background: #fff; color: #4e5969; font-size: 13px; cursor: pointer; transition: all .12s; }
  .mc-mini:hover { border-color: #2080f0; color: #2080f0; }
  .mc-mini.primary { background: #2080f0; color: #fff; border-color: transparent; }
  .mc-mini.primary:hover { background: #1a6fd6; color: #fff; }
  .mc-mini.following { background: #f2f3f5; color: #8a919f; border-color: transparent; }

  /* 深色模式（洛谷主视觉为浅色，这里做基础适配） */
  .theme-dark .mc-modal .mc-card, .theme-dark .mc-head { background: #1f2329; color: #e5e6eb; }
  .theme-dark .mc-side { background: #171a1f; border-color: #2a2f37; }
  .theme-dark .mc-nav { color: #c9cdd4; }
  .theme-dark .mc-nav:hover { background: #2a2f37; }
  .theme-dark .mc-nav.active { background: rgba(32,128,240,.18); color: #6cb0ff; }
  .theme-dark .mc-main, .theme-dark .mc-conv:hover { background: #1f2329; }
  .theme-dark .mc-conv.active { background: rgba(32,128,240,.18); }
  .theme-dark .mc-item { border-color: #2a2f37; }
  .theme-dark .mc-item-av { background: #2a3550; }
  .theme-dark .mc-item-name, .theme-dark .mc-conv-name, .theme-dark .mc-disc-name { color: #e5e6eb; }
  .theme-dark .mc-item-text { color: #c9cdd4; }
  .theme-dark .mc-msg.them .mc-msg-bubble { background: #2a2f37; color: #e5e6eb; border-color: #3a3f47; }
  .theme-dark .mc-chat-body { background: #171a1f; }
  .theme-dark .mc-chat-input, .theme-dark .mc-composer { background: #1f2329; border-color: #2a2f37; }
  .theme-dark .mc-chat-input input, .theme-dark .mc-composer-input { background: #171a1f; color: #e5e6eb; border-color: #2a2f37; }

  /* ===== 用户资料卡 popup ===== */
  .up-modal .up-card {
    max-width: 340px; width: 88vw; padding: 26px 22px 22px; text-align: center;
  }
  .up-avatar { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 12px; background: var(--bg-2); display: flex; align-items: center; justify-content: center; font-size: 38px; overflow: hidden; }
  .up-name { font-size: 18px; font-weight: 700; color: var(--text); }
  .up-handle { font-size: 13px; color: var(--text-3); margin: 2px 0 16px; }
  .up-actions { display: flex; gap: 10px; justify-content: center; }
  .up-btn { flex: 1; padding: 10px 0; border: 1px solid var(--primary); border-radius: 10px; background: #fff; color: var(--primary); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .12s; }
  .up-btn.primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border-color: transparent; }
  .up-btn.following { background: var(--bg-2); color: var(--text-2); border-color: var(--line); }
  .up-btn:hover { opacity: .92; }

  /* ===== 账号设置：头像上传 ===== */
  .profile-avatar-upload { display: flex; gap: 10px; margin-bottom: 12px; }
  .profile-upload-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px dashed var(--primary); border-radius: 10px; color: var(--primary); font-size: 13px; cursor: pointer; transition: background .12s; }
  .profile-upload-btn:hover { background: rgba(74,125,224,.08); }
  .profile-reset-btn { padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--text-2); font-size: 13px; cursor: pointer; }
  .profile-reset-btn:hover { border-color: var(--primary); color: var(--primary); }

  /* 深色模式适配 */
  body.theme-dark .topbar-bell { background: #232831; border-color: var(--line); color: var(--text-2); }
  body.theme-dark .topbar-bell:hover { background: #2a2f3a; color: var(--text); }
  body.theme-dark .bell-badge { box-shadow: 0 0 0 2px #232831; }
  body.theme-dark .mc-side, body.theme-dark .mc-nav:hover, body.theme-dark .mc-conv:hover { background: var(--bg); }
  body.theme-dark .mc-nav.active { color: #fff; }
  body.theme-dark .mc-mini, body.theme-dark .profile-reset-btn { background: #232831; border-color: var(--line); color: var(--text); }
  body.theme-dark .mc-msg.them .mc-msg-bubble { background: #2a2f3a; }
  body.theme-dark .up-btn, body.theme-dark .mc-mini.primary { color: #fff; }
  body.theme-dark .up-btn.following, body.theme-dark .mc-mini.following { background: var(--bg-2); color: var(--text-2); }

  /* ===== 管理后台（禁言 / 封号） ===== */
  .adm-tip { margin: 0 0 14px; padding: 10px 14px; background: #f2f7ff; border: 1px solid #d6e4ff; border-radius: 10px; color: #45556e; font-size: 13px; line-height: 1.6; }
  body.theme-dark .adm-tip { background: #1c2433; border-color: #2a3a55; color: var(--text-2); }
  .adm-tip b { color: #1d4ed8; }
  body.theme-dark .adm-tip b { color: #6ea8ff; }
  .adm-search { margin-bottom: 12px; }
  .adm-search input { width: 100%; max-width: 360px; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 14px; outline: none; transition: border-color .12s; }
  .adm-search input:focus { border-color: var(--primary); }
  .adm-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  body.theme-dark .adm-table { background: var(--bg-2); border-color: var(--line); }
  .adm-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); background: #f7f8fa; padding: 11px 14px; border-bottom: 1px solid var(--line); }
  body.theme-dark .adm-table th { background: #1c2230; }
  .adm-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
  body.theme-dark .adm-table td { border-color: var(--line); }
  .adm-table tr:last-child td { border-bottom: none; }
  .adm-av { font-size: 22px; width: 44px; text-align: center; }
  .adm-av .ua-img { width: 34px; height: 34px; border-radius: 50%; display: inline-block; object-fit: cover; }
  .adm-name { font-weight: 600; color: var(--text); }
  .adm-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
  .adm-badges { white-space: nowrap; }
  .adm-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-right: 4px; }
  .adm-badge.ok { background: #e8f6ee; color: #1a9e54; }
  .adm-badge.ban { background: #fdecec; color: #e23a3a; }
  .adm-badge.mute { background: #fff4e0; color: #c9820a; }
  body.theme-dark .adm-badge.ok { background: #14301f; color: #5fd99a; }
  body.theme-dark .adm-badge.ban { background: #3a1c1c; color: #ff8585; }
  body.theme-dark .adm-badge.mute { background: #3a2e16; color: #ffc15e; }
  .adm-actions { white-space: nowrap; }
  .adm-btn { padding: 6px 13px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: #45556e; font-size: 13px; cursor: pointer; margin-right: 6px; transition: all .12s; }
  .adm-btn:hover { border-color: var(--primary); color: var(--primary); }
  .adm-btn.danger { border-color: #f3c2c2; color: #e23a3a; }
  .adm-btn.danger:hover { background: #e23a3a; border-color: #e23a3a; color: #fff; }
  .adm-btn.on { background: #eef2f7; color: var(--text-2); border-color: var(--line-2); }
  body.theme-dark .adm-btn { background: #232831; color: var(--text); border-color: var(--line); }
  body.theme-dark .adm-btn:hover { border-color: var(--primary); color: var(--primary); }
  .adm-self { font-size: 13px; color: var(--text-2); }
  .adm-empty { text-align: center; color: var(--text-2); padding: 24px 0; }

/* ===== 常考题型筛选栏 ===== */
.cc-filterbar {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  margin: 18px 0 4px; padding: 16px 18px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.cc-filter-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px 14px; width: 100%;
}
.cc-filter-label { font-size: 15px; font-weight: 800; color: var(--text); }
.cc-field { display: flex; align-items: center; gap: 10px; }
.cc-field-label { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.cc-diff-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cc-diff-chip {
  font-size: 13px; padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--text-2);
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.cc-diff-chip:hover { border-color: var(--primary); color: var(--primary); }
.cc-diff-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.cc-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-width: 190px; padding: 9px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); color: var(--text-2);
  cursor: pointer; transition: all .15s ease; user-select: none;
}
.cc-box:hover { border-color: var(--primary); color: var(--text); }
.cc-box-text { font-size: 13.5px; }
.cc-box-caret { font-size: 12px; }
.cc-search-field { flex: 1; min-width: 200px; }
.cc-search-input {
  width: 100%; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-size: 13.5px; outline: none; transition: border-color .15s ease;
}
.cc-search-input:focus { border-color: var(--primary); }

.cc-selected-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.cc-selected-label { font-size: 13px; font-weight: 800; color: var(--text); }
.cc-sel-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 5px 10px; border-radius: 999px;
  color: #fff; background: var(--sc, var(--primary));
  border: 1px solid var(--sc, var(--primary));
}
.cc-sel-tag i { font-style: normal; cursor: pointer; opacity: .85; font-size: 12px; }
.cc-sel-tag i:hover { opacity: 1; }
.cc-sel-empty { font-size: 13px; color: var(--text-2); }

.cc-content { margin-top: 16px; }
.cc-empty { text-align: center; padding: 48px 20px; color: var(--text-2); font-size: 14px; line-height: 1.8; }
.cc-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cc-type-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; transition: all .15s ease; position: relative; overflow: hidden;
}
.cc-type-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--sc); opacity: .7; }
.cc-type-card:hover { box-shadow: var(--shadow-md); border-color: var(--sc); transform: translateY(-2px); }
.cc-tc-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: color-mix(in srgb, var(--sc) 12%, #fff); color: var(--sc); flex-shrink: 0; }
.cc-tc-body { flex: 1; min-width: 0; }
.cc-tc-subj { font-size: 12px; color: var(--text-2); }
.cc-tc-name { font-size: 15px; font-weight: 700; color: var(--text); }
.cc-tc-arrow { color: var(--text-3); font-size: 18px; }
.cc-tc-fav {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--text-3); font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all .12s;
}
.cc-tc-fav:hover { border-color: var(--primary); color: var(--primary); }
.cc-tc-fav.is-fav { color: #f5a623; border-color: #f5a623; background: #fff7e6; }
body.theme-dark .cc-tc-fav { background: var(--bg-2); }
.cc-tc-struct { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, #fff); vertical-align: middle; }
body.theme-dark .cc-tc-struct { background: color-mix(in srgb, var(--sc) 24%, var(--bg-2)); }
.cc-tag-struct { display: inline-block; margin-right: 5px; padding: 0 6px; border-radius: 4px; font-size: 10px; font-style: normal; font-weight: 600; color: #fff; background: var(--sc); vertical-align: middle; }

/* 科目多选弹窗 */
.cc-modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  animation: cc-fade .15s ease;
}
@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }
.cc-modal {
  width: min(760px, 92vw); max-height: 86vh; background: var(--card);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column; overflow: hidden;
}
.cc-modal-head {
  display: flex; align-items: center; gap: 10px; padding: 18px 22px;
  font-size: 16px; font-weight: 800; color: var(--text); border-bottom: 1px solid var(--line);
}
.cc-modal-tip { font-size: 12px; font-weight: 600; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, #fff); padding: 2px 10px; border-radius: 999px; }
.cc-modal-body { display: flex; gap: 0; flex: 1; min-height: 0; }
.cc-modal-col { padding: 18px 20px; overflow-y: auto; }
.cc-modal-col-subj { width: 200px; border-right: 1px solid var(--line); flex-shrink: 0; }
.cc-modal-col-type { flex: 1; }
.cc-modal-col-title { font-size: 13px; font-weight: 800; color: var(--text-2); margin-bottom: 12px; }
.cc-subj-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  font-size: 14px; color: var(--text); cursor: pointer; transition: all .15s ease; margin-bottom: 6px;
  border: 1px solid transparent;
}
.cc-subj-item:hover { background: color-mix(in srgb, var(--sc) 8%, #fff); }
.cc-subj-item.active { background: color-mix(in srgb, var(--sc) 14%, #fff); border-color: var(--sc); font-weight: 700; }
.cc-subj-check { width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; background: var(--sc); flex-shrink: 0; }
.cc-subj-item:not(.active) .cc-subj-check { background: transparent; color: transparent; }
.cc-type-tags { display: block; }
.cc-type-group {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
}
.cc-type-group:last-child { margin-bottom: 0; }
.cc-type-group-title {
  font-size: 13px; font-weight: 800; color: var(--text);
  margin: 0 0 10px; padding: 6px 10px;
  background: color-mix(in srgb, var(--sc, var(--primary)) 10%, transparent);
  border-left: 4px solid var(--sc, var(--primary));
  border-radius: 0 8px 8px 0;
}
.cc-type-tag {
  display: inline-block; white-space: nowrap;
  font-size: 13px; padding: 7px 13px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text-2);
  cursor: pointer; transition: all .15s ease; user-select: none;
}
.cc-type-tag:hover { border-color: var(--sc); color: var(--sc); }
.cc-type-tag.active { background: var(--sc); color: #fff; border-color: var(--sc); font-weight: 600; }
.cc-type-tag.active i { font-style: normal; margin-left: 2px; cursor: pointer; }
.cc-type-empty { font-size: 13.5px; color: var(--text-2); padding: 14px 0; }
.cc-modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-top: 1px solid var(--line); }
.cc-modal-count { font-size: 13px; color: var(--text-2); }
.cc-modal-foot-btns { display: flex; gap: 10px; }
.cc-btn-ghost, .cc-btn-primary {
  font-size: 14px; padding: 9px 20px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); transition: all .15s ease;
}
.cc-btn-ghost { background: var(--card); color: var(--text-2); }
.cc-btn-ghost:hover { color: var(--text); border-color: var(--text-3); }
.cc-btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.cc-btn-primary:hover { filter: brightness(1.05); }

/* 响应式 */
@media (max-width: 720px) {
  .cc-filterbar { gap: 12px; }
  .cc-modal-body { flex-direction: column; }
  .cc-modal-col-subj { width: auto; border-right: none; border-bottom: 1px solid var(--line); max-height: 180px; }
}

/* 暗色主题 */
body.theme-dark .cc-filterbar { background: var(--bg-2); }
body.theme-dark .cc-box, body.theme-dark .cc-search-input, body.theme-dark .cc-diff-chip { background: var(--bg-2); }
body.theme-dark .cc-tc-icon { background: color-mix(in srgb, var(--sc) 24%, var(--bg-2)); }
body.theme-dark .cc-subj-item:hover { background: color-mix(in srgb, var(--sc) 16%, var(--bg-2)); }
body.theme-dark .cc-subj-item.active { background: color-mix(in srgb, var(--sc) 26%, var(--bg-2)); }
body.theme-dark .cc-modal-tip { background: color-mix(in srgb, var(--primary) 22%, var(--bg-2)); }
body.theme-dark .cc-btn-ghost { background: var(--bg-2); }

/* ============================================================
 * 移动端适配（手机版兼容）：2026-08-07 增补
 * 解决：① 各板块在手机上“过大/溢出” ② 私信功能在手机上不可用
 * ============================================================ */
@media (max-width: 640px) {
  /* 容器与通用间距收敛 */
  .main { padding: 16px 12px 48px; }
  .main > * { max-width: 100%; }
  .panel { padding: 20px 16px; border-radius: 10px; }
  .panel h2 { font-size: 18px; }

  /* 首页 / 学科 / 各类板块标题收敛 */
  .section-title { font-size: 18px; margin: 6px 0 14px; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 22px; }
  .hero-stats { gap: 16px; flex-wrap: wrap; }
  .subject-grid { grid-template-columns: 1fr; }
  .volume-list { grid-template-columns: 1fr; }
  .continue-cta { flex-direction: row; align-items: center; }

  /* 题库板块 */
  .bank-new-design { padding: 18px 14px; }
  .bank-welcome { padding: 18px 16px; }
  .bank-hero { padding: 18px 16px; }
  .bank-hero-title { font-size: 19px; }
  .bank-hero-deco { display: none; }
  .bank-entries { grid-template-columns: 1fr; }
  .bank-stats-strip { flex-wrap: wrap; }
  .bss-item { flex: 1 1 42%; }
  .bank-stats-refined { grid-template-columns: 1fr 1fr; }

  /* 常考题型筛选栏：控件占满整行，避免小屏溢出 */
  .cc-filter-row { gap: 8px 10px; }
  .cc-box, .cc-search-field { flex: 1 1 100%; min-width: 0; width: 100%; }
  .cc-type-grid { grid-template-columns: 1fr; }

  /* 错题本 */
  .wrong-card-new { padding: 16px 14px; }
  .wcn-actions { margin-top: 10px; }
  .wrong-redo-btn, .wcn-fav-btn { flex: 1 1 auto; }

  /* 课时练习 */
  .quiz { padding: 14px 14px; }

  /* ===== 私信 / 消息中心：手机全屏，聊天框不再被挤没 ===== */
  .mc-modal .mc-card {
    width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh;
    border-radius: 0;
  }
  .mc-body { flex-direction: column; }
  .mc-side {
    width: 100%; flex-direction: row; padding: 6px 8px; gap: 6px;
    border-right: none; border-bottom: 1px solid #ebedf0; flex-shrink: 0;
  }
  .mc-nav { width: auto; flex: 1; flex-direction: row; justify-content: center; padding: 10px 8px; }
  .mc-nav .mc-badge { position: static; margin-left: 6px; }
  .mc-nav .mc-nav-ic { font-size: 18px; }
  /* 关键：让 .mc-main 成为 flex 容器，内部 .mc-dm / .mc-chat 才能用 flex:1 撑满高度 */
  .mc-main { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
  .mc-list, .mc-disc-list { flex: 1; min-height: 0; overflow: auto; }
  .mc-dm { flex: 1; min-height: 0; flex-direction: column; }
  .mc-conv-list {
    width: 100%; max-height: 32vh; flex-shrink: 0; border-right: none;
    border-bottom: 1px solid #ebedf0;
  }
  .mc-chat { flex: 1; min-height: 0; }
  .mc-chat-body { flex: 1; min-height: 0; overflow: auto; }
  .mc-chat-input { flex-shrink: 0; }
  .mc-chat-input input { font-size: 16px; } /* 防止 iOS 聚焦时页面缩放 */
}

@media (max-width: 480px) {
  .topbar-inner { padding: 0 10px 0 4px; }
  .logo-text { font-size: 16px; }
  .section-title { font-size: 17px; }
  .hero h1 { font-size: 20px; }
  .bank-hero-title { font-size: 18px; }
  .mc-conv-name, .mc-conv-last { font-size: 13px; }
  .wcn-fav-btn { font-size: 12.5px; padding: 8px 12px; }
  .wrong-redo-btn, .wcn-fav-btn { font-size: 12.5px; }

  /* ===== 常考题型 → 题目列表（手机端收敛） ===== */
  .cc-q-head { gap: 6px; }
  .cc-q-toggle { margin-left: 0; padding: 4px 8px; }
  .cc-q-opts { padding-left: 0; font-size: 13.5px; }
  .cc-q-ans { font-size: 13.5px; padding: 8px 10px; }
}

/* ===== 常考题型 → 题目列表 ===== */
.cc-type-grid { display: flex; flex-direction: column; gap: 12px; }
.cc-type-group { border: 1px solid #ebedf0; border-radius: 12px; overflow: hidden; background: var(--bg-1); transition: border-color .15s; }
.cc-type-group:hover { border-color: var(--sc, #6b7280); }
body.theme-dark .cc-type-group { border-color: rgba(255, 255, 255, .08); }
.cc-type-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; transition: background .15s; }
.cc-type-card:hover { background: rgba(0, 0, 0, .025); }
body.theme-dark .cc-type-card:hover { background: rgba(255, 255, 255, .04); }
.cc-type-questions { padding: 4px 16px 16px; background: var(--bg-2); border-top: 1px dashed #ebedf0; }
body.theme-dark .cc-type-questions { border-color: rgba(255, 255, 255, .08); }
.cc-type-questions.collapsed { display: none; }
.cc-q-item { padding: 12px 0; border-bottom: 1px dashed rgba(0, 0, 0, .05); }
.cc-q-item:last-child { border-bottom: none; }
body.theme-dark .cc-q-item { border-color: rgba(255, 255, 255, .05); }
.cc-q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cc-q-no { font-weight: 600; color: var(--text-1); font-size: 14px; }
.cc-q-diff { font-size: 12px; padding: 2px 10px; border-radius: 999px; line-height: 1.5; }
.cc-q-diff.diff-easy { background: #dcfce7; color: #166534; }
.cc-q-diff.diff-medium { background: #dbeafe; color: #1e40af; }
.cc-q-diff.diff-hard { background: #ffedd5; color: #9a3412; }
.cc-q-diff.diff-expert { background: #fee2e2; color: #991b1b; }
.cc-q-src { font-size: 12px; color: var(--text-3); }
.cc-q-toggle { margin-left: auto; font-size: 12px; padding: 4px 10px; border: 1px solid var(--text-3); border-radius: 6px; background: transparent; cursor: pointer; color: var(--text-2); transition: all .15s; }
.cc-q-toggle:hover { border-color: var(--sc, #6b7280); color: var(--sc, #6b7280); }
.cc-q-body { font-size: 14px; line-height: 1.7; white-space: pre-wrap; color: var(--text-1); }
.cc-q-opts { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; padding-left: 8px; font-size: 14px; color: var(--text-1); }
.cc-q-ans { margin-top: 10px; padding: 10px 12px; background: var(--bg-1); border-left: 3px solid var(--sc, #6b7280); border-radius: 6px; font-size: 14px; line-height: 1.7; color: var(--text-1); }
.cc-q-ans b { color: var(--sc, #6b7280); }
.cc-q-empty { color: var(--text-3); font-size: 13px; padding: 12px 0; text-align: center; }
.cc-q-empty::before { content: '📭 '; }
.cc-type-card .cc-tc-arrow { color: var(--text-3); font-size: 14px; transition: transform .15s; }

/* ===== 常考题型 → 题目答题区 ===== */
.cc-q-type { font-size: 12px; padding: 2px 8px; border-radius: 999px; line-height: 1.5; background: #f3f4f6; color: #4b5563; }
.cc-q-type.type-choice { background: #ede9fe; color: #5b21b6; }
.cc-q-type.type-fill { background: #cffafe; color: #155e75; }
.cc-q-type.type-solve { background: #fef3c7; color: #92400e; }
body.theme-dark .cc-q-type { background: var(--bg-2); color: var(--text-2); }
body.theme-dark .cc-q-type.type-composite { background: #8b5cf6; color: #fff; }
.cc-q-fav { margin-left: 0; font-size: 14px; padding: 2px 6px; border: none; background: transparent; cursor: pointer; color: var(--text-3); transition: all .15s; }
.cc-q-fav:hover { color: #f59e0b; transform: scale(1.15); }
.cc-q-fav.is-fav { color: #f59e0b; }
.cc-q-opts { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.cc-q-opt { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1.5px solid #e5e7eb; border-radius: 8px; cursor: pointer; transition: all .15s; background: var(--bg-1); font-size: 14px; color: var(--text-1); }
.cc-q-opt:hover { border-color: var(--sc, #6b7280); background: var(--bg-2); }
.cc-q-opt.selected { border-color: var(--sc, #6b7280); background: color-mix(in srgb, var(--sc, #6b7280) 8%, var(--bg-1)); font-weight: 500; }
.cc-q-opt input[type=radio] { margin: 0; accent-color: var(--sc, #6b7280); cursor: pointer; }
.cc-q-opt-letter { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 50%; background: var(--sc, #6b7280); color: #fff; font-size: 12px; font-weight: 600; }
.cc-q-opt-text { flex: 1; }
.cc-q-fill { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.cc-q-fill input { flex: 1; padding: 10px 12px; border: 1.5px solid #e5e7eb; border-radius: 8px; font-size: 14px; font-family: inherit; background: var(--bg-1); color: var(--text-1); transition: border .15s; }
.cc-q-fill input:focus { outline: none; border-color: var(--sc, #6b7280); }
.cc-q-solve { margin-top: 10px; }
.cc-q-solve textarea { width: 100%; padding: 10px 12px; border: 1.5px solid #e5e7eb; border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; background: var(--bg-1); color: var(--text-1); transition: border .15s; box-sizing: border-box; }
.cc-q-solve textarea:focus { outline: none; border-color: var(--sc, #6b7280); }
.cc-q-actions { margin-top: 10px; }
.cc-q-submit { padding: 8px 20px; border: none; border-radius: 8px; background: var(--sc, #6b7280); color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; transition: opacity .15s; }
.cc-q-submit:hover { opacity: 0.85; }
.cc-q-submit:active { transform: scale(0.98); }
.cc-q-result { margin-top: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; }
.cc-q-result.correct { background: #dcfce7; color: #166534; border-left: 3px solid #22c55e; }
.cc-q-result.wrong { background: #fee2e2; color: #991b1b; border-left: 3px solid #ef4444; }
.cc-q-result.submitted { background: #dbeafe; color: #1e40af; border-left: 3px solid #3b82f6; }
body.theme-dark .cc-q-result.correct { background: rgba(34, 197, 94, .15); color: #86efac; }
body.theme-dark .cc-q-result.wrong { background: rgba(239, 68, 68, .15); color: #fca5a5; }
body.theme-dark .cc-q-result.submitted { background: rgba(59, 130, 246, .15); color: #93c5fd; }

/* AI 智能批改结果（主观题 / 解答题） */
.cc-q-result.grading,
.quiz-feedback.grading { color: var(--text-2); background: #f1f5ff; border-left: 3px solid #818cf8; }
.cc-q-result .ai-fb,
.quiz-ai-result .ai-fb { margin-top: 6px; font-weight: 400; line-height: 1.6; color: var(--text); }
.cc-q-result .ai-std,
.quiz-ai-result .ai-std { margin-top: 6px; font-weight: 400; line-height: 1.6; color: var(--text); }
.cc-q-result .ai-exp,
.quiz-ai-result .ai-exp { margin-top: 6px; font-weight: 400; line-height: 1.6; color: var(--text-2); }
.quiz-ai-result { margin-top: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; }
.quiz-ai-result.correct { background: #dcfce7; color: #166534; border-left: 3px solid #22c55e; }
.quiz-ai-result.wrong { background: #fee2e2; color: #991b1b; border-left: 3px solid #ef4444; }
.quiz-ai-result.submitted { background: #dbeafe; color: #1e40af; border-left: 3px solid #3b82f6; }
body.theme-dark .quiz-ai-result.correct { background: rgba(34, 197, 94, .15); color: #86efac; }
body.theme-dark .quiz-ai-result.wrong { background: rgba(239, 68, 68, .15); color: #fca5a5; }
body.theme-dark .quiz-ai-result.submitted { background: rgba(59, 130, 246, .15); color: #93c5fd; }
body.theme-dark .cc-q-opt { border-color: rgba(255, 255, 255, .1); }
body.theme-dark .cc-q-opt:hover { border-color: var(--sc, #6b7280); }
body.theme-dark .cc-q-fill input, body.theme-dark .cc-q-solve textarea { border-color: rgba(255, 255, 255, .1); background: var(--bg-2); }
body.theme-dark .cc-q-fill input:focus, body.theme-dark .cc-q-solve textarea:focus { border-color: var(--sc, #6b7280); }

/* ============================================================
 * 常考题型 · 洛谷式题目卡片（2026-08-08 增补）
 * ID 徽标（A0001…）+ 难度药丸 + 题目描述/题解分节 + 青绿品牌色
 * ============================================================ */
.lg-q {
  position: relative;
  margin: 14px 0; padding: 14px 16px 16px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid #00b4a0;
  border-radius: 10px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
  transition: box-shadow .15s ease;
}
.lg-q:hover { box-shadow: 0 3px 12px rgba(15, 23, 42, .10); }
.lg-q.lg-d-A { border-left-color: #c0392b; }
.lg-q.lg-d-B { border-left-color: #b45309; }
.lg-q.lg-d-C { border-left-color: #1d4ed8; }
.lg-q.lg-d-D { border-left-color: #15803d; }
.lg-q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.lg-id {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px; font-weight: 700; letter-spacing: .5px;
  background: #1f2937; color: #fff; padding: 3px 9px; border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.lg-diff {
  font-size: 12px; font-weight: 700; color: #fff; padding: 2px 10px; border-radius: 999px;
  background: #6b7280; white-space: nowrap;
}
.lg-q.lg-d-A .lg-diff { background: #c0392b; }
.lg-q.lg-d-B .lg-diff { background: #b45309; }
.lg-q.lg-d-C .lg-diff { background: #1d4ed8; }
.lg-q.lg-d-D .lg-diff { background: #15803d; }
.lg-src { font-size: 12px; color: var(--text-3); }
.lg-q-main { /* 题目描述 + 选项 + 作答区 容器 */ }
.lg-seclabel {
  font-size: 12px; font-weight: 800; color: #0e7490;
  margin: 8px 0 4px; letter-spacing: .3px;
}
body.theme-dark .lg-seclabel { color: #2dd4bf; }
/* 选项洛谷化：圆形字母徽标 + 青绿选中态 */
.cc-q-opt { border-radius: 8px; }
.cc-q-opt:hover { border-color: #00b4a0; background: var(--bg-2); }
.cc-q-opt.selected { border-color: #00b4a0; background: rgba(0, 180, 160, .10); font-weight: 500; }
.cc-q-opt-letter { background: #00b4a0; }
/* 提交按钮洛谷青绿 */
.cc-q-submit { background: #00b4a0; }
.cc-q-submit:hover { background: #009e8c; opacity: 1; }
body.theme-dark .lg-q { background: var(--bg-2); }
body.theme-dark .lg-id { background: #0f172a; }
body.theme-dark .cc-q-opt:hover { background: rgba(255, 255, 255, .04); }
body.theme-dark .cc-q-opt.selected { background: rgba(0, 180, 160, .18); }

/* ===== 题库列表（洛谷式可点击行）+ 分页 + 单题详情 ===== */
.lg-list-head { font-size: 12.5px; color: var(--text-3); margin: 4px 2px 10px; }
.lg-list { display: flex; flex-direction: column; gap: 8px; }
.lg-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--bg-1); border: 1px solid var(--bd-1);
  border-left: 4px solid #6b7280;
  cursor: pointer; transition: box-shadow .15s, transform .05s, border-color .15s;
}
.lg-row:hover { box-shadow: 0 3px 14px rgba(15, 23, 42, .10); border-color: #00b4a0; }
.lg-row:active { transform: translateY(1px); }
.lg-row.lg-d-A { border-left-color: #c0392b; }
.lg-row.lg-d-B { border-left-color: #b45309; }
.lg-row.lg-d-C { border-left-color: #1d4ed8; }
.lg-row.lg-d-D { border-left-color: #15803d; }
.lg-row-id {
  flex: 0 0 auto; min-width: 58px; text-align: center;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 800; font-size: 13px; color: #fff; background: #334155;
  padding: 3px 7px; border-radius: 6px; letter-spacing: .5px;
}
.lg-row-diff {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #fff;
  padding: 2px 8px; border-radius: 999px; background: #94a3b8;
}
.lg-row.lg-d-A .lg-row-diff { background: #c0392b; }
.lg-row.lg-d-B .lg-row-diff { background: #b45309; }
.lg-row.lg-d-C .lg-row-diff { background: #1d4ed8; }
.lg-row.lg-d-D .lg-row-diff { background: #15803d; }
.lg-row-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 14px; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lg-row-fav {
  flex: 0 0 auto; border: none; background: transparent; cursor: pointer;
  font-size: 16px; color: #94a3b8; padding: 2px 4px; line-height: 1;
}
.lg-row-fav.is-fav { color: #f59e0b; }
.lg-row-arrow { flex: 0 0 auto; color: var(--text-3); font-size: 20px; font-weight: 700; padding-left: 2px; }
.lg-row:hover .lg-row-arrow { color: #00b4a0; }

/* 复合题（大题）：材料/文章 + 多小题 */
.cc-q-type.type-composite { background: #7c3aed; color: #fff; }
.lg-composite { border-left-width: 4px; }
.lg-passage {
  background: #f8fafc; border: 1px solid var(--bd-1); border-radius: 10px;
  padding: 12px 14px; margin: 6px 0 16px;
}
.lg-passage .cc-q-body { font-size: 14.5px; line-height: 1.85; color: var(--text-1); white-space: pre-wrap; }
.lg-subs { display: flex; flex-direction: column; gap: 14px; }
.lg-sub {
  border: 1px solid var(--bd-1); border-radius: 12px;
  padding: 12px 14px; background: var(--bg-1);
}
.lg-sub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.lg-sub-no {
  font-weight: 800; color: #00b4a0; font-size: 15px;
  background: rgba(0, 180, 160, .12); border-radius: 8px; padding: 1px 9px;
}
.lg-sub .lg-seclabel { margin-top: 2px; }
.lg-tag-big { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.lg-trow-big .lg-c-title-text { font-weight: 600; }
.lg-subj-big { background: #7c3aed; color: #fff; border-color: #7c3aed; }
body.theme-dark .lg-passage { background: #0f172a; }
body.theme-dark .lg-sub { background: var(--bg-2); }

/* 洛谷式表格列表：状态 / 题号 / 题目名称 / 标签 / 难度 / 通过率 */
.lg-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1px solid var(--bd-1); background: var(--bg-1); }
.lg-table { min-width: 760px; }
.lg-trow {
  display: grid;
  grid-template-columns: 46px 86px minmax(220px, 1fr) 200px 78px 116px;
  align-items: center; gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid var(--bd-2, #f0f0f0);
  border-left: 3px solid transparent;
  cursor: pointer; transition: background .12s;
}
.lg-trow:last-child { border-bottom: none; }
.lg-trow.lg-d-A { border-left-color: #c0392b; }
.lg-trow.lg-d-B { border-left-color: #b45309; }
.lg-trow.lg-d-C { border-left-color: #1d4ed8; }
.lg-trow.lg-d-D { border-left-color: #15803d; }
.lg-trow:not(.lg-thead):hover { background: rgba(0, 180, 160, .06); }
.lg-thead {
  position: sticky; top: 0; z-index: 1; cursor: default;
  background: #f7f8fa; color: var(--text-3); font-size: 12.5px; font-weight: 700;
  border-bottom: 2px solid var(--bd-1); border-left-color: transparent !important;
}
.lg-c-status { text-align: center; font-size: 15px; line-height: 1; }
.lg-done { color: #15803d; font-weight: 800; }
.lg-todo { color: #94a3b8; }
.lg-c-id {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 800; font-size: 13px; color: var(--text-1); letter-spacing: .5px;
}
.lg-c-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lg-c-title-text {
  font-size: 14px; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lg-c-title:hover .lg-c-title-text { color: #00b4a0; }
.lg-star {
  flex: 0 0 auto; border: none; background: transparent; cursor: pointer;
  font-size: 14px; color: #94a3b8; padding: 0 2px; line-height: 1;
}
.lg-star.is-fav { color: #f59e0b; }
.lg-c-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.lg-tag {
  font-size: 11.5px; color: var(--text-2, #64748b);
  background: rgba(100, 116, 139, .10); border: 1px solid rgba(100, 116, 139, .16);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.lg-c-diff {
  font-size: 12px; font-weight: 700; color: #fff; text-align: center;
  padding: 3px 0; border-radius: 999px; background: #94a3b8;
}
.lg-trow.lg-d-A .lg-c-diff { background: #c0392b; }
.lg-trow.lg-d-B .lg-c-diff { background: #b45309; }
.lg-trow.lg-d-C .lg-c-diff { background: #1d4ed8; }
.lg-trow.lg-d-D .lg-c-diff { background: #15803d; }
.lg-c-rate { display: flex; align-items: center; gap: 8px; }
.lg-rate-bar {
  flex: 1 1 auto; height: 6px; border-radius: 999px;
  background: rgba(100, 116, 139, .16); overflow: hidden; min-width: 36px;
}
.lg-rate-bar i { display: block; height: 100%; border-radius: 999px; }
.lg-c-rate b { font-size: 13px; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

/* 分页 */
.lg-pager-wrap {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin: 18px 2px 4px; padding-top: 14px; border-top: 1px dashed var(--bd-1);
}
.lg-page {
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--bd-1); background: var(--bg-1); color: var(--text-1);
  border-radius: 8px; cursor: pointer; font-size: 13.5px; transition: all .15s;
}
.lg-page:hover:not(.disabled):not(.active) { border-color: #00b4a0; color: #00b4a0; }
.lg-page.active { background: #00b4a0; border-color: #00b4a0; color: #fff; font-weight: 700; }
.lg-page.disabled { opacity: .45; cursor: not-allowed; }
.lg-page-ellipsis { color: var(--text-3); padding: 0 2px; }
.lg-page-info { margin-left: auto; font-size: 12.5px; color: var(--text-3); }

/* 单题详情 */
.lg-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.lg-back {
  border: 1px solid var(--bd-1); background: var(--bg-1); color: var(--text-1);
  border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 13.5px;
}
.lg-back:hover { border-color: #00b4a0; color: #00b4a0; }
.lg-detail-nav { display: flex; gap: 8px; }
.lg-nav-btn {
  border: 1px solid var(--bd-1); background: var(--bg-1); color: var(--text-1);
  border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 13.5px;
}
.lg-nav-btn:hover:not(:disabled) { border-color: #00b4a0; color: #00b4a0; }
.lg-nav-btn:disabled { opacity: .4; cursor: not-allowed; }
.lg-detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.lg-subj-tag { font-size: 13px; color: var(--text-3); }
.lg-detail-card { max-width: 820px; }
.lg-detail-card .lg-q { margin: 0; }
/* ===== 洛谷式「题目信息」侧边栏 ===== */
.lg-detail-body { display: flex; gap: 22px; align-items: flex-start; margin-top: 4px; }
.lg-detail-main { flex: 1 1 auto; min-width: 0; max-width: 820px; }
.lg-detail-side { flex: 0 0 296px; max-width: 296px; position: sticky; top: 84px; }
.lg-info {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 16px 18px; box-shadow: var(--shadow);
}
.lg-info-title { font-size: 15px; font-weight: 800; color: var(--text-1); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.lg-info-sec { margin-bottom: 14px; }
.lg-info-sec:last-child { margin-bottom: 0; }
.lg-info-label { font-size: 12px; color: var(--text-3); margin-bottom: 5px; letter-spacing: .3px; }
.lg-info-bid { font-family: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace; font-size: 20px; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.lg-info-val { font-size: 13.5px; color: var(--text-1); line-height: 1.55; }
.lg-info-val b { color: var(--primary); }
.lg-info-diff { display: inline-block; padding: 2px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #fff; }
.lg-info-diff.lg-d-A { background: #c0392b; }
.lg-info-diff.lg-d-B { background: #b45309; }
.lg-info-diff.lg-d-C { background: #1d4ed8; }
.lg-info-diff.lg-d-D { background: #15803d; }
.lg-info-stars { color: var(--line); font-size: 13px; letter-spacing: 1px; margin-left: 4px; }
.lg-info-star.on { color: #f5b301; }
.lg-info-rate { display: flex; align-items: center; gap: 10px; }
.lg-info-rate-num { font-size: 17px; font-weight: 800; min-width: 46px; }
.lg-info-rate-bar { flex: 1; height: 8px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.lg-info-rate-fill { display: block; height: 100%; border-radius: 6px; transition: width .3s; }
.lg-info-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-info-tag { font-size: 12px; padding: 3px 9px; border-radius: 6px; background: var(--bg-2); color: var(--text-2); border: 1px solid var(--line); }
.lg-info-discuss { display: inline-block; font-size: 13.5px; color: var(--primary); text-decoration: none; font-weight: 600; }
.lg-info-discuss:hover { text-decoration: underline; }
/* 侧栏「相关讨论」洛谷式列表 */
.lg-info-label-row { display: flex; align-items: center; justify-content: space-between; }
.lg-info-count { display: inline-block; min-width: 18px; text-align: center; padding: 0 6px; margin-left: 2px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }
.lg-info-ask { color: var(--primary); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lg-info-ask:hover { text-decoration: underline; }
.lg-disc-list { display: flex; flex-direction: column; gap: 7px; }
.lg-disc-item { padding: 8px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; transition: all .15s; }
.lg-disc-item:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--bg-2)); }
.lg-disc-title { font-size: 13px; color: var(--text-1); font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lg-disc-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
/* 讨论区帖子上的「📌 题目编号」跳转标记 */
.ds-qtag { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 10px; background: rgba(74,125,224,.14); color: var(--primary); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.ds-qtag:hover { background: rgba(74,125,224,.24); }
.lg-info-rec { display: flex; flex-direction: column; gap: 6px; }
.lg-info-rec-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; cursor: pointer; background: var(--bg-2); border: 1px solid var(--line); transition: all .15s; }
.lg-info-rec-item:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--bg-2)); }
.lg-info-rec-id { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; font-weight: 700; color: var(--primary); flex: 0 0 auto; }
.lg-info-rec-title { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-info-rec-go { color: var(--text-3); font-size: 15px; flex: 0 0 auto; }
.lg-info-empty { font-size: 12.5px; color: var(--text-3); }
@media (max-width: 920px) {
  .lg-detail-body { flex-direction: column; }
  .lg-detail-side { flex-basis: auto; max-width: none; width: 100%; position: static; }
}

body.theme-dark .lg-row { background: var(--bg-2); }
body.theme-dark .lg-row-id { background: #0f172a; }
body.theme-dark .lg-table-scroll { background: var(--bg-2); border-color: var(--bd-1); }
body.theme-dark .lg-thead { background: #111827; color: #94a3b8; border-bottom-color: var(--bd-1); }
body.theme-dark .lg-trow:not(.lg-thead):hover { background: rgba(0, 180, 160, .12); }
body.theme-dark .lg-tag { background: rgba(148, 163, 184, .14); border-color: rgba(148, 163, 184, .22); color: #cbd5e1; }
body.theme-dark .lg-star { color: #64748b; }
body.theme-dark .lg-done { color: #4ade80; }
body.theme-dark .lg-rate-bar { background: rgba(148, 163, 184, .20); }

@media (max-width: 640px) {
  .cc-q-opt { padding: 8px 10px; font-size: 13.5px; }
  .cc-q-fill { flex-direction: column; align-items: stretch; }
  .cc-q-fill input { width: 100%; }
  .cc-q-submit { width: 100%; }
}
/* ============================================================
   移动端综合优化（2026-09-19）
   ① 收紧边距：正文更宽更好读
   ② 顶栏：压缩高度 + ☰ 只留图标，不再挤满一行
   ③ 目录抽屉：宽度贴合屏幕，顶栏降为 56px 后同步下移
   ④ 正文阅读：字号 / 行距 / 图表不溢出
   ⑤ 底部留安全空间，避免悬浮按钮挡住「下一课 / 提交」等操作按钮
   ============================================================ */
@media (max-width: 640px) {
  /* ① 内容区：左右收紧，底部留出安全空间 */
  .main { padding: 16px 13px 96px; }

  /* ② 顶栏 */
  .topbar-inner { height: 56px; padding: 0 10px 0 4px; }
  .logo-icon { font-size: 22px; }
  .logo-text { font-size: 15px; letter-spacing: 0; }
  .sidebar-toggle { font-size: 0; padding: 7px 10px; }
  .sidebar-toggle::before { content: "☰"; font-size: 17px; }
  .topbar-right { gap: 6px; }
  .theme-toggle { width: 32px; height: 32px; }

  /* ③ 目录抽屉 */
  .sidebar { top: 56px; height: calc(100vh - 56px); width: min(84vw, 300px); }
  body.sidebar-open .sidebar-mask { inset: 56px 0 0 0; }

  /* ⑤ 返回顶部按钮：缩小并抬高，别压住底部操作按钮 */
  .to-top { width: 40px; height: 40px; right: 14px; bottom: 104px; font-size: 19px; }

  /* ④ 正文阅读 */
  .main p, .main li { font-size: 15.5px; line-height: 1.85; }
  .main h1 { font-size: 21px; }
  .main h2 { font-size: 18.5px; }
  .main h3 { font-size: 16.5px; }

  /* 兜底：固定宽元素不允许撑破屏幕 */
  .main img, .main svg { max-width: 100%; height: auto; }
  .main table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .main { padding: 14px 11px 96px; }
  .logo-text { font-size: 14px; }
  .main p, .main li { font-size: 15px; }
}

/* ============================================================
 * 移动端排版统一调优（2026-09-27）
 * ① 任何屏宽都不横向溢出  ② 刘海 / 底部小白条安全区
 * ③ 点按热区够大          ④ iOS 聚焦输入框不整页放大
 * ⚠️ 本块放在文件最末尾，靠「后定义优先」覆盖前面的移动规则
 * ============================================================ */
@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; }
  body { -webkit-tap-highlight-color: transparent; }
  /* iOS 上字号 <16px 的输入框一聚焦就整页放大，必须顶到 16px */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea, select { font-size: 16px; }
  /* 长串（网址 / 连续英文 / 化学式）不许把版面撑破 */
  .main p, .main li, .main td, .main th, .ds-content, .cc-q-ans, .b-paragraph {
    overflow-wrap: anywhere;
  }
  /* 刘海屏：顶栏补上状态栏高度，侧边栏跟着一起下移 */
  .topbar { padding-top: env(safe-area-inset-top); }
  .sidebar {
    top: calc(56px + env(safe-area-inset-top));
    height: calc(100vh - 56px - env(safe-area-inset-top));
    height: calc(100dvh - 56px - env(safe-area-inset-top));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
  /* 页脚 / 悬浮按钮 / 聊天输入框：避开底部小白条 */
  .footer {
    padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
    font-size: 12px; line-height: 1.75;
  }
  .to-top {
    width: 42px; height: 42px; right: 12px; font-size: 19px;
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
  /* 手机浏览器地址栏收放时 100vh 会超出可视区，优先用 dvh */
  .mc-modal .mc-card { height: 100vh; max-height: 100vh; }
  .mc-modal .mc-card { height: 100dvh; max-height: 100dvh; }
  .mc-chat-input { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  /* 课时页 */
  .lesson-title { font-size: 21px; line-height: 1.4; }
  .lesson-head { padding-bottom: 14px; margin-bottom: 18px; }
  .lesson-cover { aspect-ratio: 16 / 9; margin-bottom: 16px; border-radius: 10px; }
  .lesson-nav { flex-wrap: wrap; gap: 8px; }
  .lesson-pill { padding: 7px 12px; font-size: 13px; }
  .b-svg { padding: 12px; margin: 16px auto; border-radius: 8px; }
  .b-svg svg { max-height: 62vh; }
  .b-table { min-width: 340px; font-size: 13.5px; }
  .b-table th, .b-table td { padding: 8px 9px; }
  .b-table-wrap { -webkit-overflow-scrolling: touch; }
  .b-formula { font-size: 15px; padding: 12px 14px; overflow-x: auto; }
  .b-keypoint, .b-warn, .b-tip, .b-example { padding: 12px 14px; }

  /* 册次页 */
  .vol-unit-head { gap: 8px; }
  .vol-unit-title { font-size: 15px; }
  .vol-unit-meta { font-size: 12px; }

  /* 题库：分类两列比一列更好点，标签栏横向滑动不换行 */
  .bank-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .bank-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bank-tab { flex-shrink: 0; padding: 8px 12px; }
  .stat-card { padding: 14px; gap: 12px; }
  .stat-number { font-size: 21px; }

  /* 讨论区 */
  .ds-board-head { padding: 14px; gap: 12px; }
  .ds-board-head-icon { width: 38px; height: 38px; font-size: 20px; }
  .ds-attachments { flex-wrap: wrap; }

  /* 热区：小按钮在手机上至少 38px 高 */
  .mc-mini { padding: 8px 14px; min-height: 34px; }
  .wcn-fav-btn, .wrong-redo-btn { min-height: 38px; }
  .cc-btn-ghost, .cc-btn-primary { min-height: 38px; }
}

@media (max-width: 480px) {
  .panel { padding: 16px 13px; }
  .hero { padding: 18px 15px; }
  .hero h1 { font-size: 19px; }
  .section-title { font-size: 16.5px; }
  .lesson-title { font-size: 19px; }
  .bank-cat-grid { grid-template-columns: 1fr; }
  .footer { font-size: 11.5px; }
}

/* 触屏没有 hover：会话行/消息行的删除按钮不能只在悬停时才显形 */
@media (hover: none) {
  .mc-conv-del, .mc-msg-del { opacity: 1; }
}

/* 管理后台：全站汇总卡 + 表格里的学习数据列 */
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 10px; margin: 0 0 14px; }
.adm-stat { background: #f7f8fa; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.adm-stat-v { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.25; }
.adm-stat-l { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.adm-dim { color: var(--text-2); font-weight: 400; font-size: 12.5px; }
.adm-na { color: #c0c4cc; }
.adm-num { white-space: nowrap; }
.adm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.theme-dark .adm-stat, body.theme-dark .adm-stat { background: #232831; }
@media (max-width: 640px) {
  .adm-stats { grid-template-columns: repeat(2, 1fr); }
  .adm-table th, .adm-table td { padding: 9px 10px; font-size: 13px; }
  .adm-stat-v { font-size: 18px; }
}
