/* =====================================================================
   Lec9-2 非参数检验 交互课件 — 样式
   ===================================================================== */

:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #1e2634;
  --text-soft: #5b6474;
  --muted: #8b93a3;
  --border: #e2e6ee;
  --border-soft: #eef1f6;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --accent-2: #7c3aed;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 30px rgba(16, 24, 40, .12);
  --radius: 12px;
  --nav-w: 250px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #0e1117;
  --panel: #161a22;
  --panel-2: #1b2029;
  --text: #e6eaf2;
  --text-soft: #a9b2c3;
  --muted: #6c7688;
  --border: #262d3a;
  --border-soft: #1f2530;
  --accent: #60a5fa;
  --accent-soft: #17233a;
  --accent-2: #a78bfa;
  --danger: #f87171;
  --danger-soft: #2a1618;
  --ok: #34d399;
  --ok-soft: #10241d;
  --warn: #fbbf24;
  --warn-soft: #2a2210;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

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

/* ---------------- 布局 ---------------- */
#app { display: flex; min-height: 100vh; }

#sidebar {
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  z-index: 30;
}

.side-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.side-head .course {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 4px;
}
.side-head h1 { font-size: 15px; margin: 0; line-height: 1.4; font-weight: 700; }
.side-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

#toc { overflow-y: auto; padding: 10px 8px 24px; flex: 1; }
#toc a {
  display: block; padding: 7px 10px; border-radius: 8px;
  color: var(--text-soft); text-decoration: none; font-size: 13.5px;
  transition: background .13s, color .13s;
  border-left: 3px solid transparent;
}
#toc a:hover { background: var(--panel-2); color: var(--text); }
#toc a.active {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; border-left-color: var(--accent);
}
#toc .toc-num {
  display: inline-block; width: 20px; color: var(--muted);
  font-variant-numeric: tabular-nums; font-size: 12px;
}
#toc a.active .toc-num { color: var(--accent); }
#toc .toc-sub { padding-left: 30px; font-size: 12.5px; color: var(--muted); }

.side-foot {
  padding: 10px 12px; border-top: 1px solid var(--border-soft);
  display: flex; gap: 8px; align-items: center; font-size: 12px;
}

#main { flex: 1; min-width: 0; padding: 26px 34px 90px; }
.wrap { max-width: 980px; margin: 0 auto; }

/* ---------------- 页头 ---------------- */
.page-head {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.page-head .kicker {
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}
.page-head h2 { margin: 6px 0 8px; font-size: 25px; letter-spacing: -.01em; }
.page-head p { margin: 0; color: var(--text-soft); font-size: 14px; }

/* ---------------- 章节 ---------------- */
section.mod {
  --mod-pad-x: 26px;                     /* 左右内边距: 交互实验要反向抵消它 */
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px var(--mod-pad-x) 26px;
  margin-bottom: 22px; box-shadow: var(--shadow);
  scroll-margin-top: 20px;
}
section.mod > h3 {
  margin: 0 0 4px; font-size: 20px; display: flex; align-items: center; gap: 10px;
}
.mod-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 27px; height: 27px; padding: 0 7px;
  background: var(--accent); color: #fff; border-radius: 7px;
  font-size: 13px; font-weight: 700; flex: 0 0 auto;
}
.mod-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }

h4 {
  font-size: 15.5px; margin: 24px 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border-soft);
}
h4:first-of-type { margin-top: 12px; }
p { margin: 9px 0; }

/* ---------------- 文本元素 ---------------- */
.lead { font-size: 15px; color: var(--text-soft); }
em.hl { font-style: normal; color: var(--accent); font-weight: 600; }
strong.hl { color: var(--accent); }

.box {
  border-radius: 10px; padding: 13px 16px; margin: 14px 0;
  border: 1px solid var(--border); background: var(--panel-2);
  border-left: 4px solid var(--muted);
}
.box .box-title {
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
  margin-bottom: 5px; display: flex; align-items: center; gap: 6px;
}
.box p:first-of-type { margin-top: 0; }
.box p:last-child { margin-bottom: 0; }
.box.intuition { border-left-color: var(--accent); background: var(--accent-soft); }
.box.intuition .box-title { color: var(--accent); }
.box.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.box.warn .box-title { color: var(--warn); }
.box.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.box.ok .box-title { color: var(--ok); }
.box.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.box.danger .box-title { color: var(--danger); }

.formula {
  overflow-x: auto; overflow-y: hidden; padding: 6px 2px; margin: 12px 0;
}
.formula.center { text-align: center; }

.katex { font-size: 1.03em; }
.katex-display { margin: 0; }

ul.clean, ol.clean { margin: 10px 0; padding-left: 22px; }
ul.clean li, ol.clean li { margin: 6px 0; }

