/* ============ 信号城 · 赛博风 ============ */
:root {
  --bg: #05060a;
  --bg2: #0b0e17;
  --line: #1c2436;
  --cyan: #00f0ff;
  --pink: #ff2e88;
  --green: #39ff88;
  --amber: #ffcc33;
  --text: #d8f6ff;
  --dim: #7d8aa3;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --sans: -apple-system, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  --hud: 52px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); min-height: 100%; }
body { overflow-x: hidden; }
body::before { /* 霓虹网格背景 */
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(0, 240, 255, .14), transparent 55%),
    radial-gradient(ellipse at 110% 110%, rgba(255, 46, 136, .14), transparent 55%),
    linear-gradient(rgba(0, 240, 255, .04) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(0, 240, 255, .04) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
}
body::after { /* 扫描线 */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
button { font: inherit; color: inherit; cursor: pointer; }
code { font-family: var(--mono); }

.title-tag { font: 600 11px/1 var(--mono); letter-spacing: .2em; color: var(--cyan); text-transform: uppercase; opacity: .85; }

.btn-neon {
  background: linear-gradient(90deg, rgba(0, 240, 255, .15), rgba(255, 46, 136, .15));
  border: 1px solid var(--cyan); color: #fff; padding: 12px 22px; border-radius: 4px;
  font-weight: 700; letter-spacing: .08em; box-shadow: 0 0 18px rgba(0, 240, 255, .35), inset 0 0 12px rgba(0, 240, 255, .15);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform .15s, box-shadow .15s;
}
.btn-neon:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(0, 240, 255, .6), inset 0 0 16px rgba(255, 46, 136, .25); }
.btn-neon:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-neon.big { font-size: 18px; padding: 16px 40px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--dim); padding: 11px 20px; border-radius: 4px; }
.btn-ghost:hover { border-color: var(--cyan); color: var(--text); }
.btn-link { background: none; border: 0; color: var(--dim); text-decoration: underline; font-size: 12px; margin: 30px auto 0; display: block; }

/* glitch 文字 */
.glitch { position: relative; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; overflow: hidden; }
.glitch::before { color: var(--pink); transform: translate(2px, 0); clip-path: inset(0 0 55% 0); animation: gl1 2.8s infinite steps(1); mix-blend-mode: screen; }
.glitch::after { color: var(--cyan); transform: translate(-2px, 0); clip-path: inset(55% 0 0 0); animation: gl2 3.4s infinite steps(1); mix-blend-mode: screen; }
@keyframes gl1 { 0%, 90%, 100% { transform: translate(2px, 0); } 92% { transform: translate(-6px, -2px); } 95% { transform: translate(5px, 2px); } }
@keyframes gl2 { 0%, 85%, 100% { transform: translate(-2px, 0); } 88% { transform: translate(6px, 1px); } 93% { transform: translate(-4px, -1px); } }

