* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #140e08; font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif; color: #4a2c12; -webkit-user-select: none; user-select: none; }
#stage { position: absolute; width: 960px; height: 640px; transform-origin: 0 0; overflow: hidden; box-shadow: 0 0 40px #000; }
#cv { position: absolute; inset: 0; display: block; }
#ui { position: absolute; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui > #hud, #ui > #battle-ui, #ui > #banner, #ui > #toast, #ui > #fade { pointer-events: none; }
.hidden { display: none !important; }
b { font-weight: 700; }
.muted { color: #8a6a44; font-size: 12px; margin-top: 6px; }

/* 按钮 */
.btn { font-family: inherit; cursor: pointer; border: 2px solid #8a5a24; border-radius: 10px; padding: 5px 14px; font-size: 14px; color: #5a3410; background: linear-gradient(#fff4d6, #f0d08e); box-shadow: 0 2px 0 #8a5a24, inset 0 1px 0 #fff; transition: filter .1s, transform .05s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 #8a5a24; }
.btn:disabled { opacity: .45; cursor: default; filter: grayscale(.5); }
.btn.primary { background: linear-gradient(#ffd98a, #f0a83a); color: #5a2a00; border-color: #a0601a; }
.btn.danger { background: linear-gradient(#ffb0a0, #e8604a); color: #fff; border-color: #a03020; }
.btn.small { font-size: 12px; padding: 3px 10px; border-radius: 8px; }
.btn.tiny { font-size: 12px; padding: 0 7px; border-radius: 6px; line-height: 18px; }
.btn.big { font-size: 20px; padding: 10px 30px; border-radius: 14px; }
.btn.on { background: linear-gradient(#b8f0a0, #6ac050); color: #1a4a10; border-color: #3a8a2a; }
.row-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.inp { font-family: inherit; font-size: 16px; padding: 6px 10px; border: 2px solid #a8783a; border-radius: 8px; background: #fffbef; color: #4a2c12; outline: none; }

/* 标题 */
.screen { position: absolute; inset: 0; }
#scr-title { display: flex; flex-direction: column; align-items: center; }
.logo { margin-top: 40px; text-align: center; animation: float 4s ease-in-out infinite; }
.logo img { width: 420px; filter: drop-shadow(0 6px 10px rgba(80,40,0,.4)); }
.logo-q { font-size: 28px; font-weight: 900; letter-spacing: 12px; color: #fff; text-shadow: 0 0 6px #c2500a, 3px 3px 0 #b04a10, -2px -2px 0 #b04a10, 2px -2px 0 #b04a10, -2px 2px 0 #b04a10; margin-top: -8px; }
@keyframes float { 50% { transform: translateY(-8px); } }
.t-btns { display: flex; gap: 20px; margin-top: 30px; }
.t-foot { position: absolute; bottom: 8px; font-size: 12px; color: rgba(70,40,10,.75); }

/* 创建角色 */
#scr-create { background: rgba(30,18,6,.55); display: flex; flex-direction: column; align-items: center; }
.cr-title { margin-top: 16px; font-size: 26px; font-weight: 900; color: #ffe8a8; text-shadow: 2px 2px 0 #6a3a10; letter-spacing: 6px; }
.cr-roles { display: flex; gap: 8px; margin-top: 12px; }
.cr-card { width: 100px; padding: 4px; border-radius: 12px; background: linear-gradient(#fff7e0, #f0d8a0); border: 3px solid #b88a4a; text-align: center; cursor: pointer; transition: transform .15s; }
.cr-card:hover { transform: translateY(-4px); }
.cr-card.sel { border-color: #e8602a; box-shadow: 0 0 14px #ffb040; transform: translateY(-6px); }
.cr-card b { display: block; font-size: 14px; }
.cr-card small { color: #8a6a44; }
.cr-info { display: flex; gap: 20px; margin-top: 18px; width: 820px; background: linear-gradient(#fff7e0ee, #f4dca8ee); border: 3px solid #a8783a; border-radius: 18px; padding: 14px 20px; }
.cr-desc { flex: 1; }
.cr-name { font-size: 24px; font-weight: 900; color: #7a3a10; }
.cr-name small { font-size: 14px; color: #8a6a44; }
.cr-desc p { margin: 8px 0; font-size: 15px; }
.schs { display: flex; gap: 8px; margin-top: 4px; }
.sch { background: #8a4a1a; color: #ffe8b0; padding: 3px 10px; border-radius: 10px; font-size: 13px; }
.cr-form { display: flex; gap: 8px; margin-top: 14px; }

/* HUD */
#hud { position: absolute; inset: 0; }
#hud.battle > *:not(#hud-log) { display: none; }
#hud > * { pointer-events: auto; }
#hud-map { position: absolute; left: 8px; top: 8px; background: rgba(40,24,8,.72); border: 2px solid #c8a060; border-radius: 12px; padding: 4px; color: #ffe8b0; }
#hud-mapname { font-size: 14px; font-weight: 700; text-align: center; padding: 1px 0 3px; }
#hud-mapname span { color: #b8e0ff; font-weight: 400; font-size: 12px; }
#hud-mini { display: block; border-radius: 8px; cursor: pointer; }
#hud-status { position: absolute; right: 8px; top: 8px; width: 238px; background: rgba(40,24,8,.72); border: 2px solid #c8a060; border-radius: 12px; padding: 6px; color: #fff6d8; }
.st-row { display: flex; gap: 6px; align-items: center; }
.st-row.pet { margin-top: 5px; padding-top: 5px; border-top: 1px dashed rgba(200,160,96,.5); }
.face { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: radial-gradient(#fff4d8, #d8a860); border: 2px solid #f0c870; flex-shrink: 0; }
.face.small { width: 38px; height: 38px; }
.st-info { flex: 1; min-width: 0; font-size: 12px; }
#hud-name b { font-size: 14px; color: #7dff7a; }
.lv { color: #ffd23a; }
.sc { color: #b8e0ff; font-size: 11px; }
.bar { position: relative; height: 12px; background: rgba(0,0,0,.55); border-radius: 6px; margin-top: 2px; overflow: hidden; border: 1px solid rgba(0,0,0,.6); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; transition: width .3s; }
.bar span { position: relative; display: block; text-align: center; font-size: 10px; line-height: 11px; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.bar.hp i { background: linear-gradient(#ff8a6a, #d8281a); }
.bar.mp i { background: linear-gradient(#7ac0ff, #1a5ad8); }
.bar.exp i { background: linear-gradient(#ffe070, #d89a10); }
#hud-track { position: absolute; right: 8px; top: 150px; width: 238px; max-height: 270px; overflow-y: auto; background: rgba(40,24,8,.6); border: 2px solid rgba(200,160,96,.8); border-radius: 12px; padding: 4px 6px; color: #fff6d8; font-size: 12px; }
.tr-head { font-weight: 700; color: #ffe8b0; border-bottom: 1px solid rgba(200,160,96,.5); padding-bottom: 2px; margin-bottom: 3px; }
.tr-item { padding: 3px 4px; border-radius: 6px; margin-bottom: 2px; }
.tr-item.nav { cursor: pointer; }
.tr-item.nav:hover { background: rgba(255,220,120,.18); }
.tr-t { font-weight: 700; }
.tr-d { color: #f4e8c8; }
.tr-d b { color: #fff; }
#hud-log { position: absolute; left: 8px; bottom: 60px; width: 380px; max-height: 128px; overflow: hidden; background: linear-gradient(rgba(20,12,4,0), rgba(20,12,4,.55) 30%); border-radius: 10px; padding: 4px 8px; font-size: 12px; line-height: 17px; text-shadow: 0 1px 2px #000; pointer-events: none !important; }
#hud-bar { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; background: rgba(40,24,8,.72); border: 2px solid #c8a060; border-radius: 14px; padding: 4px; }
#hud-bar button { width: 52px; height: 44px; font-family: inherit; font-size: 11px; color: #5a3410; border: 2px solid #8a5a24; border-radius: 10px; background: linear-gradient(#fff4d6, #eac47e); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
#hud-bar button i { font-style: normal; font-size: 17px; }
#hud-bar button:hover { filter: brightness(1.08); transform: translateY(-2px); }

/* 对话 */
#dialog { position: absolute; left: 0; right: 0; bottom: 0; top: 0; background: rgba(0,0,0,.08); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; }
.dlg-inner { display: flex; gap: 12px; width: 760px; background: linear-gradient(#fff8e4f4, #f6e0b0f4); border: 3px solid #a8783a; border-radius: 18px; padding: 12px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.4); animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(20px); opacity: 0; } }
.dlg-face { width: 96px; height: 96px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: radial-gradient(#fffaf0, #e8c88a); border: 3px solid #d8a860; }
.dlg-face:empty { display: none; }
.dlg-body { flex: 1; }
.dlg-name { font-size: 17px; font-weight: 900; color: #a0400a; }
.dlg-name small { font-size: 12px; color: #3a7aa8; margin-left: 8px; font-weight: 400; }
.dlg-text { font-size: 15px; line-height: 1.65; margin: 6px 0 8px; min-height: 48px; }
.dlg-text i { color: #3a7aa8; font-style: normal; font-size: 13px; }
.dlg-text b { color: #c0400a; }
.q-new { color: #c05a00; font-weight: 700; margin-right: 4px; }
.dlg-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { font-family: inherit; cursor: pointer; font-size: 14px; padding: 5px 14px; border-radius: 10px; border: 2px solid #b8884a; background: #fffaf0; color: #5a3410; }
.opt:hover { background: #ffe8b0; }
.opt.primary { background: linear-gradient(#ffd98a, #f0a83a); border-color: #a0601a; font-weight: 700; }

/* 面板 */
#panel, #confirm { position: absolute; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
#confirm { z-index: 5; }
.win { max-height: 600px; display: flex; flex-direction: column; background: linear-gradient(#fff8e4, #f4dca8); border: 3px solid #a8783a; border-radius: 18px; box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: pop .15s ease-out; overflow: hidden; }
.win-title { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(#c8803a, #9a5a1e); color: #fff4d0; font-weight: 900; font-size: 16px; padding: 6px 12px; letter-spacing: 2px; text-shadow: 1px 1px 0 #5a2a00; }
.win-x { font-family: inherit; border: none; background: rgba(255,255,255,.2); color: #fff; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.win-body { padding: 12px 14px; overflow-y: auto; font-size: 14px; }
.win.confirm { width: 380px; }
.win.confirm p { font-size: 15px; line-height: 1.6; margin-bottom: 6px; }
.win.confirm .inp { width: 100%; }
.empty-tip { text-align: center; padding: 30px; line-height: 1.8; color: #6a4a24; }

.char { display: flex; gap: 14px; }
.char-l { width: 260px; }
.char-face { text-align: center; background: radial-gradient(#fffaf0, #e8c88a); border-radius: 14px; }
.char-id { text-align: center; margin: 6px 0; line-height: 1.5; }
.char-id b { font-size: 18px; color: #7a3a10; }
.title-tag { display: inline-block; background: #3a7aa8; color: #fff; border-radius: 8px; padding: 0 8px; font-size: 12px; }
.eqs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.eq-slot { background: rgba(255,255,255,.5); border: 2px solid #d8b070; border-radius: 8px; padding: 3px 5px; font-size: 12px; min-height: 42px; }
.eq-slot.has { cursor: pointer; background: rgba(60,36,12,.82); color: #fff; }
.eq-slot.has:hover { border-color: #ff8a3a; }
.eq-n { display: block; color: #a8783a; font-size: 11px; }
.eq-slot small { display: block; color: #d8c8a0; font-size: 10px; }
.char-r { flex: 1; }
.kv { display: grid; grid-template-columns: 40px 1fr 40px 1fr; gap: 4px; margin-bottom: 4px; }
.kv span, .stats span { color: #8a6a44; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 10px 0; background: rgba(255,255,255,.45); padding: 8px; border-radius: 10px; }
.stats div { display: flex; justify-content: space-between; }
.attrs { background: rgba(255,255,255,.45); padding: 6px 8px; border-radius: 10px; }
.attr { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.attr span { width: 50px; color: #8a6a44; }
.attr b { width: 40px; }
.attr.free b { color: #c0400a; }
.chk { display: block; margin-top: 6px; font-size: 13px; }

.bag { display: flex; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(6, 56px); gap: 4px; }
.cell { width: 56px; height: 56px; border-radius: 8px; background: rgba(60,36,12,.8); border: 2px solid #8a6a3a; position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; overflow: hidden; }
.cell.empty { background: rgba(60,36,12,.35); cursor: default; }
.cell.sel { box-shadow: 0 0 0 2px #ffb040; }
.cell .ic { font-size: 22px; line-height: 1; }
.cell .nm { font-size: 10px; white-space: nowrap; max-width: 52px; overflow: hidden; }
.cell .ct { position: absolute; right: 3px; top: 1px; font-size: 11px; color: #ffe070; text-shadow: 0 0 2px #000; }
.detail { flex: 1; background: rgba(255,255,255,.5); border-radius: 10px; padding: 8px; font-size: 13px; line-height: 1.6; min-height: 200px; }
.it-name { font-size: 16px; font-weight: 900; text-shadow: 0 0 1px #000, 0 1px 1px rgba(0,0,0,.4); }
.it-stats b { color: #2a8a2a; }
.cmp { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #c8a060; font-size: 12px; opacity: .85; }
.gold { margin-top: 10px; text-align: right; }
.gold b { color: #c07a00; }

.pets { display: flex; gap: 12px; }
.plist { width: 170px; }
.pitem { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 10px; cursor: pointer; margin-bottom: 4px; background: rgba(60,36,12,.78); color: #fff6d8; border: 2px solid transparent; }
.pitem.sel { border-color: #ffb040; }
.pitem small { display: block; color: #d8c8a0; }
.pitem .pf canvas { border-radius: 50%; background: radial-gradient(#fffaf0, #d8b070); }
.pdetail { flex: 1; }
.ptop { display: flex; gap: 10px; align-items: center; }
.pbig canvas { border-radius: 14px; background: radial-gradient(#fffaf0, #e8c88a); }
.ptop > div:last-child { flex: 1; }
.pskills { display: flex; flex-wrap: wrap; gap: 5px; }
.sk { background: #3a7aa8; color: #fff; padding: 2px 9px; border-radius: 10px; font-size: 12px; cursor: help; }
.sk.rare { background: linear-gradient(#e8a030, #c0600a); }

.skl-head { font-weight: 900; color: #7a3a10; margin-bottom: 6px; }
.skl { background: rgba(255,255,255,.5); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.skl-n b { font-size: 15px; color: #7a3a10; }
.skl-n small { margin-left: 8px; color: #3a7aa8; }

.qitem { background: rgba(255,255,255,.5); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; position: relative; }
.qitem .qt { font-weight: 900; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.qitem button { position: absolute; right: 8px; top: 8px; }
.qdesc { font-size: 13px; line-height: 1.6; background: rgba(255,240,200,.7); padding: 8px 10px; border-radius: 10px; margin-bottom: 6px; }
.qdesc i { color: #3a7aa8; font-style: normal; }
.qhist { margin: 6px 0; }
.qhist .done { display: inline-block; font-size: 12px; margin: 2px 6px 0 0; color: #3a8a2a; }
.qhelp { font-size: 12px; line-height: 1.7; background: rgba(255,255,255,.4); padding: 8px 10px; border-radius: 10px; }

.partners { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.partner { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.5); border-radius: 12px; padding: 6px 10px; border: 2px solid transparent; }
.partner.in { border-color: #5ab04a; background: rgba(210,250,200,.6); }
.partner .pf canvas { border-radius: 50%; background: radial-gradient(#fffaf0, #d8b070); }
.pi { flex: 1; }
.pi small { color: #3a7aa8; }

.mapwrap { text-align: center; }
.bigmap { max-width: 100%; border-radius: 10px; border: 3px solid #a8783a; cursor: crosshair; }
.worldlist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }

.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tab { font-family: inherit; cursor: pointer; padding: 4px 18px; border-radius: 10px 10px 0 0; border: 2px solid #b8884a; border-bottom: none; background: #f0d8a0; color: #5a3410; }
.tab.on { background: #fff8e4; font-weight: 700; }
.shop { max-height: 380px; overflow-y: auto; }
.srow { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.5); border-radius: 8px; padding: 5px 8px; margin-bottom: 4px; }
.srow.dim { opacity: .55; }
.sinfo { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sinfo .ic { font-size: 20px; }
.sinfo small { color: #8a6a44; width: 100%; padding-left: 28px; margin-top: -4px; }
.sp { color: #c07a00; font-weight: 700; width: 70px; text-align: right; }

.sys { display: flex; flex-direction: column; gap: 8px; }
.help p { margin-bottom: 8px; line-height: 1.6; }

/* 战斗界面 */
#battle-ui { position: absolute; inset: 0; }
#battle-ui > * { pointer-events: auto; }
#bt-top { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: rgba(30,16,6,.7); border: 2px solid #c8a060; border-radius: 14px; padding: 4px 12px; color: #ffe8b0; font-weight: 700; }
#bt-hint { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); background: rgba(30,16,6,.75); color: #fff; border-radius: 10px; padding: 4px 14px; font-size: 14px; display: none; pointer-events: none !important; }
#bt-cmd { position: absolute; right: 10px; top: 110px; width: 92px; display: flex; flex-direction: column; gap: 5px; background: rgba(30,16,6,.72); border: 2px solid #c8a060; border-radius: 14px; padding: 6px; }
#bt-who { color: #ffe8b0; font-size: 12px; text-align: center; font-weight: 700; }
#bt-cmd button { font-family: inherit; cursor: pointer; font-size: 15px; font-weight: 700; padding: 6px 0; border-radius: 10px; border: 2px solid #8a5a24; color: #5a3410; background: linear-gradient(#fff4d6, #eac47e); position: relative; }
#bt-cmd button:hover { filter: brightness(1.1); transform: translateX(-2px); }
#bt-cmd kbd { position: absolute; right: 4px; bottom: 1px; font-size: 9px; color: #a07a4a; font-family: inherit; }
#bt-pop { position: absolute; right: 112px; top: 110px; width: 190px; max-height: 400px; overflow-y: auto; background: rgba(30,16,6,.85); border: 2px solid #c8a060; border-radius: 14px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.pop-title { color: #ffe8b0; text-align: center; font-weight: 700; }
#bt-pop button { font-family: inherit; cursor: pointer; text-align: left; padding: 5px 8px; border-radius: 8px; border: 2px solid #8a5a24; background: linear-gradient(#fff4d6, #eac47e); color: #5a3410; }
#bt-pop button small { float: right; color: #3a6a9a; font-size: 11px; margin-top: 2px; }
#bt-pop button:disabled { opacity: .5; cursor: default; }
#bt-pop .pop-x { text-align: center; background: #d8c8a8; }
#bt-result { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.3); cursor: pointer; }
.res-box { min-width: 340px; background: linear-gradient(#fff8e4, #f4dca8); border: 3px solid #a8783a; border-radius: 18px; padding: 14px 24px; text-align: center; animation: pop .2s ease-out; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.res-title { font-size: 28px; font-weight: 900; letter-spacing: 8px; color: #c0600a; text-shadow: 2px 2px 0 #ffe8a0; margin-bottom: 8px; }
.res-box.lose .res-title { color: #6a6a7a; }
.res-row { font-size: 14px; margin: 3px 0; }
.res-row b { color: #c07a00; }
.res-row.q { color: #3a7aa8; }
.res-row.warn { color: #c03a1a; }
.res-lv { font-size: 18px; color: #2a9a2a; font-weight: 900; margin-top: 6px; }
.res-tip { font-size: 12px; color: #8a6a44; margin-top: 10px; }

/* 提示 */
#toast { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9); background: rgba(30,16,6,.85); color: #fff6d8; border: 2px solid #c8a060; border-radius: 12px; padding: 8px 18px; font-size: 15px; opacity: 0; transition: opacity .2s, transform .2s; text-align: center; max-width: 520px; }
#toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner { position: absolute; left: 0; right: 0; top: 120px; text-align: center; opacity: 0; }
#banner.show { animation: banner 2.6s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.4); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.b-main { display: inline-block; font-size: 30px; font-weight: 900; color: #fff; letter-spacing: 6px; text-shadow: 0 0 8px #c2500a, 2px 2px 0 #a04000, -2px -2px 0 #a04000, 2px -2px 0 #a04000, -2px 2px 0 #a04000; }
.b-sub { font-size: 15px; color: #fff6d8; text-shadow: 0 1px 3px #000, 0 0 2px #000; margin-top: 2px; }
#fade { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .25s; }
#fade.on { opacity: 1; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #c8a060; border-radius: 4px; }
/* 标题画面账号面板 */
.t-account { margin-top: 22px; text-align: center; color: #5a3410; font-size: 15px; }
.t-account .acc-form { display: flex; gap: 8px; justify-content: center; align-items: center; }
.t-account .inp { width: 170px; user-select: text; }
.t-account .acc-msg { margin-top: 8px; min-height: 20px; font-size: 14px; color: #8a4a10; }
.t-account .acc-who .btn { margin-left: 6px; }
.t-account:empty { display: none; }