/* ---------------- 控件 ---------------- */
.controls {
  display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end;
  padding: 14px 16px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px; margin: 14px 0;
}
.ctl { display: flex; flex-direction: column; gap: 5px; min-width: 120px; }
.ctl > label {
  font-size: 11.5px; font-weight: 600; color: var(--text-soft);
  letter-spacing: .02em; display: flex; justify-content: space-between; gap: 10px;
}
.ctl .val {
  font-family: var(--mono); font-size: 11.5px; color: var(--accent);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.ctl .hint { font-size: 11px; color: var(--muted); line-height: 1.45; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 3px;
  background: var(--border); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--panel);
  background: var(--accent); cursor: pointer; box-shadow: 0 0 0 1px var(--accent);
}
input[type="number"], input[type="text"], select {
  padding: 6px 9px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 13px;
  font-family: inherit;
}
input[type="number"] { width: 74px; font-family: var(--mono); }
textarea {
  width: 100%; min-height: 84px; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; resize: vertical;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}

button {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 13px;
  font-family: inherit; cursor: pointer; font-weight: 500;
  transition: background .13s, border-color .13s, transform .06s;
}
button:hover { background: var(--panel-2); border-color: var(--accent); }
button:active { transform: translateY(1px); }
button.primary {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.ghost { background: transparent; }
button.sm { padding: 4px 9px; font-size: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button {
  border: none; border-radius: 0; background: var(--panel);
  padding: 6px 13px; font-size: 12.5px; color: var(--text-soft);
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }

.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.chk input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ---------------- 画布 ---------------- */
.canvas-wrap {
  position: relative; margin: 14px auto;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); padding: 6px; overflow: hidden;
  width: 100%;               /* 撑满所在小节, 图表面在其中水平居中 */
}
.canvas-wrap canvas {
  display: block; margin: 0 auto;      /* 水平居中, 尺寸由绘制侧像素宽决定 */
  max-width: 100%; height: auto;       /* 防在窄容器里溢出 */
  border-radius: 7px;
}
canvas.interactive { cursor: crosshair; touch-action: none; }
.plot-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; text-align: center; }

/* ---------------- 结果面板 ---------------- */
.result {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2); padding: 14px 16px; margin: 14px 0;
}
.result.accept { border-color: var(--ok); background: var(--ok-soft); }
.result.reject { border-color: var(--danger); background: var(--danger-soft); }
/* 结论行。曾经是 flex(为了让 .tag 与文字居中对齐), 但 flex 会把结论里的
   <strong>/<br> 各自变成独立的 flex item —— 文字一长就散成几段, 位置全乱。
   改回 block 正常排版, .tag 用 inline-block 保持原样式。 */
.verdict {
  font-size: 15px; font-weight: 700; display: block; line-height: 1.55;
  margin-bottom: 8px;
}
.result.accept .verdict { color: var(--ok); }
.result.reject .verdict { color: var(--danger); }
.verdict .tag {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: var(--panel); border: 1px solid currentColor; font-weight: 600;
  display: inline-block; vertical-align: 2px; margin-right: 6px;
}

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px; margin-top: 10px;
}
.stat {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px;
}
.stat .k { font-size: 11px; color: var(--muted); margin-bottom: 2px; letter-spacing: .02em; }
.stat .v {
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums; word-break: break-all;
}
.stat .v.accent { color: var(--accent); }
.stat .v.danger { color: var(--danger); }
.stat .v.ok { color: var(--ok); }
.stat .v.sm { font-size: 13px; }

/* ---------------- 数据表 ---------------- */
.tbl-scroll { overflow-x: auto; margin: 12px 0; }
table.data {
  border-collapse: collapse; font-size: 12.5px; width: 100%;
  font-variant-numeric: tabular-nums;
}
table.data th, table.data td {
  border: 1px solid var(--border); padding: 5px 8px; text-align: center;
  font-family: var(--mono); white-space: nowrap;
}
table.data th {
  background: var(--panel-2); font-weight: 600; color: var(--text-soft);
  font-family: inherit; font-size: 12px; position: sticky; top: 0;
}
table.data tr.gX td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
table.data tr.gY td { background: color-mix(in srgb, var(--danger) 7%, transparent); }
table.data td.rank-cell { font-weight: 700; color: var(--accent); }
table.data tr.tie td { box-shadow: inset 3px 0 0 var(--warn); }
.legend-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.dot-x { background: var(--accent); }
.dot-y { background: var(--danger); }

