:root {
  color-scheme: dark;
  --bg: #070c16;
  --bg2: #0d1626;
  --panel: rgba(16, 25, 41, 0.96);
  --panel2: #142034;
  --panel3: #1b2a42;
  --line: #2a3d59;
  --line2: #3b5578;
  --text: #e8eef7;
  --muted: #8ea3bd;
  --dim: #5d7290;
  --ice: #bfe3ff;
  --amber: #ffb547;
  --amber2: #ff8f1f;
  --danger: #ff5a4f;
  --ok: #6fd08c;
  --rad: #d8e04a;
  --blue: #4ea4ff;
  --hp: #ff5d6c;
  --hunger: #f0a35b;
  --energy: #ffd447;
  --thirst: #4fb6ff;
  --mood: #c48bff;
  --r: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --title: 'DSTitle', 'PingFang SC', 'Microsoft YaHei', serif;
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #04070d; color: var(--text); font-family: var(--font); font-size: 14px; overscroll-behavior: none; }
body { background: radial-gradient(1200px 700px at 50% -10%, #1a2c4a 0%, #070c16 55%, #03050a 100%) fixed; overflow: hidden; }
button { font-family: inherit; color: inherit; }
img, svg { display: block; }
.hidden { display: none !important; }

#app { position: relative; width: 100%; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--bg); box-shadow: 0 0 60px rgba(0, 0, 0, 0.6); }
@media (min-width: 700px) {
  #app { height: min(100dvh, 940px); margin-top: max(0px, calc((100dvh - 940px) / 2)); border-radius: 22px; border: 1px solid #22344f; }
}
@media (min-width: 700px) and (min-height: 1000px) { .desk-hint { display: block !important; } }
@media (min-width: 1100px) { .desk-hint { display: block !important; left: auto; right: 24px; bottom: auto; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; letter-spacing: 1px; font-size: 11px; max-height: 96vh; overflow: hidden; } }
.desk-hint { display: none; pointer-events: none; position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); color: #50647f; font-size: 12px; letter-spacing: 1px; white-space: nowrap; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------- 按钮 ---------- */
.btn { appearance: none; border: 1px solid var(--line2); background: linear-gradient(#22344f, #182740); color: var(--text); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .08s, filter .15s, opacity .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active { transform: scale(0.97); }
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: linear-gradient(#ffc463, #f08b1c); border-color: #ffd28a; color: #2a1600; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.btn.danger { background: linear-gradient(#ff7a6f, #d2382d); border-color: #ff9b92; color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .42; pointer-events: none; filter: grayscale(.5); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; color: var(--text); }

/* ---------- 标题页 ---------- */
.title-screen { background: linear-gradient(180deg, #0b1a30 0%, #0a1322 45%, #060a12 100%); overflow: hidden; }
.title-sky { position: absolute; inset: 0; }
.title-logo { position: relative; margin-top: 16vh; text-align: center; z-index: 2; }
.title-logo h1 { margin: 0; font-family: var(--title); font-size: 64px; letter-spacing: 6px; color: #ffe1b0; text-shadow: 0 0 2px #fff6, 0 3px 0 #b04a12, 0 6px 0 #5d2108, 0 12px 26px rgba(255, 120, 40, .45); font-weight: 400; line-height: 1; }
.title-logo .sub { margin-top: 14px; font-size: 13px; letter-spacing: 8px; color: #9fc7ee; }
.title-logo .tag { display: inline-block; margin-top: 10px; padding: 3px 10px; border: 1px solid #ff8f1f88; color: #ffb547; font-size: 12px; letter-spacing: 3px; border-radius: 4px; background: repeating-linear-gradient(-45deg, #ff8f1f22 0 8px, transparent 8px 16px); }
.title-house { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; z-index: 1; }
.title-menu { position: absolute; left: 0; right: 0; bottom: calc(40px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 3; }
.title-menu .btn { width: 220px; padding: 13px; font-size: 17px; letter-spacing: 4px; }
.title-foot { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; justify-content: space-between; z-index: 3; color: #7f95b3; font-size: 12px; }
.title-foot .pts { color: var(--ice); }

/* ---------- 通用面板 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }
.warn { color: var(--amber); }
.sep { height: 1px; background: var(--line); margin: 8px 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: #0c1524; border: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.tag-q { display: inline-block; min-width: 18px; text-align: center; font-weight: 800; font-size: 11px; border-radius: 4px; padding: 0 4px; color: #111; }
.q-S { background: linear-gradient(#ffe27a, #f2a516); }
.q-A { background: linear-gradient(#e2b6ff, #a65cf0); }
.q-B { background: linear-gradient(#a8dcff, #3c95e6); }
.q-C { background: linear-gradient(#d8e0ea, #8e9cad); }
h3.sec { margin: 14px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 1px; display: flex; align-items: center; gap: 6px; }
h3.sec::before { content: ''; width: 3px; height: 12px; background: var(--amber); border-radius: 2px; }

/* ---------- 创建角色 ---------- */
.create { padding: calc(14px + var(--safe-t)) 14px calc(14px + var(--safe-b)); overflow-y: auto; background: linear-gradient(#0d1729, #070c16); }
.create h2 { margin: 4px 0 12px; font-family: var(--title); font-weight: 400; font-size: 26px; letter-spacing: 3px; color: #ffe1b0; text-align: center; }
.create .portrait { width: 112px; height: 132px; border-radius: 12px; overflow: hidden; border: 2px solid #4a6386; background: #101a2c; flex: none; position: relative; }
.create .portrait .q { position: absolute; left: 4px; top: 4px; }
.seg { display: flex; background: #0b1424; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: linear-gradient(#ffc463, #f08b1c); color: #2a1600; }
.input { background: #0b1424; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; color: var(--text); font-size: 15px; font-family: inherit; width: 100%; outline: none; }
.input:focus { border-color: var(--amber); }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.statgrid .s { background: #0b1424; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; justify-content: space-between; font-size: 13px; }
.statgrid .s b { color: var(--ice); }
.skill { display: flex; gap: 10px; align-items: flex-start; padding: 9px; border-radius: 10px; background: #0f1a2b; border: 1px solid var(--line); }
.skill .ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; background: #1c2b44; }
.skill .nm { font-weight: 700; font-size: 13px; }
.skill .ds { font-size: 12px; color: var(--muted); margin-top: 2px; }
.perk { display: flex; gap: 10px; align-items: center; padding: 9px; border-radius: 10px; background: #0f1a2b; border: 1px solid var(--line); cursor: pointer; }
.perk.on { border-color: var(--amber); background: #2a1e0c; }
.perk.lock { opacity: .5; }
.perk .ic { font-size: 22px; width: 36px; text-align: center; }

/* ---------- 游戏主界面 ---------- */
.game { background: var(--bg); }
.hud { position: relative; z-index: 20; padding: calc(8px + var(--safe-t)) 10px 6px; background: linear-gradient(#0a1424f2, #0a142400); }
.hud-top { display: flex; gap: 8px; align-items: stretch; }
.hud-ava { width: 50px; height: 50px; border-radius: 10px; overflow: hidden; border: 2px solid #4a6386; background: #101a2c; flex: none; position: relative; cursor: pointer; }
.hud-ava .lv { position: absolute; bottom: 0; left: 0; right: 0; background: #000a; font-size: 10px; text-align: center; color: var(--ice); line-height: 14px; }
.bars { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; align-content: center; min-width: 0; }
.bar { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); }
.bar i { font-style: normal; width: 14px; text-align: center; font-size: 11px; }
.bar .track { flex: 1; height: 9px; background: #0a1220; border: 1px solid #22344f; border-radius: 5px; overflow: hidden; position: relative; }
.bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; transition: width .4s; }
.bar .val { position: absolute; inset: 0; text-align: center; font-size: 8px; line-height: 8px; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.bar.low .track { border-color: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { border-color: #22344f; } }
.daycard { width: 92px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(135deg, #20406a, #13233b); padding: 5px 7px; position: relative; overflow: hidden; cursor: pointer; }
.daycard .d { font-family: var(--title); font-size: 17px; color: #ffe1b0; line-height: 1.1; }
.daycard .t { font-size: 11px; color: var(--ice); }
.daycard .w { position: absolute; right: 4px; top: 3px; font-size: 18px; }
.daycard .cd { font-size: 10px; color: var(--amber); margin-top: 1px; }
.daycard.apoc { background: linear-gradient(135deg, #3b1d22, #161c2c); border-color: #6a3340; }
.hud-chips { display: flex; gap: 5px; margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
.hud-chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; background: #0c1626d9; border: 1px solid var(--line); font-size: 12px; white-space: nowrap; flex: none; cursor: pointer; }
.chip b { font-weight: 700; }
.chip.cold b { color: var(--blue); }
.chip.hot b { color: var(--amber); }
.chip.radc b { color: var(--rad); }
.chip.warnc { border-color: var(--danger); }

.stage { position: relative; flex: 1; overflow: hidden; }
.outside { position: absolute; inset: 0; }
.outside canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.room-wrap { position: absolute; left: 0; right: 0; top: 4px; bottom: 6px; display: flex; align-items: center; justify-content: center; }
.room { position: relative; border-radius: 6px; box-shadow: 0 0 0 6px #2d3a4b, 0 0 0 8px #11192a, 0 0 0 9px #435a78, 0 18px 40px rgba(0, 0, 0, .65); }
.room .floor { position: absolute; inset: 0; border-radius: 4px; overflow: hidden; }
.floor.wood { background: repeating-linear-gradient(90deg, #6b4a32 0 2px, #7d5739 2px var(--c), #6b4a32 var(--c) calc(var(--c) + 2px)), #7d5739; background-size: calc(var(--c) * 2) 100%; }
.floor.wood::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 calc(var(--c) * 1.5 - 1px), #0002 calc(var(--c) * 1.5 - 1px) calc(var(--c) * 1.5)); }
.floor.tile { background: linear-gradient(90deg, #0002 1px, transparent 1px) 0 0 / var(--c) var(--c), linear-gradient(0deg, #0002 1px, transparent 1px) 0 0 / var(--c) var(--c), linear-gradient(135deg, #b9c2c9, #9aa5ae); }
.floor.concrete { background: radial-gradient(circle at 20% 30%, #0001 0 10%, transparent 11%) 0 0 / 60px 60px, radial-gradient(circle at 70% 60%, #fff1 0 6%, transparent 7%) 0 0 / 45px 45px, linear-gradient(135deg, #6f757b, #585e65); }
.floor.metal { background: linear-gradient(90deg, #0003 2px, transparent 2px) 0 0 / calc(var(--c) * 2) calc(var(--c) * 2), linear-gradient(0deg, #0003 2px, transparent 2px) 0 0 / calc(var(--c) * 2) calc(var(--c) * 2), radial-gradient(circle, #fff3 1.5px, transparent 2px) 4px 4px / calc(var(--c) * 2) calc(var(--c) * 2), linear-gradient(135deg, #5a6672, #46505b); }
.room .door { position: absolute; bottom: -8px; height: 10px; background: #8b5a2b; border: 2px solid #3d2410; border-radius: 2px; }
.room .tint { position: absolute; inset: 0; pointer-events: none; border-radius: 4px; transition: background 1s; mix-blend-mode: multiply; }
.room .light { position: absolute; inset: 0; pointer-events: none; border-radius: 4px; background: radial-gradient(circle at 50% 45%, #ffcf8a33, transparent 70%); }
.furn { position: absolute; cursor: pointer; transition: filter .15s; }
.furn:hover { filter: brightness(1.15); }
.furn svg { width: 100%; height: 100%; overflow: visible; }
.furn .flv { position: absolute; right: -3px; top: -5px; font-size: 9px; background: #000b; color: var(--amber); border-radius: 4px; padding: 0 3px; line-height: 13px; pointer-events: none; }
.furn .fire-glow { position: absolute; inset: -60%; background: radial-gradient(circle, #ff9a3c55, transparent 60%); pointer-events: none; animation: flicker 2s infinite; }
@keyframes flicker { 0%, 100% { opacity: .85; } 50% { opacity: .55; } 70% { opacity: 1; } }
.furn .prog { position: absolute; left: 6%; right: 6%; bottom: -6px; height: 4px; background: #000a; border-radius: 2px; overflow: hidden; }
.furn .prog i { display: block; height: 100%; background: var(--ok); }
.token { position: absolute; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; overflow: hidden; background: #223; transition: left .8s ease, top .8s ease; cursor: pointer; z-index: 5; box-shadow: 0 3px 6px #0008; }
.token.me { border-color: var(--amber); }
.token.sick { border-color: var(--danger); }
.token .tk-task { position: absolute; }
.token-label { position: absolute; z-index: 6; font-size: 9px; background: #000a; padding: 0 4px; border-radius: 4px; white-space: nowrap; transform: translateX(-50%); pointer-events: none; transition: left .8s ease, top .8s ease; }
.bubble { position: absolute; z-index: 8; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: linear-gradient(#ff7a6f, #e0352a); border: 2px solid #fff; color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; cursor: pointer; animation: bob 1.4s ease-in-out infinite; box-shadow: 0 4px 10px #0008; font-size: 14px; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.side-btns { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 8px; z-index: 12; }
.side-btns.right { left: auto; right: 8px; }
.sbtn { width: 48px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; background: none; border: 0; padding: 0; }
.sbtn .ic { width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #34507a, #16233a); border: 2px solid #4a6386; display: flex; align-items: center; justify-content: center; font-size: 19px; box-shadow: 0 4px 10px #0007; position: relative; }
.sbtn .lb { font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.sbtn .dot { position: absolute; right: -2px; top: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }

.nav { position: relative; z-index: 20; height: calc(70px + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; align-items: flex-end; background: linear-gradient(#16233a, #0b1424); border-top: 1px solid #2a3d59; }
.nav .nb { flex: 1; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: 0; cursor: pointer; color: #cfdcec; font-size: 12px; position: relative; }
.nav .nb .ic { font-size: 22px; filter: drop-shadow(0 2px 2px #0008); }
.nav .nb.locked { opacity: .35; }
.nav .nb .dot { position: absolute; top: 8px; right: 26%; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.act { flex: 1.2; display: flex; justify-content: center; position: relative; }
.act-btn { position: relative; top: -16px; width: 84px; height: 84px; border-radius: 50%; border: 4px solid #2a1600; background: radial-gradient(circle at 35% 30%, #ffd27a, #ff8a1c 55%, #c75500); box-shadow: 0 0 0 3px #ffb547, 0 8px 22px rgba(255, 120, 20, .45), inset 0 -6px 10px #0004; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #2a1600; font-weight: 900; font-size: 15px; letter-spacing: 2px; transition: transform .1s; }
.act-btn:active { transform: scale(.94); }
.act-btn .chev { font-size: 26px; line-height: 22px; letter-spacing: -6px; margin-left: -6px; }
.act-btn.night { background: radial-gradient(circle at 35% 30%, #9fb7ff, #4a62c9 55%, #26317a); box-shadow: 0 0 0 3px #8aa2ff, 0 8px 22px rgba(80, 100, 255, .45), inset 0 -6px 10px #0004; color: #fff; border-color: #0d1340; }
.act-btn.busy { pointer-events: none; filter: grayscale(.4) brightness(.8); }
.act-hint { position: absolute; top: -34px; font-size: 10px; color: var(--muted); white-space: nowrap; pointer-events: none; }

/* ---------- 吐司 ---------- */
.toasts { position: absolute; left: 50%; top: 120px; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: 92%; }
.toast { background: #0d1828f2; border: 1px solid var(--line2); color: var(--text); padding: 7px 12px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); animation: toastIn .25s ease, toastOut .4s ease forwards; animation-delay: 0s, var(--life, 2.2s); max-width: 100%; text-align: center; }
.toast.good { border-color: #3c8a57; }
.toast.bad { border-color: #8a3c3c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- 弹窗 ---------- */
.layer { position: absolute; inset: 0; z-index: 100; }
.backdrop { position: absolute; inset: 0; background: rgba(2, 5, 10, .66); backdrop-filter: blur(2px); animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { position: absolute; left: 12px; right: 12px; top: 50%; transform: translateY(-50%); max-height: calc(100% - 40px); display: flex; flex-direction: column; background: linear-gradient(#17243a, #0f1828); border: 1px solid #3b5578; border-radius: 14px; box-shadow: 0 20px 60px #000c; animation: popIn .25s cubic-bezier(.2, 1.4, .4, 1); overflow: hidden; }
@keyframes popIn { from { transform: translateY(-46%) scale(.92); opacity: 0; } }
.modal-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: linear-gradient(#22344f, #19283f); border-bottom: 1px solid #2d4262; }
.modal-h .ttl { flex: 1; font-weight: 700; font-size: 15px; letter-spacing: 1px; }
.catchip { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 700; color: #fff; }
.modal-b { padding: 12px; overflow-y: auto; }
.scene { height: 132px; border-radius: 10px; overflow: hidden; border: 1px solid #2d4262; position: relative; background: #0b1424; margin-bottom: 10px; }
.scene svg { width: 100%; height: 100%; }
.speaker { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; background: #000a; padding: 3px 8px 3px 3px; border-radius: 99px; font-size: 12px; }
.speaker .av { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: #223; }
.evtext { font-size: 15px; line-height: 1.75; color: #eaf1fa; white-space: pre-wrap; min-height: 54px; }
.evtext .cursor { display: inline-block; width: 7px; height: 15px; background: var(--amber); vertical-align: -2px; animation: blink2 .8s infinite; margin-left: 1px; }
@keyframes blink2 { 50% { opacity: 0; } }
.chat { display: flex; flex-direction: column; gap: 8px; }
.chat .msg { max-width: 82%; padding: 8px 11px; border-radius: 12px; font-size: 14px; line-height: 1.6; }
.chat .msg.them { background: #24364f; border-top-left-radius: 3px; align-self: flex-start; }
.chat .msg.me { background: #2f6e3c; border-top-right-radius: 3px; align-self: flex-end; }
.chat .who { font-size: 11px; color: var(--muted); margin-bottom: -4px; }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.opt { position: relative; text-align: left; padding: 11px 12px; border-radius: 10px; border: 1px solid #4a6386; background: linear-gradient(#26395a, #1b2a44); cursor: pointer; font-size: 14px; font-weight: 600; color: #fff; transition: transform .08s, filter .15s; animation: optIn .3s ease backwards; }
.opt:nth-child(2) { animation-delay: .05s; } .opt:nth-child(3) { animation-delay: .1s; } .opt:nth-child(4) { animation-delay: .15s; }
@keyframes optIn { from { opacity: 0; transform: translateX(-10px); } }
.opt:hover { filter: brightness(1.15); }
.opt:active { transform: scale(.98); }
.opt .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; font-weight: 400; }
.opt .meta span { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: #0006; color: var(--muted); }
.opt .meta .cost { color: var(--amber); }
.opt .meta .req { color: #ff9b92; }
.opt .meta .dg { color: #ffd447; }
.opt.disabled { opacity: .5; pointer-events: none; }
.opt .num { display: inline-block; width: 18px; height: 18px; border-radius: 5px; background: #0007; text-align: center; line-height: 18px; font-size: 11px; color: var(--muted); margin-right: 6px; }
.result-text { font-size: 15px; line-height: 1.75; padding: 10px 12px; border-left: 3px solid var(--amber); background: #0b1424; border-radius: 0 10px 10px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rchip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 4px; border-radius: 8px; background: #0b1424; border: 1px solid #2d4262; font-size: 12px; animation: chipIn .3s ease backwards; }
.rchip.good { border-color: #2f6e48; }
.rchip.bad { border-color: #7a3434; }
.rchip .v { font-weight: 800; }
.rchip.good .v { color: var(--ok); }
.rchip.bad .v { color: var(--danger); }
@keyframes chipIn { from { opacity: 0; transform: scale(.7); } }
.modal-f { padding: 10px 12px; border-top: 1px solid #22344f; display: flex; gap: 8px; }

/* ---------- 物品图标 ---------- */
.itm { position: relative; width: 44px; height: 44px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex: none; background: linear-gradient(145deg, var(--ic, #445), #0c1424 140%); border: 1px solid #ffffff22; box-shadow: inset 0 1px 0 #ffffff22; }
.itm.sm { width: 26px; height: 26px; font-size: 15px; border-radius: 6px; }
.itm.lg { width: 56px; height: 56px; font-size: 30px; }
.itm svg { width: 70%; height: 70%; }
.itm .tier { position: absolute; right: 2px; bottom: 1px; font-size: 9px; font-weight: 900; color: #fff; text-shadow: 0 0 2px #000; }
.itm .cnt { position: absolute; right: -3px; bottom: -4px; font-size: 10px; font-weight: 800; background: #000c; color: #fff; padding: 0 4px; border-radius: 5px; line-height: 14px; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.inv-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; background: #0f1a2b; border: 1px solid var(--line); cursor: pointer; }
.inv-cell .nm { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.inv-cell:hover { border-color: var(--line2); }

/* ---------- 底部面板 ---------- */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 88%; display: flex; flex-direction: column; background: linear-gradient(#152238, #0d1627); border-top: 1px solid #3b5578; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px #000a; animation: sheetIn .28s cubic-bezier(.2, .9, .3, 1); }
.sheet.full { height: 100%; border-radius: 0; }
@keyframes sheetIn { from { transform: translateY(100%); } }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.sheet-h .ttl { flex: 1; font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.sheet-h .sub { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: #0d1626; font-size: 13px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tab.on { background: linear-gradient(#ffc463, #f08b1c); color: #2a1600; border-color: #ffd28a; font-weight: 700; }
.sheet-b { flex: 1; overflow-y: auto; padding: 4px 12px calc(16px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 11px; background: #0f1a2b; border: 1px solid var(--line); }
.li.click { cursor: pointer; }
.li.click:hover { border-color: var(--line2); }
.li .nm { font-weight: 700; font-size: 14px; }
.li .ds { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.price { font-weight: 800; color: var(--amber); white-space: nowrap; }
.qty-ctl { display: flex; align-items: center; gap: 4px; }
.qty-ctl button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line2); background: #1b2a42; color: #fff; cursor: pointer; font-size: 15px; }
.qty-ctl .q { min-width: 26px; text-align: center; font-weight: 700; }

/* 成员 */
.mem-card { display: flex; gap: 10px; padding: 10px; border-radius: 12px; background: #0f1a2b; border: 1px solid var(--line); cursor: pointer; }
.mem-card .ava { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; flex: none; background: #1a2740; position: relative; border: 2px solid #3b5578; }
.mem-card.me .ava { border-color: var(--amber); }
.mem-card .ava .lv { position: absolute; bottom: 0; left: 0; right: 0; background: #000a; font-size: 10px; text-align: center; color: var(--ice); }
.minibars { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; margin-top: 5px; }
.mb { height: 5px; background: #0a1220; border-radius: 3px; overflow: hidden; }
.mb i { display: block; height: 100%; border-radius: 3px; }
.sts { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.st { font-size: 10px; padding: 0 5px; border-radius: 4px; color: #fff; line-height: 16px; }
.gear-slot { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; background: #0b1424; border: 1px dashed var(--line2); cursor: pointer; min-width: 0; }
.gear-slot .nm { font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- 战斗 ---------- */
.battle { background: radial-gradient(ellipse at 50% 40%, #2a1a1e, #0a0c14 70%); }
.battle-h { padding: calc(10px + var(--safe-t)) 12px 6px; display: flex; align-items: center; gap: 8px; }
.battle-h .ttl { flex: 1; font-family: var(--title); font-size: 22px; color: #ffcf9a; letter-spacing: 2px; }
.bside { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px; }
.bunit { width: 84px; padding: 6px 5px; border-radius: 12px; background: #141c2c; border: 2px solid #2d3d58; text-align: center; position: relative; transition: transform .15s, opacity .4s, border-color .2s; cursor: pointer; }
.bunit.foe { background: #24151a; border-color: #5a2a33; }
.bunit.focus { border-color: var(--amber); box-shadow: 0 0 0 2px #ffb54755; }
.bunit.acting { transform: translateY(-6px) scale(1.06); border-color: #fff; }
.bunit.dead { opacity: .25; filter: grayscale(1); }
.bunit .face { width: 46px; height: 46px; margin: 0 auto; border-radius: 10px; overflow: hidden; font-size: 34px; display: flex; align-items: center; justify-content: center; background: #0006; }
.bunit .nm { font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bunit .hpb { height: 6px; background: #000; border-radius: 3px; overflow: hidden; margin-top: 3px; }
.bunit .hpb i { display: block; height: 100%; background: linear-gradient(90deg, #ff4d5e, #ff8a6a); transition: width .3s; }
.bunit.ally .hpb i { background: linear-gradient(90deg, #3ec46d, #9be36a); }
.bunit .hpt { font-size: 9px; color: var(--muted); }
.bunit .boss { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 9px; background: var(--danger); color: #fff; padding: 0 5px; border-radius: 4px; font-weight: 800; }
.dmg { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font-weight: 900; font-size: 20px; color: #ffef9a; text-shadow: 0 2px 0 #7a2b00, 0 0 6px #000; pointer-events: none; animation: dmgUp .9s ease forwards; white-space: nowrap; z-index: 3; }
.dmg.crit { font-size: 26px; color: #ff6a4d; }
.dmg.miss { color: #9fb7d6; font-size: 15px; }
.dmg.heal { color: #7dffa2; }
@keyframes dmgUp { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -34px) scale(1); } }
.shake { animation: shake .3s; }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.blog { flex: 1; overflow-y: auto; margin: 6px 12px; padding: 8px 10px; background: #0007; border-radius: 10px; border: 1px solid #2a2030; font-size: 12px; color: #c9d4e3; line-height: 1.7; display: flex; flex-direction: column-reverse; }
.blog .n { color: var(--amber); }
.bctl { display: flex; gap: 8px; padding: 8px 12px calc(12px + var(--safe-b)); }
.vs { text-align: center; font-family: var(--title); color: #ff6a4d; font-size: 20px; letter-spacing: 6px; }

/* ---------- 探索 ---------- */
.citymap { position: relative; flex: 1; overflow: hidden; background: #0a1220; }
.citymap svg.map { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; cursor: pointer; z-index: 3; }
.pin .ic { width: 44px; height: 44px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: linear-gradient(135deg, #ffc463, #e2761b); border: 2px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px #000a; }
.pin .ic span { transform: rotate(45deg); font-size: 20px; }
.pin.lock .ic { background: linear-gradient(135deg, #556274, #2d3746); }
.pin.far .ic { background: linear-gradient(135deg, #6a7c97, #3a4a63); }
.pin.done .ic { background: linear-gradient(135deg, #6fd08c, #2f8a4c); }
.pin .lb { margin-top: 4px; font-size: 11px; background: #000b; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.pin .rt { font-size: 9px; color: var(--amber); }
.crawl { background: #070b12; }
.crawl-h { padding: calc(10px + var(--safe-t)) 12px 6px; }
.grid-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6px; position: relative; }
.cgrid { display: grid; gap: 3px; padding: 6px; border-radius: 12px; background: #0d1522; border: 1px solid #22344f; touch-action: none; }
.cell { position: relative; border-radius: 7px; background: #1a2536; display: flex; align-items: center; justify-content: center; font-size: 20px; transition: background .2s; }
.cell.fog { background: #0a0f18; }
.cell.fog::after { content: ''; position: absolute; inset: 0; border-radius: 7px; background: repeating-linear-gradient(45deg, #ffffff05 0 4px, transparent 4px 8px); }
.cell.wall { background: linear-gradient(135deg, #39424f, #262d37); box-shadow: inset 0 -3px 0 #0006; }
.cell.wall.fog { background: #0a0f18; box-shadow: none; }
.cell.near { background: #22314a; }
.cell .o { filter: drop-shadow(0 2px 2px #000); }
.cell .o.ev { animation: bob 1.2s infinite; }
.cell .player { position: absolute; inset: 3px; border-radius: 50%; overflow: hidden; border: 2px solid var(--amber); box-shadow: 0 0 12px #ffb54788; z-index: 2; }
.cell.exit { background: #1f3a2c; }
.dpad { display: grid; grid-template-columns: repeat(3, 62px); grid-template-rows: repeat(3, 54px); gap: 6px; justify-content: center; padding: 6px 0 calc(10px + var(--safe-b)); }
.dpad button { border-radius: 14px; border: 1px solid #3b5578; background: linear-gradient(#26395a, #18263f); font-size: 22px; cursor: pointer; color: #fff; }
.dpad button:active { background: #3b5578; }
.dpad .c { background: transparent; border: 0; }
.bagbar { height: 8px; background: #000; border-radius: 4px; overflow: hidden; }
.bagbar i { display: block; height: 100%; background: linear-gradient(90deg, #6fd08c, #ffd447); }

/* ---------- 结局 ---------- */
.ending { background: radial-gradient(ellipse at 50% 30%, #1c2c46, #04070d 75%); align-items: center; justify-content: center; text-align: center; padding: 24px; }
.ending .big { font-size: 64px; filter: drop-shadow(0 0 20px #fff3); animation: popIn .6s; }
.ending h2 { font-family: var(--title); font-weight: 400; font-size: 40px; margin: 10px 0 4px; color: #ffe1b0; letter-spacing: 6px; }
.ending .etxt { font-size: 15px; line-height: 1.9; color: #cfdcec; max-width: 340px; margin: 12px auto; }
.ending .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 360px; margin: 14px auto; }
.ending .stats div { background: #0b1424; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.ending .stats b { display: block; font-size: 18px; color: var(--ice); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.gal { padding: 12px 8px; border-radius: 12px; background: #0f1a2b; border: 1px solid var(--line); text-align: center; }
.gal .ic { font-size: 30px; }
.gal .nm { font-weight: 800; margin-top: 4px; }
.gal .ds { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.gal.lock { opacity: .45; }
.gal.lock .ic { filter: grayscale(1) brightness(.4); }
.gal.good { border-color: #6a5420; background: #19160d; }

/* 晨报 */
.report .line { padding: 5px 0; border-bottom: 1px dashed #22344f; font-size: 13px; display: flex; gap: 6px; }
.report .line:last-child { border-bottom: 0; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #2a3d59; border-radius: 3px; }

/* 小屏 */
@media (max-height: 640px) {
  .scene { height: 96px; }
  .act-btn { width: 72px; height: 72px; font-size: 13px; }
  .evtext { font-size: 14px; }
}
@media (max-width: 360px) {
  .nav .nb { font-size: 11px; }
  .bunit { width: 74px; }
}
.title-menu .row .btn { width: auto; font-size: 13px; padding: 8px 14px; letter-spacing: 1px; }

/* ================= 第二版新增 ================= */
/* 标题菜单 */
.title-menu .cont-btn, .title-menu .daily-btn { flex-direction: column; gap: 2px; }
.title-menu .cont-sub { font-size: 11px; letter-spacing: 0; font-weight: 500; opacity: .8; }
.title-menu .daily-btn { background: linear-gradient(#2b4f7a, #1b3354); border-color: #4e7fb8; }
@media (max-height: 700px) { .title-logo { margin-top: 9vh; } .title-menu { gap: 8px; } .title-menu .btn { padding: 10px; } }
.diff-seg button { font-size: 13px; }
/* 备战清单按钮 */
.checklist-btn { position: absolute; right: 8px; top: 2px; z-index: 12; border: 1px solid #ffb54788; background: #1a1206e6; color: var(--amber); border-radius: 18px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px #0008; animation: pulseAmber 2.4s infinite; }
.checklist-btn.done { color: var(--ok); border-color: #6fd08c88; animation: none; }
@keyframes pulseAmber { 0%, 100% { box-shadow: 0 0 0 0 #ffb54755; } 50% { box-shadow: 0 0 0 6px #ffb54700; } }
.li.done { opacity: .6; }
/* 天灾 */
.dis-chip { animation: pulseRed 1.8s infinite; }
@keyframes pulseRed { 0%, 100% { box-shadow: 0 0 0 0 #ff5a4f55; } 50% { box-shadow: 0 0 0 4px #ff5a4f00; } }
.dis-card { border-color: #ff8f1f88; background: linear-gradient(135deg, #2a1a0c, #121b2c); }
/* 旋转家具 & 布置模式 */
.furn .rot { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(90deg); }
.furn .rot svg { width: 100%; height: 100%; }
.furn.editing { outline: 1px dashed #ffffff44; outline-offset: -1px; z-index: 3; }
.furn.sel { outline: 2px solid var(--amber); outline-offset: 1px; z-index: 4; filter: drop-shadow(0 0 8px #ffb547aa); animation: selBob 1s infinite alternate; }
@keyframes selBob { to { transform: translateY(-2px); } }
.cell-hit { position: absolute; z-index: 2; border: 1px dashed #ffffff22; cursor: pointer; }
.cell-hit:hover { background: #ffb54733; }
.layout-bar { position: absolute; left: 8px; right: 8px; bottom: 30px; z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: #0b1424f2; border: 1px solid var(--amber); border-radius: 12px; box-shadow: var(--shadow); }
.layout-bar .btn { flex: 1; }
/* 伙伴 */
.pet-token { position: absolute; width: 26px; height: 26px; font-size: 20px; line-height: 26px; text-align: center; z-index: 5; cursor: pointer; transition: left .8s ease, top .8s ease; filter: drop-shadow(0 2px 2px #000a); animation: petWag 1.6s infinite; }
.pet-token.sick { filter: grayscale(.6) drop-shadow(0 2px 2px #000a); animation: none; }
@keyframes petWag { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.pet-portrait { width: 88px; height: 88px; border-radius: 14px; border: 2px solid #4a6386; background: radial-gradient(circle at 50% 40%, #2a3f5e, #111b2b); display: grid; place-items: center; font-size: 54px; flex: none; }
.bunit .face.petface { font-size: 30px; display: grid; place-items: center; }
/* 守卫战 */
.defense .wave-row { display: flex; gap: 6px; flex-wrap: wrap; }
.defense .wave { flex: 1 1 30%; min-width: 96px; background: #1a1012; border: 1px solid #6b2f2f; border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.defense .wave b { color: #ff9b92; font-size: 12px; }
.defense .wave.boss { border-color: var(--amber); background: #24180a; }
.defense .wave.boss b { color: var(--amber); }
.defense .pos-seg { width: 132px; flex: none; }
.defense .pos-seg button { padding: 5px 0; font-size: 12px; }
.def-mem { padding: 6px 8px; }
.bunit .posb { background: #2b5fae; left: 50%; transform: translateX(-50%); right: auto; white-space: nowrap; }
/* 远征报告 */
.exp-log { background: #0b1424; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; line-height: 1.75; max-height: 40vh; overflow: auto; }
.exp-log > div { animation: fadeUp .4s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
/* 军械 */
.inv-cell.sel { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.inv-cell.lock { opacity: .4; }
.upbar { display: flex; gap: 3px; margin-top: 8px; }
.upbar i { flex: 1; height: 6px; border-radius: 3px; background: #22344f; }
.upbar i.on { background: linear-gradient(90deg, #ffc463, #f08b1c); box-shadow: 0 0 6px #ffb54788; }
/* 存档 */
.slot-no { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: var(--title); font-size: 18px; background: #22344f; color: #ffe1b0; flex: none; }
.slot-card { margin-bottom: 8px; }
.slot-card.cur { border-color: var(--amber); }
.code-box { width: 100%; min-height: 120px; font-size: 11px; font-family: ui-monospace, monospace; word-break: break-all; resize: vertical; }
/* 每日挑战 */
.rank-li .rank-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #22344f; font-weight: 800; font-size: 12px; flex: none; }
.rank-li .rank-no.top1 { background: linear-gradient(#ffe08a, #e0a82e); color: #3a2600; }
.rank-li .rank-no.top2 { background: linear-gradient(#e8eef7, #9fb0c4); color: #1a2433; }
.rank-li .rank-no.top3 { background: linear-gradient(#f0b27a, #b9713a); color: #2a1400; }
.rank-li.me { border-color: var(--amber); }
.daily-end .score-big { font-family: var(--title); font-size: 56px; color: var(--amber); text-shadow: 0 4px 0 #6b3a08, 0 10px 24px #ff8f1f66; margin: 4px 0 10px; }
.daily-end .score-parts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; width: 100%; max-width: 300px; margin: 0 auto; font-size: 13px; }
.daily-end .score-parts div { display: flex; justify-content: space-between; border-bottom: 1px dashed #22344f; padding: 2px 0; }
.spring-btn { background: linear-gradient(#5fbf6a, #2f8a4c); border-color: #9be3b0; color: #04210d; }
.gal-ava { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; margin: 0 auto; }
