/* chemistry.mrfay.cn 化学实验室 · 全站共用样式（2026-12-04）
   和 mrfay.cn 主站同一套简约黑底：系统字体，底色只有黑和 #1c1c1e，强调色只有蓝 #2b8cff，分栏用一根发丝线。
   版式照 mrfay.cn/lab/lens.html；每页自己的样式写在页内。
   备案号由 build.py 插在页脚结束标签前，这里的注释里别写那个标签。 */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro SC", "SF Pro Text", "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --math: "Times New Roman", "Times", "Noto Serif", serif;
  --fg: #f5f5f7;
  --fg2: #a1a1a6;
  --fg3: #6e6e73;
  --line: #2c2c2e;
  --band: #1c1c1e;
  --blue: #2b8cff;
  --blue-h: #4a9dff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #000; color-scheme: dark; }
body { margin: 0; background: #000; color: var(--fg); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.m { display: none; }
.wrap { max-width: 1152px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
sub, sup { font-size: 0.72em; line-height: 0; }
i.v { font-family: var(--math); }

/* 化学方程式：反应条件写在等号上方（下方用 .dn），等号拉长 */
.ce { white-space: nowrap; font-variant-numeric: lining-nums; }
.eqs { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 2.6em; margin: 0 0.3em;
  vertical-align: middle; line-height: 1.15; }
.eqs small { font-size: 0.62em; color: var(--fg2); white-space: nowrap; }
.eqs::before { content: ""; order: 1; align-self: stretch; height: 0.28em; margin: 0.08em 0; border-top: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.eqs small.dn { order: 2; }
.eqs.bare { height: 1em; }

/* 导航（同主站） */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(22, 22, 23, 0.8); border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 56px; }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { width: auto; height: 19px; }
.links { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; }
.links a { font-size: 14px; font-weight: 500; color: var(--fg2); white-space: nowrap; transition: color 0.2s; }
.links a:hover, .links a[aria-current] { color: var(--fg); }
.nav .btn { margin-left: auto; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 20px; border: 0; border-radius: 9999px;
  font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; transition: background 0.2s; }
.btn.pri { background: var(--blue); color: #fff; }
.btn.pri:hover { background: var(--blue-h); }
.btn.alt { background: var(--band); color: var(--fg); }
.btn.alt:hover { background: #2c2c2e; }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.pri:disabled:hover { background: var(--blue); }
.btn.alt:disabled:hover { background: var(--band); }

/* 页头 */
.top { padding-top: 80px; text-align: center; }
.eyebrow { margin: 0; font-size: 15px; font-weight: 500; color: var(--fg2); }
h1 { margin: 14px 0 0; font-size: 60px; line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; }
.lede { max-width: 34em; margin: 20px auto 0; font-size: 17px; line-height: 1.65; color: var(--fg2); }

/* 小节：小标题 + 大标题，左对齐 */
.sec { padding-top: 112px; }
.kicker { margin: 0; font-size: 17px; font-weight: 600; color: var(--blue); }
h2 { margin: 4px 0 0; font-size: 38px; line-height: 1.12; font-weight: 700; letter-spacing: -0.015em; }
h3 { margin: 0; font-size: 19px; line-height: 28px; font-weight: 600; }
.sec > .lede { margin-left: 0; }

/* 实验画面：圆角黑框，画布铺满 */
.stage { position: relative; margin-top: 40px; aspect-ratio: 2 / 1; max-height: calc(100svh - 140px); width: 100%;
  border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--line); touch-action: pan-y; }
.top + .wrap .stage { margin-top: 48px; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage.click { cursor: pointer; }
.stage:focus-visible { outline-offset: 4px; border-radius: 18px; }

/* 画面下面的读数和操作，居中排 */
.panel { display: grid; justify-items: center; gap: 18px; margin-top: 24px; text-align: center; }
.readout { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 36px; }
.ro { text-align: left; }
.ro .k { display: block; font-size: 12px; line-height: 1.4; color: var(--fg3); }
.ro .v { display: block; margin-top: 2px; font-size: 19px; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ro .v small { margin-left: 3px; font-size: 13px; font-weight: 400; color: var(--fg2); }
.ro .v.hi { color: var(--blue-h); }
.status { max-width: 40em; text-wrap: balance; margin: 0; min-height: 1.6em; font-size: 15px; line-height: 1.6; color: var(--fg2); }
.status b { font-weight: 600; color: var(--fg); }
.status .hi { color: var(--blue-h); }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; }
.hint { max-width: 38em; text-wrap: balance; margin: 0; font-size: 13px; line-height: 1.6; color: var(--fg3); }
.eqline { margin: 0; font-size: 19px; color: var(--fg); }

/* 胶囊按钮：选中变蓝 */
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { height: 32px; padding: 0 14px; border: 0; border-radius: 9999px; background: var(--band); color: var(--fg);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; transition: background 0.2s, color 0.2s, opacity 0.2s; }
.chip:hover { background: #2c2c2e; }
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; }
.chip:disabled { opacity: 0.35; cursor: default; }
.chip:disabled:hover { background: var(--band); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9999px; background: var(--band); }
.seg .chip { height: 30px; background: transparent; }
.seg .chip:hover { background: #2c2c2e; }
.seg .chip[aria-pressed="true"] { background: var(--blue); }

/* 滑条：白色圆钮，左边蓝色 */
.ctl { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; color: var(--fg2); white-space: nowrap; }
.ctl output { min-width: 4.2em; text-align: left; color: var(--fg); font-variant-numeric: tabular-nums; }
input[type="range"].sl { -webkit-appearance: none; appearance: none; width: min(220px, 50vw); height: 28px; margin: 0; background: transparent; cursor: pointer; --p: 0%; }
.sl::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--blue) var(--p), #3a3a3c var(--p)); }
.sl::-moz-range-track { height: 4px; border-radius: 2px; background: #3a3a3c; }
.sl::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--blue); }
.sl::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.sl::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }

/* 表格：发丝线 */
.tablewrap { margin-top: 40px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { padding: 0 16px 12px; text-align: left; font-size: 13px; font-weight: 500; color: var(--fg3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 16px; border-bottom: 1px solid var(--line); color: var(--fg2); transition: color 0.2s, background 0.2s; }
.tbl td:first-child { color: var(--fg); font-weight: 500; white-space: nowrap; }
.tbl tbody tr.pick { cursor: pointer; }
.tbl tbody tr.pick:hover td { background: rgba(255, 255, 255, 0.03); }
.tbl tr.on td { color: var(--fg); background: rgba(43, 140, 255, 0.08); }
.tbl tr.on td:first-child { color: var(--blue-h); box-shadow: inset 3px 0 0 var(--blue); }

/* 三栏 / 四栏：发丝线分隔 */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 56px 0 0; padding: 0; list-style: none; }
.cols.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols li { padding-top: 24px; border-top: 1px solid var(--line); }
.cols p { margin: 8px 0 0; font-size: 15px; line-height: 1.7; color: var(--fg2); }
.cols p b { font-weight: 600; color: var(--fg); }
.cols p.eq { margin-top: 12px; font-size: 17px; color: var(--fg); }
.cols .n { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--blue); }
.more { display: inline-block; margin-top: 10px; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 500; color: var(--blue); cursor: pointer; }
.more:hover { text-decoration: underline; }

/* 大段定义：居中的大字，关键词变蓝 */
.law { max-width: 30em; margin: 40px 0 0; font-size: 28px; line-height: 1.45; font-weight: 600; letter-spacing: -0.01em; }
.law em { font-style: normal; color: var(--blue-h); }

/* 小测：每题一栏，选项是胶囊；答完正确选项变蓝，选错的划掉 */
.quiz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin: 56px 0 0; padding: 0; list-style: none; counter-reset: q; }
.quiz > li { padding-top: 24px; border-top: 1px solid var(--line); counter-increment: q; }
.quiz .n::before { content: "第 " counter(q) " 题"; }
.quiz .n { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--blue); }
.quiz h3 { font-size: 17px; line-height: 1.6; }
.quiz .ask { margin: 8px 0 0; font-size: 15px; color: var(--fg2); }
.quiz .opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.quiz .opts .chip { height: auto; min-height: 32px; padding: 7px 14px; line-height: 1.35; white-space: normal; text-align: left; }
.quiz .opts .chip.no { background: transparent; color: var(--fg3); text-decoration: line-through; box-shadow: inset 0 0 0 1px var(--line); }
.quiz .fb { margin: 12px 0 0; font-size: 15px; line-height: 1.7; color: var(--fg2); }
.quiz .fb:empty { display: none; }
.quiz .fb b { font-weight: 600; color: var(--fg); }
.quiz .fb .ok { color: var(--blue-h); }
.score { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 40px; font-size: 15px; color: var(--fg2); }
.score b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }

.back { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 64px; padding-bottom: 112px; }

/* 页脚（同主站）；备案号由 build.py 插进来 */
footer { background: var(--band); color: var(--fg2); font-size: 13px; line-height: 1.6; }
.foot { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.foot .brand img { height: 17px; }
.foot p { margin: 12px 0 0; }
.foot h4 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--fg); }
.foot ul { margin: 0; padding: 0; list-style: none; }
.foot li + li { margin-top: 8px; }
.foot ul a:hover { color: var(--fg); }
.foot .sns a { display: flex; width: max-content; align-items: center; gap: 8px; }
.foot .sns .ico { width: 16px; height: 16px; flex: none; opacity: 0.8; transition: opacity 0.2s; }
.foot .sns a:hover .ico { opacity: 1; }
.base p { margin: 0; padding: 20px 0 6px; border-top: 1px solid var(--line); color: var(--fg3); text-align: center; }
footer > div[style] { max-width: 1152px; margin: 0 auto; padding: 0 32px 36px !important; text-align: center !important; font-size: 13px !important; color: var(--fg3) !important; }
footer > div[style] a:hover { color: var(--fg); }

@media (min-width: 640px) { .wrap { padding-left: 24px; padding-right: 24px; } }
@media (min-width: 1024px) { .wrap { padding-left: 32px; padding-right: 32px; } }
@media (max-width: 1023px) {
  .cols.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .foot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 734px) {
  .m { display: inline; }
  .nav .wrap { gap: 18px; height: 52px; }
  .links { gap: 16px; }
  .links .wide { display: none; }
  .brand img { height: 17px; }
  .top { padding-top: 56px; }
  h1 { font-size: 40px; line-height: 1.12; }
  h2 { font-size: 30px; line-height: 1.17; }
  .lede { font-size: 16px; }
  .sec { padding-top: 88px; }
  .stage { margin-top: 28px; aspect-ratio: 4 / 3; border-radius: 14px; }
  .top + .wrap .stage { margin-top: 36px; }
  .readout { gap: 12px 22px; }
  .ro .v { font-size: 17px; }
  .tablewrap { margin: 28px -16px 0; padding: 0 16px; }
  .tbl { font-size: 14px; }
  .tbl th { padding: 0 10px 10px; }
  .tbl td { padding: 14px 10px; }
  .cols, .cols.two, .cols.four, .quiz { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 40px; }
  .law { font-size: 22px; margin-top: 28px; }
  .back { margin-top: 48px; padding-bottom: 88px; }
  .foot { gap: 28px 16px; padding-top: 44px; }
  footer > div[style] { padding: 0 16px 32px !important; }
}
@media (max-width: 359px) { .links { display: none; } }
@media (min-width: 640px) and (max-width: 1023px) {
  footer > div[style] { padding: 0 24px 36px !important; }
}