/* ---------------- 可拖动数据点条 ---------------- */
.striproll { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.strip-row { display: flex; align-items: center; gap: 10px; }
.strip-label {
  font-size: 12px; font-weight: 600; width: 84px; flex: 0 0 84px;
  color: var(--text-soft);
}
.strip-track {
  position: relative; flex: 1; height: 30px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.strip-pt {
  position: absolute; top: 50%; width: 13px; height: 13px;
  margin: -6.5px 0 0 -6.5px; border-radius: 50%;
  cursor: grab; transition: box-shadow .12s;
  border: 2px solid var(--panel);
}
.strip-pt:active { cursor: grabbing; }
.strip-pt:hover { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 25%, transparent); }
.strip-pt.gX { background: var(--accent); color: var(--accent); }
.strip-pt.gY { background: var(--danger); color: var(--danger); }
.strip-axis {
  position: relative; height: 18px; margin-left: 94px;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}
.strip-axis span { position: absolute; transform: translateX(-50%); }

/* ---------------- 选项卡 ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 0; flex-wrap: wrap; }
.tab {
  padding: 7px 14px; border: none; background: transparent; border-radius: 8px 8px 0 0;
  font-size: 13px; color: var(--text-soft); cursor: pointer; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { background: var(--panel-2); color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; background: transparent; }
.tab-panel { display: none; padding-top: 14px; }
.tab-panel.on { display: block; }

/* ---------------- 折叠 ---------------- */
details.fold {
  border: 1px solid var(--border); border-radius: 9px;
  padding: 0; margin: 12px 0; background: var(--panel-2); overflow: hidden;
}
details.fold > summary {
  padding: 10px 14px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  color: var(--accent); list-style: none; user-select: none;
  display: flex; align-items: center; gap: 7px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before {
  content: "▸"; font-size: 11px; transition: transform .15s; display: inline-block;
}
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary:hover { background: var(--accent-soft); }
details.fold .fold-body { padding: 2px 16px 14px; border-top: 1px solid var(--border-soft); }
details.fold .fold-body > *:first-child { margin-top: 10px; }

/* ---------------- 步骤演示 ---------------- */
.steps { margin: 14px 0; }
.step-item {
  display: flex; gap: 11px; padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--border); margin-bottom: 7px; background: var(--panel-2);
  opacity: .42; transition: opacity .2s, border-color .2s, background .2s;
}
.step-item.on { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.step-item.done { opacity: 1; }
.step-n {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--muted);
  color: #fff; font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-item.on .step-n { background: var(--accent); }
.step-item.done .step-n { background: var(--ok); }
.step-body { flex: 1; min-width: 0; font-size: 13.5px; }
.step-body .st { font-weight: 600; margin-bottom: 2px; }
.step-body .sd { color: var(--text-soft); font-size: 13px; }
.step-body .formula { margin: 6px 0 2px; }

/* ---------------- 其他 ---------------- */
.pill {
  display: inline-block; padding: 1px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; background: var(--accent-soft);
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 780px) { .grid2 { grid-template-columns: 1fr; } }

.footer-note {
  text-align: center; color: var(--muted); font-size: 12.5px;
  padding: 30px 0 10px;
}

#toTop {
  position: fixed; right: 22px; bottom: 22px; width: 42px; height: 42px;
  border-radius: 50%; display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); z-index: 40; font-size: 17px; padding: 0;
  background: var(--panel);
}
#toTop.show { display: flex; }

/* 进度条 */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; background: var(--accent);
  width: 0; z-index: 50; transition: width .1s linear;
}

/* ---------------- 响应式 ---------------- */
#menuBtn { display: none; }
@media (max-width: 900px) {
  #sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  #sidebar.open { transform: translateX(0); }
  #main { padding: 16px 16px 80px; }
  #menuBtn {
    display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 45;
    width: 40px; height: 40px; border-radius: 10px; padding: 0;
    align-items: center; justify-content: center; box-shadow: var(--shadow);
  }
  .page-head { padding: 18px; }
  .page-head h2 { font-size: 21px; }
  section.mod { --mod-pad-x: 16px; padding: 18px var(--mod-pad-x) 20px; }
}

@media print {
  #sidebar, #toTop, #menuBtn, #progress { display: none !important; }
  body { background: #fff; }
  section.mod { break-inside: avoid; box-shadow: none; }
}

/* =====================================================================
   视图模式: 电脑 / 手机 / 平板 / 投影
   通过 <html data-view="..."> 切换。手机与平板模式把页面装进 iframe
   预览框, 使媒体查询与图表按该宽度真实重排 (而非仅做视觉缩放)。
   ===================================================================== */

/* ---------------- 顶部工具栏 ---------------- */
#viewBar {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px; border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .2s ease, opacity .2s ease;
}
#viewBar .vb-label {
  font-size: 11px; color: var(--muted); font-weight: 600;
  letter-spacing: .04em; padding: 0 4px 0 2px;
}
#viewBar .vb-sep {
  width: 1px; height: 20px; background: var(--border); margin: 0 3px;
}
#viewBar button.vb {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 9px; font-size: 12.5px;
  border: 1px solid transparent; background: transparent; color: var(--text-soft);
  white-space: nowrap;
}
#viewBar button.vb:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }
#viewBar button.vb.on {
  background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600;
}
#viewBar button.vb.on:hover { background: var(--accent); color: #fff; }
#viewBar .vb-ico { font-size: 14px; line-height: 1; }
#viewBar select { max-width:150px; min-width:0; padding:7px; border:1px solid var(--border); border-radius:8px; background:var(--panel); color:var(--text); font:inherit; font-size:12px; }
@media (pointer: coarse) {
  #viewBar button.vb, #viewBar select, .controls button, .controls select, .qopt { min-height:44px; }
  .controls input[type="range"] { min-height:32px; }
}

/* 回到顶部按钮让位给工具栏 */
#toTop { bottom: 82px; }

/* ---------------- 设备预览舞台 ---------------- */
#deviceStage {
  display: none;
  position: fixed; inset: 0; z-index: 70;
  background: color-mix(in srgb, var(--bg) 94%, #000 6%);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 62px 20px 24px; overflow: auto;
}
html[data-view="phone"] #deviceStage,
html[data-view="tablet"] #deviceStage { display: block; }

