/* 电学实验台：深色夜间实验室 + 霓虹辉光。左侧全幅三维台面，右侧控制栏（immersive-right-rail）。 */
:root {
  --bg: #060b14; --panel: rgba(12, 22, 36, .86); --panel2: rgba(18, 32, 50, .9); --line: rgba(110, 190, 255, .18);
  --text: #e6f1ff; --muted: #8fa7c0; --cyan: #3ee0ff; --amber: #ffb347; --red: #ff5a5a; --green: #45f0a0; --blue: #5aa8ff;
  --rail: clamp(300px, 22vw, 380px);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
#lab { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail); height: 100vh; background: #08111d; }
/* 公共课堂工具条贴屏幕右缘；本页没有一键演示，隐藏演示步进按钮 */
#physics-classroom-toolbar [data-tool="previous"], #physics-classroom-toolbar [data-tool="play"], #physics-classroom-toolbar [data-tool="next"], #physics-subtitle-settings-toggle { display: none !important; }
body.collapsed #lab { grid-template-columns: 1fr 0; }
body.collapsed #rail > :not(.rail-head) , body.collapsed .rail-head > :not(#collapse) { display: none; }
body.collapsed #rail { border: 0; }
body.collapsed #collapse { position: fixed; right: 12px; top: 12px; z-index: 30; }

/* ── 台面 ── */
#stage { position: relative; overflow: hidden; min-width: 0; }
#canvas { position: absolute; inset: 0; }
#canvas canvas { display: block; touch-action: none; }
#labels { position: absolute; inset: 0; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; display: flex; gap: 6px; align-items: baseline; padding: 3px 9px; border-radius: 999px; background: rgba(8, 18, 30, .72); border: 1px solid rgba(62, 224, 255, .35); box-shadow: 0 0 14px rgba(62, 224, 255, .18); font-size: 13px; white-space: nowrap; backdrop-filter: blur(4px); }
.tag b { color: var(--cyan); font-weight: 700; }
.tag span { color: #d6e6f5; font-family: Consolas, monospace; }
.tag.sel { border-color: var(--cyan); box-shadow: 0 0 20px rgba(62, 224, 255, .55); }
.tag.bad { border-color: var(--red); box-shadow: 0 0 18px rgba(255, 70, 70, .6); animation: pulse 0.8s infinite alternate; }
@keyframes pulse { to { box-shadow: 0 0 4px rgba(255, 70, 70, .2); } }
#tooltip { position: absolute; left: 0; top: 0; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: rgba(6, 16, 28, .92); border: 1px solid rgba(62, 224, 255, .5); box-shadow: 0 0 24px rgba(62, 224, 255, .3); display: grid; gap: 2px; font-size: 13px; z-index: 6; }
#tooltip b { color: #fff; }
.endtag { position: absolute; left: 0; top: 0; pointer-events: none; padding: 3px 9px; border-radius: 8px; font-size: 13px; white-space: nowrap; color: #fff; background: rgba(6, 14, 24, .88); border: 1.5px solid var(--c); box-shadow: 0 0 14px var(--c); z-index: 5; }
.endtag::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 9px; height: 9px; margin-left: -5px; background: var(--c); border-radius: 50%; box-shadow: 0 0 10px var(--c); } #tooltip span { color: var(--amber); font-family: Consolas, monospace; } #tooltip small { color: var(--muted); }
#loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; color: var(--cyan); background: radial-gradient(circle at 50% 45%, #0d2036, #060b14 70%); z-index: 20; letter-spacing: .1em; text-shadow: 0 0 18px rgba(62, 224, 255, .7); }
#loading[hidden] { display: none; }

.hud { position: absolute; display: flex; gap: 8px; flex-wrap: wrap; z-index: 5; pointer-events: none; }
.hud > * { pointer-events: auto; }
.top-left { left: 14px; top: 12px; max-width: calc(100% - 420px); }
.top-right { right: 14px; top: 12px; }
.bottom-left { left: 14px; bottom: 12px; align-items: center; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; backdrop-filter: blur(8px); }
.seg button, .top-right button { border: 0; background: transparent; padding: 7px 11px; border-radius: 9px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg button:hover:not(:disabled) { color: var(--text); background: rgba(62, 224, 255, .08); }
.seg button.on { color: #04121c; background: linear-gradient(135deg, #6ff3ff, #3ec2ff); box-shadow: 0 0 14px rgba(62, 224, 255, .55); font-weight: 600; }
.top-right button { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.top-right button.on { color: var(--cyan); border-color: rgba(62, 224, 255, .6); box-shadow: 0 0 12px rgba(62, 224, 255, .3); }
.wire-colors { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 5px 9px; }
.wire-colors span { color: var(--muted); font-size: 13px; margin-right: 2px; }
.wire-colors button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); background: var(--c); padding: 0; }
.wire-colors button[data-color="auto"] { width: auto; border-radius: 8px; padding: 0 8px; background: transparent; font-size: 13px; color: var(--muted); height: 24px; }
.wire-colors button.on { border-color: #fff; box-shadow: 0 0 10px var(--c, var(--cyan)); color: var(--cyan); }
.scene-note { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; margin: 0; font-size: 12.5px; color: rgba(160, 190, 220, .65); pointer-events: none; white-space: nowrap; }
@media (max-width: 1500px) { .scene-note { display: none; } }

#warnings { position: absolute; top: 100px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 8; width: min(560px, 70%); pointer-events: none; }
.alert, .toast { pointer-events: auto; padding: 10px 14px; border-radius: 12px; font-size: 15px; display: flex; gap: 10px; align-items: center; backdrop-filter: blur(8px); }
.alert i { font-style: normal; font-weight: 800; }
.alert.danger { background: rgba(60, 8, 12, .86); border: 1px solid rgba(255, 80, 80, .8); color: #ffd6d6; box-shadow: 0 0 26px rgba(255, 50, 50, .45); animation: alarm 0.9s infinite alternate; cursor: pointer; }
.alert.warn { background: rgba(52, 34, 6, .86); border: 1px solid rgba(255, 180, 70, .75); color: #ffe7c2; box-shadow: 0 0 18px rgba(255, 170, 50, .3); cursor: pointer; }
@keyframes alarm { to { box-shadow: 0 0 8px rgba(255, 50, 50, .2); } }
.toast { background: rgba(8, 22, 36, .9); border: 1px solid rgba(62, 224, 255, .45); color: #d8f4ff; box-shadow: 0 0 18px rgba(62, 224, 255, .25); transition: opacity .5s, transform .5s; }
.toast.danger { border-color: rgba(255, 90, 90, .7); color: #ffd6d6; }
.toast.out { opacity: 0; transform: translateY(-8px); }
#mode-hint { position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); padding: 9px 16px; border-radius: 999px; background: rgba(6, 24, 38, .9); border: 1px solid var(--cyan); color: var(--cyan); box-shadow: 0 0 22px rgba(62, 224, 255, .45); font-size: 14px; z-index: 7; white-space: nowrap; }
#mode-hint[hidden] { display: none; }

/* ── 浮窗 ── */
.win { position: absolute; z-index: 9; display: flex; flex-direction: column; background: var(--panel); border: 1px solid rgba(62, 224, 255, .3); border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5), 0 0 26px rgba(62, 224, 255, .12); backdrop-filter: blur(10px); resize: both; overflow: hidden; min-width: 240px; min-height: 44px; max-height: calc(100% - 80px); }
.win[hidden] { display: none; }
.win header { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; cursor: move; border-bottom: 1px solid var(--line); user-select: none; flex: none; }
.win header b { font-size: 15px; color: #fff; }
.win header small { color: var(--muted); font-size: 12px; flex: 1; }
.win header button { border: 0; background: transparent; color: var(--muted); width: 26px; height: 24px; border-radius: 6px; }
.win header .smode { display: flex; gap: 2px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 2px; }
.win header .smode button { width: auto; padding: 0 8px; font-size: 12px; }
.win header .smode button.on { background: rgba(62,224,255,.22); color: var(--cyan); }
#schem .b.potbody { fill: #0b1724; }
.win header button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.win.min { height: auto !important; resize: none; }
.win.min .win-body { display: none; }
.win-body { flex: 1; min-height: 0; overflow: auto; }
#win-schematic .win-body { padding: 4px; }
#schem { width: 100%; height: 100%; display: block; }
#schem .b { fill: none; stroke: #bfe2ff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#schem .b.f { fill: #bfe2ff; } #schem .b.f2 { fill: #0b1724; }
#schem .b.thick { stroke-width: 5; } #schem .b.on { stroke: var(--green); } #schem .b.link { stroke-dasharray: 4 4; stroke-width: 1.4; opacity: .7; }
#schem .b.meter { fill: #0b1724; stroke: var(--cyan); } #schem .b.lead { stroke-width: 2; }
#schem .led-ray { stroke: #ffd36a; }
#schem .w { fill: none; stroke: #6f8fb0; stroke-width: 2; stroke-linejoin: round; }
#schem .flow { fill: none; stroke: #ffc46a; stroke-width: 3.4; stroke-dasharray: 3 14; stroke-linecap: round; filter: drop-shadow(0 0 3px #ffae3a); opacity: 0; }
#schem .flow.electron { stroke: #5ae2ff; filter: drop-shadow(0 0 3px #3ec2ff); }
#schem .dot { fill: #bfe2ff; } #schem .pin { fill: #0b1724; stroke: #6f8fb0; stroke-width: 1.2; }
#schem .t { fill: #e6f1ff; font-size: 15px; font-weight: 700; text-anchor: middle; }
#schem .t.s { font-size: 12px; } #schem .t.pol { fill: #ffb0a0; }
#schem .t.lab { fill: #8fd8ff; font-size: 12.5px; font-weight: 600; }
#schem .t.val { fill: var(--amber); font-size: 12.5px; font-family: Consolas, monospace; }
#schem .t.empty { fill: var(--muted); font-size: 14px; font-weight: 400; }
#schem .part { cursor: pointer; } #schem .part:hover .b { stroke: var(--cyan); filter: drop-shadow(0 0 4px var(--cyan)); }

#meter-list { padding: 6px; display: grid; gap: 6px; }
.meter-card canvas { max-height: 110px; object-fit: contain; }
#meter-list .empty { color: var(--muted); margin: 10px; font-size: 14px; }
.meter-card { background: radial-gradient(ellipse at 50% 100%, rgba(30, 70, 110, .55), rgba(8, 18, 30, .8)); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.meter-card.bad { border-color: var(--red); box-shadow: 0 0 18px rgba(255, 60, 60, .45); }
.meter-card .mh { display: flex; justify-content: space-between; font-size: 13px; } .meter-card .mh span { color: var(--muted); }
.meter-card canvas { width: 100%; display: block; }
.meter-card .mr { text-align: center; margin-top: -6px; }
.meter-card output { font: 700 24px Consolas, monospace; color: #fff; text-shadow: 0 0 12px rgba(62, 224, 255, .8); }
.meter-card .mr small { color: var(--muted); margin-left: 4px; font-size: 15px; }

.data-body { padding: 10px; display: grid; gap: 8px; grid-template-rows: auto auto auto 1fr; }
.data-body .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.data-body button, .data-body select { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--text); }
.data-body button.primary { background: linear-gradient(135deg, #ff6a5a, #ff9a4a); border: 0; color: #1a0604; font-weight: 700; box-shadow: 0 0 14px rgba(255, 110, 70, .5); }
.axes label { font-size: 13px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
#plot { width: 100%; background: rgba(4, 12, 22, .6); border-radius: 10px; }
#plot .ax { stroke: #6f8fb0; fill: none; } #plot .gr { stroke: rgba(110, 160, 210, .14); }
#plot .tk { fill: #8fa7c0; font-size: 11px; } #plot .al { fill: #8fd8ff; font-size: 12px; }
#plot .ln { fill: none; stroke: var(--cyan); stroke-width: 2; filter: drop-shadow(0 0 4px var(--cyan)); }
#plot .pt { fill: var(--amber); filter: drop-shadow(0 0 5px var(--amber)); }
.table-wrap { overflow: auto; min-height: 60px; }
.data-body table { width: 100%; border-collapse: collapse; font: 13px Consolas, monospace; }
.data-body th, .data-body td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.data-body th { color: var(--muted); font-family: inherit; position: sticky; top: 0; background: var(--panel2); }

/* ── 右侧控制栏 ── */
#rail { display: flex; flex-direction: column; min-height: 0; background: linear-gradient(180deg, #0b1626, #08111d); border-left: 1px solid rgba(62, 224, 255, .22); box-shadow: -10px 0 40px rgba(0, 0, 0, .4); position: relative; z-index: 10; overflow: hidden; }
.rail-head { padding: 16px 18px 10px; position: relative; }
.rail-head small { color: var(--muted); font-size: 12.5px; }
.rail-head h1 { margin: 4px 0 2px; font-size: 26px; letter-spacing: .04em; background: linear-gradient(90deg, #7ff3ff, #ffd27a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(62, 224, 255, .35)); }
.rail-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
#collapse { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--cyan); font-size: 17px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 14px; padding: 4px; background: rgba(0, 0, 0, .25); border-radius: 12px; border: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 8px 0; border-radius: 9px; color: var(--muted); font-size: 15px; }
.tabs button.on { background: linear-gradient(135deg, rgba(62, 224, 255, .25), rgba(62, 160, 255, .15)); color: #fff; box-shadow: inset 0 0 0 1px rgba(62, 224, 255, .5), 0 0 14px rgba(62, 224, 255, .2); }
.rail-body { flex: 1; overflow: auto; padding: 12px 14px; min-height: 0; }
.rail-body::-webkit-scrollbar { width: 8px; } .rail-body::-webkit-scrollbar-thumb { background: rgba(110, 190, 255, .2); border-radius: 4px; }
.tab h3 { margin: 14px 2px 8px; font-size: 13px; color: var(--amber); letter-spacing: .12em; font-weight: 600; }
.tab .hint, .tab .empty { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 2px 2px 6px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card { display: grid; grid-template-rows: 74px auto; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(30, 50, 76, .55), rgba(12, 22, 36, .6)); text-align: center; font-size: 13.5px; transition: .15s; }
.card img { width: 100%; height: 74px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); background: radial-gradient(circle, rgba(230, 240, 250, .9), rgba(190, 210, 228, .75)); border-radius: 8px; }
.card .icon { display: grid; place-items: center; height: 74px; border-radius: 8px; background: radial-gradient(circle, rgba(230, 240, 250, .9), rgba(190, 210, 228, .75)); font-size: 30px; color: #2a4655; }
.card .icon svg { height: 64px; }
.card:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(62, 224, 255, .35); transform: translateY(-1px); }

.ph { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.ph img, .ph .icon { width: 72px; height: 56px; object-fit: contain; border-radius: 8px; background: radial-gradient(circle, rgba(230, 240, 250, .9), rgba(190, 210, 228, .75)); display: grid; place-items: center; }
.ph b { display: block; font-size: 17px; } .ph small { color: var(--amber); font-family: Consolas, monospace; }
.ph .sw { width: 40px; height: 10px; border-radius: 6px; box-shadow: 0 0 12px currentColor; }
.live { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.live div { background: rgba(4, 14, 26, .7); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; display: grid; }
.live span { color: var(--muted); font-size: 12px; }
.live b { font: 700 18px Consolas, monospace; color: #fff; text-shadow: 0 0 10px rgba(62, 224, 255, .5); }
.field { display: grid; gap: 6px; margin: 12px 0; font-size: 14px; color: #cfe0f2; grid-template-columns: 1fr auto; align-items: center; }
.field .val { color: var(--cyan); font-family: Consolas, monospace; }
.field input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--cyan); }
.field select { grid-column: 1 / -1; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px; font: inherit; }
.field.toggle { cursor: pointer; }
.field.toggle input { display: none; }
.field.toggle i { width: 46px; height: 26px; border-radius: 13px; background: #24384c; position: relative; transition: .2s; }
.field.toggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #9fb3c8; transition: .2s; }
.field.toggle input:checked + i { background: rgba(62, 224, 255, .4); box-shadow: 0 0 12px rgba(62, 224, 255, .5); }
.field.toggle input:checked + i::after { left: 23px; background: #fff; }
.digits { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.digits label { display: grid; text-align: center; } .digits small { color: var(--muted); }
.digits input { width: 100%; text-align: center; font: 700 20px Consolas, monospace; background: rgba(4, 14, 26, .8); color: var(--cyan); border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.note { color: var(--muted); font-size: 13.5px; line-height: 1.65; background: rgba(255, 179, 71, .06); border-left: 3px solid rgba(255, 179, 71, .5); padding: 8px 10px; border-radius: 0 8px 8px 0; }
.terms { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.terms span { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(62, 224, 255, .35); color: #9fe9ff; }
.terms span.pos { border-color: rgba(255, 90, 90, .6); color: #ffb0a8; } .terms span.neg { border-color: rgba(130, 160, 255, .5); color: #b8c8ff; }
.actions { display: flex; gap: 6px; margin-top: 10px; }
.actions button, button.wide { flex: 1; padding: 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); }
button.wide { width: 100%; margin: 6px 0; border-color: rgba(69, 240, 160, .5); color: var(--green); }
.actions button.danger { border-color: rgba(255, 90, 90, .5); color: #ff9a9a; }
.chips { display: flex; gap: 6px; grid-column: 1 / -1; }
.chips button { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid rgba(255, 255, 255, .15); }
.chips button.on { border-color: #fff; box-shadow: 0 0 10px var(--c); }

.current { background: linear-gradient(135deg, rgba(69, 240, 160, .12), rgba(62, 224, 255, .06)); border: 1px solid rgba(69, 240, 160, .4); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.current small { color: var(--green); } .current b { display: block; font-size: 17px; margin: 2px 0 4px; }
.current ol { margin: 0; padding-left: 20px; color: #d4e6f5; font-size: 14px; line-height: 1.65; }
.task { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: rgba(14, 26, 42, .6); }
.task.on { border-color: rgba(62, 224, 255, .6); box-shadow: 0 0 14px rgba(62, 224, 255, .2); }
.task div { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.task b { font-size: 15.5px; } .task em { font-style: normal; font-size: 12px; color: var(--amber); white-space: nowrap; }
.task p { margin: 5px 0 8px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.task button { padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(62, 224, 255, .5); background: rgba(62, 224, 255, .1); color: var(--cyan); }

#rail footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
#rail footer button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 11px; font-size: 16px; border: 1px solid; }
#rail footer svg { width: 20px; height: 20px; }
#principle { background: rgba(69, 240, 160, .1); border-color: rgba(69, 240, 160, .5) !important; color: var(--green); }
#check { background: rgba(255, 179, 71, .1); border-color: rgba(255, 179, 71, .5) !important; color: var(--amber); }

/* ── 原理页 ── */
#learning { position: fixed; inset: 0; overflow: auto; padding: 34px 56px; background: radial-gradient(circle at 20% 0%, #10243c, #060b14 60%); }
#learning[hidden] { display: none; }
#learning > small { color: var(--muted); font-size: 16px; display: block; margin-top: 18px; }
#learning h1 { font-size: 40px; margin: 6px 0 24px; }
#back { padding: 10px 18px; border-radius: 10px; border: 1px solid var(--cyan); background: rgba(62, 224, 255, .1); color: var(--cyan); font-size: 18px; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lesson-grid article { border-radius: 18px; padding: 22px 26px; font-size: 22px; line-height: 1.65; border: 1px solid; }
.lesson-grid h2 { margin: 0 0 10px; font-size: 26px; }
.lesson-grid strong { display: block; font: 700 36px Consolas, "Times New Roman", serif; text-align: center; margin: 10px 0; }
.lesson-grid ul { padding-left: 22px; margin: 0; font-size: 19px; }
.lesson-grid .green { background: rgba(69, 240, 160, .08); border-color: rgba(69, 240, 160, .4); } .green h2, .green strong { color: var(--green); text-shadow: 0 0 16px rgba(69, 240, 160, .5); }
.lesson-grid .blue { background: rgba(90, 168, 255, .08); border-color: rgba(90, 168, 255, .4); } .blue h2 { color: var(--blue); }
.lesson-grid .amber { background: rgba(255, 179, 71, .08); border-color: rgba(255, 179, 71, .4); } .amber h2 { color: var(--amber); }
#live-example { color: var(--amber); }
@media (max-width: 1280px) { .lesson-grid { grid-template-columns: 1fr; } }

/* 暂停状态醒目提示 */
#t-run.paused { background: rgba(255, 179, 71, .22); border-color: #ffb347; color: #ffd28a; box-shadow: 0 0 12px rgba(255, 179, 71, .45); }
/* 音乐开启时按钮随节拍发光（--beat 由 updateGroove 每帧写入） */
#t-music.on { color: #ffd6f0; border-color: rgba(255, 95, 168, .7); box-shadow: 0 0 calc(8px + 22px * var(--beat, 0)) rgba(255, 95, 168, calc(.35 + .5 * var(--beat, 0))); }
/* 页内确认框（替代原生 confirm，避免退出全屏） */
.ask-mask { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; background: rgba(2, 6, 12, .55); backdrop-filter: blur(3px); }
.ask { min-width: 340px; max-width: 460px; padding: 22px 22px 16px; border-radius: 16px; background: var(--panel2); border: 1px solid rgba(62, 224, 255, .45); box-shadow: 0 0 36px rgba(62, 224, 255, .25), 0 18px 50px rgba(0, 0, 0, .55); }
.ask p { margin: 0 0 18px; font-size: 18px; line-height: 1.6; color: var(--text); }
.ask-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ask-actions button { min-width: 88px; height: 40px; border-radius: 10px; font-size: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--muted); }
.ask-actions .ask-ok { color: #04121c; font-weight: 600; border: 0; background: linear-gradient(135deg, #6ff3ff, #3ec2ff); box-shadow: 0 0 14px rgba(62, 224, 255, .5); }
.ask-actions .ask-ok.danger { color: #fff; background: linear-gradient(135deg, #ff7a6a, #e8413a); box-shadow: 0 0 14px rgba(255, 90, 90, .45); }
/* 控制栏收起后，展开按钮固定在右上角；右上浮动按钮组左移让位 */
body.collapsed .top-right { right: 58px; }
/* 控制栏固定按钮：位于收起按钮左侧；固定时高亮 */
#pin-rail { position: absolute; right: 54px; top: 12px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-size: 15px; filter: grayscale(1); opacity: .55; }
#pin-rail.on { filter: none; opacity: 1; border-color: rgba(255, 179, 71, .7); box-shadow: 0 0 12px rgba(255, 179, 71, .4); }
body.collapsed #pin-rail { display: none; }
