/* 导航栏品牌字：马善政毛笔楷书（SIL OFL 1.1）四字子集，见 scripts/build_brand_font.py。
   unicode-range 限定只接管「逐光知理」，其余文字仍走系统字体。 */
@font-face {
  font-family: "ZhuGuang Brand";
  src: url("../fonts/zhuguang-brand.ttf") format("truetype");
  font-display: swap;
  unicode-range: U+9010, U+5149, U+77E5, U+7406;
}

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1f2937;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --green: #059669;
  --amber: #b45309;
  --cyan: #0e7490;
  --red: #dc2626;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.container { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }

/* 键盘用户跳转主内容的入口，仅在获得焦点时可见 */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 8px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.site-header {
  background: var(--surface);
  box-shadow:
    0 8px 22px rgba(20, 26, 36, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 -2px 0 rgba(32, 38, 48, 0.34) inset;
  position: sticky;
  top: 0;
  z-index: 10;
  transition: box-shadow 0.18s ease;
}

/* 寓意条还露在导航行下方时，分隔线与投影由寓意条自己带着，导航行保持干净 */
.has-js .site-header:not(.is-stuck) {
  box-shadow:
    0 0 0 rgba(20, 26, 36, 0),
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 -2px 0 rgba(32, 38, 48, 0) inset;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}

/* 毛笔字重本身就够，用 400 以免浏览器伪粗把笔锋糊成一团。 */
.brand {
  font-family: "ZhuGuang Brand", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", serif;
  font-size: 24px;
  font-weight: 400;
  color: #111827;
  letter-spacing: 0.08em;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  margin-right: 9px;
  vertical-align: -7px;
}

/* 导航栏下沿的品牌寓意条：紧贴导航主行、居中、宋体衬线。
   它在吸顶区之外，随页面自然上移，滚到导航行下沿即完全退到导航后面。 */
.brand-motto {
  background-color: var(--surface);
  background-image: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.05),
    rgba(14, 116, 144, 0.045) 50%,
    rgba(37, 99, 235, 0.05)
  );
  border-bottom: 2px solid rgba(32, 38, 48, 0.34);
  box-shadow: 0 8px 22px rgba(20, 26, 36, 0.12);
}
.brand-motto p {
  margin: 0;
  padding: 0 0 5px;
  text-align: center;
  font-family: "Kaiti SC", "STKaiti", "Kaiti", "KaiTi", "楷体", "Kaiti TC", serif;
  font-size: 11.5px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  color: #475569;
  white-space: normal;
}

@media (min-width: 1040px) {
  .brand-motto p { white-space: nowrap; }
}
.brand-motto strong {
  color: #1d4ed8;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.brand-motto .motto-tail { color: #6b7280; }

.brand:hover { color: var(--accent); text-decoration: none; }

.nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.nav a.nav-active { color: var(--text); font-weight: 600; }
.nav-user { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }

.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font: inherit;
  line-height: inherit;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary:hover { color: var(--accent-dark); }
.nav-dropdown > summary.nav-active,
.nav-dropdown[open] > summary { color: var(--text); }
.nav-dropdown > summary.nav-active { font-weight: 600; }
.nav-dropdown > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}
.nav-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s ease;
}
.nav-dropdown[open] .nav-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}
.nav-dropdown-menu a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  background: #eff6ff;
  color: var(--accent-dark);
  text-decoration: none;
}
.nav-dropdown-menu a.nav-active {
  background: #eff6ff;
  color: var(--accent-dark);
  font-weight: 600;
}
.nav-subgroup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.nav-subgroup-label {
  margin: 0;
  padding: 4px 12px 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.nav-subgroup-items { display: flex; flex-direction: column; gap: 2px; }

/* 「其他操作」条目最多，整栏摊开会顶出视口下半屏。桌面端改为限高＋纵向滑动，
   滚轮只滚菜单、不把页面一起带走（overscroll-behavior: contain）；
   移动端整块导航面板本来就整体滚动，这里不再叠加第二层滚动条。 */
@media (min-width: 861px) {
  .nav-dropdown-scroll .nav-dropdown-menu {
    max-height: min(62vh, 440px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }
  .nav-dropdown-scroll .nav-dropdown-menu::-webkit-scrollbar { width: 8px; }
  .nav-dropdown-scroll .nav-dropdown-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
  }
  .nav-dropdown-scroll .nav-dropdown-menu::-webkit-scrollbar-track { background: transparent; }
  /* 底部压一道渐隐，提示列表还能往下滚；sticky 让它始终贴在容器下沿，不拦点击 */
  .nav-dropdown-scroll .nav-dropdown-menu::after {
    content: "";
    position: sticky;
    bottom: -8px;
    flex: 0 0 auto;
    height: 18px;
    margin: -18px -8px 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--surface));
  }
  /* 分组标题随内容滚走就认不出当前在哪一组，贴在滚动容器顶部 */
  .nav-dropdown-scroll .nav-subgroup-label {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-top: 6px;
    background: var(--surface);
  }
}

.inline-form { display: inline; margin: 0; }
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