/* 预览模式下隐藏真实页面内容, 避免两份渲染并存 */
html[data-view="phone"] #app,
html[data-view="phone"] #viewBar,
html[data-view="tablet"] #app,
html[data-view="tablet"] #viewBar { display: none !important; }

#deviceStage .stage-head {
  position: fixed; top: 0; left: 0; right: 0; height: 54px; z-index: 71;
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#deviceStage .stage-title { font-size: 13px; font-weight: 600; }
#deviceStage .stage-meta { font-size: 12px; color: var(--muted); font-family: var(--mono); }
#deviceStage .stage-head .spacer { flex: 1; }

.device-frame {
  margin: 0 auto; background: #1c1f26;
  border-radius: 26px; padding: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transition: width .22s ease;
}
.device-frame.phone { width: 414px; border-radius: 34px; padding: 12px 12px 20px; }
.device-frame.tablet { width: 844px; border-radius: 22px; }

.device-notch {
  height: 20px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.device-notch i {
  display: block; width: 62px; height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, .22);
}
.device-frame.tablet .device-notch { height: 12px; }
.device-frame.tablet .device-notch i { width: 40px; height: 4px; }

.device-screen {
  background: var(--bg); border-radius: 16px; overflow: hidden;
  width: 100%; height: calc(100vh - 170px); min-height: 380px;
  position: relative;
}
.device-frame.phone .device-screen { border-radius: 24px; }
.device-screen iframe {
  width: 100%; height: 100%; border: 0; display: block; background: var(--bg);
}



/* ---------- 可点选的速查表 (表格行 → 联动绘图) ---------- */
table.data caption {
  caption-side: top; text-align: left; padding: 0 0 8px;
  font-size: 13px; font-weight: 600; color: var(--text-soft);
}
table.data tr[data-row], table.data tr[data-n] { cursor: pointer; transition: background .12s; }
table.data tr[data-row]:hover, table.data tr[data-n]:hover { background: var(--panel-2); }
table.data tr[data-row].on, table.data tr[data-n].on {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
table.data tr[data-row].on td:first-child { font-weight: 600; color: var(--accent); }
.side-note-inline {
  font-size: 12.5px; color: var(--text-soft); line-height: 1.7;
  margin: 6px 0 14px; padding-left: 2px;
}

/* ---------- 交互题库 (core/widgets/quiz.js) ---------- */
.quiz-card {
  background: var(--panel); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 14px 16px; margin: 14px 0; box-shadow: var(--shadow);
}
.quiz-card.answered.right { border-left-color: var(--ok); }
.quiz-card.answered.wrong { border-left-color: var(--danger); }
.quiz-no {
  font-size: 12.5px; font-weight: 700; color: var(--accent);
  letter-spacing: .05em; margin-bottom: 6px;
}
.quiz-q { margin: 0 0 10px; line-height: 1.8; }
.qopts { display: flex; flex-direction: column; gap: 6px; }
.qopt {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; text-align: left; white-space: normal;
  padding: 9px 12px; line-height: 1.65;
}
.qopt .qlab { flex: 0 0 auto; font-weight: 700; color: var(--muted); }
.qopt:disabled { opacity: 1; cursor: default; }
.qopt.dim { color: var(--text-soft); }
.qopt.right {
  background: var(--ok-soft); border-color: var(--ok);
  color: var(--ok); font-weight: 600;
}
.qopt.right .qlab { color: var(--ok); }
.qopt.wrong { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.qopt.wrong .qlab { color: var(--danger); }
.qwhy {
  display: none; margin-top: 10px; padding: 10px 13px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 13.5px; line-height: 1.8;
}
.qwhy.open { display: block; }
.qwhy.right { border-color: var(--ok); }
.qwhy.wrong { border-color: var(--danger); }
.qwhy .tick { font-weight: 700; }
.qwhy.right .tick { color: var(--ok); }
.qwhy.wrong .tick { color: var(--danger); }
.qwhy-b { margin-top: 5px; color: var(--text-soft); }

/* ---------------- 投影模式: 4:3 PPT 画布 + 隐藏侧栏 + 放大字号 ----------------
   进入投影模式后, 主体被约束为一个 4:3 的画布 (仿传统 PPT 一页),
   整页高度固定为一屏, 全部内容在画布内滚动, 页面外框始终可见。
   侧栏与返回顶部按钮隐藏, 聚焦内容本身。 */
html[data-view="projection"] #sidebar,
html[data-view="projection"] #toTop,
html[data-view="projection"] #menuBtn,
html[data-view="projection"] #progress { display: none; }
html[data-view="projection"] #app { display: block; height: 100vh; overflow: hidden; }
html[data-view="projection"] #main {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  padding: 0; background: var(--bg);
  display: flex; align-items: stretch; justify-content: center;
}
html[data-view="projection"] .wrap {
  /* 4:3 画布: 撑满可视高度, 宽度按 4:3 比例;
     窗口较窄 (< 4:3) 时退化为整宽, 画布在内部滚动。 */
  height: 100vh;
  aspect-ratio: 4 / 3;
  width: min(calc(100vh * 4 / 3), 100vw);
  max-width: 100vw;
  margin: 0 auto;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
  overflow-y: auto; overscroll-behavior: contain;   /* 整页在画布内滚动 */
  padding: 26px 40px 60px;
  scrollbar-width: thin;
}
html[data-view="projection"] .page-head { display: none; }        /* 一屏聚焦内容, 略去导言 */
html[data-view="projection"] section.mod {
  box-shadow: none; border: none; border-bottom: 2px solid var(--border-soft);
  border-radius: 0; padding: 22px 0 30px;
  scroll-margin-top: 16px;
}
html[data-view="projection"] section.mod:last-child { border-bottom: none; }
html[data-view="projection"] .footer-note { display: none; }

html[data-view="projection"] body { font-size: 20px; line-height: 1.85; }

/* ---------------- 投影分页 (deck) 画布与幻灯片 ---------------- */
html[data-view="projection"] .wrap.deck-ready {
  /* 分页后不再由画布自身滚动, 交给单页 */
  overflow: hidden;
}
.deck-probe {
  --slide-pad-x: 44px;                  /* 与 .deck-slide 保持一致, 否则量高会偏 */
  /* 测量探针: 不可见, 宽度同 4:3 画布, 测量子元素自然高度 */
  position: absolute; visibility: hidden; left: -99999px; top: 0;
  overflow: hidden; pointer-events: none;
  background: var(--panel);
}
.deck-canvas {
  margin: 0 auto;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
  overflow: hidden;                     /* 单页固定, 不滚动 */
  position: relative;
}
.deck-slide {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  --slide-pad-x: 44px;                  /* 左右内边距: 实验与图要反向抵消它 */
  padding: 20px var(--slide-pad-x) 58px;   /* 底部留出页码条空间 */
  overflow: hidden;
  box-sizing: border-box;
  /* 平滑翻页: 淡入 + 轻微上移; 非当前页不可交互、不占据焦点 */
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
}
.deck-slide.deck-current {
  opacity: 1; transform: none; pointer-events: auto;
}
/* 页正文容器: 建立 BFC(外边距不外溢 → 探针测高与实际一致);
   内容整块过高时由 JS 施加 scale(), 保证"图 + 结论"不被拆到两页。 */
.deck-body { display: flow-root; transform-origin: top center; }
.deck-slide.deck-fit .deck-body { transition: transform .18s ease; }
/* 让 slide 在画布内垂直贴近顶部留一点呼吸感, 内容更居中 */
.deck-slide-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-bottom: 2px solid var(--border-soft);
  padding-bottom: 10px; margin-bottom: 14px;
}
.deck-slide-module {
  font-size: 15px; font-weight: 700; color: var(--accent);
  white-space: nowrap;
}
.deck-slide-name {
  font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.25;
}
.deck-slide .deck-body > .controls,
.deck-probe > .controls { margin-top: 8px; }
.deck-slide h4,
.deck-probe h4 { display: none; }        /* 页名已在页头, 正文不再重复小节标题 */

