:root {
  --bg: #02050b; --fg: #e8f4ff; --muted: #8aa3bd; --cyan: #5ce1ff; --green: #4dffb0; --gold: #ffd36b; --red: #ff5c7a;
  --glass: rgba(10, 24, 44, .66); --line: rgba(120, 200, 255, .2);
  --subfs: 24px; --subbot: 60px;
}
* { box-sizing: border-box; margin: 0; padding: 0 }
html, body { height: 100%; background: var(--bg); color: var(--fg); overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; -webkit-font-smoothing: antialiased }
body.hidecur #app { cursor: none }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none }
.hidden { display: none !important }
svg { width: 22px; height: 22px; fill: currentColor; display: block }

/* ---------- 视频 ---------- */
#app { position: fixed; inset: 0 }
#stage { position: absolute; inset: 0; display: block }
#chapterChip { position: absolute; display: flex; gap: 10px; align-items: center; padding: 6px 14px; border-radius: 999px;
  background: rgba(5, 14, 28, .55); border: 1px solid var(--line); backdrop-filter: blur(8px); font-size: 14px; pointer-events: none }
#chapterChip .num { color: var(--cyan); font-weight: 800; letter-spacing: .5px }
#subtitle { position: absolute; left: 50%; bottom: var(--subbot); transform: translate(-50%, 8px); width: min(86vw, 1500px); text-align: center;
  pointer-events: none; opacity: 0; transition: opacity .35s, transform .35s, bottom .35s }
#subtitle.show { opacity: 1; transform: translate(-50%, 0) }
#app:has(#controls:not(.idle):not(.hidden)) #subtitle { bottom: max(var(--subbot), 96px) }
#subtitle span { display: inline-block; padding: .3em .9em; border-radius: 12px; background: rgba(2, 8, 18, .6); backdrop-filter: blur(6px);
  font-size: var(--subfs); line-height: 1.5; color: #f4faff; border: 1px solid rgba(120, 200, 255, .14);
  text-shadow: 0 0 14px rgba(92, 225, 255, .35); box-shadow: 0 0 24px rgba(0, 0, 0, .35) }

#controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 22px 14px;
  background: linear-gradient(transparent, rgba(2, 6, 14, .92)); transition: opacity .35s, transform .35s }
#controls.idle { opacity: 0; transform: translateY(16px); pointer-events: none }
#progress { position: relative; height: 22px; cursor: pointer; touch-action: none }
#progress .track { position: absolute; left: 0; right: 0; top: 9px; height: 4px; background: rgba(255, 255, 255, .14); border-radius: 4px; transition: height .2s, top .2s }
#progress:hover .track { top: 8px; height: 6px }
#progress .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--green), var(--cyan)); box-shadow: 0 0 12px var(--cyan) }
#progress .ticks span { position: absolute; top: 7px; width: 3px; height: 10px; margin-left: -1px; background: rgba(2, 5, 11, .95) }
#progress .knob { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 14px var(--cyan), 0 0 4px #fff; pointer-events: none }
#progress .tip { position: absolute; bottom: 26px; transform: translateX(-50%); white-space: nowrap; padding: 4px 10px; border-radius: 8px; font-size: 13px;
  background: rgba(5, 14, 28, .9); border: 1px solid var(--line); opacity: 0; transition: opacity .2s; pointer-events: none }
#progress .tip.show { opacity: 1 }
.row { display: flex; align-items: center; gap: 8px; margin-top: 6px }
.sp { flex: 1 }
.ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #dff3ff; transition: background .2s, box-shadow .2s, color .2s }
.ic:hover { background: rgba(92, 225, 255, .12); color: #fff; box-shadow: 0 0 16px rgba(92, 225, 255, .3) }
.ic.off { color: var(--red) }
#btnPlay { width: 46px; height: 46px; border-radius: 50%; background: rgba(92, 225, 255, .14); box-shadow: 0 0 18px rgba(92, 225, 255, .35) }
#time { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); margin-left: 6px }
.txt { padding: 6px 10px; border-radius: 10px; font-size: 14px; font-weight: 700; color: #cfe8ff }
.txt:hover { background: rgba(92, 225, 255, .12) }
.cta, .primary { padding: 9px 18px; border-radius: 999px; font-weight: 800; color: #031018;
  background: linear-gradient(90deg, var(--green), var(--cyan)); box-shadow: 0 0 20px rgba(92, 225, 255, .5); transition: transform .2s, box-shadow .2s }
.cta:hover, .primary:hover { transform: translateY(-1px); box-shadow: 0 0 32px rgba(92, 225, 255, .8) }
.ghost { padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); color: #cfe8ff; background: rgba(10, 24, 44, .5); transition: all .2s }
.ghost:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(92, 225, 255, .35); color: #fff }

input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 6px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, rgba(77, 255, 176, .5), rgba(92, 225, 255, .5)) }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px rgba(92, 225, 255, .35), 0 0 16px var(--cyan) }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 0 16px var(--cyan) }
#vol { width: 90px }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(3, 10, 22, .55), rgba(2, 5, 11, .88)); backdrop-filter: blur(3px); animation: fade .6s }
@keyframes fade { from { opacity: 0 } }
.card { text-align: center; padding: 44px 56px; border-radius: 28px; background: rgba(8, 20, 40, .55); border: 1px solid var(--line);
  box-shadow: 0 0 60px rgba(92, 225, 255, .15), inset 0 0 40px rgba(92, 225, 255, .05); max-width: 760px }