/* ---------- 三维实验台页（一个实验一页）：左边实验台，右边操作、读数和步骤 ---------- */
.lab-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; max-width: 1640px; margin: 0 auto; padding: 26px 32px 18px; }
.lab-head .eyebrow { font-size: 13px; }
.lab-head h1 { margin-top: 4px; font-size: 34px; line-height: 1.15; }
.lab-head .seg { margin-bottom: 2px; }
.lab { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; max-width: 1640px; margin: 0 auto; padding: 0 32px; }
.lab-stage { position: relative; height: clamp(460px, calc(100svh - 176px), 820px); border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--line); }
.lab-stage canvas { display: block; width: 100%; height: 100%; }
.lab-stage.pick canvas { cursor: pointer; }
.lab-tags { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lab-tag { position: absolute; left: 0; top: 0; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--fg2); white-space: nowrap; text-align: center; transition: opacity 0.25s; }
.lab-tag.gas { font-size: 14px; color: var(--blue-h); }
.lab-tag.note { padding: 4px 9px; border-radius: 7px; background: rgba(0, 0, 0, 0.6); font-size: 13px; color: var(--fg); }
.lab-tip { position: absolute; left: 16px; bottom: 12px; margin: 0; font-size: 12px; color: var(--fg3); pointer-events: none; }
.lab-side { display: flex; flex-direction: column; gap: 16px; height: clamp(460px, calc(100svh - 176px), 820px); overflow-y: auto; padding: 18px; border-radius: 18px; background: var(--band); }
.lab-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lab-acts .btn, .lab-acts .chip { width: 100%; height: 36px; padding: 0 10px; }
.lab-acts .wide { grid-column: 1 / -1; }
.lab-acts .seg { display: flex; background: #000; }
.lab-acts .seg .chip { flex: 1; height: 30px; }
.lab-now { margin: 0; padding: 11px 13px; border-radius: 11px; background: #000; font-size: 14px; line-height: 1.6; color: var(--fg2); }
.lab-now b { font-weight: 600; color: var(--fg); }
.lab-side .readout { justify-content: flex-start; gap: 10px 26px; }
.lab-side h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.lab-side .sub { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: var(--fg2); }
.lab-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.lab-steps li { display: grid; grid-template-columns: 26px 1fr; gap: 1px 8px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--fg3); }
.lab-steps li::before { counter-increment: s; content: counter(s, decimal-leading-zero); grid-row: span 2; padding-top: 2px; font-size: 12px; font-variant-numeric: tabular-nums; }
.lab-steps b { font-size: 14px; font-weight: 600; }
.lab-steps span { font-size: 13px; line-height: 1.5; }
.lab-steps li.done { color: var(--fg2); }
.lab-steps li.done::before { content: "✓"; color: var(--blue); }
.lab-steps li.now { color: var(--fg); }
.lab-steps li.now::before { color: var(--blue); }
.lab-steps li.now span { color: var(--fg2); }
.lab-key { margin: 0; padding: 12px 13px; border-radius: 11px; box-shadow: inset 0 0 0 1px rgba(43, 140, 255, 0.45); font-size: 14px; line-height: 1.6; color: var(--fg2); }
.lab-key b { color: var(--fg); font-weight: 600; }
.lab-key[hidden] { display: none; }
@media (max-width: 1023px) {
  .lab { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .lab-head { padding: 20px 16px 14px; }
  .lab-stage { height: auto; aspect-ratio: 4 / 3; max-height: 72svh; }
  .lab-side { height: auto; overflow: visible; }
}
@media (max-width: 734px) {
  .lab-head h1 { font-size: 28px; }
  .lab-stage { border-radius: 14px; }
  .lab-tip { display: none; }
}