/* 模块首屏(引导标题 + 首小节内容同屏): 模块 h3 作为紧凑横幅, 不独占一屏 */
.deck-slide-cover .deck-slide-head { display: none; }   /* 首屏自带模块 h3, 不再叠加头 */
.deck-slide-cover h3 {
  font-size: 30px; margin: 2px 0 2px; display: flex;
  align-items: center; gap: 14px; line-height: 1.15;
}
.deck-slide-cover h3 .mod-badge { min-width: 44px; height: 44px; font-size: 22px; }
.deck-slide-cover .mod-sub {
  font-size: 18px; color: var(--text-soft); margin: 6px 0 16px;
  padding-bottom: 12px; border-bottom: 2px solid var(--border-soft);
}
.deck-slide-cover p:not(.mod-sub) { font-size: 17px; }

/* 投影分页内的图表容器垂直居中, 避免顶部拥挤/下部悬空 */
.deck-slide .canvas-wrap,
.deck-probe .canvas-wrap { margin: 18px auto; }

/* 分步显示: 未展开的关键块隐藏但仍占位 —— 版面与图表尺寸全程不跳动 */
.deck-step { visibility: hidden; }
.deck-step-in { visibility: visible; animation: deckStepIn .22s ease both; }
@keyframes deckStepIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}
/* 非当前页不播放入场动画, 避免翻页时观感重复 */
.deck-slide:not(.deck-current) .deck-step-in { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .deck-step-in { animation: none; }
}

