* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body { font-family:"Microsoft YaHei",sans-serif; background:linear-gradient(180deg,#6db3f2,#bfe6ff 55%,#9be29b); min-height:100vh; color:#333; user-select:none; }
.hidden { display:none !important; }
#app { max-width:900px; margin:0 auto; padding:12px; }
h1 { font-size:30px; color:#fff; text-shadow:0 2px 0 #3a7bd5,0 4px 8px rgba(0,0,0,.2); }
.home-head,.lv-head { display:flex; align-items:center; gap:12px; padding:8px 4px; }
.lv-title { font-size:22px; font-weight:bold; color:#fff; text-shadow:0 2px 3px rgba(0,0,0,.25); flex:1; }
.lv-stars { font-size:20px; }
.icon-btn { font-size:22px; background:#fff; border:none; border-radius:12px; width:44px; height:44px; cursor:pointer; box-shadow:0 3px 0 rgba(0,0,0,.15); }
.quota { font-size:14px; color:#fff; font-weight:bold; text-shadow:0 1px 2px rgba(0,0,0,.3); }

/* 主页 */
.profiles { display:flex; gap:10px; margin:10px 0; flex-wrap:wrap; }
.profile-chip { display:flex; align-items:center; gap:8px; background:#fff; border:3px solid transparent; border-radius:40px; padding:6px 16px 6px 8px; cursor:pointer; font-size:16px; font-weight:bold; box-shadow:0 3px 0 rgba(0,0,0,.12); }
.profile-chip.active { border-color:#ff9a3d; }
.profile-face { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:18px; }
.guide-bubble { background:#fff; border-radius:18px; padding:12px 16px; font-size:17px; margin:8px 0; box-shadow:0 3px 8px rgba(0,0,0,.12); position:relative; }
.map { display:flex; flex-wrap:wrap; gap:10px; margin:12px 0; }
.map-node { width:64px; height:64px; border-radius:16px; border:none; background:#fff; font-size:13px; font-weight:bold; cursor:pointer; box-shadow:0 4px 0 rgba(0,0,0,.15); position:relative; color:#555; }
.map-node .mn-stars { position:absolute; bottom:2px; left:0; right:0; font-size:10px; color:#f5a623; }
.map-node.locked { background:#cfd8dc; color:#90a4ae; cursor:not-allowed; }
.map-node.ch1 { background:#ffe0b2; } .map-node.ch2 { background:#c8e6c9; } .map-node.ch3 { background:#d1c4e9; }
.big-btn { padding:14px 40px; font-size:22px; font-weight:bold; color:#fff; background:linear-gradient(180deg,#ff9a3d,#ff6b3d); border:none; border-radius:50px; cursor:pointer; box-shadow:0 5px 0 #d14e1f,0 8px 14px rgba(0,0,0,.2); letter-spacing:2px; }
.big-btn:active { transform:translateY(3px); box-shadow:0 2px 0 #d14e1f; }
.big-btn:disabled { background:#b0bec5; box-shadow:0 5px 0 #78909c; cursor:not-allowed; }
.big-btn.small { padding:8px 22px; font-size:17px; }
.workshop-btn { display:block; margin:6px auto 14px; background:linear-gradient(180deg,#7c6bff,#5a4bd8); box-shadow:0 5px 0 #3f34a0,0 8px 14px rgba(0,0,0,.2); }
.skin-bar { display:flex; gap:10px; justify-content:center; padding:8px; }
.skin-dot { width:38px; height:38px; border-radius:50%; border:4px solid transparent; cursor:pointer; }
.skin-dot.locked { opacity:.25; cursor:not-allowed; }
.skin-dot.active { border-color:#ff6b3d; }

/* 闯关 */
.lv-body { display:flex; justify-content:center; }
.grid { display:grid; gap:4px; background:rgba(255,255,255,.4); padding:10px; border-radius:16px; width:max-content; margin:0 auto; }
.cell { width:52px; height:52px; background:rgba(255,255,255,.75); border-radius:10px; position:relative; display:flex; align-items:center; justify-content:center; font-size:28px; }
.cell.wall { background:#8d6e63; }
.cell .star,.cell .flag { position:absolute; }
.monster { position:absolute; inset:4px; border-radius:12px; background:#a626ff; display:flex; align-items:center; justify-content:center; font-size:26px; transition:all .3s ease; z-index:2; box-shadow:inset 0 -6px 0 rgba(0,0,0,.2); }
.monster .eyes { color:#fff; font-size:20px; font-weight:bold; letter-spacing:2px; }
.monster.bonk { animation:bonk .5s; }
@keyframes bonk { 0%,100%{transform:translate(0,0)} 25%{transform:translate(0,-14px) rotate(-12deg)} 60%{transform:translate(0,8px) rotate(10deg)} }
.hud { display:flex; gap:10px; align-items:center; justify-content:center; margin:10px 0; flex-wrap:wrap; }
.slot-count { font-weight:bold; font-size:17px; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.3); }
.slot-count.full { color:#ff4444; }
.pill-btn { padding:8px 18px; font-size:16px; font-weight:bold; background:#fff; border:none; border-radius:30px; cursor:pointer; box-shadow:0 3px 0 rgba(0,0,0,.15); }
.card-pool { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin:6px 0; }
.cmd-card { min-width:64px; padding:8px 10px 4px; background:#fff; border-radius:12px; border:none; cursor:pointer; box-shadow:0 4px 0 rgba(0,0,0,.18); font-size:20px; font-weight:bold; text-align:center; }
.cmd-card small { display:block; font-size:9px; color:#888; font-family:monospace; font-weight:normal; }
.cmd-card.repeat { background:#ffe9a8; } .cmd-card.wallturn { background:#c8f0ff; }
.program { min-height:74px; max-height:180px; overflow-y:auto; background:rgba(255,255,255,.55); border-radius:14px; padding:8px; display:flex; flex-wrap:wrap; gap:6px; align-items:flex-start; }
.prog-card { min-width:52px; padding:6px 8px 2px; background:#fff; border-radius:10px; font-size:17px; font-weight:bold; text-align:center; box-shadow:0 2px 0 rgba(0,0,0,.12); }
.prog-card small { display:block; font-size:8px; color:#888; font-family:monospace; font-weight:normal; }
.prog-card.repeat,.prog-card .prog-card { background:#ffe9a8; }
.prog-card.wallturn { background:#c8f0ff; }
.prog-box { border:2px dashed #f5a623; border-radius:10px; padding:4px; display:flex; flex-wrap:wrap; gap:4px; align-items:flex-start; background:rgba(255,233,168,.35); }
.prog-box .box-label { width:100%; font-size:11px; font-weight:bold; color:#c07f00; }
.run-cell { display:flex; align-items:center; gap:4px; }
.hint-box { position:fixed; left:50%; bottom:20px; transform:translateX(-50%); background:#fff8e1; border:2px solid #f5a623; border-radius:14px; padding:12px 20px; font-size:16px; max-width:88%; box-shadow:0 6px 18px rgba(0,0,0,.25); z-index:30; }
.toast { position:fixed; left:50%; top:18%; transform:translateX(-50%); background:rgba(30,40,70,.9); color:#fff; border-radius:14px; padding:12px 22px; font-size:18px; z-index:40; text-align:center; }
.overlay { position:fixed; inset:0; background:rgba(20,40,80,.72); display:flex; align-items:center; justify-content:center; z-index:50; }
.win-card { background:#fff; border-radius:24px; padding:30px 40px; text-align:center; }
.win-stars { font-size:46px; letter-spacing:6px; }
.win-shard { margin:10px 0; font-size:18px; color:#a626ff; font-weight:bold; }
#winText { font-size:20px; margin:8px 0; }
.overlay .pill-btn { margin-top:10px; }

/* 工坊 */
.ws-body { display:flex; gap:12px; }
.ws-chat-col { flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; }
.chat { height:46vh; overflow-y:auto; background:rgba(255,255,255,.6); border-radius:16px; padding:10px; display:flex; flex-direction:column; gap:8px; }
.msg { max-width:85%; padding:9px 14px; border-radius:16px; font-size:15px; line-height:1.5; white-space:pre-wrap; word-break:break-word; }
.msg.bobo { background:#fff; align-self:flex-start; border-bottom-left-radius:4px; }
.msg.kid { background:#7c6bff; color:#fff; align-self:flex-end; border-bottom-right-radius:4px; }
.msg .tag { display:inline-block; background:#e8f5e9; color:#2e7d32; border-radius:8px; padding:1px 8px; font-size:12px; margin:3px 2px 0 0; }
.chat-input-row { display:flex; gap:8px; }
.chat-input-row input { flex:1; border:none; border-radius:30px; padding:12px 18px; font-size:16px; outline:none; }
.ws-preview-col { width:46%; display:flex; flex-direction:column; gap:8px; }
.game-frame { width:100%; height:46vh; border:none; border-radius:16px; background:#fff; }
.cards-panel { background:#fff; border-radius:16px; padding:10px 14px; }
.cards-panel h3 { font-size:15px; margin-bottom:6px; }
.knob-row { display:flex; align-items:center; gap:8px; margin:6px 0; font-size:14px; flex-wrap:wrap; }
.knob-row .concept { background:#e3f2fd; color:#1565c0; border-radius:8px; padding:1px 8px; font-size:12px; }
.knob-row input[type=range] { flex:1; }
.knob-row .val { font-weight:bold; min-width:24px; text-align:center; }
.quiz-box { background:#fff8e1; border:2px solid #f5a623; border-radius:14px; padding:12px; }
.quiz-box p.q { font-weight:bold; font-size:16px; margin-bottom:8px; }
.quiz-opt { display:block; width:100%; text-align:left; margin:5px 0; padding:9px 12px; font-size:15px; background:#fff; border:2px solid #eee; border-radius:10px; cursor:pointer; }
.quiz-opt.ok { border-color:#4caf50; background:#e8f5e9; }
.quiz-opt.bad { border-color:#ef5350; background:#ffebee; }
@media (max-width:760px){ .ws-body{flex-direction:column} .ws-preview-col{width:100%} .chat{height:32vh} .game-frame{height:38vh} .cell{width:44px;height:44px} }
