/* ============================================================
   化学实验室 /chem/ 样式
   依赖 fonts.css（--font-main）、site.css 变量（--bg/--card/--line/
   --ink/--muted/--accent）；本页未引入 site.css，故在此补齐兜底，
   主题切换与字体方案自动跟随（head.php 输出 data-theme / data-font）。
   ============================================================ */

/* 变量兜底：--card/--ease/--font-mono 由 site.css 定义，本页以主题变量回退 */
html {
  --card: var(--c-card, #fff);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.chem-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

.chem-main {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: calc(var(--tb-h, 60px) + 18px) 20px 28px;
  align-items: start;
}

/* ---------------- 左栏 ---------------- */
.chem-side {
  position: sticky;
  top: calc(var(--tb-h, 60px) + 18px);
  height: calc(100vh - var(--tb-h, 60px) - 46px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.chem-side-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.chem-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.chem-title-row h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.chem-count { font-size: 11px; color: var(--muted); }

.chem-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  transition: border-color .15s;
}
.chem-search:focus-within { border-color: var(--accent); }
.chem-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.chem-search input::placeholder { color: var(--muted); opacity: .85; }
.chem-search kbd {
  font: inherit;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  line-height: 16px;
}

.chem-tree {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 8px 16px;
  scrollbar-width: thin;
}
.chem-tree::-webkit-scrollbar { width: 8px; }
.chem-tree::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.chem-loading { padding: 20px 12px; color: var(--muted); font-size: 13px; }

/* 册 */
.chem-book { margin-bottom: 4px; }
.chem-book-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.chem-book-btn:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.chem-book-btn .chev {
  width: 14px;
  color: var(--muted);
  transition: transform .18s var(--ease);
  flex: none;
}
.chem-book.open .chev { transform: rotate(90deg); }
.chem-book-btn .bk-stage {
  font-size: 10px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 16px;
  flex: none;
}
.chem-book-btn .bk-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chem-book-btn .bk-num { font-size: 11px; color: var(--muted); font-weight: 400; }

.chem-chapters { display: none; padding: 2px 0 6px 0; }
.chem-book.open .chem-chapters { display: block; }

/* 单元 */
.chem-unit { margin: 2px 0; }
.chem-unit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 22px;
  background: none;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}
.chem-unit-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.chem-unit.open > .chem-unit-btn { color: var(--ink); }
.chem-unit-btn .chev { width: 12px; flex: none; transition: transform .18s var(--ease); }
.chem-unit.open > .chem-unit-btn .chev { transform: rotate(90deg); }
.chem-unit-btn .u-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chem-unit-btn .u-num { font-size: 10.5px; color: var(--muted); }

/* 反应条目 */
.chem-rx-list { display: none; padding: 2px 0 8px; }
.chem-unit.open > .chem-rx-list { display: block; }
.chem-rx {
  display: block;
  width: 100%;
  padding: 7px 10px 7px 36px;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  line-height: 1.45;
}
.chem-rx:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--ink); }
.chem-rx.on {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-left-color: var(--accent);
  color: var(--ink);
}
.chem-rx b { display: block; font-weight: 500; font-size: 12.5px; }
.chem-rx span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chem-side-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* 搜索结果 */
.chem-sr-group { margin: 0 0 10px; }
.chem-sr-head { font-size: 11px; color: var(--muted); padding: 6px 10px; letter-spacing: .4px; }
.chem-sr-empty { padding: 24px 14px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.chem-sr-empty b { color: var(--ink); }
.chem-mark { color: var(--accent); font-weight: 600; }

/* ---------------- 右栏 ---------------- */
.chem-stage-wrap { min-width: 0; }

.chem-stage-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chem-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}
.chem-stage-title { min-width: 0; }
.chem-crumb { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.chem-stage-title h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: .2px; }
.chem-stage-actions { display: flex; gap: 6px; flex: none; }

.chem-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.chem-btn:hover { border-color: var(--accent); color: var(--accent); }
.chem-btn-side { display: none; }

.chem-eq-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 18px 14px;
}
.chem-eq {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: .2px;
  color: var(--ink);
  padding: 8px 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 9px;
  line-height: 1.5;
}
.chem-eq-empty { color: var(--muted); }
.chem-eq .arr {
  position: relative;
  display: inline-block;
  padding: 0 .55em;
  color: var(--accent);
}
.chem-eq .arr i {
  position: absolute;
  left: 50%;
  top: -1.05em;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  font-family: var(--font-main);
}
.chem-type {
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  line-height: 1.6;
}

.chem-canvas-box {
  position: relative;
  margin: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  overflow: hidden;
}
.chem-canvas-box canvas { display: block; width: 100%; height: clamp(360px, 52vh, 560px); }

.chem-canvas-tip {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
  pointer-events: none;
}
.chem-canvas-tip[hidden] { display: none; }
.chem-canvas-tip b { font-size: 15px; color: var(--ink); font-weight: 600; }
.chem-canvas-tip span { font-size: 12.5px; color: var(--muted); max-width: 340px; line-height: 1.7; }