/* 底部导航条 */
.deck-chrome {
  position: fixed; left: 0; right: 0; bottom: 0; height: 44px; z-index: 80;
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: var(--mono);
}
.deck-count { color: var(--text-soft); font-size: 13px; min-width: 74px; }
/* 退出按钮推到最右, 中间留白(原进度条位置) */
.deck-chrome .deck-exit { margin-left: auto; }
.deck-chrome button {
  width: 38px; height: 32px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 7px;
  font-size: 15px;
}
/* 分步开关: 打开时高亮 */
.deck-chrome .deck-steps.on {
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft);
}
/* 缩略页面板 */
.deck-grid-panel {
  position: fixed; right: 16px; bottom: 60px; z-index: 90;
  width: min(420px, 92vw); max-height: 70vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 12px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.deck-grid-item {
  flex: 0 0 calc(50% - 4px); flex-direction: column; align-items: flex-start;
  gap: 2px; height: auto; min-height: 40px; padding: 7px 9px;
  font-size: 12px; text-align: left; border: 1px solid var(--border);
}
.deck-grid-item .dgi {
  font-family: var(--mono); color: var(--muted); font-size: 11px;
}
.deck-grid-item .dgn { color: var(--text); font-size: 12px; line-height: 1.3; }
.deck-grid-item.on { border-color: var(--accent); background: var(--accent-soft); }

/* 画布内点击提示 */
.deck-hint {
  position: absolute; left: 0; right: 0; bottom: 6px; text-align: center;
  font-size: 12px; color: var(--muted); pointer-events: none;
}

/* 分页后单页内的详情/表格等允许在其内滚动,但页本体不滚动 */
.deck-slide .tbl-scroll,
.deck-probe .tbl-scroll { max-height: 40vh; overflow-y: auto; }
.deck-slide details.fold,
.deck-probe details.fold { max-height: 40vh; overflow-y: auto; }

/* 投影模式放大各级标题与正文 */
html[data-view="projection"] section.mod { --mod-pad-x: 32px; padding: 30px var(--mod-pad-x) 34px; }
html[data-view="projection"] section.mod > h3 { font-size: 28px; }
html[data-view="projection"] .mod-badge { min-width: 36px; height: 36px; font-size: 17px; }
html[data-view="projection"] .mod-sub { font-size: 16px; }
html[data-view="projection"] h4 { font-size: 21px; margin: 34px 0 14px; }
html[data-view="projection"] .box { padding: 18px 22px; border-left-width: 6px; }
html[data-view="projection"] .box .box-title { font-size: 16px; }
html[data-view="projection"] .katex { font-size: 1.24em; }
html[data-view="projection"] .formula { padding: 12px 2px; }
html[data-view="projection"] ul.clean li, html[data-view="projection"] ol.clean li { margin: 10px 0; }
html[data-view="projection"] .controls { padding: 18px 20px; gap: 18px 26px; }
html[data-view="projection"] .ctl > label { font-size: 14px; }
html[data-view="projection"] .ctl .val { font-size: 14px; }
html[data-view="projection"] .ctl .hint { font-size: 13px; }
html[data-view="projection"] input[type="range"] { height: 7px; }
html[data-view="projection"] input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; }
html[data-view="projection"] input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; }
html[data-view="projection"] button { font-size: 15px; padding: 10px 18px; }
html[data-view="projection"] button.sm { font-size: 14px; padding: 7px 13px; }
html[data-view="projection"] select, html[data-view="projection"] input[type="number"] { font-size: 15px; }
html[data-view="projection"] textarea { font-size: 14.5px; min-height: 104px; }
html[data-view="projection"] table.data { font-size: 15px; }
html[data-view="projection"] table.data th, html[data-view="projection"] table.data td { padding: 8px 12px; }
html[data-view="projection"] .stat { padding: 12px 14px; }
html[data-view="projection"] .stat .k { font-size: 13px; }
html[data-view="projection"] .stat .v { font-size: 21px; }
html[data-view="projection"] .stat .v.sm { font-size: 16px; }
html[data-view="projection"] .verdict { font-size: 20px; }
html[data-view="projection"] .step-body { font-size: 16.5px; }
html[data-view="projection"] .step-body .sd { font-size: 16px; }
html[data-view="projection"] .steps .step-n { flex-basis: 28px; height: 28px; font-size: 14px; }
html[data-view="projection"] details.fold > summary { font-size: 16.5px; padding: 13px 18px; }
html[data-view="projection"] .tab { font-size: 16px; padding: 9px 18px; }
html[data-view="projection"] .plot-note { font-size: 14px; }
html[data-view="projection"] table.data caption { font-size: 16px; }
html[data-view="projection"] .side-note-inline { font-size: 14px; }
html[data-view="projection"] .quiz-no { font-size: 15px; }
html[data-view="projection"] .quiz-q { font-size: 19px; }
html[data-view="projection"] .qopt { font-size: 17px; padding: 11px 16px; }
html[data-view="projection"] .qwhy { font-size: 15.5px; padding: 12px 16px; }

html[data-view="projection"] #viewBar button.vb { font-size: 14px; padding: 8px 13px; }
html[data-view="projection"] .footer-note { font-size: 14px; }

/* 投影模式隐藏次要装饰, 聚焦内容 */
html[data-view="projection"] #progress { height: 4px; }

/* KaTeX 为读屏软件在每段公式里塞了一份隐藏的 MathML(.katex-mathml):
   它是 position:absolute + 1px + overflow:hidden 的, 本该不占地方 ——
   但 .katex 自己没定位, 于是它去找更外层的定位祖先当包含块,
   那一份几百上千像素宽的 MathML 就把整页撑宽了(窄屏下尤其明显:
   lec8-2 一讲多出 502px 的横向空白)。给 .katex 加上 position:relative,
   MathML 就老老实实待在自己那段公式里。 */
