:root {
  --ink: #3b2a20; --paper: #fff6e3; --paper2: #f6e6c4; --wood: #8a5a34; --wood2: #6a4226; --gold: #f5c542;
  --red: #e8463a; --blue: #4fa3e0; --green: #4fbf7a; --gray: #a89a8a; --milk: #ffd54a; --baobao: #e8604c;
  --font: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: #1d1612; overflow: hidden; position: fixed; inset: 0; font-family: var(--font); color: var(--ink); user-select: none; }
img { image-rendering: pixelated; -webkit-user-drag: none; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#stage { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; transform-origin: center; overflow: hidden; border-radius: 6px; background: #2a1d16; }

/* ---------- 档案馆场景 ---------- */
.wall { position: absolute; inset: 0 0 230px 0; background:
  repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 64px),
  linear-gradient(#5a3f5e, #7a5068 55%, #8a5a5a); }
.wall::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: #4a2f2a; }
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: 230px; background:
  repeating-linear-gradient(90deg, rgba(0, 0, 0, .08) 0 3px, transparent 3px 120px),
  linear-gradient(#b07a4a, #8a5a34); }
.rug { position: absolute; left: 260px; right: 260px; bottom: 70px; height: 150px; border-radius: 50%; background: radial-gradient(#d8a070, #c08050 60%, transparent 62%); opacity: .55; }
.speaker { position: absolute; bottom: 150px; width: 110px; height: 300px; background: linear-gradient(#4a3428, #33241c); border: 4px solid #221812; border-radius: 10px; }
.speaker.l { left: 26px; } .speaker.r { right: 26px; }
.speaker i { position: absolute; left: 50%; width: 70px; height: 70px; margin-left: -35px; border-radius: 50%; background: radial-gradient(#111 30%, #3a2a22 32%, #1a120e 60%, #4a3a30 62%); }
.speaker i:nth-child(1) { top: 30px; } .speaker i:nth-child(2) { top: 120px; width: 90px; height: 90px; margin-left: -45px; }
.couplet { position: absolute; top: 40px; width: 30px; height: 220px; background: #c8281e; color: var(--gold); font-size: 22px; writing-mode: vertical-rl; text-align: center; line-height: 30px; padding-top: 10px; border: 2px solid #8a1a12; display: none; }
.couplet.l { left: 160px; } .couplet.r { right: 160px; }
.lanterns { position: absolute; top: 56px; left: 0; right: 0; height: 80px; display: none; justify-content: space-around; pointer-events: none; }
.lanterns span { width: 40px; height: 46px; border-radius: 50%; background: radial-gradient(#ffb060, #e8302a 70%); border-top: 6px solid var(--gold); border-bottom: 6px solid var(--gold); animation: sway 3s ease-in-out infinite; transform-origin: top center; }
.lanterns span:nth-child(2n) { animation-delay: -1.5s; }
.lanterns.lantern span { background: radial-gradient(#fff2a0, #f0a030 70%); }
#stage.fest-spring .lanterns, #stage.fest-spring .couplet { display: flex; }
#stage.fest-spring .couplet { display: block; }
@keyframes sway { 50% { transform: rotate(6deg); } }

/* 顶栏 */
#topbar { position: absolute; left: 0; right: 0; top: 0; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: linear-gradient(rgba(20, 12, 10, .75), rgba(20, 12, 10, 0)); z-index: 20; color: #fff; }
.tb-back { width: 44px; height: 40px; border-radius: 10px; border: 3px solid var(--ink); background: var(--paper); font-size: 22px; font-weight: 900; color: var(--ink); }
.tb-title { display: flex; flex-direction: column; line-height: 1.15; }
.tb-title b { font-size: 20px; letter-spacing: 1px; text-shadow: 0 2px 0 #000; }
.tb-title small { font-size: 13px; opacity: .85; }
.tb-space { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 6px 0 4px; border-radius: 18px; background: rgba(0, 0, 0, .45); border: 2px solid rgba(255, 255, 255, .25); font-weight: 700; font-size: 17px; }
.pill img { width: 30px; height: 30px; }
.pill .plus { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--gold); color: var(--ink); font-weight: 900; font-size: 18px; line-height: 26px; padding: 0; }
.tb-btn { height: 38px; padding: 0 14px; border-radius: 10px; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); font-weight: 800; font-size: 15px; position: relative; }
.tb-chip { font-size: 12px; padding: 4px 8px; border-radius: 8px; background: rgba(0, 0, 0, .4); color: #ddd; }
.tb-chip b { color: #8f8; }
.tb-gm { background: #333; color: #ff0; border-color: #000; }

/* 电视墙 */
#tvwall { position: absolute; left: 150px; right: 150px; top: 90px; height: 270px; }
.cabinet { position: absolute; left: -10px; right: -10px; bottom: 0; height: 56px; background: linear-gradient(var(--wood), var(--wood2)); border: 4px solid #3a2416; border-radius: 8px; }
.cabinet::before, .cabinet::after { content: ''; position: absolute; bottom: -30px; width: 18px; height: 30px; background: #3a2416; }
.cabinet::before { left: 40px; } .cabinet::after { right: 40px; }
.tvs { position: absolute; left: 0; right: 0; bottom: 52px; display: flex; justify-content: space-between; align-items: flex-end; }
.tv { position: relative; width: 178px; height: 164px; border-radius: 16px; background: linear-gradient(#9a6a44, #74482a); border: 4px solid #3a2416; padding: 12px 12px 26px; cursor: pointer; transition: transform .15s; }
.tv:nth-child(2n) { height: 176px; }
.tv:hover { transform: translateY(-3px); }
.tv.static { cursor: default; } .tv.static:hover { transform: none; }
.tv .screen { position: relative; width: 100%; height: 100%; border-radius: 18px / 14px; overflow: hidden; background: #1a2a2a; border: 3px solid #241510; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; box-shadow: inset 0 0 20px rgba(0, 0, 0, .7); }
.tv .screen::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(rgba(255, 255, 255, .06) 0 1px, transparent 1px 3px); pointer-events: none; }
.tv .screen b { font-size: 20px; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.tv .screen small { font-size: 13px; margin-top: 4px; opacity: .9; }
.tv .screen .prog { margin-top: 6px; width: 80%; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.tv .screen .prog i { display: block; height: 100%; background: var(--gold); }
.tv .screen.nosignal { background: #222; }
.tv .screen.nosignal::before { content: ''; position: absolute; inset: 0; opacity: .35; background: repeating-radial-gradient(circle at 30% 40%, #fff 0 1px, #000 1px 2px); animation: noise .2s steps(2) infinite; }
.tv .screen.poster { padding: 0; }
.tv .screen.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tv .screen.poster span { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px; font-size: 12px; background: rgba(0, 0, 0, .55); }
.tv .knobs { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 10px; }
.tv .knobs i { width: 12px; height: 12px; border-radius: 50%; background: #3a2416; }
.tv .tv-no { position: absolute; left: 10px; bottom: 4px; font-size: 11px; color: #ffe9c0; font-weight: 800; }
@keyframes noise { 50% { transform: translate(3px, -2px); } }

/* 功能电视 */
#func { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; z-index: 6; pointer-events: none; }
.ftv { position: absolute; bottom: 14px; pointer-events: auto; width: 116px; height: 104px; border-radius: 14px; background: linear-gradient(#7aa0b8, #4a6a80); border: 4px solid #22323e; padding: 8px 8px 18px; cursor: pointer; }
.ftv .screen { width: 100%; height: 100%; border-radius: 12px / 10px; background: #e9f7ff; border: 3px solid #22323e; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; font-size: 19px; color: #2a3a4a; }
.ftv .screen em { font-style: normal; font-size: 26px; line-height: 1; }
.ftv:hover { transform: translateY(-3px); }
#btn-task { left: 40px; } #btn-codex { left: 170px; } #btn-friend { left: 300px; }
#btn-depart { right: 40px; width: 250px; height: 128px; background: linear-gradient(#f0b040, #c87a20); border-color: #5a3410; }
#btn-depart .screen { background: #fff4c8; color: #6a3a10; font-size: 26px; border-color: #5a3410; }
#btn-depart.gray { background: linear-gradient(#a8a098, #807870); border-color: #4a4440; }
#btn-depart.gray .screen { background: #ddd8d0; color: #777; font-size: 22px; }
.depart-count { position: absolute; right: 70px; bottom: 148px; padding: 3px 12px; border-radius: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; font-size: 15px; z-index: 6; }
.reddot { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: 3px solid #fff; z-index: 3; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }

#visit-banner { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); padding: 6px 18px; border-radius: 20px; background: rgba(0, 0, 0, .6); color: #fff; font-weight: 700; z-index: 21; }
#visit-banner button { margin-left: 10px; }

/* ---------- 龙 ---------- */
#actors { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.actor { position: absolute; width: 132px; height: 168px; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; }
.actor .a-shadow { position: absolute; left: 26px; right: 26px; bottom: 0; height: 16px; border-radius: 50%; background: rgba(0, 0, 0, .25); }
.actor .a-body { position: absolute; left: 2px; bottom: 4px; width: 128px; height: 128px; transform-origin: 50% 100%; }
.actor .a-sprite { width: 128px; height: 128px; display: block; }
.actor.flip .a-sprite { transform: scaleX(-1); }
.actor.walking .a-body { animation: bob .36s ease-in-out infinite; }
.actor .a-head { position: absolute; left: 50%; top: 0; transform: translateX(-50%); white-space: nowrap; padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.actor .xp { display: inline-block; width: 44px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.actor .xp b { display: block; height: 100%; background: var(--gold); }
.actor .a-foot { position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); white-space: nowrap; padding: 1px 8px; border-radius: 8px; background: rgba(40, 80, 160, .85); color: #fff; font-size: 12px; }
.actor.ghost.inert { cursor: default; }
.actor.ghost .a-sprite { filter: brightness(0) invert(1); opacity: .28; }
.actor.ghost .a-body::after { content: ''; position: absolute; inset: 6px 10px 0; border: 3px dashed rgba(255, 255, 255, .7); border-radius: 50% 50% 40% 40%; }
.a-bubble { position: absolute; left: 50%; bottom: 160px; transform: translateX(-50%); min-width: 90px; max-width: 230px; padding: 8px 12px; border-radius: 14px; background: #fff; border: 3px solid var(--ink); font-size: 14px; line-height: 1.35; text-align: center; white-space: normal; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); animation: pop .2s; z-index: 4; }
.a-bubble::after { content: ''; position: absolute; left: 50%; bottom: -12px; margin-left: -8px; border: 8px solid transparent; border-top-color: var(--ink); }
.a-bubble.sticky { background: #eef4ff; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-2deg); } }

/* 表演 */
.perf-bubble .a-body { animation: puff 1s ease-in-out 2; }
.perf-shake .a-body { animation: shake .25s linear 8; }
.perf-spin .a-body { animation: spin 1s ease-in-out 2; }
.perf-squash .a-body { animation: squash .6s ease-in-out 3; }
.perf-hop .a-body { animation: hop .45s ease-out 4; }
.perf-highfive .a-body { animation: lean .5s ease-in-out 3; }
.perf-highfive.flip .a-body { animation-name: leanR; }
.perf-chase .a-body { animation: hop .3s ease-out 7; }
.perf-tug .a-body { animation: tug .4s ease-in-out 5; }
.perf-tug.flip .a-body { animation-name: tugR; }
.perf-firework .a-body, .perf-redpacket .a-body, .perf-cheer .a-body { animation: hop .5s ease-out 4; }
.perf-eat .a-body { animation: squash .5s ease-in-out 4; }
@keyframes puff { 50% { transform: scale(1.12, .92); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes spin { 50% { transform: scaleX(-1); } }
@keyframes squash { 50% { transform: scale(1.15, .82); } }
@keyframes hop { 40% { transform: translateY(-34px); } 80% { transform: translateY(0) scale(1.08, .92); } }
@keyframes lean { 50% { transform: rotate(14deg); } }
@keyframes leanR { 50% { transform: rotate(-14deg); } }
@keyframes tug { 50% { transform: rotate(-12deg) translateX(-6px); } }
@keyframes tugR { 50% { transform: rotate(12deg) translateX(6px); } }
.actor.tap-shake .a-body { animation: tapShake var(--shake, .3s) linear 1; }
@keyframes tapShake { 20% { transform: translateX(-7px) rotate(-4deg); } 45% { transform: translateX(7px) rotate(4deg); } 70% { transform: translateX(-4px) rotate(-2deg); } 90% { transform: translateX(3px); } }
.particle { position: absolute; pointer-events: none; z-index: 6; animation: rise 1.4s ease-out forwards; }
.particle.bub { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #8fd8ff; background: rgba(200, 240, 255, .5); }
.particle.spark { width: 8px; height: 8px; border-radius: 50%; animation: burst 1.1s ease-out forwards; }
.particle.icon { width: 44px; height: 44px; }
.particle.star { font-size: 26px; color: var(--gold); }
@keyframes rise { to { transform: translate(var(--dx, 0), -110px); opacity: 0; } }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

/* ---------- 面板 ---------- */
#layer { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.mask { position: absolute; inset: 0; background: rgba(20, 12, 8, .6); display: flex; align-items: center; justify-content: center; pointer-events: auto; animation: fade .15s; }
.mask.clear { background: transparent; }
@keyframes fade { from { opacity: 0; } }
.panel { position: relative; background: var(--paper); border: 5px solid var(--ink); border-radius: 22px; box-shadow: 0 10px 0 rgba(0, 0, 0, .3); padding: 18px 22px; max-height: 690px; display: flex; flex-direction: column; animation: rise-in .18s; }
@keyframes rise-in { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.panel-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-h h2 { margin: 0; font-size: 26px; }
.panel-h .sub { color: #8a7060; font-size: 14px; }
.panel-h .x { margin-left: auto; }
.x { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--ink); background: #fff; font-size: 24px; font-weight: 900; line-height: 30px; padding: 0; color: var(--ink); flex: none; }
.btn { position: relative; height: 44px; padding: 0 20px; border-radius: 14px; border: 4px solid var(--ink); background: var(--gold); color: var(--ink); font-weight: 900; font-size: 17px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); white-space: nowrap; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; border-width: 3px; border-radius: 10px; }
.btn.blue { background: #8fd0ff; } .btn.green { background: #8fe0a8; } .btn.white { background: #fff; } .btn.red { background: #ff9a8a; }
.btn.gray, .btn:disabled { background: #d8d0c4; color: #8a8076; box-shadow: none; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button { position: relative; height: 38px; padding: 0 18px; border-radius: 12px 12px 4px 4px; border: 3px solid var(--ink); background: var(--paper2); font-weight: 800; font-size: 15px; color: var(--ink); }
.tabs button.on { background: var(--gold); }
.muted { color: #8a7060; }
.red-t { color: var(--red) !important; font-weight: 800; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.scroll { overflow-y: auto; overflow-x: hidden; }
.scroll::-webkit-scrollbar { width: 10px; } .scroll::-webkit-scrollbar-thumb { background: #c8b090; border-radius: 6px; }
.card { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 10px; }
.card.sel { background: #fff3c0; box-shadow: 0 0 0 4px var(--gold); }
.card.dis { background: #e8e0d4; color: #998; }
.ico { width: 64px; height: 64px; flex: none; }
.ico.s { width: 40px; height: 40px; } .ico.l { width: 96px; height: 96px; } .ico.xl { width: 160px; height: 160px; }
.sil { filter: brightness(0); opacity: .3; }
.tag { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 800; color: #fff; background: #888; margin-left: 2px; }
.tag.milk { background: #e0a020; } .tag.baobao { background: var(--baobao); } .tag.food { background: #3cb56a; } .tag.new { background: var(--red); } .tag.mini { background: #8a6be0; }
.bar { height: 10px; border-radius: 5px; background: #e8dcc8; overflow: hidden; border: 2px solid var(--ink); }
.bar i { display: block; height: 100%; background: var(--gold); }

/* 准备面板 */
.prep { width: 1200px; height: 680px; }
.prep-body { display: grid; grid-template-columns: 250px 1fr 300px; gap: 14px; flex: 1; min-height: 0; }
.rift-list { display: flex; flex-direction: column; gap: 8px; }
.rift-card { padding: 8px 10px; cursor: pointer; border-left-width: 10px; }
.rift-card b { font-size: 17px; }
.rift-card .meta { font-size: 13px; color: #6a5a4a; display: flex; gap: 10px; margin-top: 2px; }
.team { display: flex; gap: 12px; }
.slot { width: 196px; height: 228px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px; }
.slot .ico { width: 112px; height: 112px; }
.slot.empty { justify-content: center; cursor: pointer; border-style: dashed; background: #fbf4e6; }
.slot.empty big { font-size: 56px; line-height: 1; color: #b09070; }
.slot .who { font-size: 13px; color: #6a5a4a; }
.snackbar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.snacks { display: flex; gap: 8px; flex: 1; }
.snack { width: 100px; height: 118px; padding: 6px; text-align: center; cursor: pointer; font-size: 12px; line-height: 1.25; }
.snack .ico { width: 52px; height: 52px; display: block; margin: 0 auto 2px; }
.snack b { font-size: 14px; display: block; }
.snack.locked .ico { filter: grayscale(1) brightness(.7); }
.snack .lock { position: absolute; top: 4px; left: 6px; font-size: 16px; }
.pager { width: 34px; height: 60px; border-radius: 10px; border: 3px solid var(--ink); background: #fff; font-weight: 900; font-size: 18px; }
.pager:disabled { opacity: .35; }
.items-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.it { position: relative; text-align: center; font-size: 11px; line-height: 1.2; padding: 4px 2px; border-radius: 10px; background: #fff; border: 2px solid #d8c8b0; cursor: pointer; }
.it .ico { width: 52px; height: 52px; display: block; margin: 0 auto; }
.it .marks { position: absolute; top: 1px; right: 1px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; pointer-events: none; }
.it .marks .tag { margin: 0; padding: 0 4px; font-size: 11px; line-height: 16px; border-radius: 5px; }
.it .need { display: block; color: #2a8a50; font-weight: 800; font-size: 11px; line-height: 1.25; }
.it.locked { background: #d4d0cb; border-color: #9a948c; color: #6a645c; }
.it.locked .ico { opacity: .45; }
.it .lockbadge { position: absolute; left: 50%; top: 30px; transform: translate(-50%, -50%); padding: 2px 8px; border-radius: 6px; background: #4a4a50; color: #fff; font-size: 13px; font-weight: 900; pointer-events: none; }
.it .need.lock-t { color: #d0452a; }
.prep-foot { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 10px; font-size: 16px; }
.prep-foot .cost { display: flex; align-items: center; gap: 4px; font-weight: 800; }
.prep-foot .cost img { width: 28px; height: 28px; }
.lvneed { color: var(--red); font-weight: 900; font-size: 14px; }

/* 报告 */
.report { width: 760px; height: 680px; }
.report .outing { padding: 8px 12px; border-radius: 10px; background: var(--paper2); margin-bottom: 10px; font-size: 15px; }
.ev-area { height: 368px; padding-right: 6px; }
.ev-card { display: flex; gap: 12px; align-items: center; height: 108px; margin-bottom: 10px; }
.ev-card .txt { flex: 1; min-width: 0; }
.ev-card .txt b { font-size: 17px; }
.ev-card .txt p { margin: 4px 0 0; font-size: 14px; color: #5a4a3a; }
.ev-card .got { position: relative; width: 104px; text-align: center; font-size: 12px; }
.ev-card .got .ico { width: 72px; height: 72px; display: block; margin: 0 auto; }
.ev-card .got .tag.new { position: absolute; top: -6px; right: 4px; }
.goldline { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border-radius: 8px; background: #eef2f8; font-weight: 800; }
.goldline img { width: 18px; height: 18px; }
.report .ending { margin-top: 8px; padding: 10px 12px; border-top: 3px dashed #c8b090; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.report-foot { display: flex; justify-content: center; margin-top: 12px; }

/* 通用奖励 */
.reward { width: 640px; text-align: center; cursor: pointer; }
.reward h2 { margin: 6px 0 14px; font-size: 30px; color: #c87a20; text-shadow: 0 2px 0 #fff; }
.reward-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.rw { width: 108px; padding: 8px 4px; border-radius: 14px; background: #fff; border: 3px solid var(--ink); position: relative; font-size: 13px; }
.rw .ico { width: 72px; height: 72px; display: block; margin: 0 auto; }
.rw.prize { background: #fff3c0; box-shadow: 0 0 18px var(--gold); }
.reward .hint { margin-top: 14px; color: #8a7060; }

/* 图鉴 */
.codex { width: 1180px; height: 680px; }
.ov-top { display: flex; gap: 14px; }
.dcard { width: 330px; display: flex; gap: 10px; cursor: pointer; }
.dcard .ico { width: 110px; height: 110px; }
.skills-row { display: flex; gap: 8px; margin-top: 6px; }
.sk { text-align: center; font-size: 11px; width: 52px; }
.sk .ico { width: 44px; height: 44px; display: block; margin: 0 auto; }
.sk.off .ico { filter: grayscale(1); opacity: .45; }
.rcards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.rcard { text-align: center; padding: 8px; }
.rcard img { width: 100%; height: 86px; object-fit: cover; border-radius: 8px; }
.prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.prize { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.codex-body { display: grid; grid-template-columns: 200px 1fr; gap: 14px; flex: 1; min-height: 0; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav button { position: relative; text-align: left; padding: 8px 10px; border-radius: 12px; border: 3px solid var(--ink); background: #fff; font-weight: 800; font-size: 15px; color: var(--ink); }
.nav button.on { background: var(--gold); }
.nav button:disabled { background: #e8e0d4; color: #a09080; }
.nav small { display: block; font-weight: 400; font-size: 12px; }
.cgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-content: start; }
.cgrid .it { padding: 8px 4px; font-size: 13px; }
.cgrid .it .ico { width: 72px; height: 72px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; }
.task-row .rws { display: flex; gap: 6px; }
.task-row .rws .rwi { position: relative; width: 52px; text-align: center; font-size: 12px; font-weight: 800; }
.task-row .rws .rwi .ico { width: 40px; height: 40px; display: block; margin: 0 auto; }
.task-row .desc { flex: 1; }
.task-row .desc b { font-size: 16px; }
.task-row.top { background: #fff6d0; border-color: #c87a20; }

/* 龙详情 / 技能 */
.dd { width: 900px; }
.dd-body { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
.skill-card { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.skill-card.off { background: #eee6da; color: #988; }
.skill-card.off .ico { filter: grayscale(1); opacity: .5; }

/* 剧情对话 */
.dialog-mask { background: rgba(0, 0, 0, .35); align-items: flex-end; justify-content: stretch; }
.dlg { position: relative; width: 100%; height: 100%; cursor: pointer; }
.dlg .por { position: absolute; bottom: 150px; width: 300px; height: 300px; transition: filter .2s, transform .2s; }
.dlg .por.l { left: 90px; } .dlg .por.r { right: 90px; transform: scaleX(-1); }
.dlg .por.dim { filter: grayscale(.9) brightness(.55); }
.dlg .box { position: absolute; left: 60px; right: 60px; bottom: 26px; height: 150px; background: var(--paper); border: 5px solid var(--ink); border-radius: 20px; padding: 26px 30px; font-size: 22px; line-height: 1.5; }
.dlg .name { position: absolute; top: -26px; left: 40px; padding: 4px 18px; border-radius: 12px; border: 4px solid var(--ink); background: var(--milk); font-weight: 900; font-size: 18px; }
.dlg .name.r { left: auto; right: 40px; background: var(--baobao); color: #fff; }
.dlg .next { position: absolute; right: 26px; bottom: 14px; font-size: 22px; animation: bob .6s infinite; }
.dlg .skip { position: absolute; right: 30px; top: 70px; }

/* 好友 / 借龙 */
.friends { width: 900px; height: 640px; }
.fr { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; }
.fr .ava { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; }
.fr .on { color: var(--green); font-weight: 800; } .fr .off { color: #988; }
.fr .dr { display: flex; align-items: center; gap: 6px; width: 230px; padding: 4px 6px; border-radius: 10px; background: #f8f0e0; font-size: 13px; }
.fr .dr .ico { width: 52px; height: 52px; }
.group-h { margin: 8px 0 6px; font-weight: 900; color: #8a6040; }
.rule { padding: 8px 12px; border-radius: 10px; background: var(--paper2); font-size: 14px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }

/* 弹窗 */
.pop { width: 520px; text-align: center; }
.pop p { font-size: 17px; line-height: 1.5; }
.pop .acts { display: flex; justify-content: center; gap: 14px; margin-top: 10px; }

/* 教程 / 漫画 */
.tut { width: 860px; height: 600px; }
.tut-page { flex: 1; display: flex; align-items: center; gap: 24px; padding: 10px 30px; }
.tut-page img { width: 256px; height: 256px; border-radius: 16px; border: 4px solid var(--ink); background: #fff; flex: none; object-fit: contain; }
.tut-page p { font-size: 20px; line-height: 1.7; }
.pg { display: flex; align-items: center; justify-content: center; gap: 18px; font-weight: 800; }
.comic { width: 980px; height: 680px; }
.comic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 0; }
.comic-grid figure { margin: 0; background: #fff; border: 4px solid var(--ink); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; min-height: 0; }
.comic-grid img { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.comic-grid figcaption { text-align: center; font-size: 14px; padding-top: 4px; }
.letter { flex: 1; background: #fffaf0 repeating-linear-gradient(transparent 0 33px, #f0dcc0 33px 34px); border: 4px solid #c8a070; border-radius: 12px; padding: 20px 36px; font-size: 18px; line-height: 34px; white-space: pre-wrap; overflow-y: auto; }
.letter h3 { text-align: center; margin: 0 0 6px; font-size: 24px; }
.letter .sign { text-align: right; margin-top: 10px; }

/* ---------- 全屏演出 ---------- */
#fx { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
.fx { position: absolute; inset: 0; pointer-events: auto; overflow: hidden; background: rgba(10, 6, 4, .85); }
.fx .big-tv { position: absolute; left: 50%; top: 46%; width: 520px; height: 400px; margin: -200px 0 0 -260px; border-radius: 30px; background: linear-gradient(#9a6a44, #74482a); border: 6px solid #3a2416; padding: 24px 24px 50px; transition: transform .5s ease-in; }
.fx .big-tv .screen { position: relative; width: 100%; height: 100%; border-radius: 30px / 24px; background: #111; overflow: hidden; border: 4px solid #241510; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; font-weight: 900; text-align: center; }
.fx .big-tv .screen.on { background: #cfe8ff; animation: flick .12s steps(2) 6; }
.fx .squad { position: absolute; left: 50%; bottom: 40px; display: flex; gap: 6px; transform: translateX(-50%); }
.fx .squad .m { position: relative; text-align: center; color: #fff; font-size: 13px; transition: transform .45s ease-in, opacity .45s; }
.fx .squad .m img { width: 112px; height: 112px; display: block; }
.fx .squad .m .snk { position: absolute; right: 6px; top: 40px; width: 40px; height: 40px; }
.fx.ready .squad .m { animation: hop .45s ease-out infinite; }
.fx .tunnel { position: absolute; inset: 0; display: none; }
.fx .tunnel i { position: absolute; left: 50%; top: 50%; border: 6px solid rgba(255, 255, 255, .7); border-radius: 20px; animation: tunnel 1.2s linear infinite; }
.fx.dive .tunnel { display: block; }
.fx.dive .big-tv, .fx.dive .squad { opacity: 0; transition: opacity .2s; }
.fx .arrive { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.fx .arrive b { font-size: 64px; } .fx .arrive span { font-size: 26px; margin-top: 8px; }
.fx.arrived .arrive { display: flex; animation: fade .3s; }
.fx .skip-hint { position: absolute; bottom: 14px; right: 20px; color: #ccc; font-size: 14px; }
@keyframes tunnel { from { width: 40px; height: 30px; margin: -15px 0 0 -20px; opacity: 0; } 30% { opacity: 1; } to { width: 1600px; height: 1200px; margin: -600px 0 0 -800px; opacity: 0; } }
@keyframes flick { 50% { filter: brightness(1.8); } }
.fx .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fade .6s; }
.fx .caption { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); padding: 8px 26px; border-radius: 14px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 28px; font-weight: 900; white-space: nowrap; }
.fx .tvrow { position: absolute; left: 50%; top: 120px; transform: translateX(-50%); display: flex; gap: 16px; }
.fx .tvrow .mini { width: 200px; height: 160px; border-radius: 16px; background: linear-gradient(#9a6a44, #74482a); border: 4px solid #3a2416; padding: 10px 10px 22px; }
.fx .tvrow .mini .screen { width: 100%; height: 100%; border-radius: 12px; background: #111; overflow: hidden; position: relative; }
.fx .tvrow .mini img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s; }
.fx .tvrow .mini.lit img { opacity: 1; }
.fx .cheer { position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); display: flex; gap: 40px; }
.fx .cheer img { width: 140px; height: 140px; animation: hop .5s ease-out infinite; }
.fx .cheer img:last-child { animation-delay: .25s; transform: scaleX(-1); }
.noise { position: absolute; inset: 0; background: repeating-radial-gradient(circle at 40% 30%, #fff 0 1px, #000 1px 2px); animation: noise .1s steps(2) infinite; opacity: .8; }

/* 小游戏 */
.mg { width: 760px; height: 560px; }
.mg-field { position: relative; flex: 1; border-radius: 14px; background: linear-gradient(#cfe8ff, #a8d0f0); border: 4px solid var(--ink); overflow: hidden; }
.mg-field img { position: absolute; width: 72px; height: 72px; cursor: pointer; transition: transform .1s; }
.mg-field img:active { transform: scale(.85); }

/* 打 BOSS 小游戏（minigame.js） */
.mg2 { position: absolute; inset: 0; z-index: 150; background: #1d1830; touch-action: none; }
.mg2 canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.mg2-pause { position: absolute; right: 22px; top: 18px; height: 44px; padding: 0 18px; border-radius: 14px; border: 4px solid var(--ink); background: #fff; font-weight: 900; font-size: 17px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.mg2-layer { position: absolute; inset: 0; pointer-events: none; }
.mg2-layer > * { pointer-events: auto; }
.mg2-mask { position: absolute; inset: 0; background: rgba(10, 6, 20, .6); display: flex; align-items: center; justify-content: center; animation: fade .15s; }
.mg2-pop { min-width: 440px; background: var(--paper); border: 5px solid var(--ink); border-radius: 22px; box-shadow: 0 10px 0 rgba(0, 0, 0, .3); padding: 22px 30px; text-align: center; animation: rise-in .18s; }
.mg2-pop h2 { margin: 4px 0 10px; font-size: 32px; }
.mg2-pop.win h2 { color: #e8463a; font-size: 40px; }
.mg2-pop p { margin: 8px 0; font-size: 18px; }
.mg2-pop .acts { display: flex; gap: 18px; justify-content: center; margin-top: 16px; }
.mg2-pop .acts .btn { min-width: 150px; }
.mg2-net { color: #e8463a; font-weight: 900; }
.mg2-squad { display: flex; gap: 22px; justify-content: center; margin: 10px 0; }
.mg2-squad img { width: 110px; height: 110px; }
.mg2-squad.cheer img { animation: hop .5s ease-out infinite; }
.mg2-squad.sad img { filter: grayscale(.6) brightness(.85); transform: translateY(14px) rotate(8deg); }
.mg2-dlg { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); cursor: pointer; animation: fade .15s; }
.mg2-dlg .por { position: absolute; bottom: 150px; width: 300px; height: 300px; transition: filter .2s; }
.mg2-dlg .por.l { left: 90px; }
.mg2-dlg .por.r { right: 90px; }
.mg2-dlg .por.dim { filter: grayscale(.9) brightness(.55); }
.mg2-dlg .box { position: absolute; left: 60px; right: 60px; bottom: 26px; height: 150px; background: var(--paper); border: 5px solid var(--ink); border-radius: 20px; padding: 26px 30px; font-size: 22px; line-height: 1.5; }
.mg2-dlg .name { position: absolute; top: -26px; left: 40px; padding: 4px 18px; border-radius: 12px; border: 4px solid var(--ink); background: var(--milk); font-weight: 900; font-size: 18px; }
.mg2-dlg .name.r { left: auto; right: 40px; background: #6a5a8a; color: #fff; }
.mg2-dlg .next { position: absolute; right: 26px; bottom: 14px; font-size: 22px; animation: bob .6s infinite; }
.mg2-dlg .skip { position: absolute; right: 30px; top: 30px; }

/* ---------- 引导 ---------- */
#guide { position: fixed; inset: 0; z-index: 1000; }
#guide .blocker { position: absolute; inset: 0; }
#guide .hole { position: absolute; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62); border: 3px solid var(--gold); pointer-events: none; transition: all .2s; animation: pulse 1.2s infinite; }
#guide .tipbox { position: absolute; display: flex; align-items: flex-end; gap: 8px; max-width: 520px; pointer-events: none; }
#guide .tipbox img { width: 110px; height: 110px; }
#guide .tipbox div { background: var(--paper); border: 4px solid var(--ink); border-radius: 16px; padding: 12px 16px; font-size: 18px; font-family: var(--font); color: var(--ink); line-height: 1.4; }
#guide .tipbox small { display: block; margin-top: 4px; font-size: 13px; color: #8a7060; }
@keyframes pulse { 50% { border-color: #fff; } }
.tip-arrow { position: absolute; z-index: 70; max-width: 300px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 3px solid var(--ink); font-size: 14px; pointer-events: none; animation: pop .2s; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }

/* ---------- toast / 登录 / GM ---------- */
#toast { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
#toast div { padding: 10px 22px; border-radius: 22px; background: rgba(20, 12, 8, .85); color: #fff; font-size: 17px; font-weight: 700; animation: fade .15s; max-width: 760px; text-align: center; }
#login { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: radial-gradient(#5a3f5e, #2a1d26); overflow: auto; -webkit-overflow-scrolling: touch; }
#login .panel { width: min(560px, 100%); text-align: center; flex: none; max-height: none; }
#login .doc-rail { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 236px; overflow: visible; text-align: left; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 8px 10px; box-shadow: 4px 4px 0 rgba(0, 0, 0, .28); user-select: text; }
#login .doc-rail h2 { margin: 0 0 2px; font-size: 15px; }
#login .doc-rail h3 { margin: 6px 0 3px; font-size: 11px; color: var(--wood); letter-spacing: .04em; }
#login .doc-rail .doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#login .doc-rail a, #login .doc-rail button.doc-sim { display: flex; align-items: center; justify-content: center; min-height: 24px; margin: 0; padding: 3px 5px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; color: var(--ink); text-decoration: none; font-size: 11px; line-height: 1.2; font-weight: 700; text-align: center; }
#login .doc-rail a:hover { background: var(--gold); }
#login .doc-rail a.miss { opacity: .45; pointer-events: none; font-weight: 400; }
#login .doc-rail button.doc-sim { grid-column: 1 / -1; background: var(--gold); font-family: inherit; cursor: pointer; }
@media (max-width: 1100px) {
  #login { flex-direction: column; align-items: center; justify-content: flex-start; padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); }
  #login .panel, #login .doc-rail { position: static; width: min(560px, 100%); transform: none; }
  #login .doc-rail { margin-top: 16px; }
}
#login h1 { margin: 6px 0; font-size: 34px; line-height: 1.25; }
#login input { width: 100%; max-width: 100%; height: 48px; border-radius: 12px; border: 4px solid var(--ink); padding: 0 14px; font-size: 16px; font-family: inherit; margin: 12px 0; }
.avas { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.avas img { width: 54px; height: 54px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; background: #fff; }
.avas img.on { border-color: var(--ink); box-shadow: 0 0 0 3px var(--gold); }
#login .login-msg { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: #ffe2d8; border: 2px solid var(--red); color: #a02a1a; font-size: 14px; line-height: 1.5; }
#login .mode { margin-top: 12px; font-size: 14px; color: #6a5a4a; line-height: 1.6; overflow-wrap: anywhere; }
#gm { position: absolute; right: 0; top: 56px; bottom: 0; width: 300px; z-index: 250; background: rgba(20, 20, 20, .92); color: #eee; padding: 12px; overflow-y: auto; font-size: 13px; }
#gm h3 { margin: 8px 0 6px; color: #ff0; font-size: 14px; }
#gm button { margin: 2px; padding: 5px 8px; border-radius: 6px; border: 1px solid #666; background: #333; color: #fff; font-size: 12px; }
#gm button:hover { background: #555; }
#gm input, #gm select { background: #222; color: #fff; border: 1px solid #666; border-radius: 4px; padding: 4px; font-size: 12px; }
#gm .kv { color: #aaa; line-height: 1.6; }
.mg-embed { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; background: #1d1612; }
.mg-embed-bar { flex: none; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: #2a1d16; color: #fff6e3; font-size: 14px; }
.mg-embed-bar b { font-size: 16px; }
.mg-embed-bar span { color: #d7c4a3; }
.mg-embed-back { height: 32px; padding: 0 14px; border-radius: 8px; border: 2px solid #e7c27a; background: #f5c542; color: #3b2a20; font-weight: 900; cursor: pointer; }
.mg-embed iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #1d1612; }
.overlay-msg { position: absolute; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .7); color: #fff; font-size: 30px; font-weight: 900; text-align: center; line-height: 1.6; }
.net-bad { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 300; padding: 4px 12px; border-radius: 10px; background: #a33; color: #fff; font-size: 13px; }
