:root {
  --bg: #0b0e14;
  --panel: #1b2433;
  --panel2: #16202e;
  --line: #2b3a4f;
  --txt: #cfd8e3;
  --dim: #7d8ea3;
  --gold: #f0c040;
  --red: #e2564a;
  --blue: #3ea6ff;
  --green: #4cc38a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: 64px;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 10px; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border-radius: 12px; padding: 10px;
  border: 1px solid var(--line);
}
.topbar .ava {
  width: 46px; height: 46px; border-radius: 10px; background: var(--panel2);
  overflow: hidden; position: relative; flex: none;
}
.topbar .ava img { width: 100%; height: 100%; object-fit: contain; }
.topbar .who { flex: 1; min-width: 0; }
.topbar .who b { font-size: 16px; }
.topbar .who small { color: var(--dim); display: block; }
.topbar .coin { text-align: right; font-size: 12px; color: var(--gold); line-height: 1.8; }

h3.sec { color: var(--gold); font-size: 13px; margin: 16px 0 8px; font-weight: 600; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.card {
  background: linear-gradient(160deg, #1d2738, #151d29);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column;
  justify-content: center; min-height: 68px; cursor: pointer;
  transition: .15s; position: relative;
}
.card:active { transform: scale(.985); }
.card.dis { opacity: .45; cursor: not-allowed; }
.card b { font-size: 14px; }
.card small { color: var(--dim); font-size: 11px; }
.card .tag {
  position: absolute; right: 8px; top: 8px; font-size: 10px;
  color: var(--gold); border: 1px solid rgba(240,192,64,.4);
  border-radius: 6px; padding: 0 5px;
}

.bar { height: 8px; background: #0f1620; border-radius: 6px; overflow: hidden; margin: 6px 0; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #e2564a, #f08a4a); }
.bar.mp > i { background: linear-gradient(90deg, #3e7bd6, #6fb2ff); }
.bar.exp > i { background: linear-gradient(90deg, #c9a227, #f5d76e); }

.rowline { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.rowline b { color: var(--txt); }

.stat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; font-size: 12px; }
.stat div { display: flex; justify-content: space-between; border-bottom: 1px dashed #22303f; padding: 4px 0; }

/* 角色装备区 */
.equipbox { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: start; margin-top: 10px; }
.eslots { display: flex; flex-direction: column; gap: 6px; }
.eslot {
  width: 56px; height: 56px; border-radius: 8px; background: #121a25;
  border: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 10px; color: var(--dim);
  position: relative; cursor: pointer;
}
.eslot img { max-width: 40px; max-height: 40px; }
.eslot.filled { color: var(--gold); border-color: rgba(240,192,64,.45); }
.hero {
  position: relative; min-height: 300px; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  background: radial-gradient(circle at 50% 70%, #24344a 0%, #101822 70%);
  border-radius: 12px; overflow: hidden;
}
.hero .sprite {
  width: 220px; height: 220px; background-repeat: no-repeat;
  background-size: auto 100%; animation: heroAnim 1.2s steps(12) infinite;
}
@keyframes heroAnim { from { background-position: 0 0; } to { background-position: -100% 0; } }
.hero .idline { position: absolute; top: 8px; right: 10px; font-size: 11px; color: var(--dim); }

/* 背包 */
.bagbar { display: flex; gap: 8px; margin-bottom: 8px; }
.btn {
  background: #223045; color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font-size: 12px; cursor: pointer;
}
.btn.gold { background: linear-gradient(180deg,#f0c040,#c99a1d); color: #2b1d00; border: none; font-weight: 600; }
.btn.red { background: #7a2f2a; border-color: #9c4038; }
.btn:active { transform: scale(.97); }

.baggrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cell {
  aspect-ratio: 1/1; border-radius: 8px; background: #121a25;
  border: 1px solid var(--line); position: relative;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
}
.cell img { max-width: 82%; max-height: 82%; }
.cell .q { position: absolute; left: 2px; top: 1px; font-size: 9px; }
.cell.empty { opacity: .35; }
.q1 { color: #b9c2cc; } .q2 { color: #4cc38a; } .q3 { color: #3ea6ff; }
.q4 { color: #b06cff; } .q5 { color: #f0a020; } .q6 { color: #ff4d4d; }

/* 聊天 */
.feed { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; height: calc(100vh - 230px); overflow: auto; font-size: 12px; }
.feed p { margin: 0 0 6px; color: #9fb0c4; }
.feed p b { color: var(--gold); }

/* 底部导航 */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; height: 56px;
  background: #0f1620; border-top: 1px solid var(--line);
  display: flex; z-index: 20;
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--dim); text-decoration: none; font-size: 12px;
}
.nav a.on { color: var(--gold); }
.nav a i { font-style: normal; font-size: 18px; line-height: 1.2; }

/* 登录 */
.login { max-width: 380px; margin: 12vh auto; padding: 20px; }
.login h1 { font-size: 22px; color: var(--gold); text-align: center; margin: 0 0 6px; }
.login p.desc { text-align: center; color: var(--dim); font-size: 12px; margin: 0 0 18px; }
.login input {
  width: 100%; padding: 11px 12px; margin-bottom: 10px; border-radius: 8px;
  background: #101924; border: 1px solid var(--line); color: var(--txt); font-size: 14px;
}
.login .btn { width: 100%; padding: 11px; margin-top: 4px; }
.login .alt { text-align: center; font-size: 12px; color: var(--dim); margin-top: 12px; }
.login .alt a { color: var(--blue); cursor: pointer; }

.clslist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.clslist .c { border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; cursor: pointer; background: #121a25; }
.clslist .c.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.clslist .c img { width: 100%; max-height: 96px; object-fit: contain; }
.clslist .c b { display: block; font-size: 12px; margin-top: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(20,28,40,.95); border: 1px solid var(--line);
  color: var(--txt); padding: 9px 14px; border-radius: 8px; font-size: 13px;
  z-index: 40; max-width: 80vw;
}
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 30; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; width: 300px; }
.modal h4 { margin: 0 0 10px; color: var(--gold); font-size: 15px; }
.modal .row { font-size: 12px; margin-bottom: 6px; display: flex; justify-content: space-between; }

/* ---- 传2 真图标 ---- */
.iicon { image-rendering: auto; ; }
.eslot .iicon { max-width: 40px; max-height: 40px; }
.eslot.filled .iicon { max-width: 32px; max-height: 32px; margin-bottom: 2px; }
.iicon.ghost { display: inline-block; }
.iicon.ghost img { opacity: .2; max-width: 34px; max-height: 34px; image-rendering: auto; }
.cell .iicon { max-width: 82%; max-height: 82%; }

.iicon { image-rendering: auto; pointer-events: none; }
.iicon.ghost img { opacity: .22; }


/* 战斗页 v2 */
.fightcard { background: radial-gradient(120% 80% at 50% 0%, #1a2436 0%, #101827 60%, #0b0e14 100%); }
.mons { display: flex; gap: 8px; justify-content: center; align-items: flex-end; margin-top: 8px; min-height: 150px; }
.mon { flex: 1; max-width: 33%; opacity: .55; transition: .2s; text-align: center; }
.mon.on { opacity: 1; transform: translateY(-4px); }
.mon img { width: 100%; max-height: 108px; object-fit: contain; }
.mon.bossmon img { max-height: 140px; }
.mon.bossmon .mname { color: #ff6b6b; }
.mname { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mname em { color: var(--gold); font-style: normal; font-size: 9px; }
.mbar { height: 4px; background: #223047; border-radius: 3px; margin: 3px 6px 0; overflow: hidden; }
.mbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff5c5c, #ff9b45); transition: width .25s; }
.mhp { font-size: 9px; color: #7d8ea3; }
.bar.hp i { background: linear-gradient(90deg, #35c07a, #7fe6a3); }
.logbox { max-height: 150px; overflow-y: auto; font-size: 12px; line-height: 1.7; }
.logline { color: #9fb0c4; border-bottom: 1px dashed rgba(255,255,255,.05); padding: 1px 0; }
.logline:last-child { color: var(--gold); }
.tag.boss { background: rgba(255,92,92,.16); color: #ff6b6b; }
.lootlist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lootlist span { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #121a25; border: 1px solid var(--line); }

/* 背包 / 仓库 v3 */
.pcard { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: linear-gradient(180deg,#1b2638,#121a25); }
.pava { width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: #0b0e14; border: 1px solid var(--line); }
.pava img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.pinfo { flex: 1; min-width: 0; }
.pinfo b { display: block; font-size: 15px; color: #e8eef7; }
.pinfo small { color: var(--dim); font-size: 11px; }
.pcoin { text-align: right; font-size: 12px; color: var(--gold); line-height: 1.6; }
.pcoin span { display: block; }
.bagbar { display: flex; gap: 6px; align-items: center; margin: 10px 0; }
.bagtab { flex: 0 0 auto; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: #121a25; color: var(--dim); font-size: 12px; }
.bagtab.on { color: var(--gold); border-color: rgba(240,192,64,.5); background: rgba(240,192,64,.08); }
.btn.mini { padding: 7px 10px; font-size: 12px; margin-left: auto; }
.bagbar .btn.mini + .btn.mini { margin-left: 6px; }
.cell.qb1 { border-color: #3a4657; }
.cell.qb2 { border-color: #2f7a52; }
.cell.qb3 { border-color: #2b6da8; }
.cell.qb4 { border-color: #7a4ea8; }
.cell.qb5 { border-color: #a8752b; }
.cell.qb6 { border-color: #a83a3a; }
.cell .plus { position: absolute; right: 3px; bottom: 1px; font-size: 9px; color: var(--gold); }
.sheet { width: min(330px, 88vw); background: #141c29; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.shead { font-size: 15px; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sbody { display: flex; gap: 12px; margin: 12px 0; align-items: center; }
.sicon { width: 74px; height: 74px; border-radius: 8px; background: #0f1622; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.sicon img { max-width: 58px; max-height: 58px; image-rendering: auto; }
.sstat { flex: 1; font-size: 12px; }
.srow { display: flex; justify-content: space-between; padding: 2px 0; color: var(--dim); }
.srow b { color: #56d67f; font-weight: 600; }
.cmpbox { display: flex; gap: 8px; font-size: 11px; }
.cmpbox > div { flex: 1; background: #0f1622; border-radius: 8px; padding: 8px; border: 1px solid var(--line); }
.cmpbox em { display: block; color: var(--gold); font-style: normal; margin-bottom: 4px; }
.sbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sbtns .btn { margin: 0; }

/* 角色页 v3 */
.rolecard { background: radial-gradient(120% 70% at 50% 20%, #1c2740 0%, #121a25 60%, #0d131d 100%); }
.eslot { position: relative; }
.eslot .en { font-size: 9px; color: var(--dim); max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eslot .plus { position: absolute; right: 2px; bottom: 1px; font-size: 9px; color: var(--gold); }
.eslot.qb1 { border-color: #3a4657; } .eslot.qb2 { border-color: #2f7a52; }
.eslot.qb3 { border-color: #2b6da8; } .eslot.qb4 { border-color: #7a4ea8; }
.eslot.qb5 { border-color: #a8752b; } .eslot.qb6 { border-color: #a83a3a; }
.hname { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 13px; color: #e8eef7; }
.hname em { color: var(--gold); font-style: normal; font-size: 10px; margin-left: 4px; }
.coinrow { display: flex; justify-content: space-between; margin-top: 12px; font-size: 11px; color: var(--dim); }
.coinrow b { color: var(--gold); font-weight: 600; }


.tbadge{font-style:normal;font-size:11px;color:#f0cf7a;border:1px solid rgba(240,207,122,.55);border-radius:4px;padding:0 4px;margin-left:6px;vertical-align:middle;background:rgba(240,207,122,.08)}

.xflist{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.xfrow{display:flex;align-items:center;gap:8px;background:#141c28;border:1px solid rgba(120,140,170,.18);border-radius:8px;padding:8px}
.xfic{width:46px;height:46px;flex:0 0 46px;border-radius:6px;background:#0d1420;border:1px solid rgba(120,140,170,.2);display:flex;align-items:center;justify-content:center}
.xfic img{max-width:38px;max-height:38px}
.xfinfo{flex:1;min-width:0}
.xfinfo b{font-size:14px;color:#dfe7f2}
.xfinfo b i{font-style:normal;font-size:12px;color:#7fc0ff;margin-left:2px}
.xfinfo small{display:block;color:#7d8ea3;font-size:11px;margin-top:2px}
.xfbtn{flex:0 0 auto}
.xfbtn .btn{padding:6px 10px;font-size:12px;border-radius:8px}
.btn.blue{background:linear-gradient(180deg,#2f5f9e,#244a7c);color:#dfeaff;border-color:#3b6ea8}

/* ---- 角色页「基本属性」面板（对齐参考站） ---- */
.attrp { padding: 0 2px; }
.attrp .arow { display: flex; align-items: center; gap: 0; padding: 9px 0; border-bottom: 1px solid #1a2530; font-size: 13px; }
.attrp .arow:last-child { border-bottom: 0; }
.attrp .lb { color: #d7e0ea; flex: none; }
.attrp .dots { flex: 1; height: 1px; margin: 0 8px; border-bottom: 1px dotted #2b3b4a; transform: translateY(4px); }
.attrp .val { flex: none; font-weight: 700; letter-spacing: .3px; }
.attrp .v-atk { color: #f2b544; }
.attrp .v-mag { color: #5aa9ff; }
.attrp .v-tao { color: #4fd08a; }
.attrp .v-def { color: #ef5a5a; }
.attrp .v-mdef { color: #4fd08a; }
.attrp .v-spd { color: #f2b544; }
.attrp .v-luck { color: #f2b544; }
.attrp .brow { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid #1a2530; }
.attrp .brow .bar { flex: 1; margin: 0; height: 10px; }
.attrp .brow .bv { flex: none; font-size: 12px; font-weight: 700; }
.attrp .brow.hp .bv { color: #ef5a5a; }
.attrp .brow.mp .bv { color: #5aa9ff; }

/* ---- 地图挂机页 ---- */
.maphd { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px 6px; }
.maphd .mt { font-size: 15px; font-weight: 700; color: #e8eef5; letter-spacing: 1px; }
.maphd button { font-size: 12px; padding: 5px 12px; }
.mapgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mapcard { background: #101a26; border: 1px solid #1e2d3d; border-radius: 10px; padding: 8px 8px 9px; cursor: pointer; position: relative; overflow: hidden; }
.mapcard.cur { border-color: #3d8bff; box-shadow: 0 0 0 1px #3d8bff inset; }
.mapcard.lock { cursor: not-allowed; }
.mapcard .thumb { position: relative; height: 74px; border-radius: 8px; overflow: hidden; background: #0b1219; }
.mapcard .thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.mapcard.lock .thumb img { filter: grayscale(.7) brightness(.55); }
.mapcard .thumb .lk { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #9fb0c0; background: rgba(6,10,15,.35); letter-spacing: 1px; }
.mapcard .nm { margin-top: 7px; font-size: 13px; font-weight: 700; color: #dfe8f1; }
.mapcard.lock .nm { color: #7c8a97; }
.mapcard .lv { margin-top: 3px; font-size: 11px; color: #7f8d9b; }
.mapcard .lv b { color: #c9a227; font-weight: 700; }
.mapcard .thumb { background-repeat: no-repeat; background-size: 500% 200%; background-color: #0b1219; }
.mapcard .thumb.dim { filter: grayscale(.65) brightness(.5); }

/* ---- 神兵图鉴 ---- */
.cxrow { padding: 9px 0; border-bottom: 1px solid #1a2530; }
.cxrow:last-child { border-bottom: 0; }
.cxh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; }
.cxcells { display: flex; gap: 6px; }
.cxc { width: 44px; height: 44px; border: 1px solid #2a3a4a; border-radius: 8px; position: relative; opacity: .32; filter: grayscale(.6); }
.cxc.on { opacity: 1; filter: none; }
.cxc img { width: 100%; height: 100%; border-radius: 8px; }
.cxc .qc { position: absolute; right: 2px; bottom: 0; font-size: 9px; color: #9fb0c0; }
.cxc.qb1 { border-color: #55606b; } .cxc.qb2 { border-color: #4a86c8; } .cxc.qb3 { border-color: #6bbf6b; }
.cxc.qb4 { border-color: #b06be0; } .cxc.qb5 { border-color: #e0a03a; } .cxc.qb6 { border-color: #e0553a; }

/* ===== 签到 / 邮件 / 聊天输入 ===== */
.sgngrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.sgncell { background: #141e28; border: 1px solid #22303d; border-radius: 6px; padding: 8px 6px; text-align: center; }
.sgncell b { display: block; font-size: 12px; color: #cfdae6; }
.sgncell small { display: block; font-size: 10px; color: #7d8ea3; margin-top: 3px; line-height: 1.3; }
.sgncell.done { border-color: #d4a13a; background: #241f10; }
.sgncell.done b { color: #ffd24a; }
.mlrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid #1a2530; font-size: 13px; }
.mlrow:last-child { border-bottom: 0; }
.chbar { display: flex; gap: 8px; position: sticky; bottom: 0; padding: 8px 0 10px; background: rgba(10,15,20,.92); }
.chbar input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border-radius: 6px; border: 1px solid #22303d; background: #101922; color: #dfe8f1; font-size: 13px; }
.chbar .btn { width: 68px; flex: 0 0 auto; height: 34px; }