.card.small { max-width: 620px }
.kicker { color: var(--cyan); letter-spacing: 4px; font-size: 14px; font-weight: 700; margin-bottom: 12px }
.card h1 { font-size: 52px; font-weight: 900; letter-spacing: 2px; background: linear-gradient(90deg, #9dffcf, #fff, #ffd36b); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(77, 255, 176, .45)) }
.card h1 em { font-style: normal; font-weight: 500; opacity: .8 }
.card p { color: #bcd3ea; margin: 16px 0 26px; line-height: 1.8 }
.card .play { width: 108px; height: 108px; border-radius: 50%; display: inline-grid; place-items: center; color: #031018; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff, var(--cyan) 45%, #1aa7d6); box-shadow: 0 0 40px var(--cyan), 0 0 90px rgba(77, 255, 176, .4) }
.card .play svg { width: 44px; height: 44px; margin-left: 6px }
.card .play::before, .card .play::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--cyan); animation: ring 2.2s infinite }
.card .play::after { animation-delay: 1.1s }
@keyframes ring { from { transform: scale(1); opacity: .8 } to { transform: scale(1.7); opacity: 0 } }
.card .play:hover { transform: scale(1.05) }
.hint { margin: 22px 0 18px; font-size: 13px; color: var(--muted) }
.card .btns { display: flex; gap: 14px; justify-content: center }

/* ---------- 实验室 ---------- */
#lab { position: fixed; inset: 0; display: flex; flex-direction: column; background: radial-gradient(1200px 700px at 30% 15%, #0d2340, #050b16 60%, #02050b) }
#lab header { height: 64px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(4, 10, 22, .6); backdrop-filter: blur(8px) }
.brand { font-weight: 900; font-size: 20px; background: linear-gradient(90deg, var(--green), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(92, 225, 255, .5)); white-space: nowrap }
#labTabs { display: flex; gap: 6px; overflow-x: auto }
#labTabs button { padding: 8px 16px; border-radius: 999px; color: #b8d2ea; white-space: nowrap; border: 1px solid transparent; transition: all .2s }
#labTabs button:hover { color: #fff; background: rgba(92, 225, 255, .08) }
#labTabs button.on { color: #fff; border-color: rgba(92, 225, 255, .55); background: rgba(92, 225, 255, .12); box-shadow: 0 0 18px rgba(92, 225, 255, .35), inset 0 0 12px rgba(92, 225, 255, .15) }
#lab main { flex: 1; min-height: 0; position: relative }
.tab { position: absolute; inset: 0; display: none; grid-template-columns: 1fr 380px; gap: 16px; padding: 16px }
.tab.on { display: grid; animation: fade .4s }
.viz { position: relative; border-radius: 20px; border: 1px solid var(--line); background: rgba(3, 9, 20, .6); overflow: hidden;
  box-shadow: inset 0 0 80px rgba(92, 225, 255, .05), 0 0 30px rgba(0, 0, 0, .4) }
.viz canvas { position: absolute; inset: 0 }
aside.ctrl { overflow-y: auto; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); padding: 18px; display: flex; flex-direction: column; gap: 12px }
aside h3 { font-size: 14px; letter-spacing: 1px; color: var(--cyan); text-shadow: 0 0 10px rgba(92, 225, 255, .5); margin-top: 4px }
.ctl { display: flex; flex-direction: column; gap: 8px }
.ctl label { display: flex; justify-content: space-between; font-size: 14px; color: #cfe2f5 }
.ctl label b { color: #fff; font-variant-numeric: tabular-nums }
small { color: var(--muted); font-size: 12px; line-height: 1.6 }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line) }
.seg button { flex: 1; padding: 7px 4px; border-radius: 9px; font-size: 13px; color: #b8d2ea; transition: all .2s }
.seg button.on { background: rgba(92, 225, 255, .18); color: #fff; box-shadow: 0 0 14px rgba(92, 225, 255, .4) }
.btns3, .btns2, .presets { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px }
.btns2 { grid-template-columns: 2fr 1fr }
.btns3 button, .btns2 button:not(.primary), .presets button { padding: 9px 6px; border-radius: 10px; font-size: 13px; border: 1px solid var(--line); background: rgba(10, 24, 44, .6); transition: all .2s }
.btns3 button:hover, .btns2 button:hover, .presets button:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(92, 225, 255, .3) }
.tog.on { border-color: var(--red) !important; color: #fff; background: rgba(255, 92, 122, .2) !important; box-shadow: 0 0 16px rgba(255, 92, 122, .5) !important }
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 6px }
.readout div { padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(120, 200, 255, .1); display: flex; flex-direction: column; gap: 2px }
.readout span { font-size: 12px; color: var(--muted) }
.readout b { font-size: 18px; font-variant-numeric: tabular-nums }
.readout .big { grid-column: 1 / -1 }
.readout .big b { font-size: 26px }
.readout b.pos { color: var(--green); text-shadow: 0 0 12px rgba(77, 255, 176, .6) }
.readout b.neg { color: var(--red); text-shadow: 0 0 12px rgba(255, 92, 122, .6) }
.explain { padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.75; color: #dbeaf8; background: linear-gradient(135deg, rgba(77, 255, 176, .08), rgba(92, 225, 255, .06));
  border-left: 3px solid var(--green); min-height: 72px }
.explain b { color: #fff }
.explain .c3 { color: #ff7a9c; font-weight: 700 } .explain .c5 { color: #6aa8ff; font-weight: 700 }
.legend { font-size: 12px; color: var(--muted); line-height: 2 }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); margin: 0 4px 0 8px }
.steps { padding-left: 20px; font-size: 13px; line-height: 1.7; color: #cfe2f5; display: flex; flex-direction: column; gap: 6px }
.steps em { font-style: normal; color: var(--gold) }

/* 测验 */
.quiz { position: absolute; inset: 16px; display: grid; place-items: center; overflow: auto }
#quizBox { width: min(820px, 100%); padding: 34px 38px; border-radius: 24px; background: var(--glass); border: 1px solid var(--line); box-shadow: 0 0 50px rgba(92, 225, 255, .12) }
.qhead { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px }
.qbar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); margin: 10px 0 22px; overflow: hidden }
.qbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); box-shadow: 0 0 10px var(--cyan); transition: width .4s }
#quizBox h2 { font-size: 24px; line-height: 1.6; margin-bottom: 20px }
.opts { display: grid; gap: 10px }
.opts button { text-align: left; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(5, 14, 28, .6); font-size: 17px; display: flex; gap: 14px; align-items: center; transition: all .2s }
.opts button b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(92, 225, 255, .15); color: var(--cyan); flex: none }
.opts button:hover:not(:disabled) { border-color: var(--cyan); box-shadow: 0 0 18px rgba(92, 225, 255, .3); transform: translateX(4px) }
.opts button.ok { border-color: var(--green); background: rgba(77, 255, 176, .14); box-shadow: 0 0 22px rgba(77, 255, 176, .45) }
.opts button.ok b { background: var(--green); color: #031018 }
.opts button.bad { border-color: var(--red); background: rgba(255, 92, 122, .14); box-shadow: 0 0 22px rgba(255, 92, 122, .4); animation: shake .4s }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.exp { margin-top: 18px; font-size: 15px; line-height: 1.8; color: #d6e8fa; opacity: 0; transform: translateY(6px); transition: all .3s }
.exp.show { opacity: 1; transform: none }
.exp .g { color: var(--green) } .exp .r { color: var(--red) }
.next { margin-top: 18px; float: right }
.result { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px }
.ring { --p: 0; width: 180px; height: 180px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0); box-shadow: 0 0 40px rgba(77, 255, 176, .4) }
.ring span { width: 150px; height: 150px; border-radius: 50%; background: #071324; display: grid; place-items: center; font-size: 48px; font-weight: 900 }
.ring small { font-size: 20px }

@media (max-width: 960px) {
  .tab { grid-template-columns: 1fr; grid-template-rows: minmax(320px, 55%) auto; overflow-y: auto }
  #lab header { gap: 8px; padding: 0 10px } .brand { display: none }
  #vol, #time { display: none }
}
