/* 主题变量（由 body.theme-* 覆盖；game.js 也同步设置 --accent） */
:root {
  --accent: #e74c3c;
  --panel: #141c26;
  --bg: #0d1117;
  --line: #2c3e50;
}
body.theme-ember  { --accent:#e74c3c; --panel:#141c26; --bg:#0d1117; }
body.theme-gold   { --accent:#f1c40f; --panel:#1c1810; --bg:#100c06; }
body.theme-azure  { --accent:#3498db; --panel:#101c2b; --bg:#060d16; }
body.theme-jade   { --accent:#2ecc71; --panel:#10231a; --bg:#06120c; }
body.theme-violet { --accent:#9b59b6; --panel:#1b1026; --bg:#0e0616; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  background: var(--bg); color: #e6e6e6;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  height: 100%; display: flex; align-items: center; justify-content: center;
  user-select: none;
}
#stage {
  position: relative; width: 960px; height: 600px;
  border: 2px solid var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}
#game { display: block; }

/* HUD */
#hud {
  position: absolute; top: 0; left: 0; right: 0; height: 64px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; background: linear-gradient(180deg, rgba(0,0,0,0.75), rgba(0,0,0,0));
  pointer-events: none;
}
.hudLeft { display: flex; flex-direction: column; gap: 4px; }
.hudRight { display: flex; gap: 14px; align-items: center; font-size: 13px; }
.lv { font-size: 18px; font-weight: bold; color: var(--accent); }
.bar {
  position: relative; width: 240px; height: 14px; border-radius: 7px;
  background: rgba(0,0,0,0.5); overflow: hidden; border: 1px solid #000;
}
.bar.exp { height: 10px; }
.barFill { height: 100%; transition: width 0.15s linear; }
.hp .barFill { background: linear-gradient(90deg, #e74c3c, #ff7675); }
.exp .barFill { background: linear-gradient(90deg, #2980b9, #74b9ff); }
.barText {
  position: absolute; inset: 0; font-size: 10px; line-height: 14px;
  text-align: center; color: #fff; text-shadow: 0 1px 2px #000;
}
.stat b { color: #ffd479; }
.auto { font-size: 12px; }

/* 右侧工具栏 */
#toolbar {
  position: absolute; right: 8px; top: 72px; display: flex; flex-direction: column; gap: 8px;
  z-index: 5;
}
.toolBtn {
  width: 42px; height: 42px; border-radius: 8px; background: rgba(0,0,0,0.55);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; position: relative; transition: transform .1s;
}
.toolBtn:hover { transform: translateY(-2px); border-color: var(--accent); }
.toolBtn .dot {
  position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: #e74c3c; box-shadow: 0 0 6px #e74c3c;
}

/* 操作提示 */
#hint {
  position: absolute; bottom: 6px; left: 0; right: 0; text-align: center;
  font-size: 12px; color: #9aa; pointer-events: none; text-shadow: 0 1px 2px #000;
}

/* 通用面板头 */
.panelHead {
  font-size: 16px; font-weight: bold; color: var(--accent);
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.panelHead .close { cursor: pointer; color: #888; }
.panelSub { font-size: 12px; color: #8ab; margin: 10px 0 6px; }

/* 背包面板 */
#bag {
  display: none; position: absolute; top: 64px; left: 0; right: 0; bottom: 0;
  background: rgba(10,15,22,0.96); padding: 16px; flex-direction: column; gap: 10px;
}
.bagHead { font-size: 16px; font-weight: bold; color: #ffd479; display: flex; justify-content: space-between; }
.bagHead .close { cursor: pointer; color: #888; margin-left: 10px; }
.bagHead .restart { cursor: pointer; color: #e67e22; font-size: 13px; }
.bagBody { display: flex; gap: 20px; flex: 1; }
.bagGrid { display: grid; grid-template-columns: repeat(6, 64px); gap: 6px; }
.bagCell {
  width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); display: flex; flex-direction: column; align-items: center;
  justify-content: center; font-size: 11px; text-align: center; cursor: pointer; padding: 2px;
}
.bagCell small { color: #788; font-size: 10px; }
.bagCell:hover { border-color: var(--accent); }
.charEquip { display: flex; flex-direction: column; gap: 6px; width: 240px; }
.eqRow {
  display: flex; justify-content: space-between; background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px;
}
.eqSlot { color: #8ab; }
.charStats { margin-top: 12px; font-size: 13px; color: #cdd; line-height: 1.7; }

/* 皮肤面板 */
#skinPanel {
  display: none; position: absolute; top: 64px; left: 0; right: 0; bottom: 0;
  background: rgba(10,15,22,0.97); padding: 16px; overflow-y: auto;
}
.skinGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.skinCard {
  border: 2px solid var(--line); border-radius: 10px; padding: 10px; background: var(--panel);
  text-align: center; cursor: default;
}
.skinCard.eq { box-shadow: 0 0 0 2px var(--accent) inset; }
.skinArt {
  width: 100%; height: 110px; object-fit: contain; border-radius: 6px; background: #0a0e14;
  margin-bottom: 6px;
}
.skinArtPh { width: 100%; height: 110px; border-radius: 6px; margin-bottom: 6px; opacity: .8; }
.skinName { font-size: 14px; font-weight: bold; }
.skinRar { font-size: 11px; color: #bbb; margin: 2px 0; }
.skinSrc { font-size: 10px; color: #789; margin-bottom: 6px; }
.skinBtn {
  display: inline-block; padding: 5px 14px; border-radius: 6px; font-size: 12px; font-weight: bold;
  background: var(--accent); color: #fff; cursor: pointer;
}
.skinBtn.locked { background: #444; color: #999; cursor: default; }
.themeRow { display: flex; gap: 10px; }
.themeSwatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 2px solid #333;
}
.themeSwatch.on { border-color: #fff; box-shadow: 0 0 8px #fff; }

/* 特效面板 */
#fxPanel {
  display: none; position: absolute; top: 64px; left: 0; right: 0; bottom: 0;
  background: rgba(10,15,22,0.97); padding: 16px; overflow-y: auto;
}
.fxRow { display: flex; flex-wrap: wrap; gap: 8px; }
.fxChip {
  padding: 8px 16px; border-radius: 8px; background: var(--panel);
  border: 2px solid var(--line); color: #cdd; font-size: 13px; cursor: pointer;
  transition: transform .08s, box-shadow .12s;
}
.fxChip:hover { transform: translateY(-1px); }
.fxChip.on {
  border-color: var(--accent); color: #fff;
  box-shadow: 0 0 10px rgba(231,76,60,.45);
  background: linear-gradient(180deg, rgba(231,76,60,.18), var(--panel));
}

/* 活动面板 */
#activityPanel {
  display: none; position: absolute; top: 64px; left: 0; right: 0; bottom: 0;
  background: rgba(10,15,22,0.97); padding: 16px; overflow-y: auto;
}
.actTabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.actTab {
  padding: 6px 14px; border-radius: 6px 6px 0 0; font-size: 13px; cursor: pointer; color: #9ab;
}
.actTab.on { color: #fff; background: var(--accent); font-weight: bold; }
.actBody { padding-top: 12px; }
.actInfo { font-size: 12px; color: #8ab; margin-bottom: 10px; }

.loginGrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.loginCell {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 4px; text-align: center;
  background: var(--panel); font-size: 11px;
}
.loginCell.ready { border-color: var(--accent); box-shadow: 0 0 8px rgba(231,76,60,.4); }
.loginCell.done { opacity: .5; }
.loginCell.locked { opacity: .35; }
.lcDay { font-weight: bold; color: #ffd479; margin-bottom: 4px; }
.lcReward { color: #cdd; line-height: 1.3; }

.dailyList, .eventList, .rechargeList { display: flex; flex-direction: column; gap: 8px; }
.dailyRow, .eventRow, .rcRow {
  display: flex; align-items: center; gap: 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font-size: 13px;
}
.dailyRow.done, .rcRow.done { opacity: .55; }
.drName, .erName, .rcName { flex: 1; }
.drProg { color: #ffd479; }
.drBtn, .erBtn, .rcBtn {
  padding: 4px 12px; border-radius: 6px; background: var(--accent); color: #fff;
  font-size: 12px; cursor: pointer; white-space: nowrap;
}
.erDesc { flex: 1.4; color: #9ab; font-size: 12px; }
.erStatus { color: #8ab; font-size: 12px; }
.bigBtn {
  margin-top: 14px; width: 100%; padding: 12px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: bold; cursor: pointer;
}
.bigBtn:disabled { background: #444; color: #999; cursor: default; }

.rcTotal { font-size: 14px; margin: 6px 0; }
.rcTotal b { color: #ffd479; }
.rcBtns { display: flex; gap: 8px; margin-bottom: 10px; }
.smBtn {
  flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: #cdd; cursor: pointer; font-size: 13px;
}
.smBtn:hover { border-color: var(--accent); }

/* 转盘 */
.wheelWrap { margin-top: 16px; text-align: center; }
.wheelTitle { font-size: 13px; color: #8ab; margin-bottom: 10px; }
.wheelTitle b { color: #ffd479; }
.wheelStage { position: relative; width: 200px; height: 200px; margin: 0 auto 12px; }
#wheelCanvas {
  width: 200px; height: 200px; border-radius: 50%;
  border: 4px solid var(--accent); box-shadow: 0 0 16px rgba(0,0,0,.5);
}
.wheelPin {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 22px; text-shadow: 0 1px 3px #000; z-index: 2;
}

/* 职业选择 */
#classSelect {
  display: none; position: absolute; inset: 0; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 30%, #16263a, #0a0e14);
}
.csTitle { font-size: 26px; font-weight: bold; color: #ffd479; letter-spacing: 2px; }
.classCards { display: flex; gap: 18px; }
.classCard {
  width: 200px; border: 2px solid; border-radius: 10px; padding: 16px;
  background: rgba(255,255,255,0.04); cursor: pointer; transition: transform 0.1s;
}
.classCard:hover { transform: translateY(-4px); }
.ccName { font-size: 20px; font-weight: bold; margin-bottom: 8px; }
.ccDesc { font-size: 12px; color: #bcc; line-height: 1.6; min-height: 60px; }
.ccStat { font-size: 12px; color: #9ab; margin: 10px 0; }
.ccBtn { text-align: center; color: #fff; border-radius: 6px; padding: 8px; font-weight: bold; }
.csFoot { font-size: 11px; color: #677; }

/* 死亡面板 */
#deathPanel {
  display: none; position: absolute; inset: 0; flex-direction: column;
  align-items: center; justify-content: center; background: rgba(0,0,0,0.8);
}
.deathBox { text-align: center; }
.deathTitle { font-size: 40px; font-weight: bold; color: #e74c3c; margin-bottom: 14px; }
.deathInfo { font-size: 14px; color: #cdd; margin-bottom: 20px; }
.deathBtn {
  display: inline-block; padding: 12px 28px; background: #e74c3c; color: #fff;
  border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 16px;
}
.deathBtn:hover { background: #ff6b6b; }

/* 战力排行榜 */
.lbTitle { margin: 10px 0 6px; color: #ffd479; font-weight: bold; font-size: 14px; }
.lbList { max-height: 180px; overflow-y: auto; background: rgba(0,0,0,.35); border-radius: 8px; padding: 6px; }
.lbRow { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.06); }
.lbRank { width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: #c0392b; color: #fff; font-weight: bold; flex: 0 0 auto; }
.lbName { flex: 1; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbPow { color: #f1c40f; font-weight: bold; }
.lbEmpty { color: #888; font-size: 12px; padding: 8px; text-align: center; }

/* ============ 技能 / 设计 overlay 面板 ============ */
.overlayPanel {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.62); z-index: 30; padding: 20px;
}
.panelBox {
  width: 600px; max-width: 94%; max-height: 90%; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; box-shadow: 0 12px 48px rgba(0,0,0,.6);
}
.panelBody { font-size: 13px; color: #cdd; }
.panelHead .x { cursor: pointer; color: #888; font-size: 15px; font-weight: bold; }
.panelHead .x:hover { color: #fff; }

/* 技能图鉴行 */
.skillRow {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.skillRow:last-child { border-bottom: none; }
.skillMain { flex: 1; min-width: 0; }
.skillMain b { font-size: 14px; }
.tag {
  display: inline-block; margin-left: 6px; font-size: 11px; color: #9ab;
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; vertical-align: middle;
}
.skillDesc { font-size: 12px; color: #bcc; line-height: 1.55; margin-top: 5px; }
.skillAct { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex: 0 0 auto; }
.mini {
  padding: 5px 12px; border-radius: 6px; background: var(--accent); color: #fff;
  font-size: 12px; cursor: pointer; border: none; white-space: nowrap; transition: filter .1s;
}
.mini:hover { filter: brightness(1.1); }
.mini.on { background: #555; color: #fff; box-shadow: 0 0 0 2px var(--accent) inset; }

/* 通用表单（技能设计 / 角色皮肤设计面板） */
.panelBody label { display: block; font-size: 12px; color: #8ab; margin: 12px 0 4px; }
.panelBody input, .panelBody select, .panelBody textarea {
  width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: #0d1117; color: #e6e6e6; font-size: 13px; font-family: inherit;
}
.panelBody input[type=color] { height: 38px; padding: 3px; cursor: pointer; }
.panelBody textarea { resize: vertical; min-height: 64px; }
.panelBody .row { display: flex; gap: 10px; margin-top: 14px; }
.panelBody .row .mini { flex: 1; }
.tip { font-size: 11px; color: #789; margin-top: 10px; line-height: 1.5; }

/* 角色皮肤设计 */
.skinPick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.csPrev {
  display: block; width: 120px; height: 120px; margin: 0 auto 10px;
  background: #0a0e14; border-radius: 8px; border: 1px solid var(--line);
}

/* 技能栏（底部 HUD） */
.skillBar {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 6; align-items: flex-end;
}
.skillChip {
  position: relative; min-width: 74px; height: 52px; padding: 8px 14px;
  border-radius: 10px; background: rgba(0,0,0,0.55); border: 1px solid var(--line);
  color: #e6e6e6; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center; transition: border-color .12s, box-shadow .12s;
}
.skillChip.on {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(231,76,60,.45);
  background: linear-gradient(180deg, rgba(231,76,60,.18), rgba(0,0,0,.55));
}
.skillChip .sn { font-weight: bold; }
.skillChip .cd {
  position: absolute; top: -9px; right: -7px; min-width: 18px; height: 18px; line-height: 18px;
  text-align: center; font-size: 11px; font-weight: bold; color: #fff;
  background: #c0392b; border-radius: 9px; padding: 0 4px;
}
/* —— 地图列表 / NPC 对话 —— */
.mapListGrid { display:flex; flex-direction:column; gap:10px; padding:12px; max-height:70vh; overflow:auto; }
.mapCard { background:rgba(255,255,255,.05); border:1px solid var(--line); border-radius:10px; padding:10px 12px; cursor:pointer; transition:border-color .12s, background .12s; }
.mapCard:hover { border-color: var(--accent); background:rgba(255,255,255,.09); }
.mapName { font-size:16px; font-weight:bold; color:#fff; }
.mapDesc { font-size:12px; color:#aaa; margin:4px 0; }
.mapMeta { font-size:12px; color:var(--accent); }
.npcDialogText { padding:16px; font-size:14px; line-height:1.6; color:#e6e6e6; }
