:root {
  --bg-0: #10132a;
  --bg-1: #1b1f42;
  --floor: #2a2e52;
  --floor-2: #313663;
  --wall: #454b86;
  --panel: #2b3060;
  --ink: #eef0ff;
  --muted: #a9adcf;
  --teal: #45d3c4;
  --amber: #ffce54;
  --danger: #ff4d6d;
  --ok: #4bd07a;
  --radius: 16px;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  --world-w: 760px;
  --world-h: 520px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; min-height: 100%;
  font-family: "Baloo 2", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(900px 500px at 80% -10%, #33285f 0%, transparent 55%), linear-gradient(160deg, var(--bg-0), var(--bg-1));
  user-select: none; overflow-x: hidden; touch-action: manipulation;
}
#app { max-width: 800px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding: 8px 10px 16px; }
.hidden { display: none !important; }

/* ---------- 顶部栏 ---------- */
.topbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); padding: 8px 12px; }
.brand { font-size: 16px; font-weight: 800; color: var(--ink); display: flex; gap: 6px; align-items: center; }
.logo-cross { position: relative; width: 18px; height: 18px; background: #e5484d; border-radius: 5px; display: inline-block; }
.logo-cross::before, .logo-cross::after { content: ""; position: absolute; background: #fff; border-radius: 1px; }
.logo-cross::before { left: 7px; top: 3px; width: 4px; height: 12px; }
.logo-cross::after { left: 3px; top: 7px; width: 12px; height: 4px; }
.shift-tag { font-weight: 800; background: rgba(255,206,84,.16); color: var(--amber); border: 1px solid rgba(255,206,84,.4); padding: 3px 10px; border-radius: 999px; font-size: 13px; }
.stats { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.stat { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.08); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 14px; border: 1px solid rgba(255,255,255,.1); }
.carry.holding { border-color: var(--teal); background: rgba(69,211,196,.15); }
.ic-coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe08a, #e0a53a); border: 1px solid #b9812a; display: inline-block; }
.sanity-wrap { width: 100%; order: 3; display: flex; align-items: center; gap: 10px; }
.sanity-label { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.sanity-bar { flex: 1; height: 12px; background: rgba(0,0,0,.3); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); }
.sanity-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--danger), var(--amber) 45%, var(--ok)); border-radius: 999px; transition: width .3s ease; }