.chem-controls {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.chem-controls[hidden] { display: none; }
.chem-ctl {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
}
.chem-ctl:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.chem-speed { display: flex; gap: 2px; padding-left: 4px; border-left: 1px solid var(--line); }
.chem-speed button {
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  padding: 5px 7px;
  cursor: pointer;
}
.chem-speed button.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }

.chem-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}
.chem-note {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 13px;
}
.chem-note-k {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: .6px;
  color: var(--accent);
  margin-bottom: 6px;
}
.chem-note p { margin: 0; font-size: 12.5px; line-height: 1.75; color: color-mix(in srgb, var(--ink) 88%, transparent); }
.chem-note-warn { border-color: color-mix(in srgb, #e0644d 30%, var(--line)); }
.chem-note-warn .chem-note-k { color: #e0644d; }

.chem-foot-note {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.8;
  padding: 12px 4px 0;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .chem-main { grid-template-columns: 280px minmax(0, 1fr); padding-left: 14px; padding-right: 14px; }
  .chem-notes { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .chem-main { grid-template-columns: minmax(0, 1fr); padding-top: calc(var(--tb-h, 60px) + 12px); padding-left: 10px; padding-right: 10px; }
  .chem-side {
    position: fixed;
    z-index: 950;
    left: 8px; right: 8px;
    top: calc(var(--tb-h, 60px) + 8px);
    height: calc(100dvh - var(--tb-h, 60px) - 20px);
    transform: translateX(calc(-100% - 20px));
    transition: transform .22s var(--ease);
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
  }
  .chem-side.open { transform: none; }
  .chem-btn-side { display: inline-flex; }
  .chem-canvas-box canvas { height: clamp(280px, 44vh, 420px); }
  .chem-canvas-box { min-height: clamp(280px, 44vh, 420px); margin: 0 8px; }
  .chem-stage-head { padding: 12px 12px 8px; gap: 8px; }
  .chem-stage-title h2 { font-size: 16.5px; }
  .chem-crumb { font-size: 11px; }
  .chem-eq-row { padding: 2px 12px 10px; gap: 8px; }
  .chem-eq { font-size: 13px; padding: 7px 10px; }
  .chem-notes { padding: 10px; gap: 8px; }
  .chem-foot-note { padding: 10px 6px 0; }
}

/* 手机端抽屉遮罩：点击关闭侧栏，锁定背景滚动 */
.chem-scrim {
  display: none;
}
@media (max-width: 860px) {
  .chem-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 940;
    background: rgba(10, 14, 20, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease);
  }
  .chem-scrim.show { opacity: 1; pointer-events: auto; }
}

/* ============================================================
   演示模式切换（微观 / Manim / 结构式）
   ============================================================ */
.chem-modes {
  display: flex;
  gap: 6px;
  padding: 0 18px;
  margin: 2px 0 10px;
  flex-wrap: wrap;
}
.chem-modes button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.chem-modes button:hover { color: var(--ink); border-color: var(--ink); }
.chem-modes button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.chem-modes button svg { flex: none; }

/* 画布区替代容器（Manim / 结构式共用）；flex 居中让矮 host 垂直居中不留白 */
#chemAlt { position: absolute; inset: 0; overflow: auto; display: flex; align-items: center; justify-content: center; }
.chem-canvas-box { position: relative; min-height: clamp(360px, 52vh, 560px); }
#chemAlt .manim-host { width: 100%; background: #10131A; }
#chemAlt .manim-host canvas { margin: 0 auto; display: block; }

/* ============================================================
   结构式模式（ChemDoodle）
   ============================================================ */
.cd-wrap {
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100%;
}
.cd-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}
.cd-side {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.cd-card {
  background: #FDFDFB;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  overflow: hidden;
  flex: none;
}
.cd-card canvas { display: block; }
.cd-formula {
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  background: var(--soft, rgba(128,128,128,.08));
  border: 1px solid var(--line, rgba(128,128,128,.25));
  border-radius: 10px;
  padding: 14px 18px;
  letter-spacing: .02em;
  flex: none;
}
.cd-plus { font-size: 20px; color: var(--muted); font-weight: 600; padding: 0 2px; }
.cd-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 130px;
  flex: none;
  margin: 0 4px;
}
.cd-cond {
  font-size: 12.5px;
  color: var(--accent, #E8A33D);
  font-weight: 600;
  margin-bottom: 3px;
  min-height: 16px;
}
.cd-arrow svg { width: 120px; height: 12px; overflow: visible; }
.cd-arrow line { stroke: var(--ink); stroke-width: 1.6; }
.cd-arrow path { fill: var(--ink); }
.cd-type-badge {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
}
.cd-hide { opacity: 0; transform: translateY(6px); }
.cd-side, .cd-arrow, .cd-type-badge {
  transition: opacity .5s ease, transform .5s ease;
}
.cd-empty {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 20px;
}

@media (max-width: 860px) {
  .chem-modes { padding: 0 10px; }
  .chem-modes button { padding: 5px 10px; font-size: 12px; }
  .cd-card { max-width: 42vw; }
  .cd-card canvas { max-width: 100%; height: auto; }
  .cd-formula { font-size: 16px; padding: 10px 12px; border-radius: 8px; }
  .cd-plus { font-size: 16px; }
  .cd-arrow { min-width: 96px; }
  .cd-arrow svg { width: 88px; }
  .cd-wrap { padding: 12px 8px; }
}

/* ============================================================
   3D 微观模式（edu-chem-reaction 内核）
   ============================================================ */
.edu3d-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; }
.edu3d-stage {
  position: relative; flex: 1; min-height: 0;
  background: #eef2f7;
  cursor: grab;
}
.edu3d-stage:active { cursor: grabbing; }
.edu3d-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.edu3d-cons {
  position: absolute; top: 10px; left: 10px; right: 10px;
  display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none;
}
.edu3d-tag {
  font-size: 11px; font-weight: 600; color: #1e3932;
  background: rgba(255,255,255,.85); border: 1px solid rgba(0,98,65,.35);
  border-radius: 999px; padding: 2px 9px; line-height: 1.6;
}
.edu3d-zoom { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.edu3d-zoom button {
  width: 32px; height: 32px; border: 1px solid rgba(51,65,85,.25); border-radius: 8px;
  background: rgba(255,255,255,.9); color: #334155; font-size: 15px; cursor: pointer;
}
.edu3d-zoom button:hover { background: #fff; border-color: #006241; color: #006241; }
.edu3d-step {
  position: absolute; left: 12px; bottom: 10px; right: 12px;
  font-size: 12px; color: #475569; pointer-events: none;
  background: rgba(255,255,255,.8); border-radius: 8px; padding: 6px 10px; line-height: 1.5;
}
.edu3d-step b { color: #006241; margin-right: 8px; }
.edu3d-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: rgba(255,255,255,.6);
  border-top: 1px solid rgba(51,65,85,.12);
}
.edu3d-play {
  width: 32px; height: 32px; flex: none; border: 1px solid rgba(51,65,85,.25);
  border-radius: 8px; background: #fff; color: #006241; font-size: 13px; cursor: pointer;
}
.edu3d-slider { flex: 1; accent-color: #006241; height: 4px; cursor: pointer; }
.edu3d-pct { font-size: 11px; font-weight: 600; color: #64748b; width: 34px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }

/* ============================================================
   实验视频模式
   ============================================================ */
.chem-vwrap { position: absolute; inset: 0; overflow-y: auto; padding: 14px; }
.chem-v-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chem-v-filters button {
  padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; font-family: inherit;
}
.chem-v-filters button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chem-v-group-head { font-size: 11.5px; color: var(--muted); letter-spacing: .4px; margin: 4px 0 10px; }
.chem-v-related { margin-bottom: 16px; }
.chem-v-related .chem-v-group-head { color: var(--accent); font-weight: 600; }
.chem-v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.chem-v-card {
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px;
  color: var(--ink); font-family: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.chem-v-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.chem-v-stage {
  font-size: 10px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px; padding: 0 8px; line-height: 16px;
}
.chem-v-title { font-size: 13px; font-weight: 600; line-height: 1.45; }
.chem-v-unit { font-size: 11px; color: var(--muted); }
.chem-vplay { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.chem-vplay-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); flex: none;
}
.chem-vplay-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chem-vback, .sl-back {
  flex: none; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; font-family: inherit;
}
.chem-vback:hover, .sl-back:hover { border-color: var(--accent); color: var(--accent); }
.chem-vopen, .sl-newwin { flex: none; font-size: 12px; color: var(--accent); text-decoration: none; }
.chem-vopen:hover, .sl-newwin:hover { text-decoration: underline; }
.chem-vframe { flex: 1; min-height: 0; background: #000; }
.chem-vframe iframe { width: 100%; height: 100%; border: 0; display: block; }
.chem-vnote { flex: none; margin: 0; padding: 8px 14px; font-size: 11px; color: var(--muted); }

/* ============================================================
   虚拟实验模式（ScienceLab 3D）
   ============================================================ */
.sl-wrap { position: absolute; inset: 0; overflow-y: auto; padding: 14px; }
.sl-head { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.sl-sub { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.sl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.sl-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  color: var(--ink); font-family: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.sl-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 14%, transparent); }
.sl-emoji { font-size: 22px; line-height: 1; }
.sl-card b { font-size: 13.5px; font-weight: 650; }
.sl-desc { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.sl-note { font-size: 11px; color: var(--muted); margin: 14px 0 0; }
.sl-play { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.sl-play-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
.sl-play-head b { flex: 1; min-width: 0; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-frame { flex: 1; min-height: 0; background: #05070c; }
.sl-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 860px) {
  .chem-modes button { padding: 5px 9px; font-size: 11.5px; gap: 4px; }
  .chem-v-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .sl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .edu3d-step { font-size: 11px; }
}