main.container { padding: 32px 0 64px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: #eff6ff; color: var(--accent-dark); }

/* 首页三个主行动按钮：同为实心，靠色相区分动线 */
.btn-learn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-learn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-practice {
  background: #047857;
  border-color: #047857;
  color: #fff;
}
.btn-practice:hover { background: #065f46; border-color: #065f46; }

.btn-sim {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #fff;
}
.btn-sim:hover { background: #155e75; border-color: #155e75; }

.btn-small { padding: 6px 12px; font-size: 14px; border-radius: 8px; }

.badge {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  line-height: 1.8;
  white-space: nowrap;
}
.badge-free { background: #ecfdf5; color: var(--green); }
.badge-paid { background: #fffbeb; color: var(--amber); }
.badge-member { background: #eff6ff; color: var(--accent); font-weight: 600; }
.badge-draft { background: #fff7ed; color: #c2410c; }
.badge-reviewed { background: #eff6ff; color: #1e40af; }
.badge-approved { background: #f0fdf4; color: #166534; }

.diff-easy { background: #ecfdf5; color: var(--green); }
.diff-medium { background: #fffbeb; color: var(--amber); }
.diff-hard { background: #fef2f2; color: var(--red); }

.muted { color: var(--muted); }
.small { font-size: 13px; }

.hero {
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 55%, #ecfeff 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 48px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
}

.hero h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.3; }
.hero-sub { margin: 0 0 22px; color: var(--muted); max-width: 560px; }

.search-form { display: flex; gap: 10px; max-width: 560px; margin-bottom: 22px; }
.search-form .btn { flex: none; white-space: nowrap; }
.search-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.search-form input:focus,
.filter-form input:focus,
.filter-form select:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-title { font-size: 21px; margin: 0 0 16px; }
.section-sub { margin: -8px 0 16px; color: var(--muted); font-size: 14px; max-width: 720px; }

.kp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.kp-card { padding: 20px; }
.kp-card h3 { margin: 0 0 12px; font-size: 17px; }

.kp-stage-stack { display: grid; gap: 12px; }
.kp-stage {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.kp-stage-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  list-style: none;
  cursor: pointer;
}
.kp-stage-head::-webkit-details-marker { display: none; }
.kp-stage-head:hover { background: #f8fafc; }
.kp-stage-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kp-stage-title strong { font-size: 17px; }
.kp-stage-title small { color: var(--muted); font-size: 13px; }
.kp-stage-meta {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.kp-stage-caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform 0.15s ease;
}
.kp-stage[open] .kp-stage-caret { transform: rotate(180deg); }
.kp-stage[open] .kp-stage-head { border-bottom: 1px solid var(--line); }
.kp-stage-body { padding: 18px 20px 20px; }
.kp-stage-body .junior-home-card { padding: 0; }

/* 模块简介默认折叠：展开后是 200 字以内的导读 */
.kp-intro {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 14px;
}
.kp-intro summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kp-intro summary::-webkit-details-marker { display: none; }
.kp-intro summary::before { content: "＋"; font-size: 12px; color: var(--muted); }
.kp-intro[open] summary::before { content: "－"; }
.kp-intro p {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

/* 习题按板块分组：每组一个小标题 + 一行胶囊 */
.chip-group { display: grid; gap: 8px; }
.chip-group + .chip-group { margin-top: 4px; }
.chip-group-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  letter-spacing: .02em;
}
.chip-group-name::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 12px;
  margin-right: 6px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -1px;
}

/* 专业课习题导航：门课 → 章 两级折叠，默认全收起 */
.course-fold-list { display: grid; gap: 10px; }
.course-fold {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.course-fold-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  list-style: none;
  cursor: pointer;
}
.course-fold-head::-webkit-details-marker { display: none; }
.course-fold-head:hover { background: #f8fafc; }
.course-fold-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.course-fold-title strong { font-size: 16px; }
.course-fold-all { font-size: 13px; color: var(--accent-dark); }
.course-fold-all:hover { text-decoration: underline; }
.course-fold-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.course-fold-caret {
  flex: 0 0 auto;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform 0.15s ease;
}
.course-fold[open] .course-fold-caret { transform: rotate(180deg); }
.course-fold[open] .course-fold-head { border-bottom: 1px solid var(--line); }
.course-fold-body { padding: 10px 16px 16px; display: grid; gap: 8px; }
.chapter-fold {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.chapter-fold-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  color: #334155;
}
.chapter-fold-head::-webkit-details-marker { display: none; }
.chapter-fold-head:hover { background: #eef2f7; }
.chapter-fold-title { font-weight: 600; }
.chapter-fold-meta { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.chapter-fold-caret {
  flex: 0 0 auto; width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform 0.15s ease;
}
.chapter-fold[open] .chapter-fold-caret { transform: rotate(180deg); }
.chapter-fold-body { padding: 6px 14px 14px; }
.chip.chip-empty { opacity: .6; background: #f1f5f9; }
/* 通用「板块→章→小节」递归折叠：首页与答题页侧栏共用，按深度递增缩进 */
.nav-fold-tree { display: grid; gap: 8px; }
.nav-fold { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.nav-fold-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; list-style: none; cursor: pointer; }
.nav-fold-head::-webkit-details-marker { display: none; }
.nav-fold-head:hover { background: #f8fafc; }
.nav-fold-title { font-weight: 600; min-width: 0; color: inherit; text-decoration: none; }
.nav-fold-title:hover { text-decoration: underline; }
.nav-fold-title.active { color: var(--accent); }
.nav-fold-meta { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.nav-fold-caret { flex: 0 0 auto; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); transition: transform 0.15s ease; }
.nav-fold[open] .nav-fold-caret { transform: rotate(180deg); }
.nav-fold[open] .nav-fold-head { border-bottom: 1px solid var(--line); }
.nav-fold-body { padding: 8px 12px 12px; display: grid; gap: 6px; }
.nav-leaf { display: block; padding: 6px 10px; border-radius: 8px; color: #334155; font-size: 13.5px; }
.nav-leaf:hover { background: #f3f4f6; text-decoration: none; }
.nav-leaf.active { background: #eff6ff; color: var(--accent); font-weight: 600; }
/* 答题页侧栏内的「门课→章→小节」折叠：复用基样式，窄栏下收紧留白与字号 */
.filter-panel .nav-fold { border-radius: 10px; }
.filter-panel .nav-fold .course-fold-head { padding: 10px 12px; gap: 8px; }
.filter-panel .nav-fold .course-fold-title strong { font-size: 14px; }
.filter-panel .nav-fold .course-fold-all { font-size: 12px; }
.filter-panel .nav-fold .course-fold-all.active { color: var(--accent); font-weight: 600; }
.filter-panel .nav-fold .course-fold-meta { font-size: 11.5px; }
.filter-panel .nav-fold-body { padding: 8px 10px 10px; gap: 6px; }
.filter-panel .chapter-fold-head { padding: 7px 11px; gap: 8px; font-size: 13px; }
.filter-panel .chapter-fold-meta { font-size: 11.5px; }
.filter-panel .nav-fold-leaves { padding: 4px 8px 10px; display: grid; gap: 2px; }
.filter-panel .nav-fold .nav-fold-head { padding: 9px 12px; gap: 8px; }
.filter-panel .nav-fold .nav-fold-title { font-size: 13.5px; }
.filter-panel .nav-fold .nav-fold-meta { font-size: 11.5px; }
.filter-panel .nav-fold .nav-fold-body { padding: 6px 10px 10px; gap: 4px; }
.filter-panel .nav-leaf { padding: 6px 10px 6px 22px; font-size: 12.5px; }
.filter-panel .nav-fold .nav-fold .nav-leaf { padding-left: 30px; }
.filter-panel .nav-fold .nav-fold .nav-fold .nav-leaf { padding-left: 38px; }
.filter-panel .filter-link.leaf { padding-left: 22px; color: var(--muted); font-size: 12.5px; }
.filter-panel .filter-link.leaf.active { color: var(--accent); font-weight: 600; }
.filter-panel .filter-link.filter-link-dead { color: #b6c0cd; cursor: default; }

/* 细分小节默认收起：主页只摊开板块，章节级细目按需下拉 */
/* 答题页的知识点卡标：可点击跳回该章题目列表 */
.badge-kp { background: #eef2ff; color: var(--accent-dark); text-decoration: none; }
.badge-kp:hover { background: #e0e7ff; text-decoration: none; }
.badge-kp-static { background: #eef2ff; color: var(--accent-dark); }
.attempt-kp {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.attempt-kp a {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1.8;
}
.attempt-kp a:hover { background: #e0e7ff; text-decoration: none; }

.knowledge-note { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.knowledge-books { display: grid; gap: 18px; }
.knowledge-book {
  /* 栅格项的自动最小尺寸＝内容 min-content：展开后一条不换行的长公式会把整列撑破手机视口，须显式允许收缩 */
  min-width: 0;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}
.knowledge-book:first-child { border-top: 0; padding-top: 0; }
.knowledge-book h3 { margin: 0 0 10px; color: var(--accent-dark); font-size: 15px; }
/* 分册也做成折叠块：展开学段后先只看到分册名，再逐层展开章与节 */
.knowledge-book-head {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.knowledge-book-head::-webkit-details-marker { display: none; }
.knowledge-book-head::before {
  content: "▸";
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.knowledge-book[open] > .knowledge-book-head::before { transform: rotate(90deg); }
.knowledge-book-head h3 { margin: 0; }
.knowledge-book-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.knowledge-book-body { padding-top: 10px; }
/* 板块目录树收口到大专题：专题折叠一层，章一行直达所属分册页 */
.knowledge-topics { display: grid; gap: 18px; }
.knowledge-stage-topics { margin-top: 4px; }
.knowledge-topic {
  /* 同 .knowledge-book：栅格项须允许收缩，长专题名不换行会撑破窄视口 */
  min-width: 0;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}
.knowledge-topic:first-child { border-top: 0; padding-top: 0; }
.knowledge-topic h3 { margin: 0; color: var(--accent-dark); font-size: 15px; }
.knowledge-topic-head {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.knowledge-topic-head::-webkit-details-marker { display: none; }
.knowledge-topic-head::before {
  content: "▸";
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.knowledge-topic[open] > .knowledge-topic-head::before { transform: rotate(90deg); }
.knowledge-topic-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.knowledge-topic-body { padding-top: 12px; }
.knowledge-topic-chapters { display: block; margin: 0; padding: 0; list-style: none; }
/* 首页轻量目录：一章一行，点章名直达分册页，不再逐章展开节名 */
.knowledge-topic-chapter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.knowledge-topic-chapter-row:last-child { border-bottom: 0; }
.knowledge-topic-chapter-row .knowledge-topic-chapter-title { text-decoration: none; }
.knowledge-topic-chapter-row .knowledge-topic-chapter-title:hover { text-decoration: underline; }
.knowledge-topic-chapter-row .knowledge-topic-chapter-count,
.knowledge-topic-chapter-row .knowledge-topic-chapter-book {
  color: var(--text-soft, #7a7a7a);
  font-size: 12px;
}
.knowledge-topic-chapter-row .knowledge-topic-chapter-count { margin-left: auto; }
/* 章是一层 details：默认展开列本节，点章标题折叠；节在章内再各自折叠一层 */
.knowledge-topic-chapter {
  display: block;
  padding: 0;
  border-bottom: 1px dashed var(--line);
}
.knowledge-topic-chapter:last-child { border-bottom: 0; }
.knowledge-topic-chapter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}
.knowledge-topic-chapter-head::-webkit-details-marker { display: none; }
.knowledge-topic-chapter-head::before {
  content: "▸";
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.knowledge-topic-chapter[open] > .knowledge-topic-chapter-head::before { transform: rotate(90deg); }
.knowledge-topic-chapter-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
/* is-plain 章是 flex 容器，章体作为 flex 项若无 basis 会按内容收缩，整列小节卡片随之挤在左侧 */
.knowledge-topic-chapter-body { flex: 1 1 100%; width: 100%; min-width: 0; padding: 0 0 12px 16px; }
.knowledge-topic-chapter.is-plain {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding: 7px 0;
}
.knowledge-topic-chapter.is-plain > .knowledge-topic-chapter-head { flex: 1 1 100%; }
.knowledge-topic-chapter.is-plain .knowledge-topic-chapter-count { margin-left: auto; }
.knowledge-topic-chapter.is-plain .knowledge-topic-chapter-link {
  margin-left: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
.knowledge-topic-chapter-link {
  margin-left: auto;
  color: var(--accent-dark);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.knowledge-topic-chapter-link:hover { color: var(--accent-dark); text-decoration: underline; }
.knowledge-topic-chapter-book,
.knowledge-topic-chapter-count { color: var(--muted); font-size: 12px; }
.knowledge-topic-chapter-count { white-space: nowrap; }
.knowledge-topic-sections { flex-basis: 100%; margin: 2px 0 4px; }
/* 光电与器件：十门专业课程横向排一条筛选栏，选中课程的长文直接在本页展开 */
.knowledge-course-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: thin;
}
.knowledge-course-filter .knowledge-sections-label { flex: none; white-space: nowrap; }
.knowledge-course-filter .chip { flex: none; white-space: nowrap; }
/* 导航侧每节两块：知识点总结 + 易错点分析（NAV-TWO-BLOCKS） */
.knowledge-nav-sections {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 10px;
  margin: 6px 0 8px;
  padding: 0 0 0 18px;
  list-style: none;
  counter-reset: nav-section;
}
.knowledge-nav-section {
  min-width: 0;
  counter-increment: nav-section;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.knowledge-nav-section:target { border-color: var(--accent); background: #f0f9ff; }
/* 每节折叠为一枚 details.section-note：卡片不再自带内边距，横向留白由 summary / body 承担 */
.knowledge-nav-section .section-note { border-top: none; }
.knowledge-nav-section .section-note-head { padding-inline: 12px 10px; }
.knowledge-nav-section .section-note-body { padding: 0 12px 10px; }
.knowledge-nav-section-title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-dark);
}
.knowledge-nav-section .longform-block:last-child { margin-bottom: 0; }
.knowledge-nav-section .longform-pitfalls {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: 8px;
}
.knowledge-nav-section .longform-pitfalls > h5 { color: var(--red); }
.knowledge-nav-section .longform-pitfalls > h5::before { background: var(--red); }
.knowledge-topic.is-pending .knowledge-topic-head::before { content: ""; }
.knowledge-chapters { display: grid; gap: 6px; }
.knowledge-chapter {
  min-width: 0;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.knowledge-chapter summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.knowledge-chapter summary::-webkit-details-marker { display: none; }
.knowledge-chapter summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s ease;
}
.knowledge-chapter[open] summary::before { transform: rotate(90deg); }
.knowledge-chapter[open] summary { border-bottom: 1px solid var(--line); }
.knowledge-chapter-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}
.knowledge-chapter-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}
.knowledge-chapter-count + .knowledge-chapter-meta { margin-left: 10px; }
.kp-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 2px 10px;
}
.kp-toolbar-btn { min-height: 44px; }
.kp-toolbar-hint { color: var(--muted); font-size: 12px; }
.knowledge-chapter-body { padding: 12px 14px 14px; }
.knowledge-chapter.is-current { border-color: var(--accent); }
.knowledge-chapter-teaser {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}
.knowledge-chapter-teaser-meta { color: var(--muted); font-size: 12px; }
.knowledge-meaning {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f0f7ff;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: #1f2937;
  font-size: 13.5px;
  line-height: 1.8;
}
.knowledge-meaning strong { display: inline-block; margin-right: 8px; color: var(--accent-dark); }
.knowledge-stage-practice {
  margin: 0 0 16px;
  padding: 12px 0 6px;
  border-top: 0;
  border-bottom: 1px dashed var(--line);
}
.knowledge-practice-more { color: var(--muted); font-size: 12px; }
.knowledge-stage-practice .btn { margin-left: auto; }
.knowledge-sections { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.knowledge-sections-label,
.knowledge-practice-label { color: var(--muted); font-size: 12px; }
/* 导航页各章的「对应练习」与节次芯片同格式，独占一行跟在章名下面。 */
.knowledge-chapter-practice { flex-basis: 100%; margin: 2px 0 4px; }
.knowledge-chapter-practice-link {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--accent-dark);
  font-size: 12px;
  text-decoration: none;
}
.knowledge-chapter-practice-link:hover {
  border-color: var(--accent);
  background: #eef4ff;
}
.knowledge-section-chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}
.section-notes { margin: 4px 0 14px; }
a.knowledge-section-chip { color: var(--muted); text-decoration: none; }
a.knowledge-section-chip:hover {
  border-color: var(--accent);
  background: #eef4ff;
  color: var(--accent-dark);
}
.section-note:target {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  background: #f6f9ff;
}
.section-note {
  border-top: 1px dashed var(--line);
}
.section-note:first-child { border-top: none; }
.section-note-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 44px;
  padding: 10px 4px;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}
.section-note-head::-webkit-details-marker { display: none; }
.section-note-head::before {
  content: "▸";
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s ease;
}
.section-note[open] > .section-note-head::before { transform: rotate(90deg); }
.section-note-head:hover { background: #f6f9ff; }
.section-note-title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 15px;
  color: var(--text);
}
.section-note-state,
.section-note-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.section-note-state { color: var(--accent-dark); }
.section-note-body { padding: 4px 2px 12px; }
.section-note-index {
  display: inline-block;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  vertical-align: 2px;
}
.section-note-aim {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}
.section-note-todo { color: #b45309; }
.section-note-points {
  margin: 0 0 10px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.9;
}
.section-note-points li { margin: 6px 0; }
.section-note-points strong { color: var(--text); }
.section-note-formulas {
  width: 100%;
  margin: 0 0 10px;
  border-collapse: collapse;
  font-size: 13.5px;
}
.section-note-formulas caption {
  caption-side: top;
  text-align: left;
  color: var(--accent-dark);
  font-size: 12px;
  padding-bottom: 4px;
}
.section-note-formulas td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  vertical-align: middle;
}
.section-note-formulas .formula-cell { white-space: nowrap; }
.section-note-pitfalls {
  margin: 0 0 10px;
  padding: 10px 14px;
  background: #fef2f2;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.8;
}
.section-note-pitfalls h5 {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--red);
  letter-spacing: 1px;
}
.section-note-pitfalls ul { margin: 0; padding-left: 18px; }
.section-note-pitfalls li { margin: 4px 0; }
.section-note-practice { font-size: 12.5px; }
.section-note-progress {
  margin: 0 0 10px;
  color: #b45309;
  font-size: 12.5px;
}
.section-note.is-longform {
  margin: 8px 0;
  padding: 0 12px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.section-note.is-longform .section-note-body { padding-bottom: 12px; }
.longform-block { margin: 0 0 12px; }
.longform-block > h5 {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent-dark);
}
.longform-block > h5::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 12px;
  margin-right: 6px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -1px;
}
.longform-block p {
  margin: 0 0 6px;
  font-size: 13.8px;
  line-height: 1.95;
  color: var(--text);
  text-align: justify;
}
.longform-block ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13.8px;
  line-height: 1.9;
}
.longform-block li { margin: 5px 0; }
.longform-block .section-note-formulas { margin-bottom: 0; }
.longform-pitfalls {
  padding: 10px 14px;
  background: #fef2f2;
  border-radius: 10px;
}
.longform-pitfalls > h5 { color: var(--red); }
.longform-pitfalls > h5::before { background: var(--red); }
.longform-summary {
  padding: 10px 14px;
  background: #f0f7ff;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}
/* 知识点长文配图：图与图注同块、不与正文抢行 */
.longform-figure-block { margin: 0 0 12px; }
.longform-figure {
  margin: 8px 0 12px;
  padding: 12px 14px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.longform-figure img {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 0 auto;
}
.longform-figure figcaption {
  margin: 8px auto 0;
  max-width: 620px;
  font-size: 12.4px;
  line-height: 1.75;
  color: #475569;
  text-align: center;
  overflow-wrap: anywhere;
}
/* 考研讲义每节 3000 字以上：正文字号与行距抬高，长公式串撑破栏时先换行再横向滚动 */
.section-notes[data-stage="kaoyan"] .longform-block { margin-bottom: 16px; }
.section-notes[data-stage="kaoyan"] .longform-block > h5 {
  margin-bottom: 7px;
  break-after: avoid;
  page-break-after: avoid;
}
.section-notes[data-stage="kaoyan"] .longform-block p,
.section-notes[data-stage="kaoyan"] .longform-block li {
  margin-bottom: 8px;
  font-size: 14.6px;
  line-height: 2.05;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  word-break: normal;
}
/* 1.02em 只给宽屏：它带 [data-stage] 属性选择器，特异性高于下面的窄屏分档，
   不加 min-width 闸会把 0.86em/0.78em 整条吃掉（实测 320 屏字号仍是 14.28px）。 */
@media (min-width: 431px) {
  .section-notes[data-stage="kaoyan"] .longform-block .katex { font-size: 1.02em; }
}
.section-notes[data-stage="kaoyan"] .longform-block .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}
.section-notes[data-stage="kaoyan"] .longform-figure figcaption { font-size: 12.8px; }
.section-notes[data-stage="kaoyan"] .section-note.is-longform { padding: 20px 20px 16px; }
@media (max-width: 640px) {
  .section-notes[data-stage="kaoyan"] .longform-block p,
  .section-notes[data-stage="kaoyan"] .longform-block li { font-size: 14px; line-height: 1.95; }
  .longform-figure { padding: 10px 10px 8px; }
}
/* 长文排版兜底（全学段共用）：KaTeX 行内式是不可分割的整体，长算式会把段落顶出屏幕 */
.section-notes .longform-block p,
.section-notes .longform-block li { overflow-wrap: anywhere; }
.section-notes .longform-block .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}
/* 公式速查表是 table，收缩不下去：窄屏改固定布局＋单元格自滚，桌面端版式不动 */
@media (max-width: 640px) {
  table.section-note-formulas { table-layout: fixed; width: 100%; }
  table.section-note-formulas td { overflow-x: auto; overflow-wrap: anywhere; }
}
/* 实测：320—390 屏上把行内公式字号收到 0.86em 起，页面才不再横向滚动 */
@media (max-width: 430px) {
  .section-notes .longform-block .katex { font-size: 0.86em; }
}
/* 实测：320 屏上长算式（如道尔顿分压的连分式）收到 0.78em 才回到视口内，出血 30→0 */
@media (max-width: 360px) {
  .section-notes .longform-block .katex { font-size: 0.78em; }
}
/* KaTeX 的 .katex-mathml 是 position:absolute＋clip，本包 .katex 没有定位，
   隐藏节点就以视口为基准落在滚动容器之外：实测 major 页 docScroll 616 全由它贡献。
   给 .katex 设定位父级后，它被单元格自身的 overflow 裁掉，文档宽度即回到视口。 */
.katex { position: relative; }
/* 逐节长文的自然段与编号步骤：分片里的真换行只在渲染层切成 <p>（数据不动），
   推导与例题按步骤编号，一条步骤里的多行不再挤成一块。 */
.longform-block > ol.longform-steps,
.longform-block > ul.longform-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.longform-block > ol.longform-steps { counter-reset: longform-step; }
.longform-block > ol.longform-steps > li {
  position: relative;
  counter-increment: longform-step;
  margin: 0 0 8px;
  padding-left: 27px;
}
.longform-block > ol.longform-steps > li::before {
  content: counter(longform-step);
  position: absolute;
  left: 0;
  top: 0.4em;
  min-width: 19px;
  padding: 0 4px;
  border-radius: 9px;
  background: #eef2ff;
  color: var(--accent-dark);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
}
.longform-block > ul.longform-list > li {
  position: relative;
  margin: 0 0 7px;
  padding-left: 16px;
}
.longform-block > ul.longform-list > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.8em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  opacity: .5;
}
.longform-block > ol.longform-steps > li > p,
.longform-block > ul.longform-list > li > p { margin: 0 0 5px; }
.longform-block > ol.longform-steps > li > p:last-child,
.longform-block > ul.longform-list > li > p:last-child { margin-bottom: 0; }
/* 行内公式与中文/中文标点之间的窄空格：KaTeX 出来的 <span class="katex"> 加外边距，
   不去改分片字节（改文会影响逐字比对与字数口径）。 */
.section-notes .longform-block .katex { margin-inline: .08em; }
/* 长文公式表：表头写明两列含义，长式在单元格内自滚而不是撑破栏 */
table.longform-formulas { width: 100%; border-collapse: collapse; }
table.longform-formulas th {
  padding: 4px 8px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-align: left;
}
table.longform-formulas th:first-child { width: 46%; }
@media print {
  .longform-figure { border-color: #d1d5db; }
  .section-note-title { break-after: avoid; page-break-after: avoid; }
  /* 打印兜底：即便 JS 未在 beforeprint 前展开，折叠正文也必须印出来 */
  details.section-note > .section-note-body { display: block !important; }
  .kp-toolbar,
  .section-note-head::before { display: none !important; }
}
.chip-static {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: default;
}
.knowledge-practice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.knowledge-practice-link { background: #eef2ff; color: var(--accent-dark); }
.knowledge-practice-link:hover { background: #e0e7ff; }
.practice-count { color: var(--muted); font-size: 12px; }

.frontier-books { gap: 22px; }
.frontier-stage-sub { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.frontier-chapter-foot { margin: 10px 0 0; }

.frontier-article { padding: 20px 22px; }
.frontier-article-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
}
.frontier-article-head h3 { margin: 0; font-size: 18px; line-height: 1.5; }
.frontier-article-head h3 a { color: var(--ink); text-decoration: none; }
.frontier-article-head h3 a:hover { color: var(--accent-dark); text-decoration: underline; }
.frontier-article-head h4 { margin: 0; font-size: 17px; line-height: 1.5; }
.frontier-article-head h4 a { color: var(--ink); text-decoration: none; }
.frontier-article-head h4 a:hover { color: var(--accent-dark); text-decoration: underline; }
.frontier-article-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.frontier-article-summary { margin: 10px 0 0; color: #374151; line-height: 1.85; }
.frontier-article-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.frontier-links-label { color: var(--muted); font-size: 12px; }
.frontier-article-practice .knowledge-practice-link { white-space: nowrap; }
.frontier-article-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.frontier-note-list { margin: 8px 0 0; padding-left: 20px; }
.frontier-note-list li { margin: 4px 0; }
.frontier-note-code {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.frontier-theme { margin-top: 30px; }
.frontier-theme-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.frontier-theme-title {
  position: relative;
  margin: 0;
  padding-left: 14px;
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink);
}
.frontier-theme-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 3px;
  background: var(--accent);
}
.frontier-theme-intro { margin: 0; color: var(--muted); font-size: 13px; }
.frontier-article-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.frontier-article-grid .frontier-article-summary {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 820px) {
  .frontier-article { padding: 16px; }
  .frontier-article-head { flex-direction: column; }
  .frontier-article-grid { grid-template-columns: 1fr; }
  .frontier-theme { margin-top: 24px; }
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
}
.chip:hover { background: #e0e7ff; color: var(--accent-dark); text-decoration: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.question-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

.question-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* 题库正文排版：中文用宋体，西文与公式用 Times New Roman（变量斜体、单位正体） */
:root {
  --font-question: "Songti SC", "宋体", SimSun, "STSong", "Times New Roman", serif;
}

.question-stem,
.stem,
.teacher-stem-link,
.choice-list li,
.answer-box,
.analysis-box,
.question-figure figcaption,
.paper-body {
  font-family: var(--font-question);
}

.katex .mathnormal {
  font-family: "Times New Roman", "STIXGeneral Text", serif;
  font-style: italic;
}

.katex .mathrm {
  font-family: "Times New Roman", "STIXGeneral Text", serif;
  font-style: normal;
}

.question-stem {
  position: relative;
  height: 7.75em;
  line-height: 1.55;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #111827;
}
.question-stem::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.8em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--surface) 92%);
  pointer-events: none;
}

.question-stem p { margin: 0 0 0.65em; }
.question-stem .katex-display { margin: 0.65em 0; overflow-x: auto; overflow-y: hidden; }
.question-stem .katex-display > .katex { white-space: normal; }
.teacher-stem-link { display: block; max-height: 5.4em; overflow: hidden; color: inherit; overflow-wrap: anywhere; }
.teacher-stem-link p { margin: 0 0 0.4em; }
.teacher-stem-link .katex-display { margin: 0.4em 0; }

.card-footer { margin-top: auto; }

.exam-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.exam-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.exam-card-head { display: flex; align-items: center; gap: 12px; }
.exam-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.exam-card-head h3 { margin: 0; font-size: 17px; line-height: 1.4; }
.exam-card-head h3 span { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.exam-files { display: grid; gap: 8px; }
.file-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
a.file-link:hover { border-color: #93c5fd; background: #eff6ff; color: var(--accent-dark); text-decoration: none; }
.file-link.file-answer { background: #f8fafc; }
.file-link.file-locked { background: #f9fafb; border-style: dashed; color: var(--muted); }
.file-link.file-external { border-color: #dbeafe; background: #f8fbff; }
.exam-organizer { margin: -4px 0 0; color: var(--muted); font-size: 12px; }
.file-pages { flex: none; color: var(--muted); font-size: 12px; }
.exam-unlock { color: var(--amber); font-size: 12px; }
.exam-unlock:hover { color: #92400e; }
.exam-source {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.exam-source span { display: block; }
.exam-more { margin-top: 16px; }
.exam-switcher-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.exam-switcher-tab {
  padding: 8px 18px;
  border-radius: 8px;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.exam-switcher-tab:hover {
  background: #fff;
  color: var(--accent-dark);
  text-decoration: none;
}
.exam-switcher-tab[aria-selected="true"] {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  font-weight: 600;
}
.exam-switcher-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.exam-panel { margin-top: 18px; }
.exam-panel[hidden] { display: none; }
.exam-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.exam-panel-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.exam-panel-head .small { flex: none; margin-top: 2px; }
.exam-notice { margin-bottom: 24px; line-height: 1.7; }
.exam-notice a { margin-left: 6px; }
.exam-years { display: grid; gap: 30px; }
.exam-year-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.exam-year-head h2 { margin: 0; font-size: 23px; }
.exam-year-head h2 span { margin-left: 2px; font-size: 14px; color: var(--muted); font-weight: 400; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.flash {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 14px;
}
.flash-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: var(--green);
}
.flash-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--red);
}
.flash-warning {
  border-color: #fed7aa;
  background: #fffbeb;
  color: var(--amber);
}

.membership-band {
  margin-top: 48px;
  padding: 28px 32px;
  border-radius: 18px;
  background: #1e3a8a;
  color: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.membership-band h2 { margin: 0 0 6px; color: #fff; font-size: 20px; }
.membership-band p { margin: 0; font-size: 14px; }
.membership-band .btn { background: #fff; color: #1e3a8a; border-color: #fff; }
.membership-band .btn:hover { background: #dbeafe; }

.section[id] { scroll-margin-top: 84px; }
.kp-stage[id] { scroll-margin-top: 132px; }
.knowledge-book[id] { scroll-margin-top: 132px; }

.home-jump {
  position: sticky;
  top: var(--header-h, 64px);
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 18px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(10px);
}
.home-jump a {
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.home-jump a:hover {
  background: #eff6ff;
  color: var(--accent-dark);
  text-decoration: none;
}
.home-jump .home-jump-cta {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.home-jump .home-jump-cta:hover {
  background: var(--accent-dark);
  color: #fff;
}

.start-zone {
  padding: 26px;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 52%, #ffffff 100%);
}
.start-question-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 { margin: 0; font-size: 28px; }
.page-head p { margin: 4px 0 0; }

.filter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-form input,
.filter-form select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.filter-form input { width: 220px; }

.notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
}
.notice a { font-weight: 600; }
.notice-draft {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
  margin: 0 0 16px;
}

.list-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; margin-top: 20px; }

.sidebar h3 { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.kp-group { margin-bottom: 14px; }
.filter-link {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: #374151;
  font-size: 14px;
}
.filter-link:hover { background: #f3f4f6; text-decoration: none; }
.filter-link.child { padding-left: 24px; color: var(--muted); }
.filter-link.grandchild { padding-left: 40px; color: var(--muted); font-size: 12.5px; }
.junior-topic-sections { margin-top: 8px; gap: 6px; }
.chip-sm { padding: 2px 8px; font-size: 12px; }
.filter-link.active { background: #eff6ff; color: var(--accent); font-weight: 600; }

.empty-state { padding: 40px; text-align: center; grid-column: 1 / -1; }

.pagination {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 8px;
}

.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin: 0 6px; }

.question-detail { padding: 28px; }
.question-detail .stem { font-size: 17px; margin-top: 14px; }

.choice-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.choice-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}
.choice-label { font-weight: 700; color: var(--accent); flex: none; }
.choice-list li > span:last-child { min-width: 0; overflow-x: auto; }

.attempt-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.attempt-fieldset { border: 0; margin: 0; padding: 0; }
.attempt-fieldset legend { padding: 0; font-size: 16px; font-weight: 700; }
.attempt-hint { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
.choice-list-selectable li { padding: 0; transition: border-color 0.15s, background 0.15s; }
.choice-list-selectable li:hover { border-color: #93c5fd; }
.choice-list-selectable li:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #dbeafe; }
.choice-list-selectable li:has(input:checked) { background: #eff6ff; border-color: var(--accent); }
.choice-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  padding: 10px 14px;
  cursor: pointer;
}
.choice-option input {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 6px;
  accent-color: var(--accent);
}
.choice-content { min-width: 0; overflow-x: auto; }
.choice-list li.choice-correct { background: #f0fdf4; border-color: #86efac; }
.choice-list li.choice-selected { background: #fef2f2; border-color: #fecaca; }
.choice-mark {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.choice-mark-correct { color: #166534; background: #dcfce7; }
.choice-mark-wrong { color: #991b1b; background: #fee2e2; }
.photo-upload { margin-top: 10px; }
.photo-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px;
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  background: #f8fbff;
  color: var(--accent);
  text-align: center;
  cursor: pointer;
}
.photo-upload-label small { color: var(--muted); font-size: 12px; }
.photo-upload-icon { font-size: 26px; line-height: 1; }
.photo-upload input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.attempt-form .errorlist { margin: 8px 0 0; padding-left: 18px; color: var(--red); font-size: 13px; }
.attempt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 14px;
}
.attempt-actions .attempt-hint { margin: 0; }
.answer-text-label {
  display: block;
  margin: 14px 0 6px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}
.answer-text-input {
  width: 100%;
  min-height: 124px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  line-height: 1.7;
  resize: vertical;
}
.answer-text-input:focus {
  outline: 3px solid #dbeafe;
  border-color: var(--accent);
}
.self-rating { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.self-rating-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fafb;
  font-size: 14px;
  cursor: pointer;
}
.self-rating-option:has(input:checked) {
  background: #eff6ff;
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}
.self-rating-option input { accent-color: var(--accent); }
.photo-optional {
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
}
.photo-optional summary {
  padding: 10px 0;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.photo-optional[open] { padding-bottom: 14px; }
.photo-optional .photo-upload { margin-top: 0; }
.photo-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.photo-file-name { margin: 6px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.attempt-text {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #fff;
}
.attempt-text-label { color: var(--accent); font-size: 12px; font-weight: 700; }
.attempt-text p { margin: 6px 0 0; line-height: 1.7; }
.attempt-result {
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.attempt-result.correct { background: #f0fdf4; border-color: #bbf7d0; }
.attempt-result.wrong { background: #fef2f2; border-color: #fecaca; }
.attempt-result.recorded { background: #eff6ff; border-color: #bfdbfe; }
.attempt-result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.attempt-result-head strong { font-size: 16px; }
.attempt-result.correct strong { color: var(--green); }
.attempt-result.wrong strong { color: var(--red); }
.attempt-result.recorded strong { color: var(--accent); }
.attempt-photo { margin: 14px 0 0; text-align: center; }
.attempt-photo img {
  max-width: min(100%, 640px);
  max-height: 480px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.attempt-photo figcaption { margin-top: 6px; color: var(--muted); font-size: 13px; }
.choice-image {
  display: block;
  max-width: min(100%, 320px);
  height: auto;
  margin-top: 8px;
  border-radius: 8px;
  background: #fff;
}

.question-figure { margin: 18px 0 4px; text-align: center; }
.question-figure img {
  max-width: min(100%, 720px);
  height: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.question-figure figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.question-detail .katex-display,
.analysis-box .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

.answer-box,
.analysis-box {
  margin-top: 18px;
  padding: 22px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.answer-box { background: #f0fdf4; border-color: #bbf7d0; }
.analysis-box { background: #f8fafc; }
.answer-box h3,
.analysis-box h3 { margin: 0 0 8px; font-size: 16px; }
.share-slice-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
}
.share-slice-row .btn { font-size: 13px; padding: 5px 12px; }
.share-slice-row .share-slice-hint { color: var(--muted); }

.locked {
  margin-top: 18px;
  padding: 32px;
  text-align: center;
  border: 1px dashed #f59e0b;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
}
.locked h3 { margin: 0 0 8px; font-size: 18px; }
.locked p { margin: 0 0 18px; color: var(--muted); }
.locked .hero-actions { justify-content: center; }

.back-row { margin-top: 22px; font-size: 14px; }

.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-card { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.plan-card h3 { margin: 0; font-size: 18px; }
.plan-card p { margin: 0; }
.plan-card form { margin-top: auto; }
.price { font-size: 26px; font-weight: 700; color: var(--accent); }

.benefit-list { margin: 0; padding-left: 20px; color: #374151; }
.benefit-list li { margin-bottom: 6px; }

.order-card { padding: 26px; max-width: 640px; }
.order-card dl { margin: 0 0 18px; display: grid; gap: 10px; }
.order-card dl > div { display: flex; gap: 16px; }
.order-card dt { width: 80px; color: var(--muted); flex: none; }
.order-card dd { margin: 0; }

.pay-box { border-top: 1px solid var(--line); padding-top: 18px; }
.pay-box p { color: var(--muted); font-size: 14px; }
.success { color: var(--green); font-weight: 600; margin: 0 0 14px; }

.auth-card {
  max-width: 430px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.auth-card h1 { margin: 0 0 20px; font-size: 26px; }
.auth-card p { margin: 14px 0; }
.auth-card label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.auth-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 15px;
  font-family: inherit;
}
.auth-card input:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.auth-card .helptext { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.auth-card .errorlist { color: var(--red); font-size: 13px; padding-left: 18px; }
.auth-card button { margin-top: 6px; width: 100%; }
.auth-card .form-field { margin-bottom: 14px; }
.auth-card .code-row { display: flex; gap: 10px; align-items: stretch; }
.auth-card .code-row input { flex: 1; min-width: 0; }
.auth-card .code-row button { width: auto; margin-top: 0; flex-shrink: 0; white-space: nowrap; }
.auth-card .checkbox-field label { display: flex; align-items: flex-start; gap: 8px; color: var(--text); font-size: 13px; cursor: pointer; }
.auth-card .checkbox-field input { width: auto; margin-top: 3px; }
.auth-card .sms-hint { min-height: 18px; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.auth-card .sms-hint.error { color: var(--red); }
.auth-card .form-field .errorlist { margin: 6px 0 0; }

.onboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 16px 0 6px; }
.onboard-option { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; font-size: 13px; color: var(--text); }
.onboard-option:hover { border-color: var(--accent); }
.onboard-option.is-suggested { border-color: var(--accent); background: #f5f8ff; }
.onboard-option input[type="radio"] { width: auto; margin: 0 0 2px; }
.onboard-option-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.onboard-option-head strong { font-size: 15px; }
.onboard-tag { padding: 1px 6px; border-radius: 99px; background: #e0e7ff; color: var(--accent-dark); font-size: 11px; font-style: normal; }
.onboard-option-meta { color: var(--muted); font-size: 12px; }
.onboard-option-link { font-size: 12px; }
.onboard-foot { display: flex; gap: 10px; margin-top: 14px; }
.onboard-foot button { width: auto; flex: 1; }
.onboard-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.onboard-actions .btn { width: auto; margin-top: 0; }
.onboard-subtitle { margin: 18px 0 8px; font-size: 17px; }
.onboard-list { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }

.stage-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 11px; background: #f5f8ff; }
.stage-notice-text { margin: 0; font-size: 14px; }
.stage-notice-actions { display: flex; align-items: center; gap: 8px; }
.stage-notice-actions form { margin: 0; }
.stage-notice-actions .btn { width: auto; margin: 0; }

.password-strength { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.password-strength-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.password-strength-head strong { font-size: 13px; color: var(--muted); }
.password-strength-head strong.strength-low { color: #b91c1c; }
.password-strength-head strong.strength-medium { color: #b45309; }
.password-strength-head strong.strength-high { color: #047857; }
.password-strength-track { height: 6px; margin: 8px 0; overflow: hidden; border-radius: 99px; background: #e2e8f0; }
.password-strength-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #cbd5e1; transition: width .2s ease, background .2s ease; }
.password-strength-track span.strength-low { background: #dc2626; }
.password-strength-track span.strength-medium { background: #d97706; }
.password-strength-track span.strength-high { background: #059669; }
.password-strength-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.6; }
.password-strength-checks li { color: #b91c1c; }
.password-strength-checks li.ok { color: #047857; }
@media (max-width: 520px) { .password-strength-checks { grid-template-columns: 1fr; } }

.legal-page { max-width: 760px; }
.legal-page h1 { font-size: 30px; margin: 0 0 6px; }
.legal-page h2 { font-size: 18px; margin: 26px 0 8px; }
.legal-page p, .legal-page li { color: #374151; line-height: 1.9; font-size: 15px; }
.site-footer a { color: inherit; text-decoration: underline; }

.site-footer {
  border-top: 1px solid var(--line);
  /* 底部留出固定管理入口的高度，滚到页脚时按钮落在空白区，不压住协议与结句 */
  padding: 22px 0 calc(22px + 52px);
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
}

.footer-slogan {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}

.footer-slogan a { white-space: nowrap; }

.footer-legal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}

.footer-visitors {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.footer-filing {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.footer-quote {
  display: flex;
  align-items: baseline;
  gap: 14px;
  max-width: 820px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  line-height: 2;
}

.footer-quote-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* 三个管理入口固定在视口最左下角：标记在 </footer> 之后、body 的直接子元素，
   因此不参与任何页面内容排版，滚动与换页都停在同一位置。 */
.ops-home-corner {
  position: fixed;
  left: env(safe-area-inset-left);
  bottom: env(safe-area-inset-bottom);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 14px 0 0;
  white-space: nowrap;
}

/* 划到页面底部才出现：base.html 的内联脚本给 <html> 打上 ops-corner-gated，
   再用 IntersectionObserver 切换 is-visible。没有 JS 时不加类，入口保持常显。 */
.ops-corner-gated .ops-home-corner {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
}

.ops-corner-gated .ops-home-corner.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

.ops-home-corner-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}

.ops-home-corner-link:hover {
  border-color: var(--accent);
  background: #fff;
  color: var(--accent-dark);
  text-decoration: none;
}

.ops-home-corner-link.is-primary {
  border-color: rgba(37, 99, 235, 0.28);
  background: #f5f8ff;
}

.ops-home-corner-link:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

.ops-home-corner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.16);
}

@media (max-width: 560px) {
  .ops-home-corner {
    gap: 6px;
    padding: 7px 9px 7px 6px;
  }
  .ops-home-corner-link {
    padding: 7px 10px;
    font-size: 11.5px;
  }
}

/* 极窄屏上三个入口纵向叠放，仍贴最左下角 */
@media (max-width: 420px) {
  .site-footer { padding-bottom: calc(22px + 132px); }
  .ops-home-corner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 860px) {
  .brand-motto p { font-size: 11px; line-height: 1.5; padding: 0 0 4px; }
  .hero { padding: 30px; }
  .hero h1 { font-size: 27px; }
  .kp-grid, .question-grid, .plan-grid, .exam-grid { grid-template-columns: 1fr; }
  .home-jump { top: var(--header-h, 64px); border-radius: 16px; flex-wrap: nowrap; overflow-x: auto; }
  .home-jump .home-jump-cta { margin-left: 0; }
  .start-zone { padding: 18px; }
  .kp-stage-head { flex-wrap: wrap; gap: 8px 10px; padding: 14px; }
  .kp-stage-title strong { font-size: 16px; }
  .kp-stage-meta { margin-left: 0; font-size: 12px; }
  .kp-stage-caret { margin-left: auto; }
  .kp-stage-body { padding: 14px; }
  .list-layout { grid-template-columns: 1fr; }
  .header-inner {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding: 10px 0;
  }
  .nav { flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; }
  .filter-form input { width: 100%; }
}

/* ---------- 物理实验 ---------- */
.lab-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 32px;
  align-items: center;
  padding: 42px 46px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 18%, rgba(34, 211, 238, 0.22), transparent 36%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 58%, #0e7490 100%);
  color: #e2e8f0;
  overflow: hidden;
}
.lab-hero .eyebrow { color: #7dd3fc; margin-bottom: 10px; }
.lab-hero h1 { margin: 0 0 12px; color: #fff; font-size: 38px; letter-spacing: 0.02em; }
.lab-hero-sub { margin: 0; max-width: 620px; color: #c7d2fe; font-size: 15px; }
.lab-hero-stats { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 24px; font-size: 13px; color: #bfdbfe; }
.lab-hero-stats strong { color: #fff; font-size: 18px; margin-right: 4px; }

.lab-hero-board {
  position: relative;
  padding: 18px 20px;
  border: 1px solid rgba(191, 219, 254, 0.28);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
}
.lab-board-top {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #93c5fd;
  font-size: 10px;
  letter-spacing: 0.16em;
}
.lab-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14);
  animation: lab-pulse 1.8s ease-in-out infinite;
}
@keyframes lab-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14); }
  50% { opacity: 0.6; box-shadow: 0 0 0 7px rgba(52, 211, 153, 0.06); }
}
.lab-board-formula {
  margin: 22px 0 18px;
  color: #f0f9ff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(18px, 2.2vw, 25px);
  letter-spacing: 0.04em;
}
.lab-board-bars { display: flex; align-items: flex-end; gap: 8px; height: 62px; }
.lab-board-bars span {
  flex: 1;
  height: var(--h);
  min-height: 8px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #67e8f9, #3b82f6);
  opacity: 0.78;
}
.lab-board-foot { margin-top: 14px; color: #93c5fd; font-size: 11px; }

.lab-filter { display: flex; flex-wrap: wrap; gap: 9px; margin: 28px 0 18px; }
.lab-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #475569;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.lab-chip:hover { border-color: #93c5fd; color: var(--accent-dark); text-decoration: none; }
.lab-chip span {
  min-width: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.lab-chip.active { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
.lab-chip.active span { background: rgba(255, 255, 255, 0.18); color: #e0f2fe; }
.lab-filter-note { margin: -4px 0 18px; color: var(--muted); font-size: 13px; }

.lab-stage-tabs {
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  margin: 26px 0 0;
  padding: 5px;
  border-radius: 14px;
  background: #e8eef7;
}
.lab-stage-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 22px;
  border-radius: 10px;
  color: #475569;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.lab-stage-tab span {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.lab-stage-tab:hover { color: #1e3a8a; text-decoration: none; }
.lab-stage-tab.active {
  background: #fff;
  color: #1e3a8a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.lab-stage-tab.active span { background: #dbeafe; color: #1d4ed8; }

.lab-group { margin-top: 28px; }
.lab-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.lab-group-head h2 { margin: 0; font-size: 17px; line-height: 1.5; }
.lab-group-head h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 15px;
  margin-right: 9px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -2px;
}
.lab-group-head span { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.sim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sim-grid-home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sim-grid-home .sim-card { padding: 18px; gap: 10px; }
.sim-grid-home .sim-tagline { font-size: 13px; }
.sim-grid-home .sim-card-meta { display: none; }
.sim-grid-home .sim-module { display: none; }

.sim-accent-mechanics { --sim-accent: #2563eb; --sim-soft: #eff6ff; --sim-deep: #1e40af; }
.sim-accent-vibration { --sim-accent: #7c3aed; --sim-soft: #f5f3ff; --sim-deep: #5b21b6; }
.sim-accent-electricity { --sim-accent: #d97706; --sim-soft: #fffbeb; --sim-deep: #92400e; }
.sim-accent-optics { --sim-accent: #0d9488; --sim-soft: #f0fdfa; --sim-deep: #115e59; }
.sim-accent-thermal { --sim-accent: #dc2626; --sim-soft: #fef2f2; --sim-deep: #991b1b; }
.sim-accent-sound { --sim-accent: #a21caf; --sim-soft: #fdf4ff; --sim-deep: #86198f; }
.sim-accent-modern { --sim-accent: #475569; --sim-soft: #f8fafc; --sim-deep: #334155; }
.sim-accent-circuits { --sim-accent: #0369a1; --sim-soft: #f0f9ff; --sim-deep: #075985; }
.sim-accent-analog { --sim-accent: #be123c; --sim-soft: #fff1f2; --sim-deep: #9f1239; }
.sim-accent-digital { --sim-accent: #15803d; --sim-soft: #f0fdf4; --sim-deep: #166534; }

.sim-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.sim-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--sim-accent, var(--accent));
}
.sim-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--sim-accent, var(--accent)) 38%, white);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}
.sim-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sim-card-tags { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.sim-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.sim-mode .lab-live-dot { width: 5px; height: 5px; box-shadow: none; animation: none; }
.sim-mode-inline { font-size: 11px; padding: 3px 10px; }
.sim-symbol {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--sim-accent, var(--accent)), var(--sim-deep, var(--accent-dark)));
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--sim-accent, var(--accent)) 24%, transparent);
}
.sim-badge-mechanics { background: #eff6ff; color: #1d4ed8; }
.sim-badge-vibration { background: #f5f3ff; color: #6d28d9; }
.sim-badge-electricity { background: #fffbeb; color: #b45309; }
.sim-badge-optics { background: #f0fdfa; color: #0f766e; }
.sim-badge-thermal { background: #fef2f2; color: #b91c1c; }
.sim-badge-sound { background: #fdf4ff; color: #a21caf; }
.sim-badge-modern { background: #f1f5f9; color: #334155; }
.sim-badge-circuits { background: #f0f9ff; color: #0369a1; }
.sim-badge-analog { background: #fff1f2; color: #be123c; }
.sim-badge-digital { background: #f0fdf4; color: #15803d; }
.sim-card h3 { margin: 0; font-size: 18px; line-height: 1.45; }
.sim-card h3 a { color: #0f172a; }
.sim-card h3 a:hover { color: var(--sim-accent, var(--accent)); text-decoration: none; }
.sim-tagline { flex: 1; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.sim-module {
  margin: -4px 0 0;
  color: #94a3b8;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sim-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #94a3b8; font-size: 12px; }
.sim-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--sim-accent, var(--accent));
  font-size: 13px;
  font-weight: 600;
}
.sim-start:hover { text-decoration: none; color: var(--sim-deep, var(--accent-dark)); }
.sim-arrow { transition: transform 0.16s ease; }
.sim-start:hover .sim-arrow { transform: translateX(3px); }

.lab-guide {
  margin-top: 46px;
  padding: 30px 34px;
  border-radius: 20px;
  background: #0f172a;
  color: #cbd5e1;
}
.lab-guide h2 { margin: 0 0 20px; color: #fff; font-size: 20px; }
.lab-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.lab-guide-step span {
  display: inline-block;
  margin-bottom: 8px;
  color: #67e8f9;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
}
.lab-guide-step h3 { margin: 0 0 6px; color: #f8fafc; font-size: 16px; }
.lab-guide-step p { margin: 0; color: #94a3b8; font-size: 13px; line-height: 1.7; }

.lab-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
.lab-title-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--sim-accent, var(--accent)), var(--sim-deep, var(--accent-dark)));
  color: #fff;
  font-size: 33px;
  font-weight: 700;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--sim-accent, var(--accent)) 22%, transparent);
}
.lab-title-copy { min-width: 0; }
.lab-title-copy h1 { margin: 8px 0 8px; font-size: 30px; line-height: 1.35; }
.lab-title-copy > p { margin: 0; max-width: 780px; color: #475569; font-size: 14.5px; }
.lab-title-copy .lab-module-line { margin-top: 8px; color: var(--muted); font-size: 12.5px; }

.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: 20px;
  align-items: start;
}
.lab-main { min-width: 0; }
.lab-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.sim-panel { overflow: hidden; }
.sim-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.sim-live { display: flex; align-items: center; gap: 8px; color: #475569; font-size: 13px; }
.sim-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sim-static-hint { color: var(--muted); font-size: 12px; }
.sim-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 330px;
  background: #eef4fb;
}
.sim-stage canvas { display: block; width: 100%; height: 100%; }
.sim-controls {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
}
.sim-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.sim-control { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.sim-control-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #475569;
  font-size: 13px;
}
.sim-control-label b {
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sim-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}
.sim-select {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.sim-select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 32%, transparent); outline-offset: 1px; }
.sim-readout-context { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.sim-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  align-self: end;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
}
.sim-switch input { accent-color: var(--accent); width: 15px; height: 15px; }
.sim-control-note { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; }

.lab-readout { padding: 18px 20px; }
.lab-readout-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.lab-readout-head h2 { margin: 0; font-size: 15px; }
.lab-readout-head span {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.readout-item {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.readout-item span { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.readout-item strong {
  display: block;
  margin-top: 2px;
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.readout-button { width: 100%; margin-top: 10px; }
.readout-button + .readout-button { margin-top: 8px; }
.readout-table-wrap { margin-top: 12px; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 5px 5px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.data-table th { color: var(--muted); font-weight: 500; }
.data-table th:first-child, .data-table td:first-child { text-align: left; color: #94a3b8; }
.readout-summary {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.readout-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.readout-summary span { color: var(--muted); flex: none; }
.readout-summary b { color: #1e293b; text-align: right; font-variant-numeric: tabular-nums; }
.readout-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.legend-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-blue { background: #2563eb; }
.dot-orange { background: #f59e0b; }
.dot-green { background: #059669; }
.dot-red { background: #dc2626; }
.energy-bars { display: grid; gap: 9px; margin-top: 14px; }
.energy-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 64px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.energy-track { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.energy-track i { display: block; width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width 0.08s linear; }
.energy-row:nth-child(2) .energy-track i { background: linear-gradient(90deg, #fbbf24, #d97706); }
.energy-row:nth-child(3) .energy-track i { background: linear-gradient(90deg, #34d399, #059669); }
.energy-row b { color: #334155; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.lens-ruler { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.lens-ruler b { color: #334155; }

.lab-tip, .lab-related { padding: 18px 20px; }
.lab-tip h3, .lab-related h3 { margin: 0 0 8px; font-size: 14px; }
.lab-tip p { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.lab-tip .btn { margin-top: 2px; }
.lab-related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.lab-related li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.lab-related li:last-child { padding-bottom: 0; border-bottom: none; }
.lab-related li span { color: var(--muted); font-size: 11px; white-space: nowrap; }

.lab-section { padding: 24px 28px; margin-top: 16px; }
.lab-section h2 { margin: 0 0 12px; font-size: 18px; }
.lab-section p { margin: 0 0 10px; color: #334155; font-size: 14.5px; line-height: 1.8; }
.lab-section p:last-child { margin-bottom: 0; }
.lab-formula {
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  background: #eff6ff;
  text-align: center;
  overflow-x: auto;
}
.lab-steps, .lab-questions { margin: 0; padding-left: 22px; color: #334155; font-size: 14px; }
.lab-steps li, .lab-questions li { margin-bottom: 8px; line-height: 1.75; }
.lab-steps li:last-child, .lab-questions li:last-child { margin-bottom: 0; }

.lab-apparatus { background: linear-gradient(180deg, #fff 0%, #fbfdff 100%); }
.apparatus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.apparatus-list li {
  position: relative;
  padding: 9px 12px 9px 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
}
.apparatus-list li::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.65;
}

.lab-conclusion { border-left: 3px solid #10b981; background: linear-gradient(90deg, #f0fdf4 0%, #fff 62%); }
.lab-conclusion h2 { color: #065f46; }

.lab-facts {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px 10px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
}
.lab-facts dt { color: var(--muted); }
.lab-facts dd { margin: 0; color: #334155; }

.lab-source { margin: 16px 2px 0; color: #94a3b8; font-size: 11.5px; line-height: 1.7; }
.lab-guide .lab-source {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  color: #64748b;
}

.lab-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.lab-pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lab-pager-link span { color: var(--muted); font-size: 11px; }
.lab-pager-link strong { font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.lab-pager-link:hover { border-color: #93c5fd; box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05); text-decoration: none; }
.lab-pager-next { align-items: flex-end; text-align: right; }
.lab-pager-empty { min-height: 1px; }

@media (max-width: 1000px) {
  .sim-grid, .sim-grid-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-layout { grid-template-columns: 1fr; }
  .lab-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .lab-readout { grid-column: span 2; }
  .sim-grid-home .sim-card-meta { display: flex; }
}

@media (max-width: 860px) {
  .lab-hero { grid-template-columns: 1fr; padding: 30px; }
  .lab-hero h1 { font-size: 30px; }
  .lab-hero-board { display: none; }
  .sim-grid, .sim-grid-home { grid-template-columns: 1fr; }
  .sim-grid-home .sim-card-meta { display: flex; }
  .lab-guide { padding: 24px; }
  .lab-guide-grid { grid-template-columns: 1fr; gap: 18px; }
  .lab-detail-head { gap: 14px; }
  .lab-title-mark { width: 58px; height: 58px; border-radius: 16px; font-size: 26px; }
  .lab-title-copy h1 { font-size: 24px; }
  .lab-side { grid-template-columns: 1fr; }
  .lab-readout { grid-column: auto; }
  .sim-control-grid { grid-template-columns: 1fr; }
  .sim-stage { min-height: 300px; }
  .lab-section { padding: 20px; }
  .lab-stage-tabs { width: 100%; }
  .lab-stage-tab { flex: 0 0 auto; justify-content: center; padding: 9px 12px; }
  .apparatus-list { grid-template-columns: 1fr; }
  .lab-pager { grid-template-columns: 1fr; }
  .lab-pager-empty { display: none; }
  .lab-pager-next { align-items: flex-start; text-align: left; }
}

/* ---------- 优秀论文分享 ---------- */
.paper-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 32px;
  align-items: center;
  padding: 42px 46px;
  border: 1px solid #fde68a;
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 12%, rgba(251, 191, 36, 0.26), transparent 34%),
    radial-gradient(circle at 10% 90%, rgba(37, 99, 235, 0.1), transparent 40%),
    linear-gradient(135deg, #fffdf5 0%, #fff7ed 52%, #eef2ff 100%);
}
.paper-hero .eyebrow { color: #b45309; }
.paper-hero h1 { margin: 0 0 12px; font-size: 36px; line-height: 1.25; }
.paper-hero-sub { margin: 0; max-width: 620px; color: #4b5563; font-size: 15px; }
.paper-hero-stats { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 22px; color: #6b7280; font-size: 13px; }
.paper-hero-stats strong { margin-right: 4px; color: #92400e; font-size: 20px; }
.paper-hero-panel {
  padding: 22px;
  border: 1px solid #fde68a;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(146, 64, 14, 0.08);
}
.paper-hero-panel-label { color: #92400e; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; }
.paper-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.paper-hero-tags span {
  padding: 4px 11px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
}
.paper-hero-panel p { margin: 14px 0 0; color: #9a3412; font-size: 12px; }

.paper-home {
  padding: 28px;
  border: 1px solid #fde68a;
  border-radius: 20px;
  background: linear-gradient(135deg, #fffdf5, #f8fafc);
}
.paper-home .section-title { margin-bottom: 6px; }
.paper-category-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.paper-category-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}
.paper-category-pill:hover { border-color: #fbbf24; background: #fffbeb; text-decoration: none; }
.paper-category-pill small { color: var(--muted); font-size: 11px; }

.paper-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.paper-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.paper-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.paper-category-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 600;
}
.badge-featured { background: #fef3c7; color: #92400e; }
.paper-card h3 { margin: 0; font-size: 17px; line-height: 1.5; }
.paper-card h3 a { color: #111827; }
.paper-card h3 a:hover { color: var(--accent-dark); text-decoration: none; }
.paper-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.75;
}
.paper-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--muted); font-size: 12px; }
.paper-source { margin-top: -4px; color: #6b7280; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.paper-read-link { font-size: 13px; font-weight: 600; }

.paper-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.paper-category-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.paper-category-card:hover {
  border-color: #fbbf24;
  box-shadow: 0 8px 22px rgba(146, 64, 14, 0.08);
  text-decoration: none;
}
.paper-category-card.active {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: inset 0 0 0 1px #f59e0b;
}
.paper-category-card h3 { margin: 0; font-size: 17px; }
.paper-category-card p { flex: 1; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.paper-category-count { color: #b45309; font-size: 12px; font-weight: 700; }
.paper-results-head { align-items: flex-end; }

.paper-article { max-width: 860px; margin: 0 auto; padding: 38px 42px; }
.paper-article-head h1 { margin: 12px 0 10px; font-size: 30px; line-height: 1.35; overflow-wrap: anywhere; }
.paper-subtitle {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}
.paper-detail-meta { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.paper-abstract {
  margin: 24px 0;
  padding: 18px 20px;
  border-left: 4px solid #f59e0b;
  border-radius: 0 12px 12px 0;
  background: #fffbeb;
}
.paper-abstract h2 { margin: 0 0 8px; color: #92400e; font-size: 15px; }
.paper-abstract p { margin: 0 0 8px; }
.paper-abstract p:last-child { margin-bottom: 0; }
.paper-body { margin-top: 24px; color: #1f2937; font-size: 16px; line-height: 1.95; overflow-wrap: anywhere; }
.paper-body p { margin: 0 0 15px; }
.paper-body .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.paper-actions-note p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 14px;
  line-height: 1.7;
}
.paper-empty { grid-column: 1 / -1; }
.paper-empty h3 { margin: 0 0 6px; }

@media (max-width: 1000px) {
  .paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .paper-hero { grid-template-columns: 1fr; padding: 30px; }
  .paper-hero h1 { font-size: 30px; }
  .paper-grid { grid-template-columns: 1fr; }
  .paper-category-grid { grid-template-columns: 1fr; }
  .paper-home { padding: 20px; }
  .paper-article { padding: 26px 20px; }
  .paper-article-head h1 { font-size: 24px; }
}

.junior-hero {
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fafc 55%, #eef2ff 100%);
}
.junior-hero .eyebrow { color: #047857; }

.junior-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.junior-stat { padding: 20px; text-align: center; }
.junior-stat strong {
  display: block;
  font-size: 28px;
  line-height: 1.3;
  color: #047857;
}
.junior-stat span { color: var(--muted); font-size: 13px; }

.junior-topic-card { display: flex; flex-direction: column; gap: 10px; }
.junior-topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.junior-topic-head h3 { margin: 0; }
.junior-topic-card .chip { align-self: flex-start; margin-top: auto; }

.junior-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.junior-source-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  color: inherit;
}
.junior-source-card:hover { border-color: #a7f3d0; text-decoration: none; }
.junior-source-card h3 { margin: 0 0 4px; font-size: 17px; }
.junior-source-card p { margin: 0; color: var(--muted); font-size: 13px; }

.junior-note { padding: 24px; }
.junior-note h3 { margin-top: 0; }
.junior-note p:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  .junior-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .junior-source-grid { grid-template-columns: 1fr; }
}

.junior-home-card { padding: 24px; display: grid; gap: 14px; }
.junior-home-summary { margin: 0; color: var(--muted); }
.junior-home-summary strong { color: var(--text); }

.junior-source-card .exam-year {
  min-width: 64px;
  background: #ecfdf5;
  color: #047857;
}

/* ---------- 模拟考试 ---------- */
.btn-large { padding: 13px 26px; font-size: 16px; border-radius: 12px; }

.badge-pool-real { background: #eff6ff; color: #1d4ed8; }
.badge-pool-regional { background: #ecfdf5; color: #047857; }
.badge-pool-mock { background: #fffbeb; color: #b45309; }
.badge-pool-mixed { background: #f5f3ff; color: #6d28d9; }
.badge-category-zhongkao_real { background: #fff1f2; color: #be123c; }
.badge-category-xuekao_real { background: #ecfeff; color: #0e7490; }
.badge-category-gaokao_mock { background: #fffbeb; color: #b45309; }
.badge-category-gaokao_real { background: #eff6ff; color: #1d4ed8; }
.badge-category-kaoyan_real { background: #f5f3ff; color: #6d28d9; }
.badge-category-other { background: #f3f4f6; color: #4b5563; }
.badge-exam-running { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.badge-exam-done,
.badge-correct,
.badge-published { background: #dcfce7; color: #166534; font-weight: 600; }
.badge-exam-expired { background: #fef3c7; color: #92400e; }
.badge-wrong { background: #fee2e2; color: #991b1b; font-weight: 600; }
.badge-question-type { background: #f3f4f6; color: #4b5563; }

.mock-exam-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.mock-exam-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.mock-exam-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mock-exam-card h3 { margin: 0; font-size: 18px; line-height: 1.5; }
.mock-exam-card h3 a { color: #111827; }
.mock-exam-card h3 a:hover { color: var(--accent-dark); text-decoration: none; }
.mock-exam-summary { margin: -4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.mock-exam-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}
.mock-exam-meta strong { color: #111827; font-size: 15px; margin-right: 2px; }
.mock-exam-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mock-exam-empty { grid-column: 1 / -1; }

.mock-exam-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 26px;
  padding: 38px 40px;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 12%, rgba(147, 197, 253, 0.35), transparent 32%),
    linear-gradient(135deg, #f8fbff 0%, #eef2ff 58%, #f0fdfa 100%);
}
.mock-exam-hero-badges { display: flex; gap: 8px; margin-bottom: 10px; }
.mock-exam-hero h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.3; }
.mock-exam-hero-sub { margin: 0; max-width: 640px; color: #4b5563; font-size: 15px; }
.mock-exam-stats { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 26px; }
.mock-exam-stats div { display: flex; flex-direction: column; min-width: 58px; }
.mock-exam-stats strong { color: #1e3a8a; font-size: 24px; line-height: 1.2; }
.mock-exam-stats span { color: var(--muted); font-size: 12px; }

.mock-exam-start-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(150deg, #0f172a, #1e3a8a);
  color: #e2e8f0;
  box-shadow: 0 18px 40px rgba(30, 58, 138, 0.22);
}
.mock-exam-panel-label { margin: 0 0 6px; color: #93c5fd; font-size: 11px; letter-spacing: 0.14em; font-weight: 700; }
.mock-exam-start-panel h2 { margin: 0 0 6px; color: #fff; font-size: 24px; }
.mock-exam-start-panel p { margin: 0 0 16px; color: #cbd5e1; font-size: 13px; }
.mock-exam-start-panel .btn { background: #fff; border-color: #fff; color: #1e3a8a; font-weight: 700; }
.mock-exam-start-panel .btn:hover { background: #dbeafe; border-color: #dbeafe; }
.mock-exam-start-panel .btn-ghost { background: transparent; color: #dbeafe; border-color: rgba(219, 234, 254, 0.5); }
.mock-exam-start-panel .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.mock-exam-staff-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(148, 163, 184, 0.3); }
.mock-exam-staff-links a { color: #bfdbfe; font-size: 12px; }

.mock-exam-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 18px;
  margin-top: 22px;
}
.mock-exam-instructions,
.mock-exam-topics { padding: 26px; }
.mock-exam-instructions h2,
.mock-exam-topics h2 { margin: 0 0 14px; font-size: 19px; }
.mock-exam-instructions ul { margin: 0; padding-left: 20px; color: #374151; font-size: 14px; }
.mock-exam-instructions li { margin-bottom: 8px; }
.mock-exam-instructions .notice { margin-bottom: 0; }

.exam-run-bar {
  position: sticky;
  top: var(--header-h, 64px);
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 22px;
  margin: -8px 0 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}
.exam-run-title h1 { margin: 0; font-size: 22px; line-height: 1.35; }
.exam-run-title .eyebrow { margin-bottom: 2px; }
.exam-run-title p { margin: 2px 0 0; }
.exam-run-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 132px;
  color: #1e3a8a;
}
.exam-run-timer-label { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.exam-run-timer strong {
  font-size: 30px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.exam-run-timer.is-urgent strong { color: var(--red); animation: exam-pulse 1.2s ease-in-out infinite; }
@keyframes exam-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.exam-run-save { margin-top: 3px; color: var(--muted); font-size: 11px; }
.exam-run-notice { margin-bottom: 18px; }

.exam-paper { max-width: 940px; margin: 0 auto; }
.exam-question { padding: 26px; margin-bottom: 18px; }
.exam-question-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.exam-question-head > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.exam-question-no { font-weight: 700; font-size: 16px; color: #111827; }
.exam-question-points { color: #92400e; background: #fffbeb; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.exam-question .stem { font-size: 16px; }
.exam-photo-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.exam-photo-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.exam-photo-upload { flex: 1; min-width: 230px; }
.exam-photo-input { display: block; width: 100%; color: var(--muted); font-size: 13px; }
.exam-photo-preview {
  max-width: 180px;
  max-height: 150px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.exam-photo-preview[hidden] { display: none; }
.exam-photo-status { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.exam-submit-bar {
  position: sticky;
  bottom: 16px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
  margin-top: 22px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.1);
}
.exam-submit-bar strong { display: block; font-size: 15px; }
.exam-submit-bar .muted { font-size: 12px; }
.exam-submit-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.exam-result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 24px;
  padding: 34px 38px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 86% 18%, rgba(52, 211, 153, 0.2), transparent 34%),
    linear-gradient(135deg, #f0fdf4 0%, #eff6ff 62%, #f8fafc 100%);
  border: 1px solid #d1fae5;
}
.exam-result-hero h1 { margin: 0 0 14px; font-size: 30px; line-height: 1.35; }
.exam-result-stats { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.exam-result-stats div { display: flex; flex-direction: column; }
.exam-result-stats strong { color: #065f46; font-size: 21px; line-height: 1.3; }
.exam-result-stats span { color: var(--muted); font-size: 12px; }
.exam-result-score {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #bbf7d0;
  text-align: center;
  box-shadow: 0 12px 30px rgba(6, 95, 70, 0.08);
}
.exam-result-score > span { color: var(--muted); font-size: 12px; }
.exam-result-score strong { color: #059669; font-size: 48px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.exam-result-score small { color: #4b5563; font-size: 13px; }
.exam-result-score p { margin: 10px 0 0; color: #6b7280; font-size: 12px; line-height: 1.6; }
.exam-result-actions { margin: 18px 0 24px; }
.exam-result-review { max-width: 940px; margin: 0 auto; }
.exam-result-question { padding: 26px; margin-bottom: 18px; }
.exam-result-selection { margin: 12px 2px 0; font-size: 13px; }
.exam-result-photo img { margin: 12px auto 0; }
.exam-result-question .answer-box,
.exam-result-question .analysis-box { margin-top: 16px; }

/* ---------- 教师组卷 ---------- */
.teacher-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.teacher-tabs a {
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: #4b5563;
  font-size: 13px;
}
.teacher-tabs a.active { background: #eff6ff; border-color: #bfdbfe; color: var(--accent-dark); font-weight: 600; }
.teacher-tabs a:hover { text-decoration: none; border-color: #93c5fd; }

.teacher-table-wrap { overflow-x: auto; }
.teacher-exam-table-wrap { padding: 0; overflow-x: auto; }
.teacher-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.teacher-table th,
.teacher-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.teacher-table th { color: var(--muted); background: #f8fafc; font-weight: 600; font-size: 12px; white-space: nowrap; }
.teacher-table tbody tr:last-child td { border-bottom: 0; }
.teacher-table td p { margin: 3px 0 0; }
.teacher-row-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; }
.teacher-row-actions .link-button { font-size: 12px; }
.teacher-exam-table-wrap .empty-state { padding: 30px; }

.teacher-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 18px;
  margin-top: 14px;
}
.teacher-form-card { padding: 30px; }
.teacher-form-card h1 { margin: 0 0 6px; font-size: 26px; }
.teacher-form-aside { padding: 24px; align-self: start; }
.teacher-form-aside h2 { margin: 0 0 12px; font-size: 18px; }
.teacher-form-aside ol { margin: 0 0 14px; padding-left: 20px; color: #4b5563; font-size: 13px; }
.teacher-form-aside li { margin-bottom: 7px; }
.teacher-form { margin-top: 18px; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; margin-bottom: 6px; color: #374151; font-size: 13px; font-weight: 600; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.form-field textarea { resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.form-field .errorlist { margin: 6px 0 0; padding-left: 18px; color: var(--red); font-size: 12px; }
.form-help { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }

.builder-head { align-items: flex-start; }
.builder-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.builder-title-line h1 { margin: 0; }
.builder-selected,
.builder-picker { padding: 24px; margin-top: 18px; }
.builder-selected .section-head,
.builder-picker .section-head { margin-bottom: 16px; }
.builder-selected h2,
.builder-picker h2 { margin: 0; font-size: 19px; }
.builder-empty { padding: 26px; }
.builder-table th,
.builder-table td { vertical-align: middle; }
.builder-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.builder-table tr.is-selected { background: #f8fafc; color: var(--muted); }
.builder-table tr.is-selected a { color: #6b7280; }
.input-mini {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.builder-source { max-width: 230px; overflow-wrap: anywhere; color: var(--muted); }
.builder-random { gap: 8px; align-items: center; }
.builder-random label { font-size: 12px; color: var(--muted); }
.builder-filter { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.builder-filter select,
.builder-filter input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  max-width: 230px;
}
.builder-filter input[type="search"] { min-width: 210px; flex: 1; }
.builder-add-actions { margin-top: 14px; }

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.preview-toolbar > div { display: flex; flex-direction: column; gap: 2px; }
.exam-preview {
  max-width: 900px;
  margin: 0 auto;
  padding: 42px 46px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.exam-preview-head { padding-bottom: 20px; border-bottom: 2px solid #111827; margin-bottom: 24px; }
.exam-preview-head h1 { margin: 0 0 10px; font-size: 30px; }
.exam-preview-head > p { margin: 0 0 10px; color: var(--muted); }
.exam-preview-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #374151; font-size: 13px; }
.exam-preview-instructions { margin-top: 14px; padding: 12px 16px; background: #f9fafb; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.exam-preview-instructions p { margin: 4px 0 0; }
.exam-preview-question { padding: 20px 0; border-bottom: 1px solid var(--line); page-break-inside: avoid; }
.exam-preview-question:last-child { border-bottom: 0; }
.exam-preview-question-head { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.exam-preview-question-head strong { color: #111827; font-size: 15px; }
.exam-preview-choices { margin-top: 12px; }
.exam-preview-solution { margin-top: 14px; padding: 12px 16px; background: #f8fafc; border-left: 3px solid #93c5fd; font-size: 14px; }
.exam-preview-solution p { margin: 0 0 8px; }
.exam-preview-solution p:last-child { margin-bottom: 0; }

@media (max-width: 1000px) {
  .nav { gap: 10px 14px; font-size: 14px; }
}
@media (max-width: 860px) {
  .mock-exam-grid { grid-template-columns: 1fr; }
  .mock-exam-hero,
  .mock-exam-detail-grid,
  .exam-result-hero,
  .teacher-form-layout { grid-template-columns: 1fr; }
  .mock-exam-hero { padding: 28px; }
  .mock-exam-hero h1 { font-size: 27px; }
  .exam-run-bar { position: static; flex-direction: column; align-items: stretch; gap: 12px; }
  .exam-run-timer { align-items: flex-start; }
  .exam-run-timer strong { font-size: 26px; }
  .exam-submit-bar { position: static; flex-direction: column; align-items: stretch; }
  .exam-submit-actions { justify-content: flex-end; }
  .exam-result-hero { padding: 26px; }
  .exam-result-hero h1 { font-size: 24px; }
  .exam-preview { padding: 26px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .builder-filter input[type="search"] { min-width: 0; width: 100%; }
}
@media (max-width: 600px) {
  .exam-question { padding: 18px; }
  .exam-question-head { flex-direction: column; }
  .teacher-form-card { padding: 22px; }
  .builder-selected,
  .builder-picker { padding: 18px; }
  .exam-switcher-tabs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .exam-switcher-tab { text-align: center; }
  .exam-panel-head { flex-direction: column; gap: 6px; }
}

/* ---------- 学习闭环、真题筛选与移动导航 ---------- */
.badge-correct { background: #ecfdf5; color: var(--green); }
.badge-wrong { background: #fef2f2; color: var(--red); }

.question-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.question-tools form { display: inline-flex; }
.attempt-retry { margin-left: auto; }

.learning-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 4px 0 18px;
}
.learning-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #374151;
  white-space: nowrap;
  font-size: 14px;
}
.learning-tabs a:hover { border-color: #93c5fd; color: var(--accent); text-decoration: none; }
.learning-tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.learning-tabs a span {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.learning-tabs a.active span { background: rgba(255, 255, 255, 0.22); color: #fff; }

.learning-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mastery-panel { padding: 22px; margin-bottom: 18px; }
.mastery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.mastery-head h2 { margin: 0; font-size: 19px; }
.mastery-head p { margin: 4px 0 0; }
.mastery-summary { display: flex; flex-wrap: wrap; gap: 10px; }
.mastery-summary div {
  min-width: 92px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fafb;
  text-align: center;
}
.mastery-summary strong { display: block; color: var(--accent); font-size: 18px; line-height: 1.3; }
.mastery-summary span { color: var(--muted); font-size: 12px; }
.mastery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.mastery-item {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: inherit;
}
.mastery-item:hover { border-color: #93c5fd; text-decoration: none; }
.mastery-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.mastery-item-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mastery-item-head b { flex: none; font-size: 12px; }
.mastery-weak .mastery-item-head b { color: #b91c1c; }
.mastery-mid .mastery-item-head b { color: #b45309; }
.mastery-start .mastery-item-head b { color: #64748b; }
.mastery-good .mastery-item-head b { color: #15803d; }
.mastery-bar {
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.mastery-bar i { display: block; height: 100%; border-radius: inherit; background: #2563eb; }
.mastery-weak .mastery-bar i { background: #dc2626; }
.mastery-mid .mastery-bar i { background: #d97706; }
.mastery-start .mastery-bar i { background: #94a3b8; }
.mastery-good .mastery-bar i { background: #16a34a; }
.mastery-item p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.mastery-empty { margin: 0; color: var(--muted); }

.retry-panel { padding: 26px; max-width: 860px; }
.retry-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.retry-stats div {
  flex: 1 1 140px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
}
.retry-stats strong { display: block; color: var(--accent); font-size: 26px; line-height: 1.2; }
.retry-stats span { color: var(--muted); font-size: 13px; }
.retry-progress {
  height: 9px;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.retry-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.2s ease; }
.retry-message { margin: 0 0 14px; line-height: 1.8; }
.retry-message-done { color: #166534; }
.retry-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.retry-hint { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.retry-preview { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.retry-preview h2 { margin: 0 0 10px; font-size: 16px; }
.retry-preview ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.retry-preview li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafafa;
  font-size: 13px;
}
.retry-empty { padding: 26px 0; text-align: center; }
.retry-empty strong { font-size: 18px; }
.retry-empty p { margin: 8px 0 16px; color: var(--muted); }

.learning-note { line-height: 1.7; }
.learning-list { display: grid; gap: 14px; }
.learning-item { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.learning-item .question-stem {
  height: 4.65em;
  line-height: 1.55;
  overflow: hidden;
}
.learning-item-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}
.learning-answer { color: var(--muted); font-size: 14px; }
.learning-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.empty-state h3 { margin: 0 0 6px; }

.exam-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.exam-filter input[type="search"],
.exam-filter select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.exam-filter input[type="search"] { flex: 1 1 280px; min-width: 0; }
.exam-filter select { flex: 0 1 150px; }
.exam-filter input[type="search"]:focus,
.exam-filter select:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.exam-filter-status { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

.exam-years { gap: 14px; }
.exam-year-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.exam-year-group > .exam-year-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.exam-year-group > .exam-year-head::-webkit-details-marker { display: none; }
.exam-year-group > .exam-year-head:hover { background: #f8fafc; }
.exam-year-group > .exam-year-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 12px;
}
.exam-year-group[open] > .exam-year-head {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
}
.exam-year-heading { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.exam-year-heading h2 { margin: 0; font-size: 20px; }
.exam-year-caret {
  width: 9px;
  height: 9px;
  flex: none;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.exam-year-group[open] .exam-year-caret { transform: rotate(-135deg); }
.exam-year-group > .exam-grid { padding: 18px; }
.exam-pagination { margin-top: 22px; }

.filter-toggle { display: none; }
.nav-toggle { display: none; }
.filter-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-panel-head h3 { margin: 0; }
.filter-close { display: none; }
.filter-backdrop { display: block; }
.filter-backdrop[hidden] { display: none; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.7fr);
  gap: 36px;
  align-items: center;
}
.home-hero h1 { font-size: clamp(30px, 3.4vw, 40px); }
.home-hero .hero-sub { max-width: 620px; }
.hero-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}
.hero-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.hero-stat strong { display: block; font-size: 24px; line-height: 1.25; color: var(--accent); }
.hero-stat span { color: var(--muted); font-size: 12px; }
.hero-access {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
}
.hero-access p { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.access-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.access-dot-free { background: var(--green); }
.access-dot-member { background: var(--amber); }

.member-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.7fr);
  gap: 34px;
  align-items: center;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #ecfdf5 100%);
}
.member-hero h1 { margin: 0 0 12px; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.3; }
.member-hero .hero-sub { max-width: 620px; }
.member-hero-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.member-hero .notice { max-width: 620px; margin: 16px 0 0; }
.member-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.member-fact {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}
.member-fact strong { display: block; font-size: 24px; line-height: 1.25; color: var(--accent); }
.member-fact span { color: var(--muted); font-size: 12px; }

.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.access-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px;
  border-top: 4px solid var(--line);
}
.access-free { border-top-color: var(--green); }
.access-member { border-top-color: var(--amber); }
.access-kicker { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; }
.access-card h2 { margin: 0; font-size: 21px; }
.access-list { margin: 0; padding-left: 20px; color: #374151; font-size: 14px; }
.access-list li { margin-bottom: 6px; }
.access-card .btn { margin-top: auto; align-self: flex-start; }

.sample-card { padding: 28px; }
.sample-stem { margin: 14px 0 4px; font-size: 17px; }
.sample-choices .choice-content { min-width: 0; }
.sample-note { margin: 14px 0 0; }

.faq-list { display: grid; gap: 10px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 0 18px;
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
  flex: none;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.plan-card { position: relative; }
.plan-featured { border-color: #93c5fd; box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1); }
.plan-badge {
  position: absolute;
  top: -11px;
  right: 16px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

@media (max-width: 860px) {
  .home-hero,
  .member-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px;
  }
  .home-hero h1,
  .member-hero h1 { font-size: 28px; }
  .hero-stats,
  .member-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-grid { grid-template-columns: 1fr; }
  .access-card { padding: 22px; }
  .sample-card { padding: 20px; }
  .sample-stem { font-size: 16px; }

  .header-inner {
    position: relative;
    height: 64px;
    min-height: 64px;
    flex-wrap: nowrap;
    padding: 0;
    gap: 12px;
  }
  .has-js .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 48px;
    min-height: 44px;
    padding: 4px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
  }
  .has-js .nav-toggle:hover { background: #f3f4f6; }
  .nav-toggle-bars { display: grid; gap: 3px; }
  .nav-toggle-bars span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }
  .nav-toggle-label { font-size: 11px; line-height: 1.2; color: var(--muted); }

  .has-js .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 8px 20px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
    font-size: 15px;
  }
  body.nav-open .nav { display: flex; }
  .has-js .nav > a,
  .has-js .nav .nav-dropdown > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 4px;
  }
  .has-js .nav-user,
  .has-js .nav > .badge { align-self: flex-start; }
  .has-js .nav .inline-form { display: flex; }
  .has-js .nav .link-button {
    min-height: 44px;
    padding: 8px 4px;
    color: var(--accent);
  }
  .has-js .nav-dropdown-menu {
    position: static;
    min-width: 0;
    padding: 2px 0 8px 16px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .has-js .nav-dropdown-menu a { min-height: 42px; display: flex; align-items: center; }
  .has-js .nav-subgroup { padding-bottom: 4px; margin-bottom: 6px; }
  .has-js .nav-subgroup-label { padding: 6px 4px 2px; }
  .has-js .nav-subgroup-items a { padding-left: 14px; }

  .filter-form { width: 100%; }
  .filter-form input { flex: 1 1 100%; width: 100%; }
  .filter-form select { flex: 1 1 140px; }
  .has-js .filter-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 16px;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--accent);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
  }

  .has-js .filter-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: min(86vw, 340px);
    margin: 0;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: var(--surface);
    box-shadow: 12px 0 30px rgba(15, 23, 42, 0.18);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }
  body.filters-open .filter-panel { transform: none; }
  body.filters-open { overflow: hidden; }
  .filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(15, 23, 42, 0.45);
  }
  .filter-panel-head {
    position: sticky;
    top: -20px;
    z-index: 1;
    margin: -20px -18px 12px;
    padding: 16px 18px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .filter-close {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
  }
  .has-js .filter-panel .filter-link { min-height: 40px; padding: 9px 10px; }
  .has-js .filter-panel .filter-link.child { padding-left: 26px; }

  .exam-filter select { flex: 1 1 130px; }
  .exam-year-group > .exam-year-head { padding: 10px 14px; }
  .exam-year-heading h2 { font-size: 18px; }
  .exam-year-group > .exam-grid { padding: 14px; }
}

.badge-qtype { background: #f1f5f9; color: #475569; }

.related-experiments {
  grid-column: 1 / -1;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}
.related-experiments-head { display: flex; flex-direction: column; gap: 2px; }
.related-experiments .chip-row { flex: 1 1 320px; margin-top: 0; }
.related-experiments-detail { padding: 20px 24px; margin-top: 16px; }
.related-experiments-detail .chip-row { margin-top: 12px; }

.pagination { flex-wrap: wrap; row-gap: 10px; }
.page-numbers { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.page-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.page-link.current { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
.page-ellipsis { padding: 0 2px; color: var(--muted); }
.page-jump { display: inline-flex; align-items: center; gap: 8px; }
.page-jump label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.page-jump input {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  text-align: center;
}

.lab-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.lab-record-head h2 { margin: 0; }
.lab-record-head p { margin: 4px 0 0; }
.lab-record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-record-table-wrap { margin-top: 14px; overflow-x: auto; }
.lab-record-table { min-width: 620px; }
.lab-record-table th,
.lab-record-table td { text-align: left; white-space: normal; }
.lab-record-table th:first-child,
.lab-record-table td:first-child { width: 34px; }
.lab-record-table th:last-child,
.lab-record-table td:last-child { width: 44px; text-align: right; }
.lab-record-table td { padding: 4px 5px; }
.lab-record-table input {
  width: 100%;
  min-width: 96px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #1e293b;
  font-family: inherit;
  font-size: 12.5px;
}
.lab-record-table input:hover { border-color: var(--line); }
.lab-record-table input:focus {
  outline: 2px solid #bfdbfe;
  border-color: var(--accent);
  background: #fff;
}
.lab-record-remove {
  padding: 5px 4px;
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.lab-record-remove:hover { text-decoration: underline; }
.lab-record-status { margin: 10px 0 0; }

.lab-kp-list { list-style: none; margin: 10px 0 12px; padding: 0; display: grid; gap: 8px; }
.lab-kp-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.lab-kp-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.lab-kp-list span { flex: none; color: var(--muted); font-size: 12px; }

@media (max-width: 600px) {
  .related-experiments { flex-direction: column; align-items: flex-start; }
  .pagination { gap: 8px; }
  .pagination > .btn { padding: 6px 10px; }
  .page-jump { flex: 1 1 100%; justify-content: center; }
  .page-jump input { width: 56px; }
  .lab-record-head { flex-direction: column; }
  .lab-record-actions { width: 100%; }
  .lab-record-actions .btn { flex: 1 1 auto; }
}

.ops-page { max-width: 1040px; }
.ops-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ops-heading h1 { margin: 0 0 4px; font-size: 30px; }
.ops-heading p { margin: 0; }
.ops-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 14px;
}
.ops-banner strong { font-size: 15px; }
.ops-banner-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.ops-banner-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ops-banner-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
.ops-grid > * { min-width: 0; }
.ops-card { padding: 20px; }
.ops-card h2 { margin: 0 0 14px; font-size: 17px; }
.ops-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ops-table th,
.ops-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: normal;
}
.ops-table th { color: var(--muted); font-weight: 500; }
.ops-table th:first-child,
.ops-table td:first-child { color: var(--text); }
.ops-table tr:last-child td { border-bottom: 0; }
.ops-history-card { grid-column: 1 / -1; }
.ops-history-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ops-history-table tr.ops-history-bad td { background: rgba(185, 28, 28, 0.04); }
.ops-history-paths,
.ops-history-reason {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.ops-history-reason { color: #b91c1c; }
.ops-history-ai { margin-top: 3px; font-size: 12px; line-height: 1.55; color: #1d4ed8; }
.ops-history-action { min-width: 140px; max-width: 260px; }
.ops-ai-card { grid-column: 1 / -1; }
.ops-ai-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 4px 0 14px;
  font-size: 15px;
}
.ops-ai-reason {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #374151;
  font-size: 12px;
}
.ops-ai-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ops-ai-actions h3 {
  margin: 14px 0 8px;
  font-size: 14px;
}
.ops-ai-actions h3:first-child { margin-top: 0; }
.ops-ai-actions .ops-ai-events {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.ops-ai-events {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ops-ai-events h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.ops-ai-events ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ops-ai-events li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #374151;
  font-size: 12.5px;
  line-height: 1.6;
}
.ops-ai-events strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.ops-ai-events div { margin-top: 4px; }
.ops-ai-event-kind {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11.5px;
  font-weight: 600;
}
.ops-ai-event-kind.is-success {
  background: #dcfce7;
  color: #166534;
}
.ops-ai-event-kind.is-warning {
  background: #fee2e2;
  color: #991b1b;
}
.ops-ai-event-breakthrough {
  background: #ecfdf5;
  color: #047857;
}
.ops-status {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ops-status-ok { background: #ecfdf5; color: #047857; }
.ops-status-warn { background: #fffbeb; color: #b45309; }
.ops-status-error { background: #fef2f2; color: #b91c1c; }
.ops-dl {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0;
  font-size: 14px;
}
.ops-dl dt { color: var(--muted); }
.ops-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ops-log-card { margin-top: 16px; }
.ops-log {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ops-card .muted.small { margin: 10px 0 0; }
.ops-diagnosis { margin-top: 16px; border-left: 4px solid var(--line); }
.ops-diagnosis-ok { border-left-color: var(--green); }
.ops-diagnosis-warn { border-left-color: var(--amber); }
.ops-diagnosis-error { border-left-color: var(--red); }
.ops-diagnosis-reason { margin: 0; font-size: 15px; font-weight: 600; }
.ops-diagnosis-last {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.ops-diagnosis-last p { margin: 0 0 6px; }
.ops-evidence { margin: 8px 0 0; padding-left: 20px; }
.ops-evidence li { margin: 3px 0; }
.ops-eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}
.ops-heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.ops-switcher-link {
  flex: none;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
}
.ops-switcher-link:hover { background: #f1f5f9; color: var(--text); }
.ops-switcher-link.is-active { background: var(--accent-soft, #eff6ff); color: var(--accent); font-weight: 600; }
.ops-switcher-home { margin-left: auto; }

.ops-online-card { grid-column: 1 / -1; min-width: 0; }
.ops-online-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ops-online-head h2 { margin-bottom: 4px; }
.ops-online-head .small { margin: 0; }
.ops-live-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.ops-live-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}
.ops-live-state.is-live { background: #ecfdf5; color: #047857; }
.ops-live-state.is-live::before { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .16); }
.ops-live-state.is-error { background: #fef2f2; color: #b91c1c; }
.ops-live-state.is-error::before { background: #ef4444; }
.ops-online-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.ops-online-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.ops-online-stat strong { font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ops-online-stat span { color: var(--muted); font-size: 12px; }
.ops-online-stat-primary { border-color: #bfdbfe; background: #eff6ff; }
.ops-online-stat-primary strong { color: var(--accent); }
.ops-ai-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ops-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; }
.ops-ai-card .ops-table { min-width: 680px; }
.ops-history-table { min-width: 760px; }
.ops-online-table { min-width: 760px; }
.ops-online-table th,
.ops-online-table td { padding: 9px 8px; white-space: nowrap; }
.ops-online-table td { font-size: 13px; }
.ops-online-path { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ops-presence {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #10b981;
}
.ops-role {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.ops-role-admin { background: #fef3c7; color: #92400e; }
.ops-role-member { background: #ede9fe; color: #6d28d9; }
.ops-role-user { background: #e0f2fe; color: #0369a1; }

@media (max-width: 820px) {
  .ops-grid { grid-template-columns: minmax(0, 1fr); }
  .ops-online-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .ops-online-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-switcher-home { margin-left: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .ops-live-state.is-live::before { animation: ops-live-pulse 2.2s ease-in-out infinite; }
}

@keyframes ops-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .28); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

/* 运维中心 · 指挥台与分区折叠 */
.ops-page { max-width: 1180px; }
.ops-heading { align-items: flex-start; }
.ops-heading-actions .btn { white-space: nowrap; }

.ops-command {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.ops-command-status {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}
.ops-command-status::after {
  content: "";
  position: absolute;
  top: -44px;
  right: -38px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: rgba(148, 163, 184, .10);
  pointer-events: none;
}
.ops-command-status.is-ok { border-color: #a7f3d0; background: linear-gradient(145deg, #f0fdf4, #ecfdf5); }
.ops-command-status.is-warn { border-color: #fde68a; background: linear-gradient(145deg, #fffdf5, #fffbeb); }
.ops-command-status.is-error { border-color: #fecaca; background: linear-gradient(145deg, #fff7f7, #fef2f2); }
.ops-command-status .ops-eyebrow { margin-bottom: 6px; }
.ops-command-status-line {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ops-command-status-line strong {
  font-size: 25px;
  line-height: 1.15;
  color: #0f172a;
}
.ops-status-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .13);
}
.is-ok .ops-status-dot { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .14); }
.is-warn .ops-status-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .15); }
.is-error .ops-status-dot { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .14); }
.ops-command-reason {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: #1f2937;
  font-size: 13.5px;
  line-height: 1.72;
}
.ops-command-next {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: #374151;
  font-size: 12.5px;
  line-height: 1.6;
}
.ops-command-next strong { color: var(--text); }
.ops-command-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}
.ops-command-live { color: #047857; }
.ops-command-status.is-warn .ops-command-live { color: #b45309; }
.ops-command-status.is-error .ops-command-live { color: #b91c1c; }

.ops-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ops-kpi {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  min-height: 112px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.ops-kpi:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  box-shadow: 0 8px 20px rgba(30, 64, 175, .08);
  text-decoration: none;
}
.ops-kpi.is-ok { border-color: #bbf7d0; background: #fbfefc; }
.ops-kpi.is-warn { border-color: #fde68a; background: #fffef8; }
.ops-kpi.is-error { border-color: #fecaca; background: #fffafa; }
.ops-kpi-label { color: var(--muted); font-size: 11.5px; letter-spacing: .04em; }
.ops-kpi strong {
  color: #0f172a;
  font-size: 25px;
  font-weight: 650;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}
.ops-kpi.is-error strong { color: #b91c1c; }
.ops-kpi.is-warn strong { color: #b45309; }
.ops-kpi-note { margin-top: auto; color: var(--muted); font-size: 11.5px; line-height: 1.5; }

.ops-attention {
  margin-top: 14px;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
}
.ops-attention-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ops-attention-head .ops-eyebrow { margin-bottom: 3px; }
.ops-attention-head h2 { margin: 0; font-size: 19px; }
.ops-attention-count {
  flex: none;
  padding: 3px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ops-attention-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.ops-attention-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.ops-attention-item.is-error { border-color: #fecaca; background: #fff7f7; }
.ops-attention-item.is-warn { border-color: #fde68a; background: #fffdf5; }
.ops-attention-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .12);
}
.ops-attention-item.is-error .ops-attention-dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.ops-attention-main { min-width: 0; }
.ops-attention-main strong { display: block; font-size: 14px; line-height: 1.45; }
.ops-attention-main p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.ops-attention-item .btn { flex: none; }
.ops-attention.is-clear { border-left-color: #10b981; }
.ops-attention.is-clear .ops-attention-count { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.ops-attention-clear { margin: 12px 0 0; color: #047857; font-size: 13.5px; }

.ops-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 16px 0 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.ops-jumps a {
  padding: 6px 11px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.ops-jumps a:hover { background: #f1f5f9; color: var(--text); text-decoration: none; }

.ops-group { margin-top: 24px; scroll-margin-top: 82px; }
.ops-group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line);
}
.ops-group-head .ops-eyebrow { margin-bottom: 2px; }
.ops-group-head h2 { margin: 0; font-size: 21px; }
.ops-group-head > p { max-width: 62%; margin: 0; text-align: right; }
.ops-group .ops-grid { margin-top: 0; }
.ops-perf-wrap { grid-column: 1 / -1; min-width: 0; }
.ops-perf-wrap > .ops-perf-card { margin: 0; }

.ops-group-fold {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  scroll-margin-top: 82px;
}
.ops-group-fold > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  list-style: none;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
}
.ops-group-fold > summary::-webkit-details-marker { display: none; }
.ops-group-fold > summary:hover { background: #f1f5f9; }
.ops-group-fold[open] > summary { border-bottom: 1px solid var(--line); background: #fff; }
.ops-group-fold[open] .ops-fold-toggle { visibility: hidden; }
.ops-fold-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ops-fold-title .ops-eyebrow { flex: none; margin: 0; }
.ops-fold-title strong { font-size: 17px; line-height: 1.3; }
.ops-fold-meta { color: var(--muted); font-size: 12.5px; text-align: right; }
.ops-fold-toggle {
  padding: 3px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  justify-self: end;
}
.ops-fold-body { padding: 16px 18px 18px; }
.ops-fold-body > .ops-grid { margin-top: 0; }
.ops-log-fold { margin-bottom: 24px; }
.ops-log-fold .ops-log-card { margin: 0; }
.ops-log-fold .ops-log-card h2 { display: none; }

@media (max-width: 900px) {
  .ops-page { max-width: 100%; }
  .ops-command { grid-template-columns: minmax(0, 1fr); }
  .ops-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-group-head { align-items: flex-start; flex-direction: column; }
  .ops-group-head > p { max-width: 100%; text-align: left; }
  .ops-group-fold > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .ops-fold-title { grid-column: 1; grid-row: 1; }
  .ops-fold-meta { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .ops-fold-toggle { grid-column: 2; grid-row: 1; }
}

@media (max-width: 560px) {
  .ops-command-status { padding: 16px; }
  .ops-command-status-line strong { font-size: 22px; }
  .ops-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-kpi { min-height: 104px; padding: 11px 12px; }
  .ops-kpi strong { font-size: 22px; }
  .ops-attention { padding: 16px; }
  .ops-attention-head { flex-direction: column; gap: 8px; }
  .ops-attention-item { grid-template-columns: auto minmax(0, 1fr); }
  .ops-attention-item .btn { grid-column: 2; justify-self: start; }
  .ops-jumps { overflow-x: auto; flex-wrap: nowrap; }
  .ops-fold-body { padding: 12px; }
}

/* 运维中心是工作台，不需要前台答疑悬浮球遮挡操作按钮。 */
body:has(.ops-page) .zhili-float { display: none !important; }

/* 前沿物理介绍页 */
.frontier-timeline { display: grid; gap: 1rem; }
.frontier-stage { border-left: 3px solid var(--accent); padding-left: 1.15rem; }
.frontier-stage-year { margin: 0 0 .35rem; font-size: .82rem; letter-spacing: .08em; font-weight: 600; color: var(--accent); }
.frontier-stage h3 { margin: 0 0 .5rem; }
.frontier-stage-point { margin: .7rem 0 0; padding-top: .6rem; border-top: 1px dashed rgba(37, 99, 235, .28); font-size: .92rem; color: #374151; }
.frontier-stage-point strong { color: var(--accent); margin-right: .35rem; }

.frontier-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.frontier-field h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.frontier-field p { margin: 0 0 .65rem; line-height: 1.8; color: #374151; }
.frontier-field-meta { margin: 0 !important; padding-top: .6rem; border-top: 1px solid #f1f5f9; font-size: .8rem; color: #6b7280; }
.frontier-field-meta strong { color: var(--accent); margin-right: .35rem; }

.frontier-figure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.frontier-figure { margin: 0; padding: 0; overflow: hidden; }
.frontier-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.frontier-figure figcaption { padding: 1rem 1.15rem 1.2rem; }
.frontier-figure figcaption h3 { margin: 0 0 .45rem; font-size: 1rem; }
.frontier-figure figcaption p { margin: 0; font-size: .9rem; line-height: 1.8; color: #374151; }

.frontier-think-list { display: grid; gap: .8rem; }
.frontier-think { padding: .9rem 1.1rem; }
.frontier-think summary { font-weight: 600; cursor: pointer; list-style: none; }
.frontier-think summary::-webkit-details-marker { display: none; }
.frontier-think summary::marker { content: ""; }
.frontier-think[open] summary { color: var(--accent); }
.frontier-think-body { margin: .7rem 0 0; line-height: 1.85; color: #374151; }
.frontier-think-hint { margin: .6rem 0 0; padding: .55rem .75rem; font-size: .88rem; line-height: 1.75; color: #6b7280; background: #f8fafc; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.frontier-note { margin: 0; }

.frontier-figure-wide { max-width: 880px; margin: 1.4rem auto 0; }
.frontier-figure-note { margin: .6rem 0 0; font-size: .8rem; color: #6b7280; }

@media (max-width: 820px) {
  .frontier-field-grid,
  .frontier-figure-grid { grid-template-columns: 1fr; }
}

/* 教学资源共享 */
.res-kind-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.res-kind { position: relative; padding: 1.15rem 1.2rem 1.3rem; }
.res-kind h3 { margin: 0 0 .5rem; font-size: 1rem; color: #111827; }
.res-kind p { margin: 0; font-size: .87rem; line-height: 1.75; color: #4b5563; }
.res-kind-tag { position: absolute; top: 1rem; right: 1rem; font-size: .74rem; color: #6b7280; background: #f3f4f6; border-radius: 999px; padding: .12rem .5rem; }

.res-stage { scroll-margin-top: 90px; }
.res-book { margin-bottom: 1rem; padding: 0; overflow: hidden; }
.res-book summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; padding: 1rem 1.25rem; cursor: pointer; list-style: none; border-bottom: 1px solid transparent; }
.res-book summary::-webkit-details-marker { display: none; }
.res-book summary::marker { content: ""; }
.res-book[open] summary { border-bottom-color: #e5e7eb; background: #fafbff; }
.res-book-title { font-weight: 600; color: #111827; }
.res-book-meta { margin-left: auto; font-size: .82rem; color: #6b7280; }

.res-chapter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; padding: 1.1rem 1.25rem 1.25rem; }
.res-chapter { padding: 0; border: 1px solid #e7ebf3; background: #fff; }
.res-chapter summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; padding: .85rem 1rem; cursor: pointer; list-style: none; }
.res-chapter summary::-webkit-details-marker { display: none; }
.res-chapter summary::marker { content: ""; }
.res-chapter[open] { border-color: #cfd9ee; }
.res-chapter-title { font-size: .95rem; font-weight: 600; color: #1f2937; }
.res-chapter-meta { display: block; width: 100%; font-size: .78rem; color: #6b7280; }
.res-chapter-body { padding: 0 1rem 1rem; border-top: 1px dashed #e5e7eb; }
.res-points { display: flex; flex-wrap: wrap; gap: .35rem; margin: .70rem 0 .2rem; }
.res-point { font-size: .78rem; padding: .18rem .55rem; }
.res-items { margin: .55rem 0 0; padding: 0; list-style: none; }
.res-item { padding: .5rem 0; border-bottom: 1px dashed #eef2f7; font-size: .83rem; line-height: 1.7; }
.res-item:last-child { border-bottom: none; }
.res-item-kind { display: inline-block; min-width: 4.6rem; font-weight: 600; color: #1e3a8a; }
.res-item-scale { display: inline-block; margin-right: .6rem; color: #111827; }
.res-item-detail { display: block; margin-top: .15rem; color: #6b7280; }
.res-dl { display: inline-block; margin-top: .35rem; font-size: .78rem; padding: .12rem .6rem; color: #1d4ed8; background: #eff4ff; border: 1px solid #d7e2fb; border-radius: 999px; }
.res-dl:hover { background: #e2ebff; }
.res-note { margin-top: 1rem; }
.res-note p { margin: 0 0 .65rem; line-height: 1.9; color: #374151; }
.res-note p:last-child { margin-bottom: 0; }

@media (max-width: 820px) {
  .res-kind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-chapter-grid { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; }
  .site-header,
  .brand-motto,
  .site-footer,
  .ops-home-corner,
  .preview-toolbar,
  .breadcrumb,
  .messages,
  .flash-stack { display: none !important; }
  main.container { padding: 0; width: 100%; }
  /* 分册页折叠：打印时兜底显示所有节正文，隐藏展开工具与箭头 */
  details.section-note > .section-note-body { display: block !important; }
  .kp-toolbar,
  .section-note-head::before { display: none !important; }
  .exam-preview { border: 0; border-radius: 0; padding: 0; max-width: none; }
  .exam-preview-question { page-break-inside: avoid; }
  .question-figure img { max-height: 320px; }
  a { color: #111827; text-decoration: none; }
}

/* 模拟考试检索器与地区标签 */
.badge-region { background: #ecfdf5; color: #047857; }
.badge-sample { background: #fef2f2; color: #b91c1c; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 14px 16px;
  margin: 0 0 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #475569; }
.filter-field select,
.filter-field input {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
  color: #0f172a;
  min-width: 120px;
}
.filter-field.filter-keyword input { min-width: 190px; }
.exam-filter-summary { margin: 10px 0 16px; }

/* 模拟考试筛选面板：桌面四列，移动端单列；选项里带数量，便于判断是否有卷。 */
.exam-filter-panel {
  padding: 16px 18px 14px;
  margin: 0 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.exam-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
}
.exam-filter-grid .filter-field select,
.exam-filter-grid .filter-field input { width: 100%; min-width: 0; }
.exam-filter-grid .filter-keyword { grid-column: span 2; }
.exam-filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.exam-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}
.exam-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  text-decoration: none;
}
.exam-filter-chip:hover { background: #dbeafe; color: #1e3a8a; }
.exam-filter-chip span { font-size: 14px; line-height: 1; }
.badge-subject { background: #f0f9ff; color: #0369a1; }
.badge-complete { background: #ecfdf5; color: #047857; }
@media (max-width: 980px) {
  .exam-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-filter-grid .filter-keyword { grid-column: span 2; }
}
@media (max-width: 640px) {
  .exam-filter-grid { grid-template-columns: 1fr; }
  .exam-filter-grid .filter-keyword { grid-column: span 1; }
}

/* 模拟考试四档检索：初中 / 高中 / 大学 / 考研 */
.stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.stage-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  font-size: 14px;
  color: #334155;
  text-decoration: none;
}
.stage-tab:hover { border-color: #17324d; color: #17324d; }
.stage-tab.is-active {
  background: #17324d;
  border-color: #17324d;
  color: #ffffff;
}
.stage-tab-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 12px;
  color: #64748b;
}
.stage-tab.is-active .stage-tab-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* 知识点笔记：正文中文宋体，西文与数字 Times New Roman，公式由 KaTeX 渲染 */
.section-note-typography,
.section-note-typography .section-note-aim,
.section-note-typography .section-note-points,
.section-note-typography .section-note-formulas,
.section-note-typography .section-note-pitfalls {
  font-family: "Times New Roman", "宋体", "SimSun", "STSong", serif;
}
.section-note-typography .section-note-points li { line-height: 1.85; }

/* 知理 · 站内答疑 */
.tutor-inline { margin: 18px 0 6px; padding: 14px 16px; border: 1px solid var(--line, #dcdcdc); border-radius: 12px; background: #fafaf8; }
.tutor-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.tutor-head strong { font-size: 15px; }
.tutor-id { display: inline-flex; align-items: center; gap: 7px; }
.tutor-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block;
  border: 1px solid rgba(214, 178, 94, .7); flex: none; }
.tutor-head span { font-size: 12px; color: #6b6b6b; }
.tutor-inline textarea { width: 100%; padding: 9px 11px; border: 1px solid #d8d8d8; border-radius: 8px; font-family: var(--font-question); font-size: 14px; line-height: 1.6; resize: vertical; }
.tutor-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tutor-tip { font-size: 12px; color: #6b6b6b; }
.tutor-reply { margin: 10px 0 0; padding: 10px 12px; background: #fff; border: 1px dashed #d8d8d8; border-radius: 8px; font-family: var(--font-question); font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; }

/* 知理 · 圆形悬浮窗 */
.zhili-float { position: fixed; right: 22px; bottom: 96px; z-index: 1200; font-family: var(--font-question); }
/* 拖动过的位置用内联 left/top 摆放，需先解除默认的右下锚定 */
.zhili-float.is-placed { right: auto; bottom: auto; }
.zhili-orb { touch-action: none; user-select: none; }
.zhili-float.is-dragging, .zhili-float.is-dragging * { user-select: none; }
.zhili-float.is-dragging .zhili-orb { cursor: grabbing; }
.zhili-orb { position: relative; width: 64px; height: 64px; border: none; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 32% 28%, #2f3a4a 0%, #141a24 62%, #0c1017 100%);
  box-shadow: 0 10px 24px rgba(12, 16, 23, .28), inset 0 1px 2px rgba(255, 255, 255, .25);
  display: grid; place-items: center; padding: 0; }
.zhili-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; display: block;
  border: 2px solid rgba(243, 230, 196, .9); box-shadow: 0 2px 8px rgba(12, 16, 23, .24); }
.zhili-id { display: flex; align-items: center; gap: 8px; min-width: 0; }
.zhili-head-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block;
  border: 1px solid rgba(214, 178, 94, .75); flex: none; }
.zhili-ring { position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(214, 178, 94, .55);
  box-shadow: 0 0 14px rgba(214, 178, 94, .35); pointer-events: none; }
.zhili-core { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  color: #f3e6c4; font-size: 15px; letter-spacing: 1px;
  background: radial-gradient(circle at 50% 38%, rgba(214, 178, 94, .26), rgba(214, 178, 94, .06) 68%, transparent 72%);
  border: 1px solid rgba(214, 178, 94, .35); }
.zhili-orb:hover .zhili-ring { box-shadow: 0 0 22px rgba(214, 178, 94, .6); }
.zhili-panel { position: absolute; right: 0; bottom: 78px; width: 340px; max-width: calc(100vw - 44px);
  background: #fbfaf7; border: 1px solid #e3ded2; border-radius: 18px; padding: 14px 16px 16px;
  box-shadow: 0 18px 40px rgba(20, 26, 36, .18); }
/* 悬浮球贴边时面板换向，左右锚点由 _tutor_float.html 按视口算，这里只管上下 */
.zhili-panel.is-below { bottom: auto; top: 78px; }
.zhili-panel-head { display: flex; align-items: center; justify-content: space-between; }
.zhili-title { font-size: 15px; font-weight: 600; color: #23282f; }
.zhili-close { border: none; background: none; font-size: 18px; line-height: 1; color: #8a8578; cursor: pointer; }
.zhili-sub { margin: 4px 0 10px; font-size: 12px; color: #7b7568; }
.zhili-panel textarea { width: 100%; border: 1px solid #ded8ca; border-radius: 12px; padding: 9px 11px;
  font-family: var(--font-question); font-size: 14px; line-height: 1.6; background: #fff; resize: vertical; }
.zhili-actions { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.zhili-send { border: 1px solid #2f3a4a; background: #2f3a4a; color: #f3e6c4; border-radius: 999px;
  padding: 6px 16px; font-size: 13px; cursor: pointer; }
.zhili-send:hover { background: #141a24; }
.zhili-tip { font-size: 12px; color: #8a8578; }
.zhili-reply .katex { font-size: 1.04em; }
.zhili-reply .katex .mathnormal,
.zhili-reply .katex .mord.mathnormal,
.zhili-reply .katex .mbin,
.zhili-reply .katex .mrel {
  font-family: "Times New Roman", "KaTeX_Math", serif;
  font-style: italic;
}
.zhili-reply .katex .mord.text { font-family: "Times New Roman", serif; }
.zhili-reply .katex-display { margin: 0.4em 0; }
.zhili-reply { margin: 10px 0 0; max-height: 260px; overflow: auto; padding: 10px 12px; background: #fff;
  border: 1px dashed #ded8ca; border-radius: 12px; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; }
@media (max-width: 640px) { .zhili-float { right: 14px; bottom: 86px; } .zhili-orb { width: 56px; height: 56px; } .zhili-avatar { width: 46px; height: 46px; } .zhili-core { width: 40px; height: 40px; font-size: 13px; } }

/* ---------- 公告栏 / 轮播 ---------- */
.notice-board {
  margin-top: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.notice-feature {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 22px 24px;
  min-height: 190px;
}
.notice-slide { display: none; }
.notice-slide.is-active { display: block; animation: notice-fade .35s ease; }
@keyframes notice-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .notice-slide.is-active { animation: none; } }
.notice-slide-title { font-size: 19px; margin: 10px 0 8px; }
.notice-slide-title a { color: var(--text); }
.notice-slide-body { margin: 0; color: #4b5563; font-size: 14px; max-width: 640px; }
.notice-kind {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eff6ff;
  color: var(--accent-dark);
}
.notice-kind-update { background: #eff6ff; color: var(--accent-dark); }
.notice-kind-policy { background: #fffbeb; color: var(--amber); }
.notice-kind-activity { background: #ecfdf5; color: var(--green); }
.notice-dots { position: absolute; right: 20px; bottom: 14px; margin: 0; display: flex; gap: 6px; }
.notice-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.notice-dot:hover { border-color: var(--accent); color: var(--accent); }
.notice-dot.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.notice-list-home {
  list-style: none;
  margin: 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.notice-list-home li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.notice-list-home li:last-child { border-bottom: none; }
.notice-list-home time { color: var(--muted); font-size: 12px; flex: none; }
.notice-list-home a { color: var(--text); }
.notice-list-home a:hover { color: var(--accent); }
.notice-more { margin: 6px 0 0; text-align: right; }
.notice-page .notice-list { display: grid; gap: 14px; }
.notice-item { padding: 20px 22px; }
.notice-meta { margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; color: var(--muted); font-size: 12px; }
.notice-title { margin: 0 0 8px; font-size: 18px; }
.notice-body { color: #374151; font-size: 14.5px; }
.notice-link { margin: 10px 0 0; }
.notice-foot { margin-top: 18px; color: var(--muted); font-size: 13px; }

/* ---------- 在线公式编辑器 ---------- */
.formula-editor { padding: 18px 20px 16px; }
.formula-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}
.formula-pane { min-width: 0; }
.formula-input {
  width: 100%;
  font-family: "SFMono-Regular", Menlo, Consolas, "Courier New", monospace !important;
  font-size: 13.5px !important;
  line-height: 1.6;
}
.formula-hint { color: var(--green); font-size: 13px; }
.formula-error {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: #fef2f2;
  color: var(--red);
  font-size: 13px;
}
/* 消息输入框的公式与符号工具条（static/js/formula_input.js 生成） */
.fx-bar {
  margin-top: 8px;
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}
.fx-palette { display: grid; gap: 8px; }
.fx-fams {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.fx-fam {
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 1px;
  min-width: 54px;
  padding: 3px 6px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  line-height: 1.15;
}
.fx-fam:hover { border-color: var(--accent); background: #f5f8ff; }
.fx-fam.is-on {
  border-color: var(--accent);
  background: #eff6ff;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.fx-fam-label { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.fx-fam.is-on .fx-fam-label { color: var(--accent-dark); font-weight: 600; }
.fx-fam-face { height: 22px; overflow: hidden; }
.fx-fam-face .katex,
.fx-key .katex { font-size: 1em; }
.fx-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.fx-mini {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.fx-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.fx-count.is-over { color: var(--red); }
.fx-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}
.fx-key {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 30px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}
.fx-key:hover {
  border-color: var(--accent);
  background: #f5f8ff;
  color: var(--accent);
}
.fx-preview {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.fx-muted { color: var(--muted); font-size: 12px; }
/* 知理面板里空间紧，工具条收窄一档 */
.zhili-panel .fx-bar { background: #fff; padding: 6px 8px 8px; }
.zhili-panel .fx-keys { max-height: 84px; }
.zhili-panel .fx-key { min-width: 26px; font-size: 12px; }
/* 面板只有 340 px 宽，族行改成横向滚动一条，免得堆成四行占掉半屏 */
.zhili-panel .fx-fams,
.msg-compose-bar .fx-fams { flex-wrap: nowrap; overflow-x: auto; }
.zhili-panel .fx-fam { min-width: 46px; padding: 2px 4px 3px; }
.zhili-panel .fx-fam-face { height: 18px; }
/* 站内信输入条吸底，色板再压一档，免得占掉半屏 */
.msg-compose-bar .fx-bar { margin-top: 4px; padding: 6px 8px 8px; }
.msg-compose-bar .fx-keys { max-height: 72px; }

.formula-ribbon { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.formula-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-top: 12px;
}
.formula-tool-field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.formula-tool-field select { min-width: 148px; }
.formula-tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.formula-pane-label { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.formula-status {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 9px;
  background: #f6f8fb;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.formula-library { margin-top: 16px; padding: 20px 22px; }
.template-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.template-list li { min-width: 0; }
.template {
  display: grid;
  gap: 6px;
  justify-items: center;
  width: 100%;
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.template:hover { border-color: var(--accent); background: #eff6ff; }
.template-face { min-height: 26px; color: var(--text); overflow-x: auto; max-width: 100%; }
.template-name { color: var(--muted); font-size: 12px; }
.formula-tip { margin: 16px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; }
.formula-preview {
  min-height: 140px;
  display: grid;
  place-items: center;
  overflow-x: auto;
  padding: 16px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fcfdff;
}
.formula-preview .katex-display { margin: 0; }
@media (max-width: 900px) {
  .notice-board,
  .formula-canvas { grid-template-columns: minmax(0, 1fr); }
  .template-list { grid-template-columns: minmax(0, 1fr); }
  .formula-tool-actions { margin-left: 0; }
}

/* ---------- 资源广场 · 上传与审核 ---------- */
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.upload-filter-label { margin: 16px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.upload-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.upload-card { display: flex; flex-direction: column; padding: 18px 20px; }
.upload-card-meta { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.upload-card-title { margin: 0 0 6px; font-size: 16.5px; }
.upload-card-title a { color: var(--text); }
.upload-card-desc { margin: 0 0 12px; color: #4b5563; font-size: 13.5px; }
.upload-card-foot {
  margin: auto 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.badge-upload-slide { background: #eff6ff; color: #1d4ed8; }
.badge-upload-lesson_plan { background: #ecfdf5; color: #047857; }
.badge-upload-study_sheet { background: #f5f3ff; color: #6d28d9; }
.badge-upload-worksheet { background: #fffbeb; color: var(--amber); }
.badge-upload-image { background: #ecfeff; color: var(--cyan); }
.badge-upload-video { background: #fef2f2; color: var(--red); }
.badge-upload-source { background: #f1f5f9; color: #334155; }
.badge-upload-paper { background: #f0fdfa; color: #0f766e; }
.badge-upload-other { background: #f3f4f6; color: var(--muted); }
.upload-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.upload-detail-main,
.upload-detail-side { padding: 22px; }
.upload-detail-main h2,
.upload-detail-side h2 { margin: 0 0 10px; font-size: 18px; }
.upload-description { color: #374151; font-size: 14.5px; }
.upload-meta-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; }
.upload-meta-table caption { text-align: left; color: var(--muted); font-size: 12px; padding-bottom: 6px; }
.upload-meta-table th,
.upload-meta-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.upload-meta-table th { width: 88px; color: var(--muted); font-weight: 600; }
.upload-copyright { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; }
.upload-form-page { display: grid; gap: 16px; }
.upload-form { padding: 24px; }
.upload-form-aside { padding: 22px 24px; }
.upload-form-aside h2 { margin: 0 0 10px; font-size: 17px; }
.upload-form-aside ol { margin: 0; padding-left: 20px; color: #4b5563; font-size: 13px; }
.upload-form-aside li { margin-bottom: 7px; }
.upload-agree label { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.upload-agree input { width: auto; margin-top: 3px; }
.form-errors { margin: 0 0 14px; padding: 10px 14px 10px 30px; border-radius: 9px; background: #fef2f2; color: var(--red); font-size: 13px; }
.my-uploads .upload-status-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.upload-status-group { padding: 20px 22px; }
.upload-status-group h2 { margin: 0 0 10px; font-size: 17px; }
.upload-status-group h2 small { color: var(--muted); font-weight: 600; }
.upload-list { list-style: none; margin: 0; padding: 0; }
.upload-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; gap: 2px; }
.upload-list li:last-child { border-bottom: none; }
@media (max-width: 900px) {
  .upload-detail-body { grid-template-columns: minmax(0, 1fr); }
}

/* 用户名下拉菜单 */
.nav-user-menu { position: relative; }
.nav-user-menu summary { cursor: pointer; list-style: none; padding: 4px 10px; border-radius: 999px;
  border: 1px solid transparent; font-size: 15px; color: var(--text); }
.nav-user-menu summary::-webkit-details-marker { display: none; }
.nav-user-menu summary:hover { border-color: var(--line); background: rgba(255, 255, 255, .6); }
.nav-user { gap: 7px; }
.nav-user-active { border-color: rgba(37, 99, 235, .18) !important; background: #eff6ff !important; }
.nav-avatar { width: 25px; height: 25px; font-size: 11px; border: 1px solid rgba(37, 99, 235, .16); }
.nav-user-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 218px; padding: 8px;
  background: #fff; border: 1px solid var(--line, #e3ded2); border-radius: 14px;
  box-shadow: 0 14px 30px rgba(20, 26, 36, .14); display: grid; gap: 2px; z-index: 30; }
.nav-user-panel a, .nav-user-panel button { display: block; width: 100%; text-align: left; padding: 7px 10px;
  border-radius: 8px; font-size: 14px; color: var(--text); background: none; border: none; cursor: pointer; }
.nav-user-panel a:hover, .nav-user-panel button:hover { background: #f4f1ea; }
.nav-user-panel a.nav-active { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.nav-user-panel a.nav-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #fbfdff, #f1f7ff);
}
.nav-user-card-avatar { width: 36px; height: 36px; font-size: 14px; border-radius: 12px; }
.nav-user-card-text { display: grid; min-width: 0; gap: 1px; }
.nav-user-card-text strong { overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-card-text small { color: #64748b; font-size: 11.5px; }
.nav-user-label { margin: 7px 10px 2px; color: #94a3b8; font-size: 11px; letter-spacing: .08em; }
.nav-user-sep { height: 1px; margin: 5px 4px; background: var(--line); }
@media (max-width: 860px) {
  .nav-user-menu { width: 100%; }
  .nav-user-menu summary { display: inline-flex; min-height: 44px; padding: 8px 4px; }
  .nav-user-panel {
    position: static;
    min-width: 0;
    margin-top: 4px;
    padding: 2px 0 8px 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .nav-user-panel a.nav-user-card { border: 0; background: #f8fbff; }
}
.unread-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
  animation: unread-badge-pop .34s cubic-bezier(.2, .9, .3, 1.35) both;
}
@keyframes unread-badge-pop {
  0% { opacity: 0; transform: translateY(-5px) scale(.45); }
  70% { opacity: 1; transform: translateY(0) scale(1.12); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .unread-badge { animation: none; }
}

/* ---------------- 教研社区（板块 · 帖子 · 回复 · 个人主页） ---------------- */
.forum-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.forum-board-card { display: flex; flex-direction: column; gap: 8px; }
.forum-board-title { margin: 0; font-size: 18px; }
.forum-board-title a { color: var(--text); }
.forum-board-title a:hover { color: var(--accent); }
.forum-board-desc { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.forum-board-foot { margin: auto 0 0; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.forum-two-col, .profile-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.forum-two-col .section-head, .profile-two-col .section-head { margin-bottom: 12px; }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.post-row { display: grid; gap: 6px; padding: 16px 18px; }
.post-row.is-pinned { border-left: 4px solid var(--accent); }
.post-row-meta { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-row-title { margin: 0; font-size: 17px; line-height: 1.5; }
.post-row-title a { color: var(--text); }
.post-row-title a:hover { color: var(--accent); }
.post-row-excerpt { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.post-row-foot { margin: 0; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.forum-rank { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.forum-rank a { color: var(--text); }
.forum-rank a:hover { color: var(--accent); }
.forum-tip { margin: 14px 0 0; padding: 10px 12px; background: #f7f4ee; border-radius: 10px; color: var(--muted); }
.badge-topic-discussion { background: #eff6ff; color: #1d4ed8; }
.badge-topic-puzzle { background: #fff7ed; color: #c2410c; }
.badge-topic-call { background: #f5f3ff; color: #6d28d9; }
.badge-topic-lab { background: #ecfdf5; color: var(--green); }
.badge-topic-paper { background: #f0fdfa; color: #0f766e; }
.badge-post-pin { background: #eef2ff; color: #3730a3; }
.badge-post-featured { background: #fef3c7; color: #92400e; }

.post-main { display: grid; gap: 10px; padding: 22px 24px; }
.post-main-title { margin: 0; font-size: 24px; line-height: 1.4; }
.post-main-meta { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.post-author { font-weight: 600; color: var(--accent-dark); }
.post-body { font-size: 16px; line-height: 1.9; color: var(--text); }
.post-links { display: flex; gap: 8px; flex-wrap: wrap; }
.forum-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.forum-actions form { margin: 0; }
.btn.is-liked { background: var(--accent); border-color: var(--accent); color: #fff; }
.report-box { display: inline-grid; gap: 6px; }
.report-box summary { cursor: pointer; color: var(--muted); }
.report-box form { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

.forum-replies { margin-top: 26px; display: grid; gap: 12px; }
.reply-item { display: grid; gap: 8px; padding: 16px 18px; }
.reply-item.is-hidden { opacity: .6; }
.reply-meta { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.reply-body { font-size: 15px; line-height: 1.85; }
.reply-actions { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.reply-actions form { margin: 0; }
.reply-form { display: grid; gap: 12px; }
.forum-post-form, .forum-post-form-page form { gap: 14px; }
.upload-form-aside ol { padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.75; }
.form-errors { margin: 4px 0 0; color: var(--red); font-size: 14px; }
.profile-aside { display: grid; gap: 10px; align-content: start; }
@media (max-width: 900px) {
  .forum-two-col, .profile-two-col { grid-template-columns: minmax(0, 1fr); }
  .post-main { padding: 18px 16px; }
}

/* 物理示意图绘图工具 */
.diagram-work {
  display: grid;
  grid-template-columns: minmax(0, 268px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.diagram-palette { display: grid; gap: 12px; padding: 16px 18px; }
.diagram-block-label {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: .04em;
}
.diagram-group { display: grid; gap: 8px; }
.diagram-group-label { margin: 0; font-size: 14px; font-weight: 600; }
.diagram-items { display: flex; flex-wrap: wrap; gap: 6px; }
.diagram-item {
  font: inherit;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfe;
  color: var(--text);
  cursor: pointer;
}
.diagram-item:hover { border-color: var(--accent); color: var(--accent-dark); background: #eff6ff; }
.diagram-presets { display: grid; gap: 8px; }
.diagram-preset {
  font: inherit;
  font-size: 14px;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.diagram-preset:hover { border-color: var(--accent); background: #eff6ff; }
.diagram-preset-note { margin: -4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.diagram-stage { display: grid; gap: 14px; padding: 16px 18px; }
.diagram-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.diagram-canvas-wrap { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: auto; }
.diagram-canvas { display: block; width: 100%; height: auto; touch-action: none; }
.diagram-canvas-bg { fill: #ffffff; }
.diagram-shape { cursor: grab; }
.diagram-shape.is-selected { cursor: grabbing; }
.diagram-selection {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  pointer-events: none;
}
.diagram-status { margin: 0; min-height: 22px; font-size: 13.5px; color: var(--muted); }
.diagram-export { display: grid; gap: 10px; }
.diagram-export-row { align-items: start; }
.diagram-export-actions { flex: 1; }
.diagram-export-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.diagram-source {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}
.diagram-tip { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.8; }
.diagram-aside { margin-top: 18px; display: grid; gap: 10px; }
.diagram-aside h2 { margin: 0; font-size: 17px; }
.diagram-aside ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.75; }

/* 创作工作台（三栏 IDE 布局） */
.diagram-ide { display: grid; grid-template-columns: 248px minmax(0, 1fr) 252px; gap: 14px; align-items: start; }
.diagram-tools, .diagram-inspect { padding: 14px 16px; display: grid; gap: 12px; align-content: start; }
.diagram-toolgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.diagram-tool {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 7px 8px; font-size: 13px; cursor: pointer; color: var(--ink, #1f2933); text-align: left;
}
.diagram-tool:hover { border-color: var(--accent); color: var(--accent-dark); background: #f8fafc; }
.diagram-tool.is-active { border-color: var(--accent); background: #eff6ff; color: var(--accent-dark); font-weight: 600; }
.diagram-tools details.diagram-group { border: 0; }
.diagram-tools summary.diagram-group-label { cursor: pointer; list-style: none; }
.diagram-tools summary.diagram-group-label::-webkit-details-marker { display: none; }
.diagram-tools summary.diagram-group-label::before { content: "▸ "; color: var(--muted); }
.diagram-tools details[open] summary.diagram-group-label::before { content: "▾ "; }
.diagram-keys ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.diagram-drafts { display: grid; gap: 8px; }
.diagram-draft-save { display: flex; gap: 6px; }
.diagram-draft-save input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.diagram-draft-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 150px; overflow: auto; }
.diagram-draft-list li { display: flex; gap: 4px; align-items: center; }
.diagram-draft-open { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 4px 6px; font-size: 12.5px; cursor: pointer; border-radius: 6px; color: var(--accent-dark); }
.diagram-draft-open:hover { background: #f1f5f9; }
.diagram-draft-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; }

.diagram-stage { display: grid; gap: 10px; padding: 14px 16px; }
.diagram-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.diagram-field { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.diagram-field select { border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; font-size: 12.5px; background: #fff; }
.diagram-check { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.diagram-sep { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }
.diagram-zoom-label { min-width: 54px; }
.diagram-canvas-wrap { border: 1px solid var(--line); border-radius: 12px; background: #f3f5f8; overflow: hidden; }
.diagram-canvas { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
.diagram-canvas[data-tool="pan"] { cursor: grab; }
.diagram-canvas[data-tool="line"], .diagram-canvas[data-tool="ray"], .diagram-canvas[data-tool="vector"],
.diagram-canvas[data-tool="polyline"], .diagram-canvas[data-tool="freehand"],
.diagram-canvas[data-tool="rect"], .diagram-canvas[data-tool="ellipse"], .diagram-canvas[data-tool="text"] { cursor: crosshair; }
.diagram-grid { pointer-events: none; }
.diagram-shape[data-hidden="1"] { display: none; }
#diagram-handles { pointer-events: none; }
.d-outline { fill: none; stroke: #1d4ed8; stroke-width: 1.4; stroke-dasharray: 5 4; }
.d-handle { fill: #fff; stroke: #1d4ed8; stroke-width: 1.6; pointer-events: all; cursor: nwse-resize; }
.d-handle[data-handle="ne"], .d-handle[data-handle="sw"] { cursor: nesw-resize; }
.d-handle.d-rotate { cursor: grab; fill: #1d4ed8; }
.d-stem { stroke: #1d4ed8; stroke-width: 1.2; }
.d-preview { stroke-dasharray: none; }

.diagram-statusbar { display: flex; justify-content: space-between; gap: 12px; margin: 0; min-height: 20px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.diagram-status-right { display: inline-flex; gap: 14px; margin-left: auto; font-variant-numeric: tabular-nums; }

.diagram-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.diagram-tab { border: 0; background: none; font-size: 14px; padding: 4px 10px; cursor: pointer; border-radius: 8px; color: var(--muted); }
.diagram-tab.is-active { background: #eff6ff; color: var(--accent-dark); font-weight: 600; }
.diagram-panel { display: grid; gap: 10px; }
.diagram-inspect-title { margin: 4px 0 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.diagram-inspect-hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.diagram-prop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12.5px; color: var(--muted); }
.diagram-prop-grid input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; font-size: 13px; margin-top: 2px; }
.diagram-prop-row { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.diagram-prop-grow { flex: 1; display: flex; gap: 6px; align-items: center; }
.diagram-prop-row select, .diagram-prop-row input[type="number"] { border: 1px solid var(--line); border-radius: 7px; padding: 3px 5px; font-size: 12.5px; }
.diagram-prop-row input[type="range"] { flex: 1; }
.diagram-prop-row input[type="color"] { width: 34px; height: 26px; border: 1px solid var(--line); border-radius: 7px; padding: 1px; background: #fff; }
#prop-text { width: 100%; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; padding: 6px; }
.diagram-swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.d-swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.12); cursor: pointer; padding: 0; }
.d-swatch:hover { outline: 2px solid #94a3b8; }
.diagram-layer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; max-height: 430px; overflow: auto; }
.diagram-layer-row { display: flex; align-items: center; gap: 2px; font-size: 12.5px; border-radius: 7px; padding: 2px 4px; }
.diagram-layer-row:hover { background: #f5f7fa; }
.diagram-layer-row.is-active { background: #eff6ff; }
.diagram-layer-row.is-empty { color: var(--muted); justify-content: center; }
.diagram-layer-row button { border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--muted); padding: 2px 4px; border-radius: 5px; }
.diagram-layer-row button:hover { background: #e5e9f0; color: var(--ink, #1f2933); }
.d-layer-name { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink, #1f2933); }
.d-eye { color: #1d4ed8 !important; }

@media (max-width: 1180px) {
  .diagram-ide { grid-template-columns: 220px minmax(0, 1fr); }
  .diagram-inspect { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .diagram-work, .diagram-ide { grid-template-columns: minmax(0, 1fr); }
}

/* 每一步可视化：工具图标 / 缩略图 / 分步引导条 / 实时气泡 / 历史面板 */
.diagram-tool { display: flex; align-items: center; gap: 6px; }
.d-toolicon { width: 16px; height: 16px; flex: 0 0 16px; }
.diagram-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 264px; overflow: auto; }
.diagram-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border-radius: 10px; padding: 6px 4px; text-align: center;
}
.d-thumb { width: 100%; height: 38px; display: block; }
.d-thumb-wide { width: 100%; height: 54px; display: block; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.diagram-preset { display: flex; flex-direction: column; gap: 4px; }
#diagram-thumb-bench { position: absolute; left: -9999px; top: 0; width: 200px; height: 120px; visibility: hidden; pointer-events: none; }
.diagram-canvas-wrap { position: relative; }
.diagram-stepbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 2px 2px 0; }
.d-step {
  font-size: 12px; line-height: 1.5; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: #fbfcfe;
}
.d-step.is-now { background: #1d4ed8; border-color: #1d4ed8; color: #fff; font-weight: 600; }
.d-step.is-done { background: #e0f2e9; border-color: #b6dfca; color: #0f7b6c; }
.d-tip {
  position: absolute; z-index: 6; pointer-events: none;
  background: rgba(31, 41, 55, .92); color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5;
  padding: 4px 8px; border-radius: 8px; white-space: pre; max-width: 260px;
}
.diagram-history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; max-height: 430px; overflow: auto; }
.diagram-history-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; border-radius: 7px; padding: 3px 4px; }
.diagram-history-row:hover { background: #f5f7fa; }
.d-his-info { flex: 1; min-width: 0; display: block; color: var(--ink, #1f2933); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.diagram-history-empty { color: var(--muted); font-size: 12.5px; justify-content: center; padding: 6px 4px; }
.d-his-jump { border: 1px solid var(--line); background: #fff; border-radius: 7px; font-size: 11.5px; padding: 2px 7px; cursor: pointer; color: var(--accent-dark); flex: 0 0 auto; }
.d-his-jump:hover { border-color: var(--accent); background: #eff6ff; }

/* 资源收藏 · 评分 · 反馈 */
.upload-feedback { margin-top: 18px; display: grid; gap: 14px; padding: 18px 20px; }
.feedback-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feedback-head h2 { margin: 0; font-size: 18px; }
.feedback-score { margin: 0; color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.star-bar { letter-spacing: 1px; color: #d5d9e0; font-size: 15px; }
.star.is-on { color: #e0a10c; }
.rating-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.rating-form legend { padding: 0 6px; font-size: 14px; color: var(--muted); }
.rating-options { display: flex; flex-wrap: wrap; gap: 10px; }
.rating-option { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; }
.feedback-item { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.upload-card-score { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.upload-card-score .small { color: var(--muted); }

/* 站内信 */
.msg-wrap { max-width: 980px; }
.msg-head { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 18px; }
.msg-title { font-size: 22px; font-weight: 650; margin: 0; }
.msg-sub { color: var(--muted); font-size: 13px; }
.msg-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.msg-compose { display: grid; gap: 10px; }
.msg-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg-input, .msg-textarea, .msg-select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; background: #fff; color: var(--text);
}
.msg-textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.msg-counter { margin-left: auto; color: var(--muted); font-size: 12px; }
.msg-btn { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 10px; padding: 9px 18px; font: inherit; cursor: pointer; }
.msg-btn:hover { background: var(--accent-dark); }
.msg-btn-ghost { background: transparent; color: var(--accent); }
.msg-btn-ghost:hover { background: #eff6ff; }
.msg-hint { color: var(--muted); font-size: 12.5px; line-height: 1.6; margin: 2px 0 0; }
.msg-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.msg-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.msg-item:last-child { border-bottom: 0; }
.msg-item:hover { background: #f9fafb; text-decoration: none; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; background: #e0e7ff; color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 15px; overflow: hidden; }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.msg-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.msg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); display: inline-block; }
.msg-snippet { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.msg-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.msg-status { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 999px; font-size: 11px; line-height: 1.6; white-space: nowrap; }
.msg-status.is-unread { background: #fee2e2; color: #b91c1c; }
.msg-status.is-read { background: #dcfce7; color: #15803d; }
.msg-bubble-meta .msg-status { margin: 0 0 0 6px; padding: 0 6px; background: rgba(255, 255, 255, .24); color: inherit; }
.msg-item-unread .msg-name { font-weight: 750; }
.msg-empty { text-align: center; color: var(--muted); padding: 26px; font-size: 14px; }
.msg-thread { display: grid; gap: 12px; padding: 4px 2px 18px; }
.msg-bubble { max-width: 74%; padding: 10px 14px; border-radius: 14px; line-height: 1.65; font-size: 15px; word-break: break-word; }
.msg-bubble-me { margin-left: auto; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble-other { background: #f3f4f6; color: var(--text); border-bottom-left-radius: 4px; }
.msg-source { display: inline-block; margin-bottom: 5px; padding: 1px 7px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: 11px; line-height: 1.6; white-space: nowrap; }
.msg-bubble-meta { font-size: 11.5px; opacity: .75; margin-top: 4px; }
.msg-compose-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 0 0; }
.msg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.msg-class { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.msg-class-name { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 4px; }
.friend-avatar { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; font-size: 15px; }
.msg-class-meta { color: var(--muted); font-size: 12.5px; }
.msg-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eff6ff; color: var(--accent); font-size: 12px; }

/* 站内班级 */
.class-page { display: grid; gap: 22px; max-width: 980px; padding-bottom: 8px; }
.class-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(270px, .6fr);
  gap: 20px;
  padding: 26px;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 20px;
  background:
    radial-gradient(720px 260px at 8% -10%, rgba(37, 99, 235, .14), transparent 62%),
    linear-gradient(135deg, #fbfdff 0%, #eef5ff 56%, #eefbf8 100%);
  box-shadow: 0 18px 38px rgba(37, 99, 235, .07);
}
.class-hero::before {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 116, 144, .12), transparent 68%);
  pointer-events: none;
}
.class-hero-main { position: relative; z-index: 1; align-self: center; }
.class-eyebrow {
  margin: 0 0 6px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .12em;
}
.class-title { margin: 0; font-size: 30px; line-height: 1.25; letter-spacing: .01em; }
.class-desc { max-width: 56ch; margin: 8px 0 0; color: #475569; font-size: 14.5px; line-height: 1.8; }
.class-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.class-stat {
  display: flex;
  min-width: 92px;
  flex-direction: column;
  padding: 10px 14px;
  border: 1px solid rgba(37, 99, 235, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .74);
}
.class-stat strong { color: #1d4ed8; font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.class-stat span { color: #64748b; font-size: 12px; }
.class-join {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .08);
}
.class-join-head { display: flex; align-items: center; gap: 10px; }
.class-join-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 20px;
  font-weight: 600;
}
.class-join h2 { margin: 0; font-size: 16px; line-height: 1.4; }
.class-join-head p { margin: 0; color: #64748b; font-size: 12.5px; }
.class-join .msg-input { flex: 1 1 140px; min-width: 0; }
.class-block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.class-block-head h2 { margin: 0; font-size: 18px; }
.class-block-head p { margin: 3px 0 0; color: #64748b; font-size: 13px; }
.class-count {
  flex: 0 0 auto;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 12.5px;
  white-space: nowrap;
}
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.class-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
a.class-card:hover {
  border-color: rgba(37, 99, 235, .32);
  box-shadow: 0 14px 30px rgba(37, 99, 235, .12);
  text-decoration: none;
  transform: translateY(-2px);
}
.class-card-mine { background: linear-gradient(180deg, #fff, #f8fbff); }
.class-card-top { display: flex; min-width: 0; align-items: center; gap: 12px; }
.class-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
  color: #1d4ed8;
  font-size: 17px;
  font-weight: 700;
}
.class-card-title { display: grid; min-width: 0; }
.class-card-title strong {
  overflow: hidden;
  font-size: 15.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.class-card-title span { color: #64748b; font-size: 12px; }
.class-tag {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  white-space: nowrap;
}
.class-tag-joined { background: #dcfce7; color: #15803d; }
.class-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: #64748b;
  font-size: 12.5px;
}
.class-enter { color: #1d4ed8; font-weight: 600; white-space: nowrap; }
.class-status { color: #15803d; }
.class-status.muted { color: #94a3b8; }
.class-empty {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
  padding: 28px 22px;
  border: 1px dashed #dbe3ef;
  border-radius: 16px;
  background: #fbfdff;
  color: #64748b;
  text-align: center;
}
.class-empty strong { color: #334155; font-size: 15px; }
.class-admin { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.class-admin > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}
.class-admin > summary::-webkit-details-marker { display: none; }
.class-admin > summary > span:first-child { display: grid; gap: 2px; }
.class-admin > summary strong { font-size: 15px; }
.class-admin > summary > span:first-child > span { color: #64748b; font-size: 12.5px; }
.class-admin-caret { color: #64748b; transition: transform .18s ease; }
.class-admin[open] .class-admin-caret { transform: rotate(180deg); }
.class-admin-body { display: grid; gap: 14px; padding: 0 18px 18px; }
.class-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.class-admin-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}
.class-admin-card h3 { margin: 0; font-size: 14.5px; }
.class-admin-foot { display: flex; justify-content: flex-end; }
/* 班级群聊 */
.class-room-page { gap: 20px; }
.class-room-side { align-self: stretch; }
.class-room-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.class-room-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 9px 3px 3px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
}
.class-room-person .msg-avatar { width: 24px; height: 24px; font-size: 11px; }
.class-room-person-name { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-room-more {
  display: inline-grid;
  min-width: 30px;
  place-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 12px;
}
.class-room-back { display: block; text-align: center; text-decoration: none; }
.class-room-dashboard-link {
  display: block;
  margin-top: 8px;
  color: #2563eb;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
}
.class-room-dashboard-link:hover { text-decoration: underline; }
.class-room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 18px;
  align-items: start;
}
.class-room-chat {
  min-width: 0;
  padding: 18px 18px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(37, 99, 235, .06);
}
.class-room-chat-head { margin-bottom: 10px; }
.class-room-thread {
  min-height: 220px;
  max-height: 58vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 4px 18px;
  scrollbar-width: thin;
}
.class-room-msg-row { display: flex; min-width: 0; align-items: flex-end; gap: 8px; }
.class-room-msg-row.is-me { justify-content: flex-end; }
.class-room-msg-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}
.class-room-thread .msg-bubble { max-width: 82%; box-shadow: 0 4px 14px rgba(15, 23, 42, .04); }
.class-room-thread .msg-bubble-other { border: 1px solid #eef2f7; background: #f8fafc; }
.class-room-thread .msg-bubble-me { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.class-room-thread .msg-bubble-name { color: #64748b; font-weight: 600; }
.class-room-compose { padding: 12px 0 16px; border-top: 1px solid var(--line); background: #fff; }
.class-room-compose .msg-field { justify-content: space-between; }
.class-room-aside { display: grid; min-width: 0; align-content: start; gap: 14px; }
.class-room-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(37, 99, 235, .05);
}
.class-room-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.class-room-card-head h2 { margin: 0; font-size: 16px; }
.class-room-card-head p { margin: 3px 0 0; color: #64748b; font-size: 12px; line-height: 1.6; }
.class-room-assign { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.class-room-assign:last-of-type { padding-bottom: 4px; border-bottom: 0; }
.class-room-assign-main { display: grid; min-width: 0; gap: 2px; }
.class-room-assign-title { color: #1f2937; font-size: 14px; font-weight: 650; line-height: 1.5; }
.class-room-assign-title:hover { color: #1d4ed8; }
.class-room-assign-meta { margin: 0; color: #64748b; font-size: 11.5px; line-height: 1.65; }
.class-room-assign-side { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.class-room-assign-side .class-tag { margin-left: 0; }
.class-room-stats-link { color: #64748b; font-size: 12px; white-space: nowrap; }
.class-room-assign-empty { padding: 18px 12px; border-style: solid; }
.class-room-assign-tools {
  margin-top: 12px;
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fbff;
}
.class-room-assign-tools > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.class-room-assign-tools > summary::-webkit-details-marker { display: none; }
.class-room-assign-tools > summary span { color: #64748b; font-size: 11.5px; font-weight: 400; }
.class-room-assign-form { display: grid; gap: 8px; padding: 0 13px 13px; }
.class-room-assign-form .msg-select, .class-room-assign-form .msg-input { padding: 8px 10px; font-size: 13px; }
.class-room-assign-form .exam-assign-also { max-height: 120px; overflow-y: auto; padding: 2px 0; }
.class-room-assign-form .msg-btn { justify-self: end; }

/* 个人资料 */
.profile-hero { grid-template-columns: minmax(0, 1fr); }
.profile-identity { display: flex; align-items: center; gap: 16px; margin: 4px 0 2px; }
.profile-avatar-large { width: 72px; height: 72px; flex: 0 0 auto; border-radius: 20px; font-size: 28px; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 8px 20px rgba(37, 99, 235, .15); }
.profile-region-value { max-width: 150px; overflow: hidden; font-size: 17px !important; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar-card { justify-items: stretch; }
.profile-avatar-preview {
  display: grid;
  width: 112px;
  height: 112px;
  margin: 2px auto 0;
  place-items: center;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .16);
}
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-fallback { color: #1d4ed8; font-size: 44px; font-weight: 700; }
.profile-avatar-state { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.profile-avatar-state .class-tag { margin-left: 0; }
.profile-avatar-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.profile-avatar-badge.is-approved { background: #dcfce7; color: #15803d; }
.profile-avatar-badge.is-pending { background: #fef3c7; color: #b45309; }
.profile-avatar-badge.is-rejected { background: #fee2e2; color: #b91c1c; }
.profile-avatar-badge.is-none { background: #eef2f7; color: #64748b; }
.profile-avatar-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px dashed #bfdbfe;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff, #f0fdfa);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.profile-avatar-dropzone.is-dragging {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
}
.profile-avatar-dropcopy { display: grid; min-width: 0; gap: 3px; }
.profile-avatar-dropcopy strong { color: #1e3a8a; font-size: 13px; }
.profile-avatar-dropcopy span { color: #64748b; font-size: 11px; }
.profile-avatar-file-meta { overflow: hidden; color: #2563eb !important; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.profile-avatar-pick:hover { background: #eff6ff; }
.profile-avatar-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
.profile-avatar-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
}
.profile-avatar-submit:disabled { cursor: wait; opacity: .65; }
.profile-avatar-note { text-align: center; }
.profile-avatar-form { display: grid; gap: 9px; }
.profile-file-label {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fbff;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}
.profile-file-label input { font: inherit; color: #334155; }
.profile-avatar-form .errorlist, .profile-form .errorlist { margin: 0; padding-left: 18px; color: #b91c1c; font-size: 12px; }
.profile-form { display: grid; gap: 16px; padding-top: 14px; }
.profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.profile-field-wide { grid-column: 1 / -1; }
.profile-field-check label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.profile-field-check input[type="checkbox"] { width: auto; height: auto; flex: 0 0 auto; }
.profile-form .form-field { display: grid; gap: 5px; }
.profile-form .form-field label { color: #475569; font-size: 13px; font-weight: 550; }
.profile-form input, .profile-form select, .profile-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.profile-form textarea { min-height: 92px; resize: vertical; line-height: 1.65; }
.profile-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.profile-meta { display: grid; gap: 0; margin: 8px 0 0; }
.profile-meta > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.profile-meta > div:last-child { border-bottom: 0; }
.profile-meta dt { color: #64748b; font-size: 12.5px; }
.profile-meta dd { margin: 0; text-align: right; font-size: 13.5px; font-weight: 550; word-break: break-all; }
@media (max-width: 960px) {
  .class-room-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .class-hero { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .class-title { font-size: 27px; }
}
@media (max-width: 640px) {
  .class-grid { grid-template-columns: minmax(0, 1fr); }
  .class-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-stat { min-width: 0; }
  .class-block-head { align-items: flex-start; }
  .class-card-foot { flex-wrap: wrap; }
  .class-admin-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-identity { align-items: flex-start; }
  .profile-avatar-large { width: 58px; height: 58px; border-radius: 17px; font-size: 23px; }
  .profile-region-value { max-width: 100%; }
  .profile-form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .msg-bubble { max-width: 88%; }
  .msg-item { grid-template-columns: 34px 1fr; }
  .msg-item .msg-time { grid-column: 2; justify-self: start; }
}

/* 知理 · 跳转按钮 */
.zhili-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.zhili-act { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid #d6b28e; color: #6b5430; background: #fffaf0; text-decoration: none; }
.zhili-act:hover { background: #f7ecd6; }

.msg-bubble-name {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-bottom: 4px;
}

/* 知理 · 贴图搜题 */
.zhili-pic { border: 1px solid #b9a887; background: #fbf6e8; color: #4a3f2b; border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.zhili-pic:hover { background: #f5edd8; }
.zhili-shot { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.zhili-shot img { max-height: 96px; max-width: 130px; border-radius: 10px; border: 1px solid #ddd3bd; object-fit: contain; background: #fff; }
.zhili-shot-x { border: none; background: #efe7d6; color: #6b5c3e; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1; }
.zhili-shot-hint { font-size: 12px; color: #8a7c60; }
.zhili-hits { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.zhili-hit { display: flex; gap: 10px; padding: 8px; border: 1px solid #e2d9c6; border-radius: 12px; background: #fffdf7; text-decoration: none; color: inherit; }
.zhili-hit.is-top { border-color: #d6b25e; box-shadow: 0 2px 10px rgba(214, 178, 94, .18); }
.zhili-hit img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid #eee6d6; }
.zhili-hit-body { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.zhili-hit-body b { color: #2f3a4a; font-weight: 600; }
.zhili-hit-body i { font-style: normal; color: #9a7c33; font-size: 12px; }
.zhili-hit-body em { font-style: normal; color: #5d5a52; line-height: 1.5; }
.zhili-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.zhili-ref { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px; border: 1px solid #e2d9c6;
  border-radius: 999px; background: #fffdf7; font-size: 12px; color: #2f3a4a; text-decoration: none; }
.zhili-ref:hover { border-color: #d6b25e; }
.zhili-ref i { font-style: normal; color: #9a7c33; }
.zhili-send[disabled] { opacity: .6; cursor: progress; }
@media (max-width: 640px) {
  .zhili-panel { max-height: 78vh; overflow-y: auto; }
}

/* 做完一题后接同考点的下一阶 */
.attempt-next { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line, #e5e1d8); }
.attempt-next-hint { margin: 0 0 8px; font-size: 13px; color: var(--muted, #7a7266); }
.attempt-next-btn { display: inline-block; }
.attempt-next-count { margin: 6px 0 0; font-size: 12px; color: var(--muted, #7a7266); }
.attempt-next-count[hidden] { display: none; }
.attempt-result-head .attempt-next-cta { margin-left: auto; }

/* 学习页今日计划 */
.today-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.today-plan-col h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.today-plan-col ul { margin: 0; padding-left: 18px; }
.today-plan-col li { margin: 4px 0; font-size: 14px; line-height: 1.7; }
@media (max-width: 720px) { .today-plan-grid { grid-template-columns: 1fr; } }

/* 先修提示：这一节卡住时，先把上一节补上 */
.prereq-hint { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px; background: #f7efdd; color: #8a6a2f; font-size: 12px; }

/* 小屏：公式横向滚动、图面要素与「下一题」按钮不挤在一起 */
@media (max-width: 720px) {
  .katex-display { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  .figure-desc { display: block; line-height: 1.75; font-size: 13px; }
  .attempt-next-btn { display: block; width: 100%; text-align: center; }
  .today-plan-col li { font-size: 13px; }
}

/* 试卷里解答题的文字输入 */
.exam-text-input { width: 100%; margin: 6px 0 10px; font-family: var(--font-question, serif); }

/* 班级试卷作业板 */
.exam-board { margin: 10px 0 14px; }
.exam-board-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; padding: 4px 2px 8px; }
.exam-board-row { display: flex; gap: 10px; justify-content: space-between; align-items: center;
  padding: 9px 2px; border-top: 1px dashed var(--line, #e6e2d8); flex-wrap: wrap; }
.exam-board-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.exam-board-title { font-weight: 700; color: var(--ink, #1f2937); }
.exam-board-side { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.exam-board-score { font-variant-numeric: tabular-nums; font-weight: 700; color: #0f766e; }
.exam-assign-form { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--line, #e6e2d8); }
.exam-assign-select { min-width: 200px; padding: 6px 8px; }
.exam-assign-time, .exam-assign-note { padding: 6px 8px; }
.exam-assign-note { flex: 1; min-width: 140px; }

/* 班级成绩单 */
.stats-sum { display: flex; gap: 18px; flex-wrap: wrap; padding: 14px 16px; }
.stat-cell { display: flex; flex-direction: column; gap: 2px; min-width: 84px; }
.stat-num { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .78rem; color: var(--muted, #6b7280); }
.stats-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.stats-table th, .stats-table td { padding: 7px 8px; border-bottom: 1px solid var(--line, #eeeae0); text-align: left; }
.stats-table th { font-weight: 700; color: var(--muted, #6b7280); background: #f8f7f2; }
.stats-num { font-variant-numeric: tabular-nums; }
.stats-strong { font-weight: 700; }
.stats-mono { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.rate-bar { display: inline-block; width: 88px; height: 8px; border-radius: 99px; background: #ece9e0; vertical-align: middle; overflow: hidden; }
.rate-fill { display: block; height: 100%; background: linear-gradient(90deg, #0ea5a4, #0f766e); }

/* 成绩页解答题回显与 AI 意见 */
.exam-ai-note { font-size: .82rem; color: var(--muted, #6b7280); }
.exam-answer-text { white-space: pre-wrap; background: #faf9f4; border-left: 3px solid #d9d4c5;
  padding: 8px 10px; margin: 8px 0; font-size: .95rem; line-height: 1.75; }
.exam-ai-comment { font-size: .86rem; color: #0f766e; background: #f0f8f6; padding: 7px 10px; border-radius: 6px; }

/* 教师批改页 */
.grade-block { padding: 12px 14px; }
.grade-student { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line, #eeeae0); }
.grade-item { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line, #eeeae0); }
.grade-item:last-child { border-bottom: none; }
.grade-qno { display: inline-block; font-weight: 700; font-size: .88rem; color: #374151; margin-bottom: 4px; }
.grade-right { display: flex; flex-direction: column; gap: 8px; }
.grade-label { font-size: .8rem; color: var(--muted, #6b7280); }
.grade-score, .grade-note { padding: 7px 9px; border: 1px solid var(--line, #dcd7c9); border-radius: 7px; font: inherit; }
.grade-meta { font-size: .78rem; color: #0f766e; }
.grade-save-bar { display: flex; gap: 12px; align-items: center; padding: 4px 0 24px; }
@media (max-width: 720px) {
  .grade-item { grid-template-columns: 1fr; }
}

/* 未交名单 */
.unsub-names { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 2px 10px; }
.unsub-name { background: #fdf1ee; color: #9a3412; border-radius: 999px; padding: 3px 10px; font-size: .85rem; }

/* 学生看到的班级逐题正确率 */
.class-peer-card { padding: 14px 16px; margin: 14px 0; }
.peer-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.peer-row { display: grid; grid-template-columns: 76px 88px 1fr; gap: 10px; align-items: center; font-size: .9rem; }
.peer-order { color: var(--muted, #6b7280); font-variant-numeric: tabular-nums; }
.peer-rate { font-variant-numeric: tabular-nums; }

/* 分数分布（横向条，窄屏也能读） */
.hist-stats { display: flex; gap: 18px; flex-wrap: wrap; padding: 4px 2px 10px; font-size: .88rem; color: var(--muted, #6b7280); }
.hist-stats b { color: var(--ink, #1f2937); font-variant-numeric: tabular-nums; }
.hist { display: flex; flex-direction: column; gap: 5px; padding: 2px 2px 12px; }
.hist-row { display: grid; grid-template-columns: 74px minmax(90px, 1fr) 44px; gap: 10px; align-items: center; font-size: .86rem; }
.hist-label { color: var(--muted, #6b7280); font-variant-numeric: tabular-nums; }
.hist-track { height: 12px; background: #f1efe7; border-radius: 999px; overflow: hidden; }
.hist-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0ea5a4, #0f766e); min-width: 2px; }
.hist-count { font-variant-numeric: tabular-nums; text-align: right; }

/* 批改页待保存计数与批量按钮 */
.grade-pending { font-size: .85rem; color: var(--muted, #6b7280); font-variant-numeric: tabular-nums; }
.grade-pending.is-active { color: #b45309; font-weight: 700; }
.grade-reset-one, .grade-reset-all { cursor: pointer; }

/* 批改页：按题/按学生切换 */
.grade-tabs { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.grade-tab { padding: 6px 14px; border: 1px solid #d8d3c4; border-radius: 999px; font-size: .9rem; color: inherit; text-decoration: none; }
.grade-tab.is-on { background: #0f766e; border-color: #0f766e; color: #fff; }
.qgrade-row { align-items: flex-start; }
.qgrade-name { display: block; margin-bottom: 4px; font-size: .92rem; }

/* 我的作业聚合 */
.myex-list { display: flex; flex-direction: column; gap: 12px; }
.myex-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.myex-badge { font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: #eef2f1; color: #33514d; }
.myex-badge-未交 { background: #fdecec; color: #b42318; }
.myex-badge-待批 { background: #fff4e0; color: #92400e; }
.myex-badge-已批 { background: #e7f6ec; color: #166534; }
.myex-badge-已截止 { background: #eceff1; color: #546067; }
.myex-late { background: #fdecec; color: #b42318; }
.myex-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .86rem; color: var(--muted, #6b7280); margin: 8px 0; }
.myex-ref { font-style: normal; font-size: .78rem; color: #92400e; }
.myex-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 作答照片质量标签 */
.photoq { display: inline-block; margin-left: 8px; font-size: .76rem; padding: 1px 8px; border-radius: 999px; }
.photoq-ok { background: #e7f6ec; color: #166534; }
.photoq-warn { background: #fff4e0; color: #92400e; }
.photoq-bad { background: #fdecec; color: #b42318; font-weight: 700; }

/* AI 抓的得分点 */
.kp-chip { display: inline-block; margin: 2px 6px 2px 0; padding: 1px 8px; border-radius: 6px; background: #eef4fb; color: #1f4e79; font-size: .8rem; }

/* 发布表单：允许重做 */
.exam-assign-retake { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: #4b5563; }

/* 一并布置到其它班 */
.exam-assign-also { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: .85rem; color: #4b5563; width: 100%; }

/* 医学与护理实验平台 */
.mlab-count { color: var(--muted); font-size: 14px; }
.mlab-notice { margin-bottom: 18px; }
.mlab-group { margin: 30px 0; }
.mlab-group-head h2 { margin: 0 0 4px; font-size: 20px; }
.mlab-group-head p { margin: 0 0 14px; }
.mlab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mlab-card {
  display: block; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.mlab-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37, 99, 235, .08); }
.mlab-card-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 8px; }
.mlab-card h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.45; }
.mlab-card-course { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.mlab-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mlab-card-meta li { padding: 2px 8px; background: #eef2ff; color: #3730a3; border-radius: 999px; font-size: 12px; }
.mlab-level { padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #e5e7eb; color: #374151; }
.mlab-level-skill { background: #dcfce7; color: #166534; }
.mlab-level-comprehensive { background: #ffedd5; color: #9a3412; }
.mlab-recent { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mlab-recent-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mlab-recent-row:last-child { border-bottom: 0; }
.mlab-recent-right { display: flex; align-items: center; gap: 10px; }
.mlab-grade { padding: 2px 9px; border-radius: 999px; font-size: 12px; background: #e5e7eb; }
.mlab-grade-优秀 { background: #dcfce7; color: #166534; }
.mlab-grade-良好 { background: #dbeafe; color: #1e40af; }
.mlab-grade-合格 { background: #fef3c7; color: #92400e; }
.mlab-grade-不合格 { background: #fee2e2; color: #991b1b; }

.mlab-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.mlab-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.mlab-panel h2 { margin: 0 0 8px; font-size: 16px; color: var(--accent-dark); }
.mlab-panel p { margin: 0; }
.mlab-panel-warn { border-color: #fed7aa; background: #fffbf5; }
.mlab-panel-warn h2 { color: var(--amber); }
.mlab-steps-preview { margin: 0; padding-left: 20px; }
.mlab-steps-preview li { margin-bottom: 14px; }
.mlab-step-line { display: flex; justify-content: space-between; gap: 10px; }
.mlab-step-detail { margin: 2px 0 6px; color: #374151; }
.mlab-step-points { margin: 0; color: #1e40af; font-size: 13px; }
.mlab-step-key { margin: 4px 0 0; color: var(--amber); font-size: 13px; }
.mlab-detail-side { position: sticky; top: 16px; }
.mlab-cta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.mlab-cta-label { margin: 0 0 6px; font-weight: 600; }
.mlab-cta .btn { width: 100%; text-align: center; }
.mlab-rules { margin: 0; padding-left: 18px; color: #374151; font-size: 14px; }
.mlab-rules li { margin-bottom: 4px; }
.mlab-history { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.mlab-history li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.mlab-history li:last-child { border-bottom: 0; }

.mlab-timer-bar { position: sticky; top: 0; z-index: 30; background: #0f172a; color: #fff; box-shadow: 0 2px 10px rgba(15, 23, 42, .15); }
.mlab-timer-inner { display: flex; align-items: center; gap: 16px; padding: 10px 0; font-size: 14px; }
.mlab-timer-clock { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: .04em; }
.mlab-timer-bar.is-urgent { background: #7f1d1d; }
.mlab-timer-bar.is-urgent .mlab-timer-clock { animation: mlab-blink 1s steps(2, start) infinite; }
@keyframes mlab-blink { 50% { opacity: .45; } }
.mlab-timer-progress { margin-left: auto; opacity: .85; }

.mlab-take { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; margin-top: 22px; }
.mlab-take-nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 62px; align-self: start; }
.mlab-take-nav h2 { margin: 0 0 10px; font-size: 14px; color: var(--muted); letter-spacing: .04em; }
.mlab-take-nav ol { margin: 0; padding: 0; list-style: none; }
.mlab-take-nav li { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; color: var(--muted); }
.mlab-take-nav li.is-current { color: var(--text); font-weight: 600; }
.mlab-take-nav li.is-done { color: var(--green); }
.mlab-nav-dot { width: 22px; height: 22px; border-radius: 50%; background: #f3f4f6; display: grid; place-items: center; font-size: 11px; color: #6b7280; flex: none; }
.mlab-take-nav li.is-current .mlab-nav-dot { background: var(--accent); color: #fff; }
.mlab-take-nav li.is-done .mlab-nav-dot { background: #d1fae5; color: var(--green); }
.mlab-finish { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mlab-step-head h1 { margin: 4px 0 6px; font-size: 24px; }
.mlab-step-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 22px 18px; }
.mlab-fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 4px; }
.mlab-fieldset:first-of-type { border-top: 0; }
.mlab-fieldset legend { padding: 0; font-weight: 600; font-size: 15px; }
.mlab-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; cursor: pointer; }
.mlab-check:hover { border-color: var(--accent); background: #f8fafc; }
.mlab-check input { margin-top: 5px; }
.mlab-key-field, .mlab-note-field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; font-size: 14px; }
.mlab-key-field input, .mlab-note-field input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; background: #fff; }
.mlab-step-actions { display: flex; gap: 12px; margin-top: 14px; }
.mlab-common-errors { margin-top: 16px; padding: 12px 16px; border-left: 3px solid var(--amber); background: #fffbeb; border-radius: 8px; font-size: 14px; }
.mlab-common-errors p { margin: 4px 0 0; }

.mlab-score-card { display: flex; align-items: center; gap: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 18px; }
.mlab-score-num { margin: 0; font-size: 44px; font-weight: 700; line-height: 1.1; }
.mlab-score-num span { font-size: 20px; color: var(--muted); font-weight: 500; }
.mlab-score-percent { margin: 4px 0 0; color: var(--muted); }
.mlab-score-grade { text-align: center; }
.mlab-grade-big { font-size: 30px; font-weight: 700; }
.mlab-grade-card-优秀 { border-left: 6px solid var(--green); }
.mlab-grade-card-良好 { border-left: 6px solid var(--accent); }
.mlab-grade-card-合格 { border-left: 6px solid #d97706; }
.mlab-grade-card-不合格 { border-left: 6px solid var(--red); }
.mlab-summary p { margin: 0 0 6px; }
.mlab-table-wrap { overflow-x: auto; }
.mlab-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mlab-table th, .mlab-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.mlab-table th { background: #f8fafc; font-size: 13px; color: var(--muted); font-weight: 600; }
.mlab-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mlab-result-actions { display: flex; gap: 12px; margin: 18px 0 10px; }
.mlab-disclaimer { font-size: 13px; margin-top: 8px; }

@media (max-width: 860px) {
  .mlab-detail-grid, .mlab-take { grid-template-columns: 1fr; }
  .mlab-detail-side, .mlab-take-nav { position: static; }
  .mlab-score-card { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ---------- 虚拟实验室（仿真实验） ---------- */
.mlab-card-scene { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.mlab-card-thumb { position: relative; aspect-ratio: 16 / 9; background: #eef2f7; }
.mlab-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mlab-card-thumb .mlab-level { position: absolute; left: 10px; top: 10px; background: rgba(255, 255, 255, .92); }
.mlab-card-body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 2px; }

.vlab-track-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.vlab-track { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-size: 14px; text-decoration: none; }
.vlab-track.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.vlab-category-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.vlab-chip { padding: 5px 12px; border-radius: 8px; border: 1px dashed var(--line); background: transparent;
  color: var(--muted); font-size: 13px; text-decoration: none; }
.vlab-chip.is-on { border-style: solid; border-color: var(--accent); color: var(--accent); background: rgba(37, 99, 235, .06); }

.vlab-preview { margin-top: 10px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #eef2f7; }
.vlab-preview img { width: 100%; display: block; }
.vlab-mini { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border-radius: 6px;
  background: rgba(37, 99, 235, .08); color: #1d4ed8; font-size: 12.5px; }
.mlab-step-sim { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.vlab-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 22px; align-items: start;
  max-width: 1180px; margin: 18px auto 48px; padding: 0 20px; }
.vlab-steps { position: sticky; top: 84px; align-self: start; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 12px; max-height: calc(100vh - 120px); overflow-y: auto; }
.vlab-steps h2 { font-size: 13px; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.vlab-steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.vlab-steps li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45;
  padding: 6px 8px; border-radius: 8px; color: var(--muted); }
.vlab-steps li.is-current { background: rgba(37, 99, 235, .08); color: var(--text); font-weight: 600; }
.vlab-steps li.is-done { color: var(--text); }
.vlab-nav-dot { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.vlab-steps li.is-done .vlab-nav-dot { background: #15803d; border-color: #15803d; color: #fff; }
.vlab-steps li.is-current .vlab-nav-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.vlab-finish { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

.vlab-main { min-width: 0; }
.vlab-head h1 { margin: 4px 0 6px; font-size: clamp(20px, 2.4vw, 26px); }
.vlab-brief { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.vlab-stage { position: relative; border-radius: 14px; overflow: hidden; background: #e6ebf2;
  border: 1px solid var(--line); aspect-ratio: 16 / 9; touch-action: manipulation; }
.vlab-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
.vlab-hotspots { position: absolute; inset: 0; }
.vlab-hotspot { position: absolute; border: 2px dashed rgba(255, 255, 255, .55); border-radius: 10px;
  background: rgba(15, 23, 42, .06); cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.vlab-hotspot:hover, .vlab-hotspot:focus-visible { border-color: #2563eb; background: rgba(37, 99, 235, .16); outline: none; }
.vlab-hotspot-name { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 6px;
  background: rgba(15, 23, 42, .62); color: #fff; font-size: 11.5px; white-space: nowrap; pointer-events: none; }
.vlab-hotspot-placed { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 4px; pointer-events: none; }
.vlab-placed-icon { width: 38px; height: 38px; border-radius: 8px; background: rgba(255, 255, 255, .95);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .25); pointer-events: auto; cursor: pointer; }
.vlab-observe-tip { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(15, 23, 42, .72); color: #fff; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; }

.vlab-tray { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.vlab-tray-title { margin: 0 0 8px; font-size: 12.5px; letter-spacing: .08em; color: var(--muted); }
.vlab-tray-items { display: flex; flex-wrap: wrap; gap: 8px; }
.vlab-item { width: 86px; padding: 8px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s; }
.vlab-item img { width: 38px; height: 38px; }
.vlab-item span { font-size: 12px; color: var(--text); line-height: 1.25; text-align: center; }
.vlab-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.vlab-item.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); transform: translateY(-2px); }
.vlab-hint { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }
.vlab-key { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 14px; }
.vlab-key input { max-width: 320px; }
.vlab-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.vlab-score-rule { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

@media (max-width: 860px) {
  .vlab-shell { grid-template-columns: 1fr; padding: 0 12px; gap: 14px; }
  .vlab-steps { position: static; max-height: none; }
  .vlab-steps ol { flex-direction: row; overflow-x: auto; gap: 6px; }
  .vlab-steps li { white-space: nowrap; }
  .vlab-item { width: 74px; }
  .vlab-item img { width: 32px; height: 32px; }
  .vlab-stage { aspect-ratio: 4 / 3; }
  .vlab-hotspot-name { font-size: 10px; padding: 1px 5px; }
  .vlab-placed-icon { width: 28px; height: 28px; }
}

/* ---------- 考试监考 ---------- */

.exam-proctor-host { display: none; }

.exam-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: #0b1220;
  color: #e5edff;
  text-align: center;
}
.exam-mask[hidden] { display: none; }
.exam-mask-inner { display: grid; gap: 10px; padding: 24px; }
.exam-mask-title { margin: 0; font-size: 22px; font-weight: 700; }
.exam-mask-text { margin: 0; font-size: 14px; color: #9fb0d0; line-height: 1.7; }
.exam-mask-count { margin: 0; font-size: 44px; font-weight: 700; color: #ffffff; min-height: 52px; }

.exam-watermark {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.exam-watermark-tile {
  position: absolute;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(15, 23, 42, 0.09);
  white-space: nowrap;
  transform: rotate(-24deg);
}

.exam-proctor-banner {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 95;
  max-width: min(680px, 92vw);
  padding: 0;
  opacity: 0;
  pointer-events: none;
  font-size: 13.5px;
  line-height: 1.6;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  transition: opacity 0.2s ease;
}
.exam-proctor-banner.is-on { opacity: 1; padding: 12px 18px; }
.exam-proctor-banner.is-warn { background: #7c2d12; color: #ffedd5; }
.exam-proctor-banner.is-bad { background: #7f1d1d; color: #fee2e2; }

.exam-preflight {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(11, 18, 32, 0.82);
}
.exam-preflight-card {
  width: min(560px, 100%);
  padding: 26px 28px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.exam-preflight-card h2 { margin: 6px 0 14px; font-size: 22px; }
.exam-preflight-list { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 8px; }
.exam-preflight-list li { font-size: 13.5px; line-height: 1.7; color: #334155; }
.exam-preflight-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.exam-proctor-state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.exam-proctor-state b { color: #0f172a; font-weight: 600; }

.proctor-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.proctor-table th,
.proctor-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.proctor-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.proctor-risk { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #0f172a; font-weight: 600; text-align: center; }
.proctor-risk.is-warn { background: #fef3c7; color: #92400e; }
.proctor-risk.is-bad { background: #fee2e2; color: #991b1b; }
.proctor-timeline { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.proctor-timeline li { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13.5px; }
.proctor-timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.proctor-tag { padding: 1px 8px; border-radius: 999px; background: #f1f5f9; font-size: 12px; }
.proctor-tag.is-serious { background: #fee2e2; color: #991b1b; }
.proctor-tag.is-minor { background: #fef3c7; color: #92400e; }
.proctor-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.proctor-shot { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.proctor-shot img { width: 100%; display: block; border-radius: 6px; }
.proctor-shot p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }


/* ---- 三维仿真层（2D 场景图保留为降级底图）---- */
.vlab-3d { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity .35s ease; background: linear-gradient(180deg, #f3f7fc 0%, #e6edf6 100%); }
.vlab-stage.is-3d .vlab-3d { opacity: 1; pointer-events: auto; }
.vlab-stage .vlab-bg { transition: opacity .35s ease; }
.vlab-stage.is-3d .vlab-bg,
.vlab-stage.is-3d .vlab-hotspots { opacity: 0; pointer-events: none; }
.vlab-3d-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.vlab-3d-canvas:active { cursor: grabbing; }
.vlab-3d-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.vlab-stage.is-3d .vlab-3d-loading { display: none; }
.vlab-3d-badge { position: absolute; right: 12px; top: 12px; z-index: 3; opacity: 0;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; letter-spacing: .02em;
  color: #fff; background: rgba(21, 45, 78, .72); border: 1px solid rgba(255, 255, 255, .22);
  pointer-events: none; transition: opacity .35s ease; }
.vlab-3d-badge.is-on { opacity: 1; }
.vlab-stage.is-3d .vlab-observe-tip { z-index: 3; }

/* 摄像头抽帧预览：小窗常驻，让考生清楚知道画面正在被取 */
.exam-cam {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 92;
  width: 148px;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.24);
}
.exam-cam-view {
  display: block;
  width: 100%;
  border-radius: 6px;
  background: #0f172a;
}
.exam-cam-label {
  margin: 6px 0 0;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
}
.proctor-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.proctor-shots li {
  margin: 0;
  width: 152px;
}
.proctor-shots img {
  display: block;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: #0f172a;
}
.proctor-shots .proctor-shot-meta {
  display: block;
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.5;
}

/* 管理员二次验证 */
.totp-secret-box {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.totp-secret-box p { margin: 0 0 8px; }
.totp-uri-box { margin-top: 8px; font-size: 12px; }
.totp-uri-box summary { cursor: pointer; color: var(--muted); }
.totp-secret {
  display: block;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  letter-spacing: .08em;
  word-break: normal;
  overflow-wrap: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.totp-uri {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-all;
  color: var(--muted);
}

/* ============================================================
   多维标签 / 学情看板 / 物理探究台 / 原生仿真 / 勘误台账
   ============================================================ */

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; line-height: 1.5;
  border: 1px solid var(--line); background: #f8fafc; color: #334155;
  text-decoration: none; white-space: nowrap;
}
.tag-pill:hover { text-decoration: none; border-color: #bfdbfe; background: #eff6ff; }
.tag-pill b { font-size: 11px; opacity: .72; }
.tag-model { background: #ecfeff; border-color: #a5f3fc; color: #155e75; }
.tag-stage { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.tag-misconception { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.tag-experiment { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.tag-exam { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.tag-filter-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.dashboard-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.dashboard-stat { padding: 18px; border-radius: 12px; background: linear-gradient(135deg, #eff6ff, #f8fafc); border: 1px solid #dbeafe; }
.dashboard-stat strong { display: block; font-size: 28px; line-height: 1.2; color: #1d4ed8; }
.dashboard-stat span { color: var(--muted); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; }
.dashboard-grid > .card { margin: 0; }
.dashboard-panel { min-width: 0; }
.error-stack { display: flex; height: 34px; border-radius: 10px; overflow: hidden; background: #f1f5f9; margin: 16px 0 10px; }
.error-seg { width: var(--w); background: var(--c); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 12px; min-width: 0; }
.error-seg b { font-weight: 600; }
.error-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.error-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.trend-chart { display: flex; gap: 8px; align-items: flex-end; height: 180px; padding-top: 12px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.trend-bar { width: 70%; height: var(--h); min-height: 2px; background: linear-gradient(180deg, #60a5fa, #2563eb); border-radius: 5px 5px 0 0; }
.trend-col b { font-size: 12px; color: #1e293b; }
.trend-col small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.dashboard-tags { margin-top: 10px; }
.weak-kp-row { display: grid; grid-template-columns: minmax(100px, 1.1fr) 2fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.weak-kp-row:last-child { border-bottom: 0; }
.weak-kp-row b { font-size: 13px; color: #334155; }
.tag-recommend-list { display: grid; gap: 10px; }
.tag-recommend { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.tag-recommend:hover { text-decoration: none; border-color: #bfdbfe; background: #f8fbff; }
.tag-recommend strong { display: block; margin: 5px 0 2px; font-size: 13px; }
.tag-recommend > span:last-child { color: var(--muted); font-size: 12px; }

.tool-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 14px; }
.tool-tab { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.tool-tab.is-active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.tool-panel { display: none; }
.tool-panel.is-active { display: block; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 16px; align-items: start; }
.tool-canvas-card { padding: 14px; }
.tool-canvas-card canvas { width: 100%; height: auto; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.tool-hint { margin: 10px 2px 0; color: var(--muted); font-size: 12px; }
.tool-controls h2 { margin: 0 0 10px; font-size: 18px; }
.tool-controls label { display: block; margin: 10px 0; font-size: 13px; color: #334155; }
.tool-controls input[type="range"] { width: 100%; accent-color: var(--accent); }
.tool-controls input[type="number"], .tool-controls select, .tool-controls textarea {
  width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
.tool-controls output { display: block; float: none; margin: -2px 2px 2px 0; text-align: right; color: var(--accent); font-weight: 600; }
.tool-check { display: flex !important; align-items: center; gap: 8px; }
.tool-readout { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); font-size: 13px; line-height: 1.65; }
.tool-readout b { color: #1d4ed8; }
.tool-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.segmented { display: flex; gap: 6px; margin-bottom: 8px; }
.segmented button { flex: 1; border: 1px solid var(--line); background: #fff; padding: 6px; border-radius: 8px; cursor: pointer; }
.segmented button.is-active { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.mini-table { max-height: 190px; overflow: auto; border-top: 1px solid var(--line); }
.mini-table > div { display: flex; justify-content: space-between; padding: 4px 6px; border-bottom: 1px dashed var(--line); font-size: 12px; }
.data-editor { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-editor th, .data-editor td { padding: 4px 3px; border-bottom: 1px solid var(--line); text-align: left; }
.data-editor input { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; font: inherit; }
.data-editor input:focus { border-color: #93c5fd; outline: none; }
.row-del { border: 0; background: transparent; color: var(--red); cursor: pointer; font-size: 16px; }
.tool-guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tool-guide-grid h3 { margin: 0 0 4px; font-size: 15px; }
.context-question .question-stem { margin-top: 6px; }

.native-hero { padding: 26px 0 14px; }
.native-hero h1 { margin: 4px 0 8px; font-size: 30px; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #0e7490; font-weight: 600; }
.native-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.native-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; color: var(--text); min-width: 0; }
.native-card:hover { text-decoration: none; border-color: #bfdbfe; box-shadow: 0 12px 30px rgba(37,99,235,.10); }
.native-card h3 { margin: 0; font-size: 20px; }
.native-card p { margin: 0; color: var(--muted); font-size: 14px; }
.native-kicker { font-size: 10px; letter-spacing: .12em; color: #0e7490; text-transform: uppercase; }
.native-formula { padding: 8px 10px; border-radius: 8px; background: #f8fafc; border: 1px dashed #cbd5e1; color: #334155; font-family: "Times New Roman", serif; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.native-formula p { margin: 0; }
.native-formula .katex-display { margin: 0.2em 0; text-align: left; }
/* KaTeX 把 .katex-display>.katex 自己设成 display:block＋text-align:center，只改父级不生效 */
.native-formula .katex-display > .katex { white-space: nowrap; text-align: left; }
.native-open { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 13px; }
.native-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 16px; align-items: start; }
.native-stage canvas { width: 100%; height: auto; border-radius: 10px; background: #fff; }
.native-readout { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); font-size: 13px; line-height: 1.7; }
.native-readout b { color: #1d4ed8; }
.native-readout .katex { font-size: 1.03em; }
.native-readout .katex-display { margin: 4px 0; }
.native-controls label { display: block; margin: 9px 0; font-size: 13px; }
.native-controls input[type="range"] { width: 100%; accent-color: #0e7490; }
.native-controls output { display: block; float: none; margin: -2px 2px 2px 0; text-align: right; color: #0e7490; font-weight: 600; }
.native-ctl-label { display: block; color: #334155; }
.native-ctl-unit { color: var(--muted); font-size: 12px; }
.native-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.native-preset { padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; color: #475569; background: #f8fafc; border: 1px solid var(--line); border-radius: 999px; }
.native-preset:hover { background: #e0e7ff; color: var(--accent-dark); border-color: #bfdbfe; }
.native-playback { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.native-theory { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 16px; }
.native-theory h2 { margin-top: 0; }
.native-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.native-pitfalls { list-style: none; padding-left: 0; }
.native-pitfalls li { padding-left: 16px; position: relative; }
.native-pitfalls li::before { content: "×"; position: absolute; left: 0; color: #dc2626; font-weight: 700; }
.native-block { margin-top: 22px; }
.native-block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.native-block-head h2 { margin: 0; font-size: 20px; }
.native-block-head p { margin: 0; flex: 1 1 240px; }
.native-block-count { padding: 2px 8px; border-radius: 999px; background: #ecfeff; border: 1px solid #a5f3fc; color: #155e75; font-size: 12px; }
.native-related { margin: 18px 0; }
.native-textbook { margin-top: 16px; }
.native-textbook li { display: grid; gap: 2px; }
.native-textbook a { font-weight: 600; }
.native-lab-flag { justify-self: start; padding: 2px 8px; border: 1px dashed #a5f3fc; border-radius: 999px; background: #ecfeff; color: #155e75; font-size: 11px; }
.sim-mode-native { color: #155e75; background: #ecfeff; border-color: #a5f3fc; }
a.sim-mode-native { text-decoration: none; }

/* 课程实验详情页内嵌的自研轻量仿真：画布占满正文列，控件在下方两栏 */
.native-embed { display: grid; gap: 14px; margin-top: 16px; }
.native-embed-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.native-embed-title { min-width: 0; }
.native-embed-head h2 { margin: 2px 0 4px; font-size: 19px; }
.native-embed-head p { margin: 0; }
.native-embed-links { display: flex; flex-wrap: wrap; gap: 8px; }
.native-embed .native-stage canvas { border: 1px solid var(--line); }
.native-embed .native-controls { display: grid; grid-template-columns: minmax(210px, .85fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.native-embed h3 { margin: 0 0 6px; font-size: 14px; color: #0f172a; }
.native-loaded { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.native-cond { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.native-cond li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; font-size: 13px; }
.native-cond b { color: #1d4ed8; white-space: nowrap; font-variant-numeric: tabular-nums; }
.native-cond i { color: var(--muted); font-style: normal; font-size: 12px; }
.native-focus { margin: 10px 0 0; padding-left: 10px; border-left: 3px solid #0e7490; color: #334155; font-size: 13px; }
.native-embed-formula { margin-top: 12px; }
.native-embed-formula summary { cursor: pointer; color: var(--accent-dark); font-size: 13px; }
.native-embed-formula .native-formula { margin-top: 8px; }
.native-ctl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 18px; }
a.sim-mode { text-decoration: none; }
@media (max-width: 780px) { .native-embed .native-controls { grid-template-columns: 1fr; } }

/* 自定义原生仿真实验台 */
.bench-notice { margin: 0 0 12px; padding: 8px 12px; border: 1px solid #fed7aa; border-radius: 8px; background: #fff7ed; color: #9a3412; font-size: 13px; }
.bench-picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 16px; }
.bench-picker h2 { margin: 0; font-size: 18px; }
.bench-picker-form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.bench-picker-label { color: var(--muted); font-size: 13px; }
.bench-picker select { min-width: 0; max-width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.bench-source a { margin-right: 2px; }
.native-bench { display: grid; gap: 14px; margin-top: 16px; }
.bench-cols { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.bench-cols h3 { margin: 0 0 6px; font-size: 14px; color: #0f172a; }
.bench-plan h3 + .bench-outs { margin-bottom: 4px; }
.bench-plan > h3:not(:first-of-type) { margin-top: 16px; }
.bench-locks { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.bench-locks label { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; }
.bench-locks input { accent-color: #0e7490; }
.bench-locks b { color: #1d4ed8; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bench-lock-name { flex: 1; min-width: 0; }
.bench-outs { display: flex; flex-wrap: wrap; gap: 4px 12px; color: #334155; font-size: 13px; }
.bench-outs label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.bench-outs:empty::after { content: "该模型没有可记录的数值读数。"; color: var(--muted); font-size: 12px; }
.bench-note { display: block; margin-top: 16px; color: #334155; font-size: 13px; }
#bench-note { width: 100%; margin-top: 4px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.bench-const { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.bench-const[hidden] { display: none; }
.bench-const-lead { color: var(--muted); font-size: 12px; }
.bench-chip { padding: 2px 8px; border: 1px solid #a5f3fc; border-radius: 999px; background: #ecfeff; color: #155e75; font-size: 12px; }
.bench-table-wrap { overflow-x: auto; max-width: 100%; }
.bench-table { font-size: 13px; }
.bench-table th, .bench-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.bench-table th { background: #f8fafc; color: #475569; font-weight: 600; }
@media (max-width: 860px) { .bench-cols { grid-template-columns: minmax(0, 1fr); } .bench-plan, .bench-data { min-width: 0; } .bench-table-wrap { max-width: 100%; } }

/* 实验台的参数扫描：等间隔取点跑同一闭式模型，出曲线＋拟合＋数据表 */
.bench-sweep { margin-top: 16px; }
.sweep-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; align-items: end; }
.sweep-form label { display: grid; gap: 4px; font-size: 12px; color: #334155; }
.sweep-form select, .sweep-form input { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-variant-numeric: tabular-nums; }
.sweep-form select { min-width: 0; }
.sweep-actions { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.sweep-fit { margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; color: var(--muted); }
.sweep-fit:not(.muted) { border-color: #a5f3fc; background: #ecfeff; color: #155e75; }
.sweep-view canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sweep-table-wrap { max-height: 280px; overflow: auto; }
@media (max-width: 860px) { .sweep-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 窄屏上把画布按设计宽度铺开可横向滑动：缩到手机宽度时刻度字只剩三四个像素，看不清 */
@media (max-width: 760px) {
  .native-stage, .sweep-view { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .native-stage canvas, .sweep-view canvas { min-width: 680px; }
}

/* 实验台构建器：元器件/部件自选、参数自调（电路搭建器与力学装配器共用） */
.builder { margin-top: 16px; }
.builder-lib { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.builder-lib .lib-btn { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.builder-lib .lib-btn:hover { border-color: var(--accent); background: #f0f9ff; }
.builder-lib .lib-btn b { font-size: 13px; color: #0f172a; }
.builder-lib .lib-btn small { color: var(--muted); font-size: 11px; }
.builder-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.builder-presets .presets-label { color: var(--muted); font-size: 12px; }
.builder-presets .preset-btn { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #f8fafc; cursor: pointer; font: inherit; font-size: 12px; color: #334155; }
.builder-presets .preset-btn:hover { border-color: var(--accent); color: var(--accent-dark); background: #f0f9ff; }
.builder-jump-note { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; margin: 12px 0 0; padding: 9px 12px; border: 1px dashed #dbe5f1; border-radius: 10px; background: #f8fafc; color: #475569; font-size: 12.5px; line-height: 1.65; }
.builder-jump-note p { margin: 0; }
.builder-jump-note b { color: #17324d; }
.builder-jump-note .native-kicker { margin-right: 8px; font-size: 10.5px; }
.builder-cols { display: grid; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.builder-net { display: grid; gap: 8px; }
.builder-net .builder-net-row, .builder-net .mech-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.builder-net .builder-net-name, .builder-net .mech-row-name { font-weight: 600; font-size: 13px; color: #0f172a; min-width: 88px; }
.builder-net .builder-node-select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; }
.builder-net .builder-param, .builder-net .mech-param { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #334155; white-space: nowrap; }
.builder-net .builder-param input[type="range"], .builder-net .mech-param input[type="range"] { width: 110px; }
.builder-net .builder-param output, .builder-net .mech-param output { min-width: 52px; font-variant-numeric: tabular-nums; color: #0f172a; }
.builder-net .small.muted { flex-basis: 100%; margin: 0; }
.builder-globals { display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.builder-globals .mech-global { display: grid; grid-template-columns: minmax(110px, auto) 1fr auto; gap: 8px; align-items: center; font-size: 12px; color: #334155; }
.builder-globals .mech-global output { min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.builder-status { margin: 8px 0 0; }
.builder-stage { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow-x: auto; }
.builder-stage svg, .builder-stage canvas { display: block; width: 100%; height: auto; }
.builder-wave { margin-top: 10px; }
.builder-wave canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.builder-table { margin-top: 10px; max-height: 260px; overflow: auto; }
.builder-energy { display: grid; gap: 4px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.builder-energy .mech-energy-row { display: grid; grid-template-columns: 84px 1fr 76px; gap: 8px; align-items: center; font-size: 12px; color: #334155; }
.builder-energy .mech-energy-row.mech-energy-total { border-top: 1px dashed var(--line); padding-top: 4px; font-weight: 600; }
.builder-energy .mech-energy-track { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.builder-energy .mech-energy-fill { height: 100%; border-radius: 999px; }
.builder-energy .mech-energy-val { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .builder-cols { grid-template-columns: minmax(0, 1fr); } .builder-net-wrap, .builder-stage-wrap { min-width: 0; } .builder-stage-wrap { overflow-x: auto; } .data-table th, .data-table td { overflow-wrap: anywhere; } .native-embed-title { min-width: 0; } .native-embed-title p { max-width: 100%; } }

.errata-form { display: grid; gap: 12px; padding: 20px; }
.errata-form label { display: block; font-size: 13px; color: #334155; }
.errata-form input, .errata-form select, .errata-form textarea {
  width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
.errata-table-card { padding: 0; overflow-x: auto; }
.errata-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.errata-table th, .errata-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.errata-table th { background: #f8fafc; color: #475569; font-weight: 600; }
.errata-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.errata-status.is-pending { background: #fff7ed; color: #9a3412; }
.errata-status.is-accepted { background: #f0fdf4; color: #166534; }
.errata-status.is-rejected { background: #fef2f2; color: #991b1b; }
.errata-question { padding: 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); }
.errata-review-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.errata-review-form label { display: block; font-size: 13px; }
.errata-review-form textarea { width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.revision-list { display: grid; gap: 8px; }
.revision-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.revision-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.revision-diff span { font-size: 11px; color: var(--muted); }
.revision-diff pre { white-space: pre-wrap; word-break: break-word; background: #f8fafc; padding: 8px; border-radius: 6px; font-size: 12px; max-height: 180px; overflow: auto; }

@media (max-width: 760px) {
  .dashboard-hero { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .tool-layout, .native-layout, .native-theory, .tool-guide-grid { grid-template-columns: minmax(0, 1fr); }
  .native-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid { gap: 12px; }
  .weak-kp-row { grid-template-columns: 1fr auto; }
  .weak-kp-row .mastery-bar { grid-column: 1 / -1; }
  .revision-diff { grid-template-columns: 1fr; }
}

/* 管理中心漏斗表与前台引导卡 */
#funnel .stats-table { display: block; overflow-x: auto; white-space: nowrap; }
#funnel .stats-table tfoot td { font-weight: 700; background: #f8f7f2; }
.funnel-nudge,

/* ---------- 虚拟实验室：演示模式 ---------- */
.demo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0 18px;
}
.demo-head h1 { margin: 4px 0 8px; font-size: clamp(22px, 2.8vw, 32px); }
.demo-head p { margin: 0; max-width: 780px; }
.demo-head-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
.demo-layout {
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin: 0 auto 54px;
  max-width: 1280px;
}
.demo-rail {
  position: sticky;
  top: 78px;
  padding: 16px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.demo-rail-head h2 { margin: 2px 0 4px; font-size: 20px; }
.demo-step-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.demo-step-button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.demo-step-button:hover { background: #f5f8fc; color: var(--text); }
.demo-step-button.is-current {
  border-color: rgba(37, 99, 235, .24);
  background: rgba(37, 99, 235, .07);
  color: var(--text);
  font-weight: 600;
}
.demo-step-button.is-past { color: var(--green); }
.demo-step-num {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
}
.demo-step-button.is-current .demo-step-num {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.demo-step-button.is-past .demo-step-num {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}
.demo-step-title { font-size: 13px; line-height: 1.45; padding-top: 2px; }
.demo-rail-note {
  margin-top: 16px;
  padding: 11px 12px;
  border-left: 3px solid #86efac;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12.5px;
  line-height: 1.65;
}
.demo-rail-note strong { display: block; margin-bottom: 2px; }
.demo-rail-note p { margin: 0; }
.demo-main { min-width: 0; }
.demo-stage { aspect-ratio: 16 / 9; box-shadow: 0 18px 46px rgba(15, 23, 42, .12); }
.demo-stage-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(15, 23, 42, .68);
  color: #fff;
  font-size: 11.5px;
  backdrop-filter: blur(5px);
  pointer-events: none;
}
.demo-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, .16);
}
.demo-caption {
  margin-top: 14px;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.demo-caption-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.demo-caption-meta span:first-child { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.demo-caption-meta span:last-child { color: var(--muted); font-size: 12px; }
.demo-caption h2 { margin: 0 0 6px; font-size: 21px; }
.demo-caption p { margin: 0; color: #374151; line-height: 1.7; }
.demo-points { margin: 10px 0 0; padding-left: 20px; color: #1e40af; font-size: 13.5px; line-height: 1.7; }
.demo-key { margin-top: 8px !important; color: #92400e !important; font-size: 13px; }
.demo-errors { margin-top: 8px !important; color: #991b1b !important; font-size: 13px; }
.demo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.demo-controls-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-status { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.demo-progress { height: 4px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.demo-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #22c55e); transition: width .35s ease; }
.vlab-3d::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 48%, rgba(15, 23, 42, .14) 100%);
}
.vlab-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #e9f1f8;
}
.vlab-stage:fullscreen .vlab-3d-canvas { height: 100vh; }
.vlab-stage:fullscreen .vlab-3d-badge { right: 18px; top: 18px; }
.vlab-stage:fullscreen .vlab-stage-caption { left: 18px; bottom: 18px; }
.demo-main:fullscreen {
  width: 100vw;
  height: 100vh;
  overflow: auto;
  padding: 18px;
  background: #e9f1f8;
}
.demo-main:fullscreen .demo-stage { height: min(64vh, 720px); aspect-ratio: auto; }
@media (max-width: 960px) {
  .demo-head { flex-direction: column; }
  .demo-layout { grid-template-columns: 1fr; }
  .demo-rail { position: static; }
  .demo-step-list { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .demo-stage { aspect-ratio: 4 / 3; }
}

.vlab-fullscreen {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(15, 23, 42, .68);
  color: #fff;
  font-size: 11.5px;
  cursor: pointer;
  backdrop-filter: blur(5px);
}
.vlab-fullscreen:hover { background: rgba(37, 99, 235, .82); }
.vlab-main:fullscreen {
  width: 100vw;
  height: 100vh;
  overflow: auto;
  padding: 16px clamp(14px, 3vw, 40px) 26px;
  background: #edf3f9;
}
.vlab-main:fullscreen .vlab-stage { height: min(68vh, 760px); aspect-ratio: auto; }
.vlab-main:fullscreen .vlab-head { margin-top: 2px; }
.vlab-main:fullscreen .vlab-fullscreen { display: none; }

/* 机构意向页：蜜罐字段与顶部指标 */
.lead-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.schools-hero .hero-stats { margin: 6px 0 10px; }

/* 三维就绪后立即切换，避免后台标签页的过渡动画停在 0 透明度。 */
.vlab-stage.is-3d .vlab-3d { opacity: 1 !important; pointer-events: auto !important; transition: none; }
.vlab-stage.is-3d .vlab-bg,
.vlab-stage.is-3d .vlab-hotspots { opacity: 0 !important; pointer-events: none !important; transition: none; }

.vlab-3d-badge.is-on { opacity: 1 !important; transition: none; }

.demo-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mlab-3d-chip {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: .06em;
  border: 1px solid rgba(255, 255, 255, .24);
}
@media (max-width: 720px) {
  .demo-head-actions { width: 100%; }
  .demo-head-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* 数学手册速查：三篇卡片 + 关键词搜索 */
.math-handbook-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.math-handbook-search input {
  flex: 1 1 280px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

.math-handbook-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.math-handbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 16px 18px 20px;
}

.math-handbook-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 18px;
}

.math-handbook-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
}

.math-handbook-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

.math-handbook-excerpt {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}

.math-handbook-excerpt strong {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 6px;
  background: #eef2ff;
  color: var(--accent-dark);
  font-size: 12px;
}

.math-handbook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

@media (max-width: 720px) {
  .math-handbook-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }
}


.footer-install {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.footer-install[hidden] { display: none; }
.zhili-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: #5b6b84; }
.zhili-feedback .zhili-fb { border: 1px solid #c9d8ee; background: #f3f8ff; color: #2a5db0; border-radius: 999px; padding: 2px 9px; cursor: pointer; font-size: 12px; }
.zhili-feedback .zhili-fb:hover { background: #e3efff; }
.zhili-feedback .zhili-fb:disabled { opacity: .55; cursor: default; }
.zhili-fb-thanks { color: #2e7d4f; }
.tutor-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: #5b6b84; }
.tutor-feedback .tutor-fb { border: 1px solid #c9d8ee; background: #f3f8ff; color: #2a5db0; border-radius: 999px; padding: 2px 9px; cursor: pointer; font-size: 12px; }

/* 诊断测评与间隔复习 */
.diagnostic-intro-row, .diagnostic-score-meta, .review-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.diagnostic-intro-row > div, .diagnostic-score-meta > div, .review-summary > div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: center;
}
.diagnostic-intro-row strong, .diagnostic-score-meta strong, .review-summary strong {
  display: block;
  font-size: 24px;
  color: var(--accent-dark);
}
.diagnostic-intro-row span, .diagnostic-score-meta span, .review-summary span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.diagnostic-form { display: flex; flex-direction: column; gap: 14px; }
.diagnostic-question .stem { margin-top: 10px; }
.diagnostic-question .choice-list { margin-top: 12px; }
.diagnostic-choices .choice-option { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.diagnostic-submit {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #cfe0f7;
  border-radius: 12px;
  background: #f4f8ff;
  box-shadow: 0 6px 24px rgba(37, 99, 235, .12);
  z-index: 20;
}
.diagnostic-progress { font-size: 14px; color: var(--muted); }
.diagnostic-progress.is-done { color: var(--green); font-weight: 600; }
.diagnostic-score-card { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; }
.diagnostic-score { text-align: center; padding: 16px; border-radius: 14px; background: #f4f8ff; }
.diagnostic-score strong { display: block; font-size: 44px; line-height: 1.1; color: var(--accent-dark); }
.diagnostic-score small { font-size: 20px; margin-left: 2px; }
.diagnostic-score span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.diagnostic-heatmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.diagnostic-heat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--text); }
.diagnostic-heat strong, .diagnostic-heat b { font-size: 20px; color: var(--accent-dark); }
.diagnostic-heat span { font-size: 14px; }
.diagnostic-heat small { font-size: 12px; color: var(--muted); }
.diagnostic-heat-strong { background: #eefaf2; border-color: #bfe8cc; }
.diagnostic-heat-medium { background: #fff8e8; border-color: #f0d89a; }
.diagnostic-heat-weak { background: #fff0f0; border-color: #f0bcbc; }
.diagnostic-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.diagnostic-plan-day { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.diagnostic-plan-day.is-today { border-color: #cfe0f7; background: #f7fbff; }
.diagnostic-plan-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.diagnostic-plan-day-head small { color: var(--muted); font-size: 12px; }
.diagnostic-plan-day p { margin: 0; font-size: 14px; line-height: 1.6; }
.diagnostic-callout { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.diagnostic-callout h2 { margin: 0 0 4px; font-size: 18px; }
.diagnostic-callout p { margin: 0; }
.review-summary { margin-bottom: 14px; }
.similar-list { display: grid; gap: 10px; margin-top: 12px; }
.similar-item { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fff; }
.similar-item:hover { border-color: #cfe0f7; text-decoration: none; }
.similar-stem { font-size: 14px; line-height: 1.6; color: #374151; }
.builder-blueprint { margin-top: 14px; padding: 14px; border: 1px solid #cfe0f7; border-radius: 12px; background: #f7fbff; }
.builder-blueprint-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.builder-blueprint-head strong { font-size: 15px; }
.builder-blueprint-head p { margin: 2px 0 0; }
.builder-blueprint-fields { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.builder-blueprint-fields input { width: 58px; }
.zhili-confidence { margin-top: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
.zhili-confidence strong { display: block; font-size: 13px; margin-bottom: 2px; }
.zhili-confidence span { display: block; color: #4b5563; }
.zhili-confidence em { display: block; margin-top: 3px; font-style: normal; color: #6b7280; font-size: 11px; }
.zhili-confidence.is-high { background: #eefaf2; border-color: #bfe8cc; }
.zhili-confidence.is-high strong { color: #047857; }
.zhili-confidence.is-medium { background: #fff8e8; border-color: #f0d89a; }
.zhili-confidence.is-medium strong { color: #92400e; }
.zhili-confidence.is-low { background: #fff0f0; border-color: #f0bcbc; }
.zhili-confidence.is-low strong { color: #b91c1c; }
@media (max-width: 720px) {
  .diagnostic-intro-row, .diagnostic-score-meta, .review-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagnostic-score-card { grid-template-columns: 1fr; }
  .diagnostic-submit { flex-direction: column; align-items: stretch; }
  .diagnostic-callout { flex-direction: column; align-items: flex-start; }
}

/* 仿真实验探究任务单 */
.lab-task-label { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: #374151; }
.lab-task textarea { width: 100%; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; line-height: 1.7; background: #fff; }
.lab-task textarea:focus { outline: 2px solid #cfe0f7; border-color: #93b8e8; }
.lab-task-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ── 公式编辑器体例：站内 KaTeX 全部字形走 Times New Roman ──────────────────────────────────────────────────────
   要求＝中文宋体、西文与公式 Times New Roman（变量斜体，数字/运算符/单位正体）。
   KaTeX 自带 20 个 @font-face 是 Computer Modern 字形，旧规则只换了 .mathnormal 与
   .mathrm，实测 = + 数字 \text 里的西文仍由 KaTeX_Main 出字。
   这里按 (family, style, weight) 把正文类字族指向本机 Times；两类例外是刻意的：
   1) 大算符（\int \sum \oint）交给 STIXGeneral——它就是 Times 的数学配套族，
      单字符 ∫ 的墨迹高 114/100em，Times 自己只有 102，CM 是 94；
   2) \left(..\right) 的拉伸定界符（KaTeX_Size1—4）不接管，保留 CM 的高括号：
      实测 Times/STIX 的单字符括号撑不满分式（定界符/内容高度比 1.0—1.4，CM 是 2.0），
      括号会比分式矮一截。KaTeX 的根号走 SVG，与字体无关。
   QBankMath 是带 unicode-range 的 Times 别名：Times 缺 ⟨⟩∇≫ 等字形时按字符跳过它，
   继续往后找 STIX，而不是让浏览器随机挑字体。 */
@font-face{font-family:"KaTeX_AMS";font-style:normal;font-weight:400;src:local("Times New Roman"),local("TimesNewRomanPSMT"),local("TimesNewRomanPS-Roman");}
@font-face{font-family:"KaTeX_Caligraphic";font-style:normal;font-weight:700;src:local("Times New Roman Bold"),local("TimesNewRomanPS-BoldMT");}
@font-face{font-family:"KaTeX_Caligraphic";font-style:normal;font-weight:400;src:local("Times New Roman"),local("TimesNewRomanPSMT"),local("TimesNewRomanPS-Roman");}
@font-face{font-family:"KaTeX_Fraktur";font-style:normal;font-weight:700;src:local("Times New Roman Bold"),local("TimesNewRomanPS-BoldMT");}
@font-face{font-family:"KaTeX_Fraktur";font-style:normal;font-weight:400;src:local("Times New Roman"),local("TimesNewRomanPSMT"),local("TimesNewRomanPS-Roman");}
@font-face{font-family:"KaTeX_Main";font-style:normal;font-weight:700;src:local("Times New Roman Bold"),local("TimesNewRomanPS-BoldMT");}
@font-face{font-family:"KaTeX_Main";font-style:italic;font-weight:700;src:local("Times New Roman Bold Italic"),local("TimesNewRomanPS-BoldItalicMT");}
@font-face{font-family:"KaTeX_Main";font-style:italic;font-weight:400;src:local("Times New Roman Italic"),local("TimesNewRomanPS-ItalicMT");}
@font-face{font-family:"KaTeX_Main";font-style:normal;font-weight:400;src:local("Times New Roman"),local("TimesNewRomanPSMT"),local("TimesNewRomanPS-Roman");}
@font-face{font-family:"KaTeX_Math";font-style:italic;font-weight:700;src:local("Times New Roman Bold Italic"),local("TimesNewRomanPS-BoldItalicMT");}
@font-face{font-family:"KaTeX_Math";font-style:italic;font-weight:400;src:local("Times New Roman Italic"),local("TimesNewRomanPS-ItalicMT");}
@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:local("Times New Roman Bold"),local("TimesNewRomanPS-BoldMT");}
@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:local("Times New Roman Italic"),local("TimesNewRomanPS-ItalicMT");}
@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:local("Times New Roman"),local("TimesNewRomanPSMT"),local("TimesNewRomanPS-Roman");}
@font-face{font-family:"KaTeX_Script";font-style:normal;font-weight:400;src:local("Times New Roman"),local("TimesNewRomanPSMT"),local("TimesNewRomanPS-Roman");}
@font-face{font-family:"KaTeX_Typewriter";font-style:normal;font-weight:400;src:local("Times New Roman"),local("TimesNewRomanPSMT"),local("TimesNewRomanPS-Roman");}
@font-face{font-family:"QBankMath";src:local("Times New Roman"),local("TimesNewRomanPSMT"),local("TimesNewRomanPS-Roman");unicode-range:U+0000-00FF,U+2013-2212,U+2C60-2C7F,U+1D00-1D7F;}

/* 字族名虽已指向 Times，这里再显式给一条回退链：Times 缺字形时按字符继续往后找，
   而不是让浏览器随机挑字体。!important 用来盖过 katex.min.css 里同类的 .katex .xxx 规则。
   注意不含 .delimsizing：定界符要留在 KaTeX_Size* 上才撑得满。 */
.katex,
.katex .mathnormal,.katex .mathrm,.katex .mathit,.katex .mathbf,.katex .boldsymbol,
.katex .mord,.katex .mbin,.katex .mrel,.katex .mpunct,.katex .minner,
.katex .textsf,.katex .texttt,.katex .textrm,.katex .textbf,.katex .textit,
.katex .mainrm,.katex .base,.katex .strut{
  font-family:"Times New Roman","QBankMath","STIXGeneral","STIX Two Text","Songti SC",serif !important;
}
/* 大算符及其上下限里的算符字符：Times 配套数学字优先，缺字再回 Times。 */
.katex .op-symbol,.katex .op-symbol *{
  font-family:"STIXGeneral","STIX Two Math","Times New Roman",serif !important;
}
/* 斜体只给变量；数字、单位、\text 内中文保持正体（汉字由 Songti SC 承接）。 */
.katex .mathnormal,.katex .mathit,.katex .boldsymbol{font-style:italic !important;}
.katex .mathrm,.katex .text,.katex .mord.text,.katex .textbf,.katex .mainrm{font-style:normal !important;}