/* ---------- 按钮 ---------- */
.btn { border: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 15px; padding: 10px 16px; border-radius: 13px; color: #1a1030; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .08s ease, box-shadow .08s ease; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn.primary { background: var(--teal); }
.btn.big { font-size: 19px; padding: 13px 26px; }
.btn.ghost { background: rgba(255,255,255,.1); color: var(--ink); }
.btn.reject { background: var(--danger); color: #fff; }
.btn.admit { background: var(--ok); color: #06301a; }
.btn.inspect { background: var(--amber); }
.btn:disabled { opacity: .45; pointer-events: none; }

/* ---------- 开始界面 ---------- */
.screen { flex: 1; display: flex; align-items: center; justify-content: center; }
.start-card { background: var(--panel); border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 24px 20px 26px; text-align: center; max-width: 480px; box-shadow: var(--shadow); }
.start-badge { width: 60px; height: 60px; border-radius: 16px; background: #e5484d; position: relative; margin: 0 auto 6px; }
.start-badge::before, .start-badge::after { content: ""; position: absolute; background: #fff; border-radius: 2px; }
.start-badge::before { left: 25px; top: 12px; width: 10px; height: 36px; }
.start-badge::after { left: 12px; top: 25px; width: 36px; height: 10px; }
.start-card h1 { margin: 6px 0 4px; font-size: 28px; color: var(--teal); }
.tagline { margin: 0 0 14px; color: var(--muted); }
.tagline strong { color: var(--danger); }
.how { text-align: left; padding: 0; list-style: none; margin: 0 0 18px; }
.how li { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 11px; padding: 8px 11px 8px 30px; margin-bottom: 6px; font-size: 13px; position: relative; }
.how .dot { position: absolute; left: 11px; top: 12px; width: 10px; height: 10px; border-radius: 50%; }
.dot.d1 { background: #7cc7ff; } .dot.d2 { background: #8be0c8; } .dot.d3 { background: #ff9ec2; }
.dot.d4 { background: #ffce54; } .dot.d5 { background: #ff6f6f; } .dot.d6 { background: #b79cff; }

/* ---------- 世界 ---------- */
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; margin-top: 10px; position: relative; }
.world-wrap { position: relative; overflow: hidden; width: var(--world-w); height: var(--world-h); max-width: 100%; }
.world {
  position: relative; width: var(--world-w); height: var(--world-h); border-radius: 18px; overflow: hidden;
  border: 4px solid var(--wall); background-color: var(--floor);
  background-image: linear-gradient(45deg, var(--floor-2) 25%, transparent 25%, transparent 75%, var(--floor-2) 75%), linear-gradient(45deg, var(--floor-2) 25%, transparent 25%, transparent 75%, var(--floor-2) 75%);
  background-size: 56px 56px; background-position: 0 0, 28px 28px;
  box-shadow: var(--shadow); transform-origin: top left;
}
.room-label { position: absolute; font-size: 12px; font-weight: 800; color: rgba(255,255,255,.35); letter-spacing: 2px; pointer-events: none; }

/* 家具 */
.furn { position: absolute; border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.1), 0 6px 0 rgba(0,0,0,.3); }
.furn-label { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 800; color: #eef0ff; pointer-events: none; }
.furn-label.small { font-size: 10px; color: #ffd9a8; }
.furn.reception { background: linear-gradient(180deg, #4a4f8c, #3a3f72); }
.furn.reception::before { content: ""; position: absolute; left: 12px; right: 12px; top: 8px; height: 16px; background: linear-gradient(180deg, rgba(180,215,255,.5), rgba(150,190,255,.2)); border-radius: 5px; border: 1px solid rgba(255,255,255,.2); }
.furn.cameras { background: linear-gradient(180deg, #3a3f72, #2c3054); display: flex; align-items: center; justify-content: center; gap: 8px; padding-bottom: 6px; }
.mini-screen { width: 34px; height: 22px; background: #08160f; border: 2px solid #1a7a4e; border-radius: 3px; box-shadow: inset 0 0 6px rgba(40,255,150,.4); }
.furn.cameras.alarm .mini-screen { border-color: #ff4d6d; box-shadow: inset 0 0 8px rgba(255,60,90,.7); animation: recBlink .6s steps(2) infinite; }
.furn.cameras.alarm { box-shadow: inset 0 0 0 3px #ff4d6d, 0 0 18px rgba(255,77,109,.7); }
.furn.shelf { background: linear-gradient(180deg, #6a4a2f, #4e3620); }
.furn.shelf::before, .furn.shelf::after { content: ""; position: absolute; left: 4px; right: 4px; height: 3px; background: rgba(0,0,0,.35); border-radius: 2px; }
.furn.shelf::before { top: 44px; } .furn.shelf::after { top: 92px; }
.bottle { position: absolute; width: 14px; height: 22px; border-radius: 4px 4px 3px 3px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); }
.bottle::before { content: ""; position: absolute; left: 3px; top: -4px; width: 8px; height: 5px; background: rgba(255,255,255,.6); border-radius: 2px; }
.bottle.b1 { left: 14px; top: 18px; background: #ff9ec2; }
.bottle.b2 { left: 40px; top: 18px; background: #f0c088; }
.bottle.b3 { left: 14px; top: 66px; background: #bfe6df; }
.bottle.b4 { left: 40px; top: 66px; background: #eee6d2; }
.furn.bed { background: linear-gradient(180deg, #3a6a6f, #2c5155); }
.furn.bed .pillow { position: absolute; left: 8px; top: 12px; width: 24px; height: 42px; background: #eef4f5; border-radius: 8px; }
.furn.bed .blanket { position: absolute; left: 38px; right: 8px; top: 10px; bottom: 10px; background: linear-gradient(180deg, #57b0b5, #3f8b90); border-radius: 8px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.12); }
.furn.bed.occupied { box-shadow: inset 0 0 0 2px var(--teal), 0 6px 0 rgba(0,0,0,.3); }
.furn.near { box-shadow: inset 0 0 0 3px var(--amber), 0 6px 0 rgba(0,0,0,.3) !important; }

/* 交互提示 */
.prompt { position: absolute; transform: translate(-50%, -100%); background: #0c0e22; border: 1px solid var(--amber); color: var(--amber); font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 999px; pointer-events: none; z-index: 40; white-space: nowrap; }
.prompt b { color: #fff; }

/* ---------- 角色 ---------- */
.char { position: absolute; width: 48px; height: 60px; transform: translate(-50%, -100%); z-index: 10; overflow: visible; transition: left .35s linear, top .35s linear; }
.char.player { transition: none; z-index: 20; }
.char .fig { display: block; width: 48px; height: 60px; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.char .leg { transform-box: fill-box; transform-origin: center; }
.char.walking .fig .leg-l { animation: stepA .3s infinite; }
.char.walking .fig .leg-r { animation: stepB .3s infinite; }
@keyframes stepA { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes stepB { 0%,100% { transform: translateY(-3px); } 50% { transform: translateY(0); } }
.char.tw-twitch .fig { transform-origin: bottom center; animation: figTwitch .18s steps(2) infinite; }
@keyframes figTwitch { 0%,100% { transform: translateX(0) skewX(0); } 50% { transform: translateX(-2px) skewX(5deg); } }
.char.tw-tall .fig { transform: scaleY(1.28); transform-origin: bottom center; }
.char .ch-bubble { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); width: 26px; height: 26px; background: #fff; border-radius: 9px; box-shadow: 0 2px 4px rgba(0,0,0,.35); z-index: 6; display: flex; align-items: center; justify-content: center; }
.char .ch-bubble.hidden { display: none; }
.mini { width: 22px; height: 22px; display: block; }

/* ---------- 触摸控制 ---------- */
.controls { width: 100%; max-width: var(--world-w); margin-top: 12px; display: flex; align-items: center; justify-content: space-between; }
.dpad { position: relative; width: 132px; height: 132px; }
.dbtn { position: absolute; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.1); cursor: pointer; }
.dbtn:active { background: rgba(69,211,196,.3); }
.dbtn::before { content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0; border-style: solid; }
.dbtn.up::before { transform: translate(-50%, -60%); border-width: 0 8px 11px 8px; border-color: transparent transparent var(--ink) transparent; }
.dbtn.down::before { transform: translate(-50%, -40%); border-width: 11px 8px 0 8px; border-color: var(--ink) transparent transparent transparent; }
.dbtn.left::before { transform: translate(-60%, -50%); border-width: 8px 11px 8px 0; border-color: transparent var(--ink) transparent transparent; }
.dbtn.right::before { transform: translate(-40%, -50%); border-width: 8px 0 8px 11px; border-color: transparent transparent transparent var(--ink); }
.dbtn.up { left: 44px; top: 0; } .dbtn.down { left: 44px; bottom: 0; }
.dbtn.left { left: 0; top: 44px; } .dbtn.right { right: 0; top: 44px; }
.act-btn { width: 90px; height: 90px; border-radius: 50%; background: var(--teal); font-size: 18px; line-height: 1.1; }
.act-btn small { font-size: 12px; opacity: .7; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(6,8,20,.7); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 14px; animation: fade .2s ease; }
.modal-card { background: var(--panel); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 20px; max-width: 500px; width: 100%; text-align: center; box-shadow: var(--shadow); max-height: 92vh; overflow-y: auto; }
.modal-card h2 { margin: 0 0 8px; color: var(--teal); }
.modal-card p { color: var(--ink); margin: 0 0 12px; white-space: pre-line; }
.close-x { margin-top: 8px; }
.dawn-badge, .over-badge { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 6px; }
.dawn-badge { background: radial-gradient(circle at 50% 70%, #ffd76b, #ff8f5a); }
.over-badge { background: radial-gradient(circle at 50% 40%, #9b6bff, #3a2060); box-shadow: inset 0 0 12px rgba(255,60,90,.6); }

/* 接诊面板 */
.rec-view { height: 160px; display: flex; align-items: flex-end; justify-content: center; background: linear-gradient(180deg, #0e1030, #1a1f45); border-radius: 12px; position: relative; overflow: hidden; }
.rec-view .char { position: static; transform: scale(1.7); transform-origin: bottom center; margin-bottom: 8px; }
.rec-view .char.tw-tall .fig { transform: scaleY(1.28); }
.rec-claim { margin: 12px 0 6px; font-weight: 700; }
.rec-result { min-height: 40px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 8px; font-size: 14px; color: var(--muted); }
.rec-result.alert { border-color: var(--danger); color: #ff9fb0; font-weight: 700; }
.rec-result.clean { border-color: var(--ok); color: #9be6b4; }
.rec-actions { display: flex; gap: 8px; margin-top: 12px; }
.rec-actions .btn { flex: 1; }

/* 监控 */
.cctv-tip { font-size: 13px; color: var(--muted); }
.cctv-screen { position: relative; background: #05060f; border: 3px solid #2a2f5c; border-radius: 12px; height: 220px; overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.cctv-static { position: absolute; inset: 0; pointer-events: none; opacity: .1; background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.5) 0 1px, transparent 1px 3px); animation: staticMove .3s steps(3) infinite; }
@keyframes staticMove { 0% { transform: translateY(0); } 100% { transform: translateY(3px); } }
.cctv-topline { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; justify-content: space-between; font-family: monospace; font-size: 12px; color: #8affce; z-index: 3; }
.cctv-rec { color: #ff5a6e; display: inline-flex; align-items: center; gap: 4px; animation: recBlink 1s steps(2) infinite; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff5a6e; display: inline-block; }
@keyframes recBlink { 0% { opacity: 1; } 50% { opacity: .2; } 100% { opacity: 1; } }
.cctv-scene { position: relative; z-index: 2; text-align: center; }
.cam-room { width: 150px; height: 96px; margin: 0 auto; background: linear-gradient(180deg, #0a0d1e 60%, #171c38 60%); border-radius: 6px; position: relative; filter: grayscale(.3) brightness(.85); }
.cam-room::after { content: ""; position: absolute; left: 44px; bottom: 12px; width: 62px; height: 12px; background: #2a2f55; border-radius: 3px; box-shadow: 0 8px 0 -4px #22284a; }
.cam-figure { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); filter: grayscale(.25) brightness(.9); }
.cam-figure .fig { width: 78px; height: 98px; overflow: visible; }
.cam-figure.calm { filter: grayscale(.55) brightness(.7); }
.cam-figure.calm .fig { transform: rotate(90deg); transform-origin: center; }
.cam-figure.staring .fig { filter: drop-shadow(0 0 9px #ff004c) brightness(1.05); }
.cam-figure.staring { animation: monLoom 1.6s ease-in-out infinite; }
@keyframes monLoom { 0%,100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.06); } }
.cam-figure.tw-twitch { animation: camTwitch .18s steps(2) infinite; }
@keyframes camTwitch { 0% { transform: translateX(-50%) translate(0,0) rotate(0); } 50% { transform: translateX(-50%) translate(1.5px,-1px) rotate(-1.5deg); } 100% { transform: translateX(-50%) translate(-1.5px,1px) rotate(1.5deg); } }
.cam-figure.tw-tall .fig { transform: scaleY(1.5); transform-origin: bottom center; }
.cctv-empty-note { display: block; margin-top: 8px; font-size: 13px; color: #6f7bbf; }
.cctv-mon .mon { width: 130px; height: 130px; filter: drop-shadow(0 0 14px #ff004c) brightness(1.05); }
.cctv-monster-note { display: block; margin-top: 4px; color: #ff9fb0; font-weight: 800; }
.cctv-screen.has-anom { border-color: var(--danger); animation: alertPulse 1s ease-in-out infinite; }
@keyframes alertPulse { 0%,100% { box-shadow: 0 0 0 rgba(255,77,109,0); } 50% { box-shadow: 0 0 16px rgba(255,77,109,.5); } }
.eject-btn { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 4; background: var(--danger); color: #fff; box-shadow: 0 4px 0 #a3253c; }
.eject-btn:active { transform: translateX(-50%) translateY(3px); box-shadow: 0 1px 0 #a3253c; }
.cam-switch { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.cam-btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: var(--ink); border-radius: 10px; padding: 8px 4px; font-family: inherit; font-weight: 800; font-size: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cam-btn .cb-ico { width: 16px; height: 12px; border: 2px solid #1a7a4e; background: #08160f; border-radius: 2px; }
.cam-btn.active { border-color: var(--teal); background: rgba(69,211,196,.12); }

/* 药架面板 */
.med-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0; }
.med-btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 12px 6px; cursor: pointer; color: var(--ink); font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.med-btn .m-ico { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.med-btn .m-ico .mini { width: 34px; height: 34px; }
.med-btn .m-name { font-size: 12px; font-weight: 800; }
.med-btn .m-for { font-size: 10px; color: var(--muted); }
.med-btn.picked { border-color: var(--teal); background: rgba(69,211,196,.15); }
.med-btn:active { transform: translateY(2px); }
.shelf-carry { font-weight: 800; }

/* ---------- 提示 & 特效 ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #0c0e22; border: 1px solid rgba(255,255,255,.18); color: #fff; padding: 11px 20px; border-radius: 999px; font-weight: 800; z-index: 60; opacity: 0; max-width: 92vw; text-align: center; transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.good { border-color: var(--ok); }
.toast.bad { border-color: var(--danger); }
.scare-flash { position: fixed; inset: 0; background: radial-gradient(circle, rgba(255,0,40,.5), rgba(120,0,20,.9)); z-index: 70; opacity: 0; pointer-events: none; }
.scare-flash.go { animation: scare .6s ease; }
@keyframes scare { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ===== 开始界面按钮 ===== */
.start-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }

/* ===== 组队大厅 ===== */
.lobby-screen { padding: 16px; }
.lobby-card { background: var(--panel); border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 22px 20px 24px; text-align: center; max-width: 720px; width: 100%; box-shadow: var(--shadow); }
.lobby-card h1 { margin: 0 0 10px; font-size: 26px; color: var(--teal); }
.room-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.room-label-lb { color: var(--muted); font-weight: 700; font-size: 13px; }
.room-code { font-family: monospace; font-weight: 800; font-size: 20px; letter-spacing: 2px; color: var(--amber); background: rgba(255,206,84,.14); border: 1px solid rgba(255,206,84,.4); padding: 4px 12px; border-radius: 10px; }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 9px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.lobby-note { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
.lobby-note b { color: var(--ink); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.slot { background: rgba(255,255,255,.05); border: 2px solid rgba(255,255,255,.12); border-radius: 16px; padding: 12px 10px; min-height: 210px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.slot.p0 { border-color: rgba(69,211,196,.6); }
.slot.p1 { border-color: rgba(255,206,84,.6); }
.slot.p2 { border-color: rgba(122,92,255,.6); }
.slot.empty { justify-content: center; color: var(--muted); }
.slot.locked { opacity: .5; }
.slot-head { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 13px; }
.host-tag { font-size: 11px; color: var(--teal); font-weight: 800; }
.slot-leave { background: rgba(255,77,109,.16); color: #ff9fb0; border: 1px solid rgba(255,77,109,.4); border-radius: 8px; font-size: 11px; font-weight: 800; padding: 3px 8px; cursor: pointer; font-family: inherit; }
.slot-fig { height: 78px; display: flex; align-items: flex-end; justify-content: center; }
.slot-fig .fig { width: 58px; height: 74px; overflow: visible; }
.slot-cls-name { font-weight: 800; color: var(--ink); }
.slot-ctrl { font-size: 11px; color: var(--muted); line-height: 1.4; }
.slot-ctrl b { color: var(--ink); }
.cls-picker { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: auto; }
.cls-pick { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); color: var(--ink); border-radius: 8px; font-size: 11px; font-weight: 700; padding: 4px 7px; cursor: pointer; font-family: inherit; }
.cls-pick.on { background: var(--teal); color: #06301a; border-color: var(--teal); }
.slot-plus { font-size: 40px; color: var(--muted); line-height: 1; }
.slot-hint { font-size: 11px; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.join { padding: 8px 18px; }
.lobby-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }

/* ===== 职业商店 ===== */
.shop-card { max-width: 640px; }
.shop-tip { font-size: 13px; color: var(--muted); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.shop-item { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.shop-item.owned { border-color: rgba(69,211,196,.5); background: rgba(69,211,196,.08); }
.shop-fig { height: 72px; display: flex; align-items: flex-end; }
.shop-fig .fig { width: 54px; height: 68px; overflow: visible; }
.shop-name { font-weight: 800; color: var(--ink); }
.shop-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; min-height: 46px; }
.shop-buy .btn { font-size: 13px; padding: 8px 12px; }
.owned-tag { color: var(--teal); font-weight: 800; font-size: 13px; }

/* ===== 队伍 HUD ===== */
.party-hud { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 45; pointer-events: none; }
.ph-item { display: flex; align-items: center; gap: 6px; background: rgba(12,14,34,.72); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; color: var(--ink); }
.ph-dot { width: 10px; height: 10px; border-radius: 50%; }
.ph-dot.p0 { background: var(--teal); }
.ph-dot.p1 { background: var(--amber); }
.ph-dot.p2 { background: #7a5cff; }

/* 玩家彩色描边，便于分辨 */
.char.pc1 .fig { filter: drop-shadow(0 0 3px var(--amber)) drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.char.pc2 .fig { filter: drop-shadow(0 0 3px #7a5cff) drop-shadow(0 2px 2px rgba(0,0,0,.35)); }

@media (max-width: 800px) { .world { border-width: 3px; } .brand { font-size: 15px; } .slots { gap: 8px; } .slot { min-height: 190px; padding: 10px 6px; } }
@media (max-width: 560px) { .slots { grid-template-columns: 1fr; } }

/* ===== 聊天室 ===== */
.chat-toggle { position: fixed; right: 14px; bottom: 14px; z-index: 80; background: var(--teal); color: #06301a; border: none; font-family: inherit; font-weight: 800; font-size: 14px; padding: 10px 16px; border-radius: 999px; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.chat-toggle:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.chat-toggle.has-new::after { content: ""; position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg-1); animation: newPulse 1s ease-in-out infinite; }
@keyframes newPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.chat-panel { position: fixed; right: 14px; bottom: 62px; z-index: 80; width: 300px; max-width: calc(100vw - 28px); background: var(--panel); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 6px; padding: 9px 10px; background: rgba(0,0,0,.2); font-size: 12.5px; color: var(--ink); }
.chat-title { font-weight: 800; color: var(--teal); }
.chat-name-wrap { margin-left: auto; color: var(--muted); }
.chat-name-wrap b { color: var(--amber); }
.chat-mini { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); color: var(--ink); border-radius: 8px; font-size: 11px; font-weight: 700; padding: 3px 7px; cursor: pointer; font-family: inherit; }
.chat-hint { font-size: 11px; color: var(--muted); margin: 0; padding: 6px 10px 0; }
.chat-log { height: 210px; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.chat-empty { color: var(--muted); font-size: 12px; text-align: center; margin: auto 0; }
.cmsg { max-width: 85%; align-self: flex-start; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; border-bottom-left-radius: 3px; padding: 6px 9px; font-size: 13px; color: var(--ink); word-break: break-word; }
.cmsg b { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.cmsg.self { align-self: flex-end; background: rgba(69,211,196,.18); border-color: rgba(69,211,196,.45); border-radius: 12px; border-bottom-right-radius: 3px; }
.cmsg.self b { color: var(--teal); }
.chat-form { display: flex; gap: 6px; padding: 8px 10px 10px; border-top: 1px solid rgba(255,255,255,.1); }
.chat-form input { flex: 1; min-width: 0; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 8px 10px; color: var(--ink); font-family: inherit; font-size: 14px; }
.chat-form input:focus { outline: none; border-color: var(--teal); }
.chat-form .btn { padding: 8px 14px; font-size: 14px; }
@media (max-width: 560px) { .chat-panel { left: 14px; width: auto; } .chat-log { height: 170px; } }
