/* AI 猜元素 · 版式：月面夜空底图（和课件第四关同一张）+ 左边 AI、周期表、提问台 + 右边提问链。
   按 1920×1080 画，#stage 整体等比缩放。颜色沿用 3D 交互网页那一套。 */
@font-face { font-family: "GEDisp"; src: url("../font/disp.woff2") format("woff2"); font-display: swap; }
:root { --accent: #6fd8ff; --accent-rgb: 111,216,255; --au: #f2c766; --au-rgb: 242,199,102; --ok: #5fe0a8; --ok-rgb: 95,224,168; --no: #ff8f7a; --no-rgb: 255,143,122;
  --ink: #eef6fb; --sub: #a9bccb; --bg: #06101c; --card: rgba(8,19,35,.84); --k: 1; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; color: var(--ink); user-select: none; -webkit-user-select: none;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif; }
body { background: #06101c url("../img/bg_night.jpg") center / cover no-repeat; }
button, input { font-family: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { all: unset; cursor: pointer; box-sizing: border-box; }
[hidden] { display: none !important; }
sub, sup { font-size: .62em; line-height: 0; }
.serif { font-family: "GEDisp", "Source Han Serif SC", "Noto Serif SC", "STZhongsong", "SimSun", serif; font-weight: 900; }
.mono { font-family: Consolas, "DejaVu Sans Mono", monospace; }
#stage { position: fixed; left: 50%; top: 50%; width: 1920px; height: 1080px; transform: translate(-50%, -50%) scale(var(--k)); }
#stage > * { position: absolute; }

/* 左上：课名 + 环节名 */
#brand { left: 44px; top: 24px; text-shadow: 0 2px 12px rgba(0,0,0,.7); white-space: nowrap; }
#brand b { display: block; font-size: 21px; font-weight: 400; letter-spacing: .12em; color: var(--sub); }
#brand span { display: inline-block; font-size: 50px; letter-spacing: .04em; margin-top: 2px; vertical-align: middle; }
#brand i { display: inline-block; vertical-align: middle; font-style: normal; font-size: 21px; margin: 8px 0 0 22px; padding: 4px 16px; border-radius: 99px; color: #ffe7b0; border: 1px solid rgba(var(--au-rgb), .55); background: rgba(var(--au-rgb), .08); }

.tools { right: 40px; top: 34px; display: flex; gap: 10px; align-items: center; }
.tools button { padding: 10px 18px; border-radius: 13px; font-size: 19px; color: var(--sub); background: rgba(6,14,26,.72); border: 1px solid rgba(var(--accent-rgb), .22); white-space: nowrap; }
.tools button:active { transform: scale(.96); }
.tools button.arm { color: #3a2600; background: var(--au); border-color: var(--au); font-weight: 700; }
#net { font-size: 18px; color: var(--sub); margin-right: 8px; white-space: nowrap; } #net em { font-style: normal; }
#net i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #7d8ea0; margin-right: 8px; vertical-align: 1px; }
#net.on i { background: var(--ok); box-shadow: 0 0 10px var(--ok); } #net.off i { background: var(--au); }

/* —— AI 区 */
#ai { left: 44px; top: 122px; width: 1252px; height: 250px; padding: 18px 26px 18px 22px; border-radius: 26px; background: var(--card); border: 1px solid rgba(var(--accent-rgb), .2); box-shadow: 0 18px 50px rgba(0,0,0,.4); display: flex; gap: 30px; align-items: center; }
#card { width: 176px; height: 214px; flex: none; perspective: 1200px; }
#card .flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3,1.3,.5,1); }
#card.open .flip { transform: rotateY(180deg); }
#card .face { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
#card .front { background: radial-gradient(120% 90% at 30% 20%, rgba(var(--accent-rgb), .26), rgba(var(--accent-rgb), .05) 70%); border: 1.5px solid rgba(var(--accent-rgb), .6); text-align: center; animation: breathe 3.2s ease-in-out infinite; }
#card .front small { display: block; margin-top: 16px; font-size: 18px; color: var(--sub); letter-spacing: .06em; }
#card .front span { display: block; font-size: 128px; line-height: 150px; color: #dff6ff; text-shadow: 0 0 34px rgba(var(--accent-rgb), .8); }
#card.think .front { animation: breathe .7s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 18px rgba(var(--accent-rgb), .18); } 50% { box-shadow: 0 0 44px rgba(var(--accent-rgb), .55); } }
#card .back { transform: rotateY(180deg); border: 2px solid rgba(var(--accent-rgb), .8); background: linear-gradient(160deg, rgba(var(--accent-rgb), .3), rgba(var(--accent-rgb), .07)); box-shadow: 0 0 46px rgba(var(--accent-rgb), .5); }
#card .back.metal { border-color: rgba(var(--au-rgb), .9); background: linear-gradient(160deg, rgba(var(--au-rgb), .32), rgba(var(--au-rgb), .07)); box-shadow: 0 0 46px rgba(var(--au-rgb), .5); }
#card .back.noble { border-color: rgba(178,140,255,.9); background: linear-gradient(160deg, rgba(178,140,255,.34), rgba(178,140,255,.08)); box-shadow: 0 0 46px rgba(178,140,255,.5); }
#card .back .z { position: absolute; left: 16px; top: 10px; font-size: 32px; font-family: Consolas, monospace; }
#card .back .sym { position: absolute; left: 0; right: 0; top: 40px; text-align: center; font-size: 82px; font-weight: 700; line-height: 1.15; }
#card .back .nm { position: absolute; left: 0; right: 0; bottom: 36px; text-align: center; font-size: 30px; }
#card .back .ar { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 22px; font-family: Consolas, monospace; color: var(--sub); }

#say { flex: 1; min-width: 0; }
#say .who { font-size: 21px; color: var(--sub); letter-spacing: .08em; margin-bottom: 8px; }
#say .idle { font-size: 34px; line-height: 1.5; } #say .idle small { display: block; font-size: 24px; color: var(--sub); margin-top: 6px; }
#say .echo { font-size: 27px; line-height: 1.35; color: #d6e8f4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#say .echo small { color: var(--sub); font-size: 21px; margin-right: 12px; letter-spacing: .04em; }
#say .ans { font-size: 98px; line-height: 1.08; letter-spacing: .06em; margin-top: 2px; animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
#say .ans.y { color: var(--ok); text-shadow: 0 0 40px rgba(var(--ok-rgb), .55); } #say .ans.n { color: var(--no); text-shadow: 0 0 40px rgba(var(--no-rgb), .5); }
#say .ans small { font-family: "Microsoft YaHei", sans-serif; font-weight: 400; font-size: 24px; letter-spacing: 0; color: var(--sub); margin-left: 22px; text-shadow: none; vertical-align: middle; }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: none; } }
#say .dots { height: 106px; display: flex; align-items: center; gap: 16px; font-size: 26px; color: var(--sub); }
#say .dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); animation: dot 1s infinite; } #say .dots i:nth-child(2) { animation-delay: .15s; } #say .dots i:nth-child(3) { animation-delay: .3s; margin-right: 8px; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-8px); } }
#say .rej { font-size: 30px; line-height: 1.5; color: #ffe7b0; margin-top: 6px; animation: pop .35s; }
#say .win { font-size: 84px; line-height: 1.15; color: var(--au); text-shadow: 0 0 44px rgba(var(--au-rgb), .55); animation: pop .6s cubic-bezier(.3,1.6,.5,1); }
#say .win small { font-family: "Microsoft YaHei", sans-serif; font-weight: 400; font-size: 26px; color: var(--ink); margin-left: 22px; text-shadow: none; vertical-align: middle; }
#say .after { font-size: 28px; line-height: 1.5; color: #d6e8f4; margin-top: 10px; } #say .after b { color: var(--au); }
#say .rvq { font-size: 38px; line-height: 1.35; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#say .rva { font-size: 30px; margin-top: 12px; line-height: 1.5; } #say .rva b.y { color: var(--ok); } #say .rva b.n { color: var(--no); } #say .rva em { font-style: normal; color: var(--au); font-weight: 700; }
/* 猜中以后，提问台换成：请学生指位置、说示意图 + 三个按钮；点“看结构示意图”右边滑出示意图 */
#winPane { display: flex; gap: 24px; align-items: center; height: 100%; }
.wp-l { flex: 1; min-width: 0; padding-left: 8px; } .wp-l p { margin: 0 0 20px; font-size: 30px; line-height: 1.5; }
.acts { display: flex; gap: 14px; } .acts .btn { height: 70px; line-height: 67px; padding: 0 26px; font-size: 26px; }
#diagram { flex: none; width: 0; overflow: hidden; opacity: 0; transition: width .5s, opacity .5s; }
#diagram.on { width: 620px; opacity: 1; }
#diagram .box { width: 620px; height: 216px; padding: 0 24px 0 14px; border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid rgba(var(--accent-rgb), .25); display: flex; align-items: center; gap: 18px; }
#diagram svg { height: 176px; flex: none; }
#diagram p { margin: 0 0 6px; font-size: 23px; line-height: 1.45; } #diagram p b { color: var(--au); font-family: Consolas, monospace; font-size: 27px; margin: 0 2px; }
#diagram p.f { color: var(--sub); font-size: 20px; margin-top: 10px; }

/* —— 周期表（前 18 号） */
#tableWrap { left: 44px; top: 388px; width: 1252px; }
.legend { display: flex; gap: 22px; font-size: 19px; color: var(--sub); margin: 0 0 8px 78px; align-items: center; text-shadow: 0 1px 6px #000; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 7px; vertical-align: -1px; }
.legend em { font-style: normal; margin-left: auto; color: #8ea3b5; } .legend em.hot { color: #ffe7b0; font-weight: 700; }
#grid { display: grid; grid-template-columns: 68px repeat(8, 1fr); gap: 10px; }
#grid .rw { font-size: 19px; color: var(--sub); display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; text-align: right; line-height: 1.25; text-shadow: 0 1px 6px #000; }
.pt { position: relative; height: 108px; border-radius: 14px; background: rgba(15,42,66,.86); border: 1.5px solid rgba(111,216,255,.5); transition: transform .25s, box-shadow .25s, opacity .35s, filter .35s; }
.pt .z { position: absolute; left: 11px; top: 5px; font-size: 21px; font-family: Consolas, monospace; }
.pt .sym { position: absolute; left: 0; right: 0; top: 16px; text-align: center; font-size: 44px; font-weight: 700; }
.pt .nm { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 21px; }
.pt.metal { background: rgba(54,44,24,.88); border-color: rgba(242,199,102,.62); } .pt.noble { background: rgba(40,32,72,.88); border-color: rgba(178,140,255,.68); }
.pt:active { transform: scale(.95); }
/* 学生手动划掉 */
.pt.x { opacity: .5; } .pt.x::after { content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 4px; border-radius: 2px; background: var(--no); transform: rotate(-36deg); box-shadow: 0 0 8px rgba(0,0,0,.6); }
/* AI 自动排除（回看时、或设置里打开了自动划掉） */
.pt.out { opacity: .2; filter: saturate(.3); } .pt.out.x { opacity: .2; }
.pt.cut { animation: cut .7s ease-out; } @keyframes cut { 0% { box-shadow: 0 0 0 3px var(--no); opacity: 1; } 60% { box-shadow: 0 0 0 3px var(--no); opacity: 1; } 100% { opacity: .2; } }
.pt.win { transform: scale(1.08); z-index: 2; box-shadow: 0 0 0 3px var(--au), 0 0 40px rgba(var(--au-rgb), .8); opacity: 1 !important; filter: none !important; } .pt.win::after { display: none; }
#grid.picking .pt:not(.out) { animation: pick 1.1s ease-in-out infinite; } @keyframes pick { 50% { box-shadow: 0 0 0 2px var(--au), 0 0 22px rgba(var(--au-rgb), .6); } }

/* —— 提问台 */
#dock { left: 44px; top: 790px; width: 1252px; height: 256px; padding: 16px 20px; border-radius: 24px; background: var(--card); border: 1px solid rgba(var(--accent-rgb), .2); box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.row1 { display: flex; gap: 14px; align-items: center; }
#mic { position: relative; width: 80px; height: 80px; flex: none; border-radius: 50%; background: rgba(var(--accent-rgb), .14); border: 2px solid rgba(var(--accent-rgb), .6); text-align: center; transition: transform .12s, background .2s; }
#mic svg { width: 40px; height: 40px; margin-top: 18px; fill: var(--accent); color: var(--accent); }
#mic:active { transform: scale(.94); }
#mic.on { background: var(--no); border-color: var(--no); animation: micOn 1.2s ease-in-out infinite; } #mic.on svg { fill: #3a0d06; color: #3a0d06; }
@keyframes micOn { 50% { box-shadow: 0 0 0 12px rgba(var(--no-rgb), .18); } }
#mic.wait { opacity: .5; pointer-events: none; }
#meter { position: absolute; left: 0; right: 0; bottom: -4px; height: 18px; display: none; justify-content: center; align-items: flex-end; gap: 3px; } #mic.on #meter { display: flex; }
#meter i { width: 4px; background: #fff; border-radius: 2px; height: 12%; }
#q { flex: 1; min-width: 0; height: 80px; padding: 0 26px; border-radius: 20px; font-size: 30px; background: rgba(2,10,20,.75); border: 1.5px solid rgba(var(--accent-rgb), .4); outline: none; user-select: text; -webkit-user-select: text; }
#q::placeholder { color: #6f8496; font-size: 24px; } #q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .16); }
.btn { height: 80px; padding: 0 32px; border-radius: 20px; font-size: 28px; line-height: 77px; white-space: nowrap; text-align: center; background: rgba(var(--accent-rgb), .12); border: 1.5px solid rgba(var(--accent-rgb), .45); transition: transform .12s, background .2s, opacity .2s; }
.btn:active { transform: scale(.95); } .btn.pri { background: var(--accent); color: #03263a; font-weight: 700; border-color: var(--accent); }
.btn.gold { background: rgba(var(--au-rgb), .16); border-color: rgba(var(--au-rgb), .7); color: #ffe7b0; } .btn.gold.on { background: var(--au); color: #3a2600; font-weight: 700; }
.btn.sm { height: 54px; line-height: 51px; padding: 0 24px; font-size: 23px; border-radius: 15px; } .btn[disabled] { opacity: .35; pointer-events: none; }
#dock.busy .row1 .btn, #dock.busy .chip { opacity: .45; pointer-events: none; }
.row2, .row3 { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.row2 label { font-size: 20px; color: var(--sub); white-space: nowrap; margin-right: 2px; }
.chips { display: flex; gap: 8px; } .sep { width: 1px; height: 34px; background: rgba(var(--accent-rgb), .25); margin: 0 4px; }
.chip { height: 54px; line-height: 51px; padding: 0 15px; border-radius: 14px; font-size: 22px; white-space: nowrap; background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.2); transition: transform .12s, background .2s; }
.chip:active { transform: scale(.93); } .chip.on { background: rgba(var(--accent-rgb), .9); border-color: var(--accent); color: #03263a; font-weight: 700; }
.chip.q { border-color: rgba(var(--au-rgb), .5); color: #ffe7b0; } .chip.ghost { margin-left: auto; color: var(--sub); }
#cNum .chip { width: 54px; padding: 0; text-align: center; font-family: Consolas, monospace; font-size: 25px; } #cNum .chip.off { opacity: .22; pointer-events: none; }
.rv-btns { display: flex; gap: 14px; } .rv-btns .btn { height: 66px; line-height: 63px; font-size: 26px; padding: 0 28px; }
#funnel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; margin-top: 14px; font-size: 24px; color: var(--sub); min-height: 50px; }
#funnel label { margin-right: 8px; } #funnel b { min-width: 50px; height: 46px; line-height: 44px; padding: 0 10px; border-radius: 12px; text-align: center; font-family: Consolas, monospace; font-size: 28px; color: var(--ink); background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.16); }
#funnel b.cur { background: rgba(var(--accent-rgb), .9); border-color: var(--accent); color: #03263a; } #funnel b.best { border-color: var(--au); color: var(--au); } #funnel b.best.cur { background: var(--au); color: #3a2600; }
#funnel i { font-style: normal; color: #6f8496; }
#rvNote { margin-top: 10px; font-size: 26px; line-height: 1.55; color: #d6e8f4; } #rvNote b { color: var(--au); } #rvNote .key { display: block; margin-top: 2px; font-size: 30px; color: #fff; font-weight: 700; } #rvNote .key em { font-style: normal; color: var(--accent); }

/* —— 提问链 */
#chain { left: 1330px; top: 122px; width: 550px; height: 924px; padding: 20px 22px; border-radius: 26px; background: var(--card); border: 1px solid rgba(var(--accent-rgb), .2); box-shadow: 0 18px 50px rgba(0,0,0,.4); display: flex; flex-direction: column; }
#chain header { display: flex; align-items: baseline; justify-content: space-between; }
#chain h3 { margin: 0; font-size: 34px; letter-spacing: .06em; } #count { font-size: 22px; color: var(--au); }
#turn { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 8px 10px; border-radius: 16px; background: rgba(var(--au-rgb), .1); border: 1px solid rgba(var(--au-rgb), .4); font-size: 24px; color: #ffe7b0; }
#turn b { color: #fff; font-size: 28px; margin: 0 4px; } #turn button { width: 50px; height: 50px; border-radius: 50%; text-align: center; font-size: 34px; line-height: 44px; background: rgba(255,255,255,.08); }
#turn button:active { transform: scale(.9); } #turn.done { background: rgba(var(--ok-rgb), .1); border-color: rgba(var(--ok-rgb), .5); color: #c9f7e2; justify-content: center; padding: 15px 10px; } #turn.done button { display: none; }
#log { list-style: none; margin: 4px -8px 0 0; padding: 12px 8px 0 0; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(var(--accent-rgb), .3) transparent; }
#log li { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px 12px 10px; margin-bottom: 10px; border-radius: 16px; background: rgba(255,255,255,.045); border: 1.5px solid transparent; animation: slide .4s ease-out; transition: opacity .3s, border-color .3s, background .3s; }
@keyframes slide { from { opacity: 0; transform: translateY(14px); } }
#log .no { width: 40px; height: 40px; border-radius: 50%; background: rgba(var(--accent-rgb), .16); color: var(--accent); font-size: 21px; line-height: 40px; text-align: center; font-weight: 700; font-family: Consolas, monospace; }
#log .q { font-size: 23px; line-height: 1.4; min-width: 0; word-break: break-all; } #log .q small { display: block; font-size: 17px; color: var(--sub); letter-spacing: .04em; }
#log .a { min-width: 68px; padding: 5px 0; border-radius: 12px; font-size: 24px; font-weight: 700; text-align: center; }
#log li.y .a { background: rgba(var(--ok-rgb), .16); color: var(--ok); } #log li.n .a { background: rgba(var(--no-rgb), .15); color: var(--no); }
#log .cutbar { grid-column: 2 / 4; display: none; align-items: center; gap: 10px; font-size: 19px; color: var(--sub); }
#log .cutbar i { display: block; height: 8px; border-radius: 4px; background: var(--au); min-width: 4px; } #log .cutbar b { color: #ffe7b0; font-weight: 400; white-space: nowrap; }
#chain.review #log li { cursor: pointer; } #chain.review #log li.shown .cutbar { display: flex; }
#chain.review #log li.later { opacity: .35; } #chain.review #log li.cur { border-color: rgba(var(--accent-rgb), .7); background: rgba(var(--accent-rgb), .1); }
#log li.best { border-color: var(--au) !important; background: rgba(var(--au-rgb), .12) !important; }
#log li.best::before { content: "最有效"; position: absolute; right: 10px; top: -12px; padding: 2px 12px; border-radius: 99px; background: var(--au); color: #3a2600; font-size: 17px; font-weight: 700; }
#empty { position: absolute; left: 0; right: 0; top: 46%; text-align: center; font-size: 22px; line-height: 1.8; color: #7f93a6; pointer-events: none; }

/* —— 设置 */
#setPane { right: 40px; top: 92px; width: 520px; padding: 22px 26px; border-radius: 22px; background: rgba(8,19,35,.97); border: 1px solid rgba(var(--accent-rgb), .4); box-shadow: 0 24px 60px rgba(0,0,0,.6); z-index: 20; font-size: 22px; }
#setPane h4 { margin: 0 0 12px; font-size: 24px; } #setPane p { margin: 14px 0; font-size: 18px; color: var(--sub); line-height: 1.6; }
.st { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; } .st > span { line-height: 1.35; }
.stp { display: flex; align-items: center; gap: 10px; } .stp b { width: 48px; text-align: center; font-size: 28px; font-family: Consolas, monospace; }
.stp button { width: 46px; height: 46px; border-radius: 50%; text-align: center; font-size: 28px; line-height: 42px; background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.3); }
.seg { display: flex; border-radius: 12px; overflow: hidden; border: 1px solid rgba(var(--accent-rgb), .4); flex: none; }
.seg button { padding: 8px 16px; font-size: 20px; color: var(--sub); white-space: nowrap; } .seg button.on { background: rgba(var(--accent-rgb), .9); color: #03263a; font-weight: 700; }

/* 提示条（common.js 建的，挂在 body 上，不跟 #stage 缩放，所以字号乘 --k） */
.toast { position: fixed; left: 50%; bottom: calc(60px * var(--k)); transform: translate(-50%, 20px); max-width: 80vw; padding: .55em 1.2em; border-radius: .7em; font-size: calc(26px * var(--k)); line-height: 1.45;
  background: rgba(8,20,36,.95); border: 1.5px solid rgba(var(--au-rgb), .7); color: #ffe7b0; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.shake { animation: shake .4s; } @keyframes shake { 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