/* ============ HUD ============ */
#hud {
  position: fixed; top: 0; left: 0; right: 0; height: var(--hud); z-index: 50;
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: rgba(5, 6, 10, .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.hud-brand { background: none; border: 0; font: 800 15px var(--mono); color: var(--cyan); letter-spacing: .1em; padding: 0; white-space: nowrap; }
.hud-sync { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.hud-label { font: 11px var(--mono); color: var(--dim); white-space: nowrap; }
.hud-bar { flex: 1; max-width: 260px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.hud-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: 0 0 10px var(--cyan); transition: width .8s; }
#syncNum { font: 700 13px var(--mono); color: var(--cyan); }
.hud-rank { font: 600 12px var(--mono); color: var(--pink); border: 1px solid rgba(255, 46, 136, .5); padding: 4px 8px; border-radius: 3px; white-space: nowrap; }
.hud-btn { background: none; border: 1px solid var(--line); border-radius: 4px; width: 34px; height: 30px; }
@media (max-width: 560px) { .hud-label { display: none; } .hud-rank { font-size: 11px; padding: 3px 6px; } }

#stage { min-height: 100vh; padding-top: var(--hud); }

/* ============ 对话框 ============ */
#dialog { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: linear-gradient(transparent 40%, rgba(0, 0, 0, .55)); cursor: pointer; }
.d-box {
  width: min(760px, 100%); display: flex; gap: 14px; align-items: flex-start; position: relative;
  background: rgba(8, 12, 22, .94); border: 1px solid var(--cyan); padding: 18px 20px 22px;
  box-shadow: 0 0 30px rgba(0, 240, 255, .25); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  animation: dIn .25s ease-out;
}
@keyframes dIn { from { opacity: 0; transform: translateY(14px); } }
.d-avatar { flex: none; width: 52px; height: 52px; display: grid; place-items: center; font: 900 24px var(--mono); color: var(--bg); background: linear-gradient(135deg, var(--cyan), var(--pink)); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.d-name { font: 700 12px var(--mono); color: var(--cyan); letter-spacing: .1em; margin-bottom: 6px; }
.d-text { font-size: 17px; line-height: 1.7; min-height: 2.4em; }
.d-next { position: absolute; right: 18px; bottom: 6px; color: var(--cyan); font-size: 12px; opacity: 0; }
#dialog.ready .d-next { opacity: 1; animation: bob 1s infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }
#dialog.who-sys .d-box { border-color: var(--pink); box-shadow: 0 0 30px rgba(255, 46, 136, .3); }
#dialog.who-sys .d-name { color: var(--pink); }
#dialog.who-sys .d-avatar { background: var(--pink); }
#dialog.who-sys .d-text { font-family: var(--mono); font-size: 15px; }
@media (max-width: 560px) { .d-text { font-size: 15px; } .d-avatar { width: 40px; height: 40px; font-size: 18px; } }

/* toast */
#toast { position: fixed; top: calc(var(--hud) + 14px); left: 50%; transform: translate(-50%, -20px); z-index: 300; opacity: 0; pointer-events: none; transition: .25s; background: rgba(8, 12, 22, .95); border: 1px solid var(--cyan); padding: 10px 16px; border-radius: 4px; font-size: 14px; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: var(--pink); color: #ffd0e2; }

/* ============ 标题屏 ============ */
.title-screen { display: grid; place-items: center; padding: 30px 20px; }
.title-wrap { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.title-wrap h1 { font: 900 clamp(64px, 16vw, 132px)/1 var(--sans); margin: 0; letter-spacing: .06em; color: #fff; text-shadow: 0 0 24px rgba(0, 240, 255, .7), 0 0 60px rgba(255, 46, 136, .4); }
.title-sub { margin: 0; color: var(--dim); font-size: 16px; letter-spacing: .1em; }
.title-terminal { font: 13px/1.9 var(--mono); color: var(--green); text-align: left; border: 1px solid var(--line); background: rgba(0, 0, 0, .4); padding: 12px 18px; margin: 10px 0; }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.title-foot { color: var(--dim); font-size: 12px; margin: 0; }
.intro-screen { position: relative; }
.intro-city { position: fixed; inset: 0; overflow: hidden; }
.intro-grid { position: absolute; left: -50%; right: -50%; bottom: 0; height: 60%; background: linear-gradient(rgba(255, 46, 136, .5) 1px, transparent 1px) 0 0 / 60px 60px, linear-gradient(90deg, rgba(0, 240, 255, .5) 1px, transparent 1px) 0 0 / 60px 60px; transform: perspective(300px) rotateX(60deg); transform-origin: bottom; animation: gridMove 2s linear infinite; mask-image: linear-gradient(transparent, #000); }
@keyframes gridMove { to { background-position: 0 60px, 0 0; } }

/* ============ 地图 ============ */
.map-screen { max-width: 640px; margin: 0 auto; padding-left: 18px; padding-right: 18px; padding-bottom: 60px; }
.map-head { padding: 28px 0 18px; }
.map-head h2 { font-size: 30px; margin: 8px 0; }
.map-head p { color: var(--dim); margin: 0; font-size: 14px; }
.map-list { display: flex; flex-direction: column; }
.map-node { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; background: rgba(11, 14, 23, .85); border: 1px solid var(--line); padding: 14px 16px; border-radius: 4px; transition: .2s; }
.map-node.current { border-color: var(--cyan); box-shadow: 0 0 20px rgba(0, 240, 255, .3); animation: pulse 2s infinite; }
.map-node.done { border-color: rgba(57, 255, 136, .5); }
.map-node.locked { opacity: .45; }
.map-node:hover:not(.locked) { transform: translateX(4px); }
@keyframes pulse { 50% { box-shadow: 0 0 34px rgba(0, 240, 255, .55); } }
.mn-icon { font-size: 28px; width: 48px; height: 48px; display: grid; place-items: center; background: rgba(0, 240, 255, .07); border: 1px solid var(--line); border-radius: 4px; flex: none; }
.mn-body { flex: 1; min-width: 0; }
.mn-ch { font: 11px var(--mono); color: var(--dim); }
.mn-title { font-size: 18px; font-weight: 700; margin: 3px 0; }
.mn-desc { font-size: 13px; color: var(--dim); }
.mn-state { font: 700 12px var(--mono); color: var(--cyan); white-space: nowrap; }
.map-node.done .mn-state { color: var(--green); }
.map-link { width: 2px; height: 22px; background: var(--line); margin-left: 39px; }
.map-link.lit { background: var(--green); box-shadow: 0 0 8px var(--green); }
.map-screen > .btn-neon.big { display: block; margin: 26px auto 0; }
.map-future { margin-top: 36px; border-top: 1px dashed var(--line); padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.future-node { display: grid; grid-template-columns: 52px 1fr; gap: 2px 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 4px; opacity: .55; }
.future-node b { font: 700 12px var(--mono); color: var(--pink); grid-row: span 2; align-self: center; }
.future-node small { color: var(--dim); font-size: 12px; }

/* ============ 关卡通用 ============ */
.level-screen { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.lv-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(5, 6, 10, .6); flex-wrap: wrap; }
.lv-title { font-weight: 800; font-size: 16px; display: flex; flex-direction: column; }
.lv-title small { font: 11px var(--mono); color: var(--dim); font-weight: 400; }
.lv-obj { font-size: 13px; color: var(--amber); display: flex; align-items: center; gap: 8px; }
.obj-tag { font: 700 10px var(--mono); background: var(--amber); color: #000; padding: 2px 6px; border-radius: 2px; letter-spacing: .1em; }
.lv-root { flex: 1; min-height: 0; position: relative; display: flex; }
.level-screen.alarm .lv-root { animation: alarm .5s 3; }
@keyframes alarm { 50% { box-shadow: inset 0 0 0 4px var(--pink), inset 0 0 120px rgba(255, 46, 136, .6); } }

/* ============ 0-1 聊天框 ============ */
.chatbox { margin: auto; width: min(440px, calc(100% - 24px)); height: min(640px, calc(100% - 24px)); background: #f4f5f8; color: #222; border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 0 0 6px #1a1d27, 0 0 60px rgba(0, 240, 255, .25); font-family: var(--sans); }
.cb-head { padding: 14px 18px; background: #fff; font-weight: 700; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #e6e8ee; }
.cb-head small { color: #999; font-weight: 400; font-size: 12px; margin-left: auto; }
.cb-dot { width: 10px; height: 10px; border-radius: 50%; background: #4c8dff; }
.cb-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cb-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.6; animation: dIn .2s; }
.cb-msg.bot { background: #fff; align-self: flex-start; border-top-left-radius: 4px; }
.cb-msg.me { background: #4c8dff; color: #fff; align-self: flex-end; border-top-right-radius: 4px; }
.cb-msg.fail { border: 1px solid #ffb4cc; background: #fff4f7; }
.cb-msg.typing { color: #aaa; letter-spacing: 3px; }
.cb-chips { padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; background: #fff; border-top: 1px solid #e6e8ee; }
.chip { border: 1px solid #d6dae4; background: #fff; color: #333; padding: 8px 12px; border-radius: 18px; font-size: 13px; }
.chip.act { border-color: #4c8dff; color: #2b6be6; }
.chip:disabled { opacity: .4; cursor: default; }
.chatbox.glitching { animation: shatter 1.2s steps(6) forwards; }
@keyframes shatter { 0% { filter: none; } 20% { transform: translate(-6px, 2px) skewX(4deg); filter: hue-rotate(90deg); } 40% { transform: translate(6px, -2px); filter: invert(1); } 60% { transform: translate(-3px, 0) skewX(-6deg); filter: hue-rotate(200deg) saturate(3); } 80% { transform: none; filter: invert(1) hue-rotate(90deg); } 100% { transform: none; filter: grayscale(1) brightness(.4); } }
.chatbox.broken { filter: grayscale(1) brightness(.4); }

/* ============ 0-2 组装 ============ */
.assemble { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 18px 14px 30px; overflow-y: auto; }
.mech { position: relative; width: min(560px, 100%); display: grid; grid-template-columns: 1fr 1.25fr 1fr; grid-template-areas: 'book brain eye' 'hand brain key'; gap: 14px; padding: 46px 14px 16px; }
.mech-frame { position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(rgba(0, 240, 255, .03), rgba(255, 46, 136, .03)); }
.mech-name { position: absolute; top: 12px; left: 0; right: 0; text-align: center; font: 700 12px var(--mono); color: var(--dim); letter-spacing: .2em; }
.mech.online .mech-frame { border-color: var(--cyan); box-shadow: 0 0 40px rgba(0, 240, 255, .4), inset 0 0 40px rgba(0, 240, 255, .15); animation: pulse 1.6s infinite; }
.mech.online .mech-name { color: var(--cyan); }
.slot { position: relative; min-height: 104px; border: 1px dashed #344058; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 6px; cursor: pointer; background: rgba(0, 0, 0, .25); transition: .2s; text-align: center; }
.slot-book { grid-area: book; } .slot-brain { grid-area: brain; border-radius: 50% / 40%; } .slot-eye { grid-area: eye; } .slot-hand { grid-area: hand; } .slot-key { grid-area: key; }
.slot-l { font: 11px var(--mono); color: var(--dim); }
.slot-c { font-size: 24px; color: #344058; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.slot-c b { font-size: 30px; }
.slot-c span { font-size: 14px; color: var(--text); font-weight: 700; }
.slot-c small { font-size: 10px; color: var(--cyan); line-height: 1.3; }
.slot.over, .slot:hover { border-color: var(--cyan); }
.slot.filled { border-style: solid; border-color: var(--cyan); background: rgba(0, 240, 255, .08); box-shadow: inset 0 0 18px rgba(0, 240, 255, .15); }
.slot.shake { animation: shake .4s; border-color: var(--pink); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: min(560px, 100%); }
.part { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); background: var(--bg2); border-radius: 4px; cursor: grab; user-select: none; transition: .15s; }
.part b { font-size: 22px; }
.part.sel { border-color: var(--amber); box-shadow: 0 0 14px rgba(255, 204, 51, .5); transform: translateY(-3px); }
.part.trash { animation: shake .4s; border-color: var(--pink); opacity: .5; }
.readout { width: min(560px, 100%); font: 12px/1.8 var(--mono); color: var(--green); }
.ro-line { animation: dIn .3s; }
.brands { border: 1px solid var(--cyan); padding: 12px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; animation: dIn .4s; }
.brands .title-tag { width: 100%; }
.brands span { border: 1px solid var(--line); padding: 4px 10px; color: var(--text); font-size: 12px; }

/* ============ WorkBuddy 仿真 ============ */
.wb { flex: 1; display: flex; flex-direction: column; min-height: 0; margin: 10px; border: 1px solid #2a3142; border-radius: 10px; overflow: hidden; background: #1b1c1f; color: #e7e7ea; position: relative; box-shadow: 0 0 0 1px rgba(0, 240, 255, .25), 0 0 40px rgba(0, 240, 255, .12); font-family: var(--sans); }
.wb::after { content: 'HUD · LINKED'; position: absolute; top: 6px; right: 10px; font: 10px var(--mono); color: var(--cyan); opacity: .6; pointer-events: none; z-index: 5; }
.wb-tabs { display: none; }
.wb-body { flex: 1; display: grid; grid-template-columns: 220px 1fr 260px; min-height: 0; }
.wb-side { background: #232427; border-right: 1px solid #2e3035; padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; overflow-y: auto; }
.wb-lights { display: flex; gap: 6px; margin-bottom: 8px; }
.wb-lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.wb-lights i:nth-child(2) { background: #febc2e; } .wb-lights i:nth-child(3) { background: #28c840; }
.wb-brand { font-weight: 700; margin-bottom: 8px; }
.wb-brand small { color: #777; font-weight: 400; margin-left: 6px; font-size: 11px; }
.wb-nav { display: flex; flex-direction: column; gap: 2px; }
.wb-ni { padding: 7px 8px; border-radius: 6px; color: #cfcfd4; cursor: default; }
.wb-ni.on { background: #34363b; color: #fff; }
.wb-ni em { font-style: normal; font-size: 9px; border: 1px solid #555; border-radius: 6px; padding: 0 4px; color: #999; }
.wb-recent { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; padding: 4px; border-radius: 6px; }
.wb-sec { font-size: 11px; color: #777; padding: 4px; }
.wb-ri { padding: 6px 4px; color: #bbb; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.wb-ri.live { color: #fff; background: #303237; border-radius: 4px; }
.wb-user { margin-top: auto; display: flex; align-items: center; gap: 8px; color: #ccc; padding-top: 12px; }
.wb-av { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, #6aa8ff, #9b6bff); }

.wb-main { position: relative; display: flex; flex-direction: column; align-items: center; padding: 16px 20px 8px; min-width: 0; min-height: 0; background: #1b1c1f; }
.wb-home { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: auto; position: relative; width: 100%; }
.wb-hello { font-size: 22px; font-weight: 700; }
.wb-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 520px; }
.wb-chips span { font-size: 12px; background: #2a2b2f; border: 1px solid #36383d; padding: 4px 10px; border-radius: 12px; color: #cfcfd4; }
.wb-buddy { position: absolute; right: 8%; top: 34px; font-size: 32px; }
.wb-convo { display: none; flex: 1; width: 100%; max-width: 640px; overflow-y: auto; flex-direction: column; gap: 10px; padding: 8px 12px 12px 2px; min-height: 0; }
.wb.tasking .wb-home { display: none; }
.wb.tasking .wb-convo { display: flex; }
.wb-composer { width: 100%; max-width: 640px; margin: 18px 0 auto; background: #232427; border: 1px solid #36383d; border-radius: 12px; padding: 12px 12px 8px; }
.wb.tasking .wb-composer { margin: 8px 0 0; }
.wb-input { min-height: 46px; color: #888; font-size: 14px; padding: 2px 4px; border-radius: 6px; }
.wb-cbar { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.wb-cbar .sp { flex: 1; }
.wb-plus { font-size: 18px; color: #aaa; padding: 0 4px; }
.wb-pill { background: none; border: 0; color: #ddd; font-size: 12px; padding: 4px 6px; border-radius: 6px; }
.wb-send { width: 26px; height: 26px; border-radius: 50%; background: #444; display: grid; place-items: center; font-size: 12px; }
.wb-sub { display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #2e3035; flex-wrap: wrap; }
.wb-mini { background: none; border: 0; color: #aaa; font-size: 12px; padding: 4px 6px; border-radius: 6px; }
.wb-mini.danger { color: #ff6b6b; }
.wb-mini.set { color: var(--green); }
.wb-disc { font-size: 11px; color: #9aa; background: #2a3550; padding: 2px 8px; border-radius: 3px; margin-top: 8px; }

.wb-panel { background: #202124; border-left: 1px solid #2e3035; display: flex; flex-direction: column; min-height: 0; }
.wb-ph { font-size: 12px; color: #999; padding: 12px 14px; border-bottom: 1px solid #2e3035; }
.wb-outlist { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.wb-empty { color: #666; font-size: 12px; text-align: center; margin-top: 40px; }
.out-item { background: #2a2b2f; border: 1px solid #3a3c42; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; animation: dIn .4s; }
.out-item small { color: #999; font-size: 11px; }
.out-item ol { margin: 0; padding-left: 18px; color: #ccc; font-size: 12px; line-height: 1.7; }
.out-thumb { aspect-ratio: 9 / 12; max-height: 200px; border-radius: 6px; background: linear-gradient(160deg, #0d3a52, #3b0f37 60%, #111); display: grid; place-items: center; position: relative; }
.out-thumb span { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .15); display: grid; place-items: center; font-size: 18px; }
.out-thumb em { position: absolute; bottom: 6px; right: 8px; font: 10px var(--mono); font-style: normal; color: #ddd; }

/* 对话流元素 */
.wb-msg { max-width: 88%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6; animation: dIn .2s; }
.wb-msg.me { align-self: flex-end; background: #34363b; }
.wb-msg.ai { align-self: flex-start; background: transparent; border: 1px solid #36383d; }
.wb-tool { font: 12px/1.5 var(--mono); color: #9aa3b5; display: flex; gap: 6px; align-items: baseline; animation: dIn .2s; }
.wb-tool.bad { color: #ff6b8f; }
.wb-tool i { flex: none; width: 10px; height: 10px; display: inline-block; }
i.spin { width: 10px; height: 10px; border: 2px solid #555; border-top-color: var(--cyan); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; flex: none; }
i.ok::before { content: '✓'; color: var(--green); }
i.x::before { content: '✗'; color: var(--pink); }
@keyframes spin { to { transform: rotate(360deg); } }
.wb-ask { border: 1px solid var(--amber); border-radius: 10px; padding: 12px; background: rgba(255, 204, 51, .06); display: flex; flex-direction: column; gap: 8px; animation: dIn .25s; }
.wb-ask.answered { opacity: .5; border-color: #3a3c42; }
.wb-ask-t { font-size: 11px; color: var(--amber); font-weight: 700; }
.wb-ask-q { font-size: 14px; }
.wb-ask code { font-size: 12px; background: #111; padding: 6px 8px; border-radius: 4px; color: #9fe; word-break: break-all; }
.wb-ask-b { display: flex; gap: 8px; }
.wb-ask-b button { flex: 1; padding: 8px; border-radius: 6px; border: 1px solid #555; background: #2a2b2f; }
.wb-ask-b button.ok { border-color: var(--amber); background: rgba(255, 204, 51, .15); }
.wb-choices { display: flex; flex-direction: column; gap: 8px; align-self: flex-end; width: min(100%, 420px); animation: dIn .25s; }
.wb-choices button { text-align: left; padding: 10px 14px; border: 1px solid var(--cyan); border-radius: 10px; background: rgba(0, 240, 255, .07); }
.wb-plan { border: 1px solid #36383d; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.wb-plan-t { font-weight: 700; margin-bottom: 6px; }
.pl { display: flex; align-items: center; gap: 8px; color: #999; padding: 2px 0; }
.pl i { width: 12px; height: 12px; border: 1px solid #666; border-radius: 3px; }
.pl.done { color: #ddd; }
.pl.done i { background: var(--green); border-color: var(--green); }

/* 导览高亮 */
.tour-target { position: relative; z-index: 3; outline: 2px solid var(--cyan) !important; outline-offset: 3px; border-radius: 6px; animation: tour 1.2s infinite; cursor: pointer !important; }
@keyframes tour { 50% { outline-color: var(--pink); box-shadow: 0 0 22px var(--pink); } }
.tour-seen { box-shadow: inset 0 0 0 1px rgba(57, 255, 136, .35); border-radius: 6px; }

/* 面板 / 卡片 */
.sheet { position: absolute; inset: 0; z-index: 20; background: rgba(5, 6, 10, .78); backdrop-filter: blur(5px); display: flex; align-items: flex-end; justify-content: center; padding: 14px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet-box { width: min(460px, 100%); background: #14171f; border: 1px solid var(--cyan); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 0 30px rgba(0, 240, 255, .25); }
.sheet-t { font: 700 13px var(--mono); color: var(--cyan); margin-bottom: 4px; }
.sheet-o { text-align: left; background: #1e222c; border: 1px solid #2c3242; border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.sheet-o:hover { border-color: var(--cyan); }
.sheet-o small { color: var(--dim); font-size: 12px; }
.sheet-o.danger b { color: #ff6b8f; }
.info-card { position: fixed; inset: 0; z-index: 150; background: rgba(5, 6, 10, .78); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.ic-box { width: min(420px, 100%); background: rgba(8, 12, 22, .97); border: 1px solid var(--cyan); padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 0 40px rgba(0, 240, 255, .3); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px)); }
.ic-box h3 { margin: 0; font-size: 26px; color: #fff; }
.ic-box p { margin: 0; line-height: 1.7; color: #cfe; }
.ic-real { font-size: 12px; color: var(--dim); }
.ic-real code { color: var(--pink); }
.ic-box .btn-neon { align-self: flex-end; }

/* 任务卡 */
.tc-sheet { align-items: center; overflow-y: auto; }
.taskcard { width: min(560px, 100%); background: #10131b; border: 1px solid var(--cyan); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 100%; overflow-y: auto; }
.tc-row { display: grid; grid-template-columns: 56px 1fr; gap: 6px 10px; align-items: start; }
.tc-k { font: 700 13px var(--mono); color: var(--amber); padding-top: 7px; }
.tc-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-o { background: #1e222c; border: 1px solid #2c3242; padding: 7px 11px; border-radius: 16px; font-size: 13px; }
.tc-o.wrong { border-color: var(--pink); color: #ff9fbf; text-decoration: line-through; }
.tc-o.right { border-color: var(--green); color: var(--green); background: rgba(57, 255, 136, .08); }
.tc-row.locked .tc-o:not(.right) { display: none; }
.tc-fb { grid-column: 2; font-size: 12px; color: #ff9fbf; }
.tc-pk { font: 11px var(--mono); color: var(--dim); }
.tc-preview { font-size: 14px; background: #1b1c1f; border: 1px solid #36383d; border-radius: 8px; padding: 10px 12px; min-height: 42px; }
.taskcard .btn-neon { align-self: flex-end; }

/* 奖励 */
.reward { position: fixed; inset: 0; z-index: 180; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; animation: fade .3s; }
.reward-card { width: min(380px, 100%); text-align: center; background: rgba(8, 12, 22, .97); border: 1px solid var(--green); padding: 26px 20px; box-shadow: 0 0 50px rgba(57, 255, 136, .3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.reward-card .title-tag { color: var(--green); }
.reward-icon { font-size: 64px; animation: pop .6s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes pop { from { transform: scale(0) rotate(-30deg); } }
.reward-card h3 { margin: 0; font-size: 20px; }
.reward-card p { margin: 0; color: var(--cyan); font: 700 14px var(--mono); }
.reward-bar { width: 100%; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.reward-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.reward-actions { display: flex; gap: 10px; margin-top: 8px; }

/* 段位卡 */
.end-screen { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 30px 16px 200px; }
.rank-card { width: min(360px, 100%); aspect-ratio: 3 / 4.4; position: relative; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; background: linear-gradient(160deg, #0a1a2a, #1a0820); border: 1px solid var(--cyan); box-shadow: 0 0 60px rgba(0, 240, 255, .3), inset 0 0 60px rgba(255, 46, 136, .15); clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px)); }
.rc-top { width: 100%; display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--dim); }
.rc-avatar { font-size: 72px; margin-top: 10px; filter: drop-shadow(0 0 20px var(--cyan)); }
.rc-code { font: 13px var(--mono); color: var(--dim); }
.rc-rank { font-size: 32px; font-weight: 900; color: #fff; }
.rc-sync { font: 700 14px var(--mono); color: var(--cyan); }
.rc-mods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; margin-top: auto; }
.rc-mods.ch7 { grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rc-mod { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1px solid var(--line); padding: 6px 2px; border-radius: 4px; }
.rc-mod b { font-size: 18px; }
.rc-mod small { font-size: 9px; color: var(--dim); text-align: center; line-height: 1.2; }
.rc-mod.off { opacity: .25; }
.rc-foot { font: 10px var(--mono); color: var(--dim); letter-spacing: .1em; }
.end-actions { display: flex; gap: 10px; }

/* ============ 章节分组与迷你互动实验室 ============ */
.ch-group { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.ch-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ch-tag { font: 700 11px var(--mono); color: var(--pink); border: 1px solid rgba(255, 46, 136, .45); padding: 2px 6px; border-radius: 3px; }
.ch-head h3 { margin: 0; font-size: 18px; color: #fff; }
.ch-head small { color: var(--dim); font-size: 12px; flex: 1; min-width: 160px; }
.ch-head em { font: 700 12px var(--mono); font-style: normal; color: var(--cyan); }
.ch-group .map-list { gap: 8px; }

.mini-lab { width: min(640px, 100%); margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; flex: 1; }
.gen-out { background: rgba(11, 14, 23, .9); border: 1px solid var(--cyan); padding: 16px; border-radius: 6px; font-size: 16px; line-height: 1.75; min-height: 92px; box-shadow: inset 0 0 24px rgba(0, 240, 255, .1); }
.prob-list { display: flex; flex-direction: column; gap: 10px; }
.prob-btn { text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; transition: .15s; }
.prob-btn:hover { border-color: var(--cyan); transform: translateX(3px); }
.pb-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.pb-top span { font: 700 13px var(--mono); color: var(--cyan); }
.pb-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.pb-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); }

.prompt-box { background: rgba(0, 240, 255, .06); border: 1px solid rgba(0, 240, 255, .35); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.prompt-box small { font: 11px var(--mono); color: var(--cyan); }
.prompt-box b { font-size: 15px; line-height: 1.6; }

.card-list { display: flex; flex-direction: column; gap: 10px; }
.check-item { text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; transition: .15s; font-size: 14px; line-height: 1.6; }
.check-item:hover { border-color: var(--cyan); }
.check-item small { color: var(--dim); font-size: 12px; }
.check-item.hit { border-color: var(--green); background: rgba(57, 255, 136, .09); }
.check-item.miss { border-color: var(--pink); background: rgba(255, 46, 136, .08); animation: shake .35s; }
.ci-why.ok { font-size: 12px; color: var(--green); margin-top: 4px; }

.mem-meter { display: flex; align-items: center; gap: 10px; font: 12px var(--mono); }
.mem-bar { flex: 1; height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.mem-bar i { display: block; height: 100%; background: var(--cyan); transition: width .35s; }
.mem-bar i.warn { background: linear-gradient(90deg, var(--amber), var(--pink)); }
.mem-feed { display: flex; flex-direction: column; gap: 8px; }
.mem-item { background: var(--bg2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 6px; font-size: 13px; transition: .35s; }
.mem-item.rule { border-color: var(--cyan); color: #fff; }
.mem-item.fade1 { opacity: .55; border-style: dashed; }
.mem-item.fade2 { opacity: .35; border-color: var(--pink); color: #ff9fbf; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.code-preview { background: #0c0f16; border: 1px solid var(--line); border-radius: 6px; padding: 14px; font: 13px/1.75 var(--mono); color: #cfe; white-space: pre-wrap; }
.code-preview.ok { border-color: var(--green); box-shadow: 0 0 20px rgba(57, 255, 136, .15); }

.plug-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plug-btn { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.plug-btn b { font-size: 28px; }
.plug-btn:hover { border-color: var(--cyan); }
.plug-btn.hit { border-color: var(--green); background: rgba(57, 255, 136, .1); }

.skel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.skel-card { text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.skel-card:hover { border-color: var(--cyan); }
.skel-card.hit { border-color: var(--green); background: rgba(57, 255, 136, .1); }
.skel-card small { color: var(--dim); font-size: 12px; }
.chip.hit { background: rgba(57, 255, 136, .18); border-color: var(--green); color: var(--green); }

/* ============ 手机端 ============ */
@media (max-width: 820px) {
  .wb { margin: 6px; }
  .wb-tabs { display: flex; border-bottom: 1px solid #2e3035; background: #232427; }
  .wb-tabs button { flex: 1; background: none; border: 0; padding: 10px 0; color: #999; font-size: 13px; position: relative; border-bottom: 2px solid transparent; }
  .wb-tabs button.on { color: #fff; border-bottom-color: var(--cyan); }
  .wb-tabs .dot { display: none; position: absolute; top: 8px; margin-left: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
  .wb.has-new .wb-tabs .dot { display: inline-block; }
  .wb-body { grid-template-columns: 1fr; }
  .wb-side, .wb-main, .wb-panel { display: none; }
  .wb[data-tab='desk'] .wb-side { display: flex; }
  .wb[data-tab='chat'] .wb-main { display: flex; }
  .wb[data-tab='out'] .wb-panel { display: flex; }
  .wb-side { border-right: 0; }
  .wb-main { padding: 12px 10px 8px; }
  .wb-buddy { display: none; }
  .wb::after { display: none; }
  .lv-obj { width: 100%; }
}