.katex { position: relative; }

/* ---------------- 窄屏: 不让任何东西把整页撑宽 ---------------- */
@media (max-width: 560px) {
  /* 1) 控件区竖着排, 分段选择器换行 */
  .controls { padding: 12px; gap: 10px 12px; }
  .controls .ctl { min-width: 0 !important; width: 100%; }   /* 压过行内的 min-width */
  .seg { display: flex; flex-wrap: wrap; }
  .seg button { flex: 1 1 auto; min-width: 0; }

  /* 2) 长串与行内公式各自消化掉自己的宽度 */
  .mod p, .mod li, .mod td, .mod th,
  .lab-observe, .verdict, .plot-note { overflow-wrap: break-word; }
  .mod .katex {
    display: inline-block; max-width: 100%;
    overflow-x: auto; overflow-y: hidden; vertical-align: middle;
  }
  .formula .katex { display: inline; max-width: none; overflow: visible; }
}

@media (max-width: 900px) {
  #viewBar { right: 12px; bottom: 12px; flex-wrap: wrap; max-width: calc(100vw - 24px); }
  #viewBar .vb-label { display: none; }
  #toTop { bottom: 74px; }
  /* 预览保持标称视口宽度；窄窗口通过 deviceStage 自身滚动检查。 */
  #deviceStage .stage-meta { display:none; }
}

/* ---------------- 课件骨架: 返回主页 / 上一讲下一讲 (shell.js 生成) ---------------- */
.side-home {
  display: inline-block; margin-bottom: 10px; font-size: 12.5px;
  color: var(--muted); text-decoration: none; font-family: var(--mono);
}
.side-home:hover { color: var(--accent); }
.lec-nav { display: flex; gap: 10px; font-size: 12px; font-family: var(--mono); }
.lec-nav a { color: var(--accent); text-decoration: none; }
.lec-nav a:hover { text-decoration: underline; }
.lec-nav-off { color: var(--muted); opacity: .6; cursor: default; }
.footer-note a { color: var(--accent); text-decoration: none; }
.footer-note a:hover { text-decoration: underline; }

