:root {
  --bg: #faf7fc;
  --panel: #ffffff;
  --panel-2: #fcfaff;
  --text: #1f1830;
  --text-2: #443a58;
  --muted: #6a6078;
  --faint: #918aa3;
  --border: #ece3f5;
  --axis: #ded3ec;
  --accent: #7a4bc8;
  --accent-deep: #3f2170;
  --accent-soft: #f6f0fe;
  --chip: #efe4fb;
  --danger: #d9534f;
  --warning: #c9871a;
  --ok: #2e7d5b;
  --dot0: #ddd0f2; --dot1: #b79ee0; --dot2: #9b6dd6; --dot3: #6a3fa0;
  --shadow: 0 1px 2px rgba(38,22,66,.06), 0 8px 24px rgba(38,22,66,.06);
  --plot-bg: #ffffff;

  /* 三维画面用色（换主题跟着变，canvas 每帧读） */
  --atom-c: #6a3fa0;   /* 中心原子（模型页的通用原子） */
  --atom-l: #9a93ad;   /* 配位原子（模型页的通用原子） */
  --bond: #b9b2c8;
  --lp: #b79ee0;       /* 孤对云（比中心原子浅一档，避免糊在一起） */
  --arc: rgba(106, 63, 160, .45);
  --star: #b8863f;     /* 反轴（Sₙ）专用：与紫色的真轴区分开 */

  /* 主题分层：--solid 用于「深底 + 白字」的实心按钮 */
  --solid: #5e33a0;
  --hdr-bg: linear-gradient(135deg,#3f2170 0%,#7a4bc8 56%,#b06bc9 100%);
  --hdr-fg: #ffffff;
  --hdr-btn-fg: rgba(255,255,255,.86);
  --hdr-btn-bg: rgba(255, 255, 255, .12);
  --hdr-btn-bd: rgba(255, 255, 255, .4);
  --hdr-btn-hover: rgba(255, 255, 255, .25);
  --hdr-tab-on-bg: #ffffff;
  --hdr-tab-on-fg: #3f2170;
  --hdr-logo-bd: rgba(255, 255, 255, .85);
  --hdr-shadow: 0 2px 12px rgba(63,33,112,.18);
  --band-bg: linear-gradient(135deg,#3f2170,#7a4bc8);
}

:root[data-theme="dark"] {
  --bg: #130d1e;
  --panel: #1e1630;
  --panel-2: #191227;
  --text: #efe9f8;
  --text-2: #d2c8e6;
  --muted: #a79dc0;
  --faint: #857ba0;
  --border: #342a4a;
  --axis: #453a5e;
  --accent: #b98cf0;
  --accent-deep: #dcc0ff;
  --accent-soft: #271c3c;
  --chip: #302448;
  --danger: #e57373;
  --warning: #d9a441;
  --ok: #5fbf94;
  --dot0: #4a3a68; --dot1: #8064ad; --dot2: #a888e0; --dot3: #cbb0f2;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 28px rgba(0,0,0,.3);
  --plot-bg: #1e1630;
  --atom-c: #b28ce8;
  --atom-l: #8d84a4;
  --bond: #55496b;
  --lp: #d3bdf6;
  --arc: rgba(178, 140, 232, .5);
  --star: #d8a45f;
  --hdr-bg: linear-gradient(135deg,#1b0f2e 0%,#3d1f66 58%,#5b2a7d 100%);
  --hdr-tab-on-fg: #2a1450;
}

/* 魔法模式：魔法少女小圆 · 鹿目圆印象色（淡樱粉 + 奶油白 + 星金） */
:root[data-theme="magic"] {
  --bg: #fff6fa;
  --panel: #ffffff;
  --panel-2: #fffafc;
  --text: #3b1526;
  --text-2: #5f2a42;
  --muted: #8c5c72;
  --faint: #b38d9e;
  --border: #f8dce8;
  --axis: #f1c9d9;
  --accent: #ec6e9c;
  --accent-deep: #a83a64;
  --accent-soft: #ffeff6;
  --chip: #ffdcea;
  --danger: #d9534f;
  --warning: #c9871a;
  --ok: #2e7d5b;
  --dot0: #ffe2ee; --dot1: #f9bcd2; --dot2: #ef8fb2; --dot3: #d4688f;
  --shadow: 0 1px 2px rgba(122,28,66,.06), 0 8px 24px rgba(122,28,66,.07);
  --plot-bg: #fffdfe;
  --atom-c: #d0688e;
  --atom-l: #d8a45f;
  --bond: #e3bccd;
  --lp: #ffc3dc;
  --arc: rgba(176, 74, 114, .42);
  --star: #d8a45f;
  --solid: #a83a64;
  --hdr-bg: linear-gradient(135deg,#ffd9e8 0%,#f7bcd4 52%,#e8a8c6 100%);
  --hdr-fg: #7b2f4d;
  --hdr-btn-fg: #8a4260;
  --hdr-btn-bg: rgba(255, 255, 255, .62);
  --hdr-btn-bd: rgba(214, 120, 155, .36);
  --hdr-btn-hover: rgba(255, 255, 255, .95);
  --hdr-tab-on-bg: #ffffff;
  --hdr-tab-on-fg: #a83a64;
  --hdr-logo-bd: rgba(255, 255, 255, .9);
  --hdr-shadow: 0 1px 3px rgba(122,28,66,.07), inset 0 -2px 0 #e8b84b;
  --band-bg: linear-gradient(135deg,#a83a64,#d0688e);
}
:root[data-theme="magic"] input[type="checkbox"] { accent-color: var(--accent-deep); }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background .25s, color .25s;
  font-size: 13px;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ================= 顶栏 ================= */
header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  height: 48px;
  background: var(--hdr-bg);
  color: var(--hdr-fg);
  box-shadow: var(--hdr-shadow);
  z-index: 5;
  flex: none;
}
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: #fff;
  padding: 2px; border: 1.5px solid var(--hdr-logo-bd);
}
.brand .titles h1 { font-size: 15px; font-weight: 700; letter-spacing: .3px; line-height: 1.1; }
.brand .titles p { font-size: 10.5px; opacity: .85; margin-top: 1px; }

nav.tabs { display: flex; gap: 4px; margin-left: 6px; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  flex: none; border: 1px solid var(--hdr-btn-bd); background: var(--hdr-btn-bg);
  color: var(--hdr-btn-fg); padding: 6px 13px; border-radius: 8px; font-size: 12.5px; transition: .15s;
}
nav.tabs button:hover { background: var(--hdr-btn-hover); }
nav.tabs button.on {
  background: var(--hdr-tab-on-bg); color: var(--hdr-tab-on-fg);
  font-weight: 700; border-color: var(--hdr-tab-on-bg);
}

.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tbtn {
  border: 1px solid var(--hdr-btn-bd); background: var(--hdr-btn-bg);
  color: var(--hdr-btn-fg); padding: 6px 11px; border-radius: 8px; font-size: 12px; transition: .15s;
}
.tbtn:hover { background: var(--hdr-btn-hover); }

/* —— 三档主题控件 —— */
.tseg { position: relative; display: flex; align-items: center; }
.tseg-menu { display: flex; align-items: center; gap: 2px; padding: 2px 3px;
             border: 1px solid var(--hdr-btn-bd); background: var(--hdr-btn-bg); border-radius: 8px; }
.tseg-menu button {
  border: 0; background: transparent; color: var(--hdr-btn-fg); font-size: 12px;
  padding: 4px 9px; border-radius: 6px; transition: .15s; white-space: nowrap;
}
.tseg-menu button:hover { background: var(--hdr-btn-hover); }
.tseg-menu button.on { background: var(--hdr-tab-on-bg); color: var(--hdr-tab-on-fg); font-weight: 700; }
.tseg-cur { display: none; }
@media (max-width: 900px) {
  .tseg-menu { display: none; }
  .tseg.open .tseg-menu {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; right: 0; top: calc(100% + 7px); min-width: 100px; padding: 4px;
    background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 10px 26px rgba(34, 26, 48, .18); z-index: 90;
  }
  .tseg.open .tseg-menu button { color: var(--text); text-align: center; padding: 9px 10px; font-size: 12px; }
  .tseg.open .tseg-menu button.on { background: var(--accent-soft); color: var(--accent-deep); }
  .tseg-cur {
    display: flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 8px;
    border: 1px solid var(--hdr-btn-bd); background: var(--hdr-btn-bg);
    color: var(--hdr-btn-fg); font-size: 11px; white-space: nowrap;
  }
  .tseg-cur::before { content: ""; width: 9px; height: 9px; border-radius: 50%;
                      background: var(--accent); box-shadow: 0 0 0 1.5px var(--hdr-tab-on-bg); }
  .tseg-cur::after { content: "▾"; font-size: 9px; opacity: .8; }
}

/* ================= 主区 ================= */
main { flex: 1; display: grid; grid-template-columns: 288px minmax(0, 1fr) 306px; min-height: 0; }
main.single { grid-template-columns: minmax(0, 1fr); }
.parambar, .settings {
  background: var(--panel-2); overflow-y: auto; padding: 12px 13px;
  border-right: 1px solid var(--border);
}
.settings { border-right: none; border-left: 1px solid var(--border); }
.stage { min-height: 0; padding: 10px; display: flex; }

/* ================= 三维卡片 ================= */
.viz-card {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.viz-hd {
  padding: 8px 13px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--border); display: flex; align-items: baseline; gap: 9px;
}
.viz-sub { font-size: 11px; font-weight: 400; color: var(--faint); }
.viz-body { position: relative; flex: 1; min-height: 0; background: var(--plot-bg); }
.viz-body canvas { position: absolute; inset: 0; display: block; cursor: grab; touch-action: none; }
.viz-body canvas.grab { cursor: grabbing; }
.plates { position: absolute; left: 11px; top: 11px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.plate {
  display: flex; align-items: baseline; gap: 7px; padding: 4px 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); font-size: 11px; color: var(--text-2);
}
.plate i { font-style: normal; font-size: 10px; color: var(--faint); }
.plate b { font-size: 12.5px; color: var(--accent-deep); }
.plate.el { background: var(--accent-soft); }
.plate.hy { background: var(--chip); }
.plate.hy b { letter-spacing: .4px; }
.plate.ax { align-self: flex-start; padding: 3px 9px; }
.plate.ax b { font-size: 13px; letter-spacing: .5px; }
.viz-hint {
  position: absolute; right: 11px; bottom: 9px; font-size: 10.5px; color: var(--faint); pointer-events: none;
}

/* ================= 栏内版块 ================= */
.pane-sec { margin-bottom: 14px; }
.pane-hd {
  font-size: 12px; font-weight: 700; color: var(--accent-deep); letter-spacing: .3px;
  margin-bottom: 8px; display: flex; align-items: baseline; gap: 6px;
}
.pane-note { font-size: 10.5px; font-weight: 400; color: var(--faint); }

.addgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.addbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 6px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel); color: var(--text-2); font-size: 11px; transition: .15s;
}
.addbtn:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.addbtn svg { width: 34px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.addbtn svg circle { fill: var(--chip); stroke: currentColor; stroke-width: 1.2; }
.addbtn svg ellipse { fill: var(--chip); stroke: currentColor; stroke-width: 1.2; }
.addbtn.lp svg ellipse { fill: var(--chip); opacity: .85; }
.addbtn.lp svg ellipse.in { fill: none; stroke-dasharray: 2 2; opacity: .8; }

.dometer { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.dometer b { color: var(--accent-deep); font-size: 12px; }
.dbar { flex: 1; max-width: 96px; height: 5px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.dbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s; }

.btnrow { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.mini {
  flex: 1; min-width: 66px; padding: 6px 8px; font-size: 11.5px; border-radius: 8px;
  border: 1px solid var(--solid); background: var(--solid); color: #fff; transition: .15s;
}
.mini:hover { filter: brightness(1.07); }
.mini.ghost { background: var(--panel); color: var(--accent-deep); border-color: var(--border); }
.mini.ghost:hover { background: var(--accent-soft); filter: none; }
.mini:disabled { opacity: .4; cursor: not-allowed; filter: none; }

.axbig {
  font-size: 27px; font-weight: 800; color: var(--accent-deep); letter-spacing: 1.5px;
  line-height: 1.1; margin: 1px 0 9px; font-variant-numeric: tabular-nums;
}
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); white-space: nowrap; }
.kv b { color: var(--text); text-align: right; font-weight: 600; }

.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pst {
  text-align: left; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); padding: 6px 8px; transition: .15s;
}
.pst:hover { border-color: var(--accent); }
.pst b { display: block; font-size: 11.5px; color: var(--text); font-weight: 600; }
.pst span { font-size: 10px; color: var(--faint); }
.pst.on { border-color: var(--accent); background: var(--accent-soft); }
.pst.on b { color: var(--accent-deep); }

.chk { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.chk input { width: 15px; height: 15px; accent-color: var(--accent); flex: none; }

.seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 6px; font-size: 11.5px; color: var(--text-2); transition: .15s; }
.seg button:hover { background: var(--accent-soft); }
.seg button.on { background: var(--solid); color: #fff; font-weight: 700; }

.note { font-size: 11px; line-height: 1.75; color: var(--muted); margin-top: 7px; }
.note b { color: var(--text-2); }

.mollist { display: flex; flex-direction: column; gap: 5px; }
.mbtn {
  display: flex; align-items: baseline; gap: 8px; text-align: left;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); transition: .15s;
}
.mbtn:hover { border-color: var(--accent); }
.mbtn b { font-size: 12.5px; color: var(--text); min-width: 52px; }
.mbtn span { font-size: 10.5px; color: var(--faint); }
.mbtn.on { border-color: var(--accent); background: var(--accent-soft); }
.mbtn.on b { color: var(--accent-deep); }

.ctbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ctbl th { text-align: left; font-size: 10.5px; color: var(--muted); font-weight: 600; padding: 3px 4px; border-bottom: 1px solid var(--border); }
.ctbl th:not(:first-child) { text-align: right; }
.ctbl td { padding: 5px 4px; border-bottom: 1px dashed var(--border); font-size: 11px; color: var(--text-2); }
.ctbl tr:last-child td { border-bottom: none; }
.nu { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctbl td.nu { text-align: right; }
.dim { color: var(--muted); }
.ok { color: var(--ok); } .warn { color: var(--warning); } .bad { color: var(--danger); }
.mt8 { margin-top: 8px; }

/* ================= 总表 ================= */
.tblcard { min-height: 0; max-width: 1140px; margin: 0 auto; width: 100%; }
.tblwrap { flex: 1; overflow: auto; padding: 2px 12px 8px; }
.vtbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.vtbl th {
  position: sticky; top: 0; z-index: 2; background: var(--accent-soft); color: var(--accent-deep);
  font-size: 11px; text-align: left; padding: 8px 9px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.vtbl td { padding: 9px; border-bottom: 1px dashed var(--border); color: var(--text-2); }
.vtbl tbody tr { cursor: pointer; }
.vtbl tbody tr:hover td { background: var(--accent-soft); }
.vtbl td.em { color: var(--text); font-weight: 600; }
.vtbl td.nu { text-align: left; }
.vtbl td.go { color: var(--accent); font-size: 11px; text-align: right; white-space: nowrap; }
.tbl-foot { padding: 8px 14px 12px; border-top: 1px solid var(--border); }

/* ================= 页脚 ================= */
.foot {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px; background: var(--panel); border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted);
}
.foot-right .pill {
  background: var(--accent-soft); color: var(--accent-deep); padding: 3px 10px; border-radius: 999px;
  font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
}
.foot-right .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ================= 弹层 ================= */
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(20, 14, 30, .42); }
.modal-box {
  position: relative; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow);
  width: min(860px, 92vw); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-hd { padding: 13px 18px; font-size: 15px; font-weight: 700; color: #fff; background: var(--band-bg); }
.modal-x { position: absolute; top: 8px; right: 12px; background: transparent; border: none; color: #fff; font-size: 22px; line-height: 1; }
.modal-bd { padding: 16px 20px; overflow-y: auto; line-height: 1.8; font-size: 13px; color: var(--text-2); }
.modal-bd h2 { font-size: 16px; color: var(--accent-deep); margin-bottom: 8px; }
.modal-bd h3 { font-size: 13.5px; color: var(--text); margin: 13px 0 4px; }
.modal-bd p { margin-bottom: 9px; }
.modal-bd ul { margin: 6px 0 10px 20px; }
.modal-bd li { margin-bottom: 4px; }
.modal-bd b { color: var(--text); }

/* 习题 */
.ex-list { display: flex; flex-direction: column; gap: 12px; }
.ex-item { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; background: var(--panel-2); }
.ex-q { font-size: 13px; color: var(--text); line-height: 1.75; }
.ex-no { display: inline-block; background: var(--chip); color: var(--accent-deep); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-right: 7px; }
.ex-load, .ex-toggle {
  margin-top: 9px; margin-right: 8px; border: 1px solid var(--solid); background: var(--solid); color: #fff;
  border-radius: 7px; padding: 5px 12px; font-size: 12px;
}
.ex-toggle { background: var(--panel); color: var(--accent-deep); }
.ex-a { margin-top: 10px; padding: 10px 12px; background: var(--accent-soft); border-radius: 8px; font-size: 12.5px; line-height: 1.8; color: var(--text-2); }

/* ================= 轻提示 ================= */
.toast {
  position: fixed; left: 50%; bottom: 58px; transform: translate(-50%, 10px);
  background: var(--accent-deep); color: #fff; padding: 8px 15px; border-radius: 999px;
  font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; z-index: 80;
  box-shadow: var(--shadow);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ================= 手机 ================= */
@media (max-width: 900px) {
  body { overflow: auto; height: auto; min-height: 100%; }
  header { height: auto; min-height: 46px; flex-wrap: wrap; padding: 6px 9px; gap: 8px; }
  .brand .titles h1 { font-size: 13.5px; }
  .brand .titles p { display: none; }
  .brand .logo { width: 26px; height: 26px; }
  nav.tabs { order: 4; width: 100%; margin: 0; padding-bottom: 2px; }
  nav.tabs button { padding: 7px 12px; font-size: 12px; }
  .top-actions { margin-left: auto; gap: 4px; }
  .tbtn { padding: 6px 9px; font-size: 11.5px; }

  main { display: flex; flex-direction: column; overflow: visible; }
  .stage { order: 1; height: 60vh; min-height: 330px; padding: 8px; }
  .parambar { order: 2; border-right: none; border-top: 1px solid var(--border); overflow: visible; padding: 10px 10px 2px; background: var(--bg); }
  .settings { order: 3; border-left: none; border-top: 1px solid var(--border); overflow: visible; padding: 10px 10px 2px; background: var(--bg); }

  .pane-sec {
    background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
    margin-bottom: 8px; overflow: hidden;
  }
  .pane-hd { padding: 12px 12px; margin: 0; cursor: pointer; position: relative; font-size: 12.5px; }
  .pane-hd::after { content: "▾"; position: absolute; right: 12px; top: 11px; color: var(--faint); font-size: 11px; transition: .15s; }
  .pane-sec.closed .pane-hd::after { transform: rotate(-90deg); }
  .pane-sec > *:not(.pane-hd) { margin-left: 12px; margin-right: 12px; }
  .pane-sec > *:last-child { margin-bottom: 12px; }
  .pane-sec.closed > *:not(.pane-hd) { display: none; }

  .addbtn { padding: 11px 4px 9px; font-size: 11.5px; }
  .chk { padding: 10px 2px; font-size: 12.5px; }
  .chk input { width: 17px; height: 17px; }
  .seg button { padding: 11px 6px; font-size: 12px; }
  .mini { padding: 10px 8px; font-size: 12px; }
  .pst { padding: 9px 8px; }
  .mbtn { padding: 11px 9px; }
  .kv { padding: 6px 0; font-size: 12px; }
  .ctbl td, .ctbl th { font-size: 11.5px; }

  .vtbl th { font-size: 10.5px; padding: 7px 6px; }
  .vtbl td { padding: 8px 6px; font-size: 11.5px; }
  .tblwrap { padding: 0 6px 6px; overflow-x: auto; }
  /* 手机上收起「电子几何 / AX 记号 / 载入」三列，整行仍可点 */
  .vtbl th:nth-child(3), .vtbl td:nth-child(3),
  .vtbl th:nth-child(7), .vtbl td:nth-child(7),
  .vtbl th:nth-child(9), .vtbl td:nth-child(9) { display: none; }
  .vtbl td, .vtbl th { white-space: nowrap; }
  main.single .stage { height: auto; min-height: 470px; }
  main.single .tblwrap { max-height: none; }

  .foot { flex-direction: column; align-items: flex-start; gap: 5px; padding: 8px 12px; }
  .modal-box { width: 94vw; max-height: 84vh; }
  .modal-bd { padding: 13px 14px; font-size: 12.5px; }
}

/* ================= 多核分子 / 环己烷 ================= */
.viz-card.plain .plates { display: none; }

.curve-card {
  border-top: 1px solid var(--border); background: var(--panel);
  padding: 5px 8px 6px; flex: none;
}
.curve-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 1px 5px 3px;
}
.curve-hd b { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.curve-hd span { font-size: 10px; color: var(--faint); }
#ecurve {
  display: block; width: 100%; height: 146px;
  cursor: crosshair; touch-action: none; border-radius: 8px;
}

.confgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.conf {
  text-align: left; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel); transition: .15s;
}
.conf:hover { border-color: var(--accent); }
.conf b { display: block; font-size: 12.5px; color: var(--text); font-weight: 600; }
.conf span { font-size: 10px; color: var(--faint); }
.conf.on { border-color: var(--accent); background: var(--accent-soft); }
.conf.on b { color: var(--accent-deep); }

@media (max-width: 900px) {
  #ecurve { height: 122px; }
  .curve-hd span { display: none; }
}

/* ---------- 点群习题页 ---------- */
.viz-card.plain.pg .plates { display: flex; }
.plate.pg b { font-size: 17px; letter-spacing: .5px; }
/* 左栏的点群结构按钮：只写名字，不带题号 */
.mbtn.pgm { justify-content: flex-start; font-size: 12.5px; color: var(--text); }

/* 对称元素浮层（照晶体查看器那套：点开抽屉，逐项勾选） */
.symwrap { position: relative; }
.symwrap .mini { display: flex; align-items: center; gap: 6px; width: 100%; justify-content: center; }
.symwrap .mini .cnt {
  min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: 10.5px;
  background: var(--chip); color: var(--accent-deep); font-variant-numeric: tabular-nums;
}
.sympop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  width: 214px; padding: 9px 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 26px rgba(34, 26, 48, .16);
}
.sympop .btnrow { margin-top: 7px; }
.symlist { display: flex; flex-direction: column; gap: 2px; }
.symrow {
  display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: 7px;
  font-size: 11.5px; color: var(--text-2); cursor: pointer;
}
.symrow:hover { background: var(--accent-soft); }
.symrow.on { background: var(--accent-soft); color: var(--accent-deep); }
.symrow input { accent-color: var(--accent); margin: 0; }
.symrow span { flex: 1; }
.symrow i { font-style: normal; font-size: 10px; color: var(--faint); }
.pgplist { display: flex; flex-wrap: wrap; gap: 5px; }
.pgp {
  padding: 5px 9px; border-radius: 7px; cursor: pointer;
  font: inherit; font-size: 11px; line-height: 1.3;
  background: var(--panel); color: var(--text-2);
  border: 1px solid var(--border); text-align: left;
}
.pgp:hover { border-color: var(--accent); color: var(--accent-deep); }
.pgp.on { background: var(--solid); border-color: var(--solid); color: #fff; }
.sld { margin-top: 9px; }
.sld label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.sld label b { color: var(--accent-deep); font-size: 12.5px; }
.sld input[type=range] { width: 100%; accent-color: var(--accent); }
