/* 题旁工作台：浅色面板、白底黑线的图（与试卷原图一致）；按钮与读数沿用同一套布局。 */
.xs {
  --xs-bg: #ffffff;
  --xs-card: #f7f9fc;
  --xs-card-2: #eef2f7;
  --xs-line: #d9e0ea;
  --xs-line-2: #b9c4d3;
  --xs-ink: #16202c;
  --xs-ink-2: #3b4757;
  --xs-ink-3: #66727f;
  --xs-gold: #1c6fd1;
  --xs-on: #e7f0fd;
  --num-font: "SF Pro Text", "Inter", "PingFang SC", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--xs-ink);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  min-width: 0;
}
.xs * { box-sizing: border-box; }
.xs [hidden] { display: none !important; }
.xs button, .xs select, .xs input { font: inherit; color: inherit; }
.xs button { min-height: 0; }

.xs-row { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.xs-top { justify-content: space-between; }
.xs-seg { display: inline-flex; background: var(--xs-card); border: 1px solid var(--xs-line); border-radius: 10px; padding: 3px; gap: 2px; }
.xs-seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; cursor: pointer; color: var(--xs-ink-2); font-weight: 600; white-space: nowrap; font-size: 13px; }
.xs-seg button:hover { color: var(--xs-ink); background: #ffffff; }
.xs-seg button[aria-checked="true"] { background: #ffffff; color: #134e9a; box-shadow: 0 1px 3px rgba(22, 32, 44, 0.12), inset 0 -2px 0 var(--xs-gold); }
.xs-check { display: inline-flex; align-items: center; gap: 6px; background: var(--xs-card); border: 1px solid var(--xs-line); border-radius: 10px; padding: 6px 10px; font-size: 13px; color: var(--xs-ink-2); cursor: pointer; }
.xs-check input { accent-color: var(--xs-gold); }

.xs-actions, .xs-points { background: var(--xs-card); border: 1px solid var(--xs-line); border-radius: 12px; padding: 7px 8px; }
.xs-actions button, .xs-points button, .xs-presets button, .xs-plotctl button, .xs-btn, .xs-lift button {
  border: 1px solid var(--xs-line-2); background: #ffffff; color: var(--xs-ink); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap;
}
.xs-actions button:hover, .xs-points button:hover, .xs-presets button:hover, .xs-plotctl button:hover, .xs-btn:hover { background: #eef4fc; }
.xs-actions button[aria-pressed="true"], .xs-points button[aria-pressed="true"], .xs-presets button.on { border-color: var(--xs-gold); color: #134e9a; background: var(--xs-on); box-shadow: inset 0 0 0 1px var(--xs-gold); }
.xs-actions .xs-primary-outline { border-color: #4c86cf; color: #134e9a; }
.xs-actnote { flex: 1 1 200px; color: var(--xs-ink-3); font-size: 12px; }
.xs-points b { font-size: 12.5px; color: var(--xs-ink-2); margin-right: 2px; }
.xs-pbtns { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.xs-pbtns button { min-width: 38px; font-family: "Times New Roman", "Songti SC", serif; font-size: 16px; padding: 3px 10px; }
.xs-points .xs-reset-focus { margin-left: auto; }

.xs-stage {
  position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--xs-line);
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(22, 32, 44, 0.07); min-height: 280px;
}
.xs-host { position: absolute; inset: 0; }
.xs .field2d-canvas, .xs .scene3d-canvas { position: absolute; inset: 0; display: block; touch-action: none; outline: none; }
.xs .field2d-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--xs-gold); }
.xs-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3; display: flex; align-items: center; gap: 8px; pointer-events: none;
  padding: 5px 11px 5px 9px; border-radius: 9px; background: rgba(255, 255, 255, 0.93); border: 1px solid var(--xs-line);
  max-width: min(330px, calc(100% - 250px)); font-size: 13px;
}
.xs-badge > div { min-width: 0; }
.xs-badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--xs-gold); flex: none; box-shadow: 0 0 0 3px rgba(28, 111, 209, 0.18); }
.xs-badge b { display: block; font-weight: 700; color: var(--xs-ink); }
.xs-badge small { display: block; color: var(--xs-ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xs-tools { position: absolute; top: 8px; right: 8px; z-index: 4; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; max-width: 58%; }
.xs-toggles, .xs-cams { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.xs-tools button {
  border: 1px solid #c8d1dc; background: rgba(255, 255, 255, 0.92); color: var(--xs-ink); padding: 4px 9px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.xs-tools button:hover { background: #eef4fc; }
.xs-toggles button[aria-pressed="false"] { color: #8a94a2; text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, 0.3); }
.xs-toggles button[aria-pressed="true"] { border-color: #4c86cf; color: #134e9a; background: var(--xs-on); }
.xs-cams button { border-color: #c8d1dc; }
.xs-planefit button { border-color: #4c86cf; color: #134e9a; }
.xs .field2d-canvas { cursor: grab; }
.xs-lift { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 4; }
.xs-lift button { background: var(--xs-gold); color: #ffffff; border-color: transparent; font-size: 14px; padding: 8px 18px; box-shadow: 0 4px 14px rgba(22, 32, 44, 0.22); }
.xs-lift button:hover { background: #1760b8; }

/* 色标（Opus ColorBar） */
.xs-cb { position: absolute; right: 10px; top: 76px; bottom: 44px; z-index: 3; width: 70px; pointer-events: none; }
.xs .colorbar { position: relative; height: 100%; max-height: 330px; pointer-events: auto; }
.xs .cb-title { color: var(--xs-ink); font-size: 12.5px; font-weight: 700; text-align: left; margin-bottom: 6px; line-height: 1.2; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.xs .cb-sub { display: block; font-weight: 500; color: var(--xs-ink-3); font-size: 10.5px; }
.xs .cb-bar { position: absolute; left: 0; top: 34px; bottom: 0; width: 16px; padding: 0; border: 1px solid #8f99a8; border-radius: 6px; cursor: pointer; background: none; overflow: visible; }
.xs .cb-grad { position: absolute; inset: 0; border-radius: 5px; }
.xs .cb-hint { position: absolute; left: 50%; bottom: -21px; transform: translateX(-50%); font-size: 10.5px; color: var(--xs-ink-2); white-space: nowrap; background: rgba(255, 255, 255, 0.92); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--xs-line); }
.xs .cb-ticks { position: absolute; left: 22px; top: 34px; bottom: 0; right: 0; }
.xs .cb-ticks span { position: absolute; left: 0; transform: translateY(50%); color: var(--xs-ink); font-size: 11.5px; font-weight: 600; font-family: var(--num-font); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.xs .cb-ticks span::before { content: ""; position: absolute; left: -6px; top: 50%; width: 4px; height: 1px; background: #555; }
.xs .cb-pop { position: absolute; right: 0; top: 30px; width: 240px; background: #ffffff; border: 1px solid var(--xs-line); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px rgba(22, 32, 44, 0.18); z-index: 10; }
.xs .cb-opt { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: var(--xs-ink); outline: none; }
.xs .cb-opt:hover, .xs .cb-opt:focus { background: #eef4fc; }
.xs .cb-sw { width: 64px; height: 12px; border-radius: 4px; flex: none; }
.xs .cb-txt b { display: block; font-size: 12.5px; }
.xs .cb-txt small { color: var(--xs-ink-3); font-size: 11px; }

/* 悬停读数与三维标签 */
.xs .probe-tip {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; opacity: 0; transition: opacity 0.12s;
  background: rgba(8, 12, 24, 0.92); color: #eef2fa; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 9px; padding: 7px 10px;
  font-size: 12.5px; line-height: 1.55; min-width: 150px; font-family: var(--num-font);
}
.xs .probe-tip small { display: block; color: #a9b8d6; }
.xs .probe-tip b { display: block; font-size: 14px; }
.xs .probe-tip span { display: block; color: #d3dcef; }
.xs .label-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.xs .lbl { position: absolute; left: 0; top: 0; color: #16202c; font-size: 12.5px; font-weight: 600; white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; font-family: var(--num-font); }
.xs .lbl.axis { background: rgba(255, 255, 255, 0.72); padding: 0 4px; border-radius: 4px; }
.xs .lbl.axis-title { font-weight: 700; font-size: 13.5px; color: #111; background: rgba(255, 255, 255, 0.85); padding: 1px 6px; border-radius: 5px; }
.xs .lbl.note { color: #3b4757; font-size: 12px; font-weight: 500; background: rgba(255, 255, 255, 0.85); padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.06); }
.xs .lbl.sec { color: #d9480f; font-weight: 800; font-size: 14px; }
.xs .lbl.pt { font: italic 700 17px "Times New Roman", "Songti SC", serif; color: #111; }
.xs .lbl.vec { font: italic 700 16px "Times New Roman", "Songti SC", serif; }
.xs .lbl.sec.axis-letter { font: italic 700 19px "Times New Roman", "Songti SC", serif; color: #111; }
.xs .lbl.charge { font-size: 20px; font-weight: 800; }
.xs .lbl.charge.pos { color: #c92a2a; }
.xs .lbl.charge.neg { color: #1864ab; }

/* 播放 */
.xs-transport { background: var(--xs-card); border: 1px solid var(--xs-line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 7px; }
.xs-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.xs-trow { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.xs-btn.xs-primary { background: var(--xs-gold); color: #ffffff; border-color: transparent; min-width: 104px; }
.xs-btn.xs-primary:hover { background: #1760b8; }
.xs-param { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--xs-ink-2); }
.xs-param select, .xs-param input[type="number"] { padding: 4px 7px; border-radius: 7px; border: 1px solid var(--xs-line-2); background: #ffffff; color: var(--xs-ink); font-family: var(--num-font); }
.xs-param input[type="range"] { accent-color: var(--xs-gold); width: 130px; }
.xs-param b { font-family: var(--num-font); color: var(--xs-ink); min-width: 62px; }
.xs-time { font-family: var(--num-font); font-size: 12.5px; color: var(--xs-ink-2); margin-left: auto; }
.xs-hint { background: #fff8e6; border: 1px solid #f0cd7a; color: #4a3a0c; border-radius: 9px; padding: 6px 10px; font-size: 12.5px; line-height: 1.55; }

/* 读数 */
.xs-readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; }
.xs-readouts > div { background: var(--xs-card); border: 1px solid var(--xs-line); border-radius: 10px; padding: 6px 10px; min-width: 0; }
.xs-readouts small { display: block; font-size: 11.5px; color: var(--xs-ink-3); }
.xs-readouts b { font: 700 15.5px var(--num-font); color: var(--xs-ink); overflow-wrap: anywhere; }
.xs-readouts em { font-style: normal; font-size: 11px; color: var(--xs-ink-3); margin-left: 4px; }

/* 切面曲线 */
.xs-plotcard { background: var(--xs-card); border: 1px solid var(--xs-line); border-radius: 12px; padding: 8px 10px; }
.xs-plothead { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.xs-plothead b { font-size: 13.5px; }
.xs-plotctl { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.xs-plotctl button { padding: 4px 9px; font-size: 12px; }
.xs-plot, .xs-plot2 { position: relative; height: 240px; }
.xs .plot-canvas { position: absolute; inset: 0; touch-action: none; }
.xs-plot2wrap { margin-top: 8px; }
.xs-plot2wrap b { font-size: 12.5px; color: var(--xs-ink-2); }
.xs-plotnote { margin: 4px 0 0; font-size: 11.5px; color: var(--xs-ink-3); line-height: 1.5; }

.xs-params { display: flex; gap: 8px 14px; flex-wrap: wrap; background: var(--xs-card); border: 1px solid var(--xs-line); border-radius: 12px; padding: 8px 10px; }
.xs-note { background: var(--xs-card); border: 1px solid var(--xs-line) !important; border-radius: 12px; padding: 8px 12px !important; margin: 0 !important; }
.xs-note summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--xs-ink) !important; }
.xs-notetext { margin-top: 6px; font-size: 12.5px; line-height: 1.7; color: var(--xs-ink-2); }
.xs-notetext p { margin: 4px 0; }

@media (max-width: 640px) {
  .xs-badge { max-width: calc(100% - 16px); }
  .xs-badge small { display: none; }
  .xs-tools { top: auto; bottom: 6px; right: 6px; max-width: calc(100% - 12px); }
  .xs-cb { top: 52px; bottom: 56px; width: 56px; }
  .xs-time { margin-left: 0; width: 100%; }
  .xs-param input[type="range"] { width: 100px; }
}
.xs-custom { display: block; width: 100%; height: 230px; }

/* 页面装配：题旁工作台放在浅色页面右栏 */
#studioHost { min-width: 0; }
.xs-tasks { margin-top: 10px; background: #fff; border: 1px solid var(--border, #dce5ee); border-radius: 10px; padding: 10px 14px !important; }
.xs-note-light { margin-top: 8px !important; background: #fff; border: 1px solid var(--border, #dce5ee) !important; border-radius: 10px; padding: 8px 12px; }
.xs-note-light summary { cursor: pointer; font-weight: 700; font-size: 13.5px; }
.xs-note-light .xs-notetext { color: #3a4a5e; }

/* 第 24 题：水槽实测类比（Opus 水槽模型） */
.xs-tank { position: absolute; inset: 0; display: flex; flex-direction: column; background: #ffffff; }
.xs-tankbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 10px; border-bottom: 1px solid var(--xs-line); }
.xs-tankbar b { font-size: 12.5px; color: var(--xs-ink-2); }
.xs-tankhost { position: relative; flex: 1; min-height: 0; }
.xs-tankhost .tank-host { position: absolute; inset: 0; }
.xs-tankhost .tank-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; background: rgba(255, 255, 255, 0.95); border: 1px solid var(--xs-line); padding: 8px 14px; border-radius: 9px; font-size: 13px; }
.xs-tankread { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; padding: 7px 10px; border-top: 1px solid var(--xs-line); }
.xs-tankread small { display: block; color: var(--xs-ink-3); font-size: 11px; }
.xs-tankread b { font: 700 14.5px var(--num-font); color: var(--xs-ink); }
.visual-pane:fullscreen #studioHost { max-width: 1400px; margin: 0 auto; }

/* 顶栏：返回实验室 */
.home-link { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border, #cbd6e4); border-radius: 5px; color: #24537a; background: #fff; text-decoration: none; white-space: nowrap; font-size: 13px; }
.home-link:hover { background: #eef4fc; }
@media (max-width: 640px) { .top-actions .home-link { width: 100%; justify-content: center; min-height: 32px; font-size: 11px; padding: 5px 7px; } }

/* 第 3、4 题电子透镜工作台：浅色面板、白底黑线的图（与题旁工作台一致） */
.lens-studio.paper {
  --ls-bg: #ffffff;
  --ls-card: #f7f9fc;
  --ls-card-2: #eef2f7;
  --ls-line: #d9e0ea;
  --ls-line-2: #b9c4d3;
  --ls-ink: #16202c;
  --ls-ink-2: #3b4757;
  --ls-ink-3: #66727f;
  --ls-gold: #1c6fd1;
}
.lens-studio.paper .chip-row button, .lens-studio.paper .btn { background: #ffffff; color: var(--ls-ink); }
.lens-studio.paper .chip-row button:hover, .lens-studio.paper .btn:hover { background: #eef4fc; }
.lens-studio.paper .chip-row button.on { color: #134e9a; background: #e7f0fd; }
.lens-studio.paper .btn.primary { background: var(--ls-gold); color: #ffffff; }
.lens-studio.paper .btn.primary:hover { background: #1760b8; filter: none; }
.lens-studio.paper .seg { background: var(--ls-card); }
.lens-studio.paper .seg button[aria-checked="true"] { background: #ffffff; color: #134e9a; box-shadow: 0 1px 3px rgba(22, 32, 44, 0.12), inset 0 -2px 0 var(--ls-gold); }
.lens-studio.paper .ls-pane { background: #ffffff; box-shadow: 0 2px 10px rgba(22, 32, 44, 0.07); }
.lens-studio.paper .ls-head { background: #f7f9fc; }
.lens-studio.paper .ls-badge { color: var(--ls-ink); }
.lens-studio.paper .ls-badge i { background: var(--ls-gold); box-shadow: 0 0 0 3px rgba(28, 111, 209, 0.18); }
.lens-studio.paper .ls-badge small { color: var(--ls-ink-3); }
.lens-studio.paper .toggle-group button { border-color: #c8d1dc; background: #ffffff; color: var(--ls-ink); }
.lens-studio.paper .toggle-group button[aria-pressed="false"] { color: #8a94a2; text-decoration-color: rgba(0, 0, 0, 0.3); }
.lens-studio.paper .toggle-group button[aria-pressed="true"] { border-color: #4c86cf; color: #134e9a; background: #e7f0fd; }
.lens-studio.paper .ls-ttools .seg { background: #ffffff; }
.lens-studio.paper select.sel, .lens-studio.paper .field input, .lens-studio.paper .field select { background: #ffffff; }
.lens-studio.paper .ls-hint { background: #fff8e6; border-color: #f0cd7a; color: #4a3a0c; }
.lens-studio.paper .ls-card b.ok { color: #2b8a3e; }
.lens-studio.paper .ls-card b.warn, .lens-studio.paper .ls-card .warn { color: #b35c00; }
.lens-studio.paper .ls-card b.bad { color: #c92a2a; }
.lens-studio.paper .c-v { color: #2f9e44; }
.lens-studio.paper .c-f { color: #e8590c; }
.lens-studio.paper .c-e { color: #111111; }
.lens-studio.paper .lbl { color: #16202c; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; }
.lens-studio.paper .lbl.axis { background: rgba(255, 255, 255, 0.72); }
.lens-studio.paper .lbl.axis-title { color: #111; background: rgba(255, 255, 255, 0.85); }
.lens-studio.paper .lbl.note { color: #3b4757; background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(0, 0, 0, 0.06); }
.lens-studio.paper .lbl.sec { color: #d9480f; }
.lens-studio.paper .lbl.cand { color: #c2255c; font-weight: 700; }
.lens-studio.paper .ls-grad { display: none; }
/* 选项对照放在图上方 */
.lens-studio .ls-cands.ls-top-cands { padding: 8px 12px; }
.lens-studio .ls-cands.ls-top-cands h4 { margin: 0 0 6px; }
.ls-cd ol { margin: 4px 0 2px; padding-left: 20px; }
.ls-cd li { margin: 3px 0; line-height: 1.6; font-size: 12.5px; color: var(--ls-ink-2); }
.ls-cd .sw { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin: 0 3px; }
.ls-cd .sw.dash { border-top-style: dashed; }

.ls-conflicts { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.ls-conflicts figure { margin: 0; flex: 1 1 220px; max-width: 320px; }
.ls-conflicts canvas { display: block; width: 100%; height: 170px; border-radius: 8px; }

/* 两栏：模型（控制、画面、播放、读数）| 图像。窄屏时两栏内容按原顺序排成一列，图像在读数之后 */
.xs-main, .xs-side { display: contents; }
.xs-top { order: 1; } .xs-actions { order: 2; } .xs-points { order: 3; } .xs-stage { order: 4; } .xs-transport { order: 5; }
.xs-readouts { order: 6; } .xs-plotcard { order: 7; } .xs-params { order: 8; } .xs-note { order: 9; }
.xs.wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.xs.wide .xs-main, .xs.wide .xs-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.xs.wide .xs-side { position: sticky; top: 8px; }
/* 三栏时一列较窄：控制按钮紧凑，画面上的标签只留标题，色标省去（地形的竖轴已标出数值） */
.xs.wide { font-size: 12.5px; }
.xs.wide .xs-row { gap: 4px 6px; }
.xs.wide .xs-seg { padding: 2px; }
.xs.wide .xs-seg button { padding: 4px 8px; font-size: 12px; }
.xs.wide .xs-check { padding: 4px 8px; font-size: 12px; }
.xs.wide .xs-actions, .xs.wide .xs-points { padding: 5px 6px; }
.xs.wide .xs-actions button, .xs.wide .xs-points button, .xs.wide .xs-presets button, .xs.wide .xs-btn { padding: 4px 9px; font-size: 12px; }
.xs.wide .xs-pbtns button { font-size: 15px; padding: 2px 8px; min-width: 32px; }
.xs.wide .xs-tools { max-width: 80%; gap: 3px; }
.xs.wide .xs-tools button { padding: 3px 7px; font-size: 11.5px; }
.xs.wide .xs-badge { max-width: 48%; padding: 3px 8px; font-size: 12px; }
.xs.wide .xs-badge small { display: none; }
.xs.wide .xs-cb { display: none; }
.xs.wide .xs-readouts { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
/* 页面三栏：原题 1 : 模型 1 : 图像 1 */
.workspace.wide3 { grid-template-columns: minmax(280px, 1fr) minmax(600px, 2fr); max-width: none; }
.workspace.wide3 .question-pane { position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow-y: auto; }