/* ---------------- 由 LaTeX 搬运来的内容用到的版式 ---------------- */
.center { text-align: center; }
/* \begin{minipage} 并排: 宽度由 import-tex.js 按 \textwidth 比例写成内联样式 */
.col { display: inline-block; vertical-align: top; max-width: 100%; box-sizing: border-box; padding-right: 10px; }
.side-note {
  float: right; width: 190px; margin: 0 0 10px 16px; padding: 10px 12px;
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 8px; font-size: 13px;box-sizing: border-box; 
}
/* 解答块: 投影模式按空格揭示; 电脑模式默认收起, 点击展开 */
.box.master { border-left-color: var(--ok); background: var(--ok-soft); }
.box.master .box-title { color: var(--ok); cursor: pointer; user-select: none; }
.box.master .box-title::after { content: ' ▸ 点击展开'; font-size: 12px; font-weight: 400; opacity: .7; }
.box.master.open .box-title::after { content: ' ▾'; }
html[data-view="desktop"] .box.master:not(.open) > *:not(.box-title) { display: none; }
/* 尚未处理的 LaTeX 原文: 醒目标出, 发布前必须清零 */
.tex-raw {
  font-family: var(--mono); font-size: .92em; color: var(--danger);
  background: var(--danger-soft); border: 1px dashed var(--danger);
  border-radius: 4px; padding: 0 4px;
}
/* 搬运来的位图: 居中、只缩不放(不拉伸位图)、限高, 免得一张图撑爆一页 */
.canvas-wrap img {
  display: block; margin: 0 auto;
  width: auto; max-width: 100%; height: auto;
  max-height: 50vh;
  border-radius: 7px;
}
/* 侧注里的示意图: 去掉内层画框的边框与内边距, 让图直接撑满侧注的内容区 */
.side-note .canvas-wrap {
  margin: 0; padding: 0; border: none; background: none;
  border-radius: 0; overflow: visible; width: 100%;
}
.side-note .canvas-wrap + .canvas-wrap { margin-top: 8px; }
.side-note .canvas-wrap img { width: 100%; border-radius: 6px; }
/* 侧注里的外链: 看起来就是链接, 长 URL 要能断行 */
.side-note a {
  color: var(--accent); text-decoration: underline; text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.side-note a:hover { text-decoration-thickness: 2px; }
/* 万一真塞了图进来, 至少别顶破侧注 */
.side-note a img { display: block; margin: 6px auto; max-width: 100%; height: auto; border-radius: 6px; }
.side-note > p:first-child { margin-top: 0; }
.side-note > :last-child { margin-bottom: 0; }
/* 投影: slide 与 probe 必须同一条规则, 否则分页按错的高度算 */
.deck-slide .canvas-wrap img,
.deck-probe .canvas-wrap img { max-height: 44vh; }

/* 整页只有一张图的页面(deck.js 判定): 顶到画布 90% 宽。
   只放宽 max-*, 不写 width —— 位图永远不会被拉到超过原始分辨率。
   78vh 的高度上限是照 fitSlide 的 avail 留的余量, 不会触发 deck-fit 缩放。 */
.deck-slide.deck-figure .canvas-wrap img {
  max-width: 90%; max-height: 78vh; width: auto; height: auto;
}

/* ---------------- 交互实验 (.lab): 网页版相对 LaTeX 新增的部分 ---------------- */
.lab {
  border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px 16px 16px; margin: 18px 0; background: var(--panel);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.lab-title {
  color: var(--accent); font-weight: 700; font-size: 14px;
  margin-bottom: 10px; letter-spacing: .01em;
}
.lab .canvas-wrap { margin-top: 10px; }
/* 交互实验与页面同宽: 反向抵消 section.mod 的左右内边距, 图表能多出 50+ px。
   只对小节的直接子元素生效 —— 嵌在 <li> 里的实验不受影响, 免得溢出。 */
section.mod > .lab {
  margin-left: calc(-1 * var(--mod-pad-x, 0px));
  margin-right: calc(-1 * var(--mod-pad-x, 0px));
}
/* 没有 .lab 外框的课件(如 lec9-2), 实验就是"控件 + 画框 + 结论"直接排在小节里,
   画框同样满宽, 免得两种写法宽度不一致 */
section.mod > .canvas-wrap {
  margin-left: calc(-1 * var(--mod-pad-x, 0px));
  margin-right: calc(-1 * var(--mod-pad-x, 0px));
  width: auto;
}
/* 投影模式: 实验与图直接顶到 4:3 画布的边(探针与幻灯片用同一条规则, 否则分页高度量不准) */
.deck-slide .deck-body > .lab,
.deck-probe > .lab,
.deck-slide .deck-body > .canvas-wrap,
.deck-probe > .canvas-wrap {
  margin-left: calc(-1 * var(--slide-pad-x, 0px));
  margin-right: calc(-1 * var(--slide-pad-x, 0px));
  width: auto;
}
/* 顶到边之后左右描边就没有意义了, 去掉圆角与竖边, 读起来是一条整幅的带子 */
.deck-slide .deck-body > .lab,
.deck-probe > .lab {
  border-left: none; border-right: none;
  border-radius: 0;
}
.cols { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.cols > .col { padding-right: 0; }

/* ================= 投影字号再放大一档 (教室后排也看得清) ================= */
html[data-view="projection"] body { font-size: 22px; line-height: 1.8; }
/* 例题里的数据表原来偏小, 明显放大 */
html[data-view="projection"] table.data { font-size: 18px; }
html[data-view="projection"] table.data th { font-size: 17px; }
html[data-view="projection"] table.data th,
html[data-view="projection"] table.data td { padding: 10px 14px; }
html[data-view="projection"] .stat .k { font-size: 14px; }
html[data-view="projection"] .stat .v { font-size: 23px; }
html[data-view="projection"] .verdict { font-size: 22px; }
html[data-view="projection"] .box-title { font-size: 18px; }
html[data-view="projection"] .lab-title { font-size: 17.5px; }
html[data-view="projection"] .plot-note { font-size: 15.5px; }
html[data-view="projection"] .ctl label { font-size: 16px; }
html[data-view="projection"] .side-note { font-size: 16px; width: 240px; }
html[data-view="projection"] .deck-slide-name { font-size: 28px; }
html[data-view="projection"] ul.clean > li,
html[data-view="projection"] ol > li { margin: 8px 0; }

/* 直观观察块: 只描述现象, 不给检验结论 (学生此时还没学检验方法) */
.lab-observe {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--border);
}
.lab-observe .k { font-size: 12.5px; color: var(--muted); }
.lab-observe .obs-line { margin: 6px 0 0; }
html[data-view="projection"] .lab-observe { font-size: 18px; }
html[data-view="projection"] .lab-observe .k { font-size: 14px; }
/* 热力着色的列联表 */
table.data td.heat { font-family: var(--mono); }
/* 投影下交互实验里的长表格再收一点, 让"图+表+结论"整体放得进一页 */
html[data-view="projection"] .deck-slide .lab .tbl-scroll,
html[data-view="projection"] .deck-probe .lab .tbl-scroll { max-height: 30vh; }

/* 表格里的小标注 (如"试验前已确定"), 手写页面也可直接用 */
.pre-fixed {
  display: inline-block; margin-top: 2px;
  font-size: .78em; color: var(--danger); white-space: nowrap;
}
html[data-view="projection"] .pre-fixed { font-size: .8em; }

/* 模块封面页(deck-slide-cover)的正文原来固定 17px —— 那是投影正文还是 20px 时
   为了"标题横幅 + 内容同屏"定的。正文调到 22px 后这条没跟上, 导致模块首页
   比其它页明显小一号(如 sec2 首页)。封面页内容本来就少, 不需要缩小, 这里恢复一致。 */
html[data-view="projection"] .deck-slide-cover p:not(.mod-sub),
html[data-view="projection"] .deck-probe p:not(.mod-sub) { font-size: 22px; }
html[data-view="projection"] .deck-slide-cover .mod-sub { font-size: 19.5px; }
html[data-view="projection"] .deck-slide-cover h3 { font-size: 32px; }
