:root {
  --bg: #0F1620;
  --bg-2: #131C28;
  --panel: #16202E;
  --panel-2: #1B2635;
  --border: #2A3546;
  --border-soft: #222C3B;
  --gold: #FAC775;
  --gold-dim: #B98F4E;
  --blue: #378ADD;
  --purple: #7F77DD;
  --green: #5DCAA5;
  --red: #E24B4A;
  --text: #D8DEE9;
  --muted: #7C8798;
  --muted-2: #566073;
  /* 品质天地玄黄四档（0 黄 / 1 玄 / 2 地 / 3 天）—— 旧制五档里的仙品紫已随品质收档删除 */
  --q0: #9AA3B2;
  --q1: #5DCAA5;
  --q2: #378ADD;
  --q3: #FAC775;
  --silver: #C9D1DC;
  --radius: 10px;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  /* 竖屏机身宽度：手机上就是满屏，桌面上居中成一条窄机身 */
  --frame: 430px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 15px;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font-family: inherit; color: inherit; cursor: pointer; }
input, select { font-family: inherit; }
.hidden { display: none !important; }

#app {
  height: 100%;
  position: relative;
  background:
    radial-gradient(760px 420px at 50% -8%, rgba(55,138,221,0.10), transparent 70%),
    radial-gradient(620px 360px at 50% 108%, rgba(250,199,117,0.06), transparent 70%),
    var(--bg);
}

/* ---------- 登录层 ---------- */
.layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.auth-card {
  width: min(380px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 26px 22px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.brand-mark {
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--gold-dim);
  border-radius: 9px;
  position: relative;
  background: linear-gradient(160deg, rgba(250,199,117,0.14), rgba(55,138,221,0.06));
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; background: var(--gold); opacity: 0.75;
}
.brand-mark::before { left: 19px; top: 9px; width: 2px; height: 22px; }
.brand-mark::after { left: 10px; top: 12px; width: 20px; height: 2px; }
.brand h1 { margin: 0; font-size: 19px; letter-spacing: 3px; color: var(--gold); font-weight: 500; }
.brand-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); letter-spacing: 1px; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border-soft); }
.tab {
  background: none; border: none; padding: 10px; font-size: 13px;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.auth-form input {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; color: var(--text); font-size: 15px; outline: none;
}
.auth-form input:focus { border-color: var(--blue); }

.btn-primary {
  background: linear-gradient(180deg, #2C3B52, #223045);
  border: 1px solid var(--gold-dim); color: var(--gold);
  min-height: 44px; padding: 11px; border-radius: 8px; font-size: 14px; letter-spacing: 2px;
}
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  min-height: 40px; padding: 8px 12px; border-radius: 8px; font-size: 12px;
}
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.auth-msg { min-height: 18px; margin: 14px 0 0; font-size: 12px; color: var(--red); line-height: 1.5; }
.auth-msg.ok { color: var(--green); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 8px 0 0; }

/* 连不上服务器时的告警条 */
.net-warn {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.7;
  color: #E8C9A8;
  background: rgba(226, 75, 74, 0.10);
  border: 1px solid rgba(226, 75, 74, 0.45);
  border-radius: 8px;
  word-break: break-all;
}
.net-warn .nw-title { color: var(--red); font-weight: 600; margin-bottom: 4px; }
.net-warn a { color: var(--gold); }
.net-warn .nw-detail { color: var(--muted); margin-top: 4px; }

/* ---------- 游戏层：竖屏五段式 ----------
   顶栏 / 战斗画面 / 战报条 / 页签内容区（自己滚） / 底部页签栏。
   画面上方不放任何按钮，所有功能入口都收在下方页签里。 */
#gameLayer {
  height: 100%;
  max-width: var(--frame);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto auto minmax(140px, 1fr) auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
@media (min-width: 480px) {
  #gameLayer { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

/* ---------- 顶栏 ---------- */
#topbar {
  padding: 8px 12px 7px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.tb-top { display: flex; align-items: center; gap: 8px; }
.tb-name {
  color: var(--gold); font-size: 15px; letter-spacing: 1px;
  min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tb-level { font-size: 11px; color: var(--muted); flex: none; font-family: var(--mono); }
.tb-res {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.tb-res b { color: var(--text); font-family: var(--mono); font-weight: 500; }
/* 顶栏资源：纹银（银锭）/ 灵石（金菱）/ 背包（圆点） */
.ico-silver, .ico-stone, .ico-bag { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.ico-silver { background: var(--silver); }
.ico-stone { background: var(--gold); transform: rotate(45deg); }
.ico-bag { background: var(--blue); border-radius: 50%; }
.tb-exp { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.tb-exp-bar {
  flex: 1; height: 6px; background: #0B111A; border-radius: 3px;
  overflow: hidden; border: 1px solid var(--border-soft);
}
.tb-exp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--purple)); transition: width .4s; }
.tb-exp-text { font-size: 10px; color: var(--muted); font-family: var(--mono); flex: none; }

/* ---------- 战斗画面 ---------- */
#canvasWrap {
  position: relative;
  /* 底部页签改成两行后多占约 40px，战斗画面相应收一点，别把内容区挤没 */
  height: clamp(212px, 33vh, 300px);
  background: linear-gradient(180deg, #0C1420, #0A111A 60%, #0C1219);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
#battleCanvas { width: 100%; height: 100%; display: block; }

/* 击杀收益（货币 + 装备）：贴在战斗画面正下方，几秒后淡出。
   位置必须是「下方正中」—— 左下原来那条杀怪战报会挡住人物下半身，
   右下的收益飘字会挡住怪物，所以两侧都不用了，只留这一处。 */
.loot-pop {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  max-width: calc(100% - 20px);
  padding: 4px 12px; border-radius: 10px;
  background: rgba(11,17,26,0.72); border: 1px solid var(--border);
  font-size: 11px; line-height: 1.55; text-align: center;
  pointer-events: none;
  opacity: 0; transition: opacity .3s;
}
.loot-pop.show { opacity: 1; }
.loot-pop > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loot-pop .lp-cur { color: var(--gold); font-family: var(--mono); }
.loot-pop .lp-item { color: var(--muted); }
.loot-pop .lp-note { color: var(--muted-2); }

/* ---------- 战报条 ---------- */
.battle-foot { display: flex; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.bf-item { flex: 1; min-width: 0; padding: 6px 4px; text-align: center; display: flex; flex-direction: column; gap: 1px; }
.bf-item + .bf-item { border-left: 1px solid var(--border-soft); }
.bf-k { font-size: 10px; color: var(--muted-2); }
.bf-v { font-size: 13px; font-family: var(--mono); color: var(--gold); }

/* ---------- 页签内容区 ---------- */
#tabContent {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 10px 10px 16px;
  min-height: 0;
}

/* ---------- 底部页签栏（两排 × 5 个，共 10 个） ----------
   5 列栅格，10 个页签自动折成两排；顺序即 TABS 的顺序。 */
#tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.gtab {
  appearance: none; background: none; border: 0;
  min-height: 46px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); font-size: 12.5px; letter-spacing: 1px;
  position: relative;
}
/* 第二排（第 6 个页签起）与第一排之间加一条分隔线 */
.gtab:nth-child(n+6) { border-top: 1px solid var(--border-soft); }
.gtab.active { color: var(--gold); }
.gtab.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 2px; background: var(--gold); border-radius: 0 0 2px 2px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px;
}
.card + .card { margin-top: 10px; }
.card-title { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--gold); letter-spacing: 1px; }

/* ---------- 属性表 ---------- */
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--border-soft);
}
.stat-list li:last-child { border-bottom: 0; }
.stat-list .k { color: var(--muted); }
.stat-list .v { font-family: var(--mono); color: var(--text); text-align: right; }
/* 两个属性一行（8 项 4 行，不用下拉就能看全）；末行两条不需要下边框 */
.stat-list.grid2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.stat-list.grid2 li { min-width: 0; }
.stat-list.grid2 li:nth-last-child(-n+2) { border-bottom: 0; }

/* ---------- 宫格（装备 / 法器入口） ---------- */
.grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 9px;
  background: var(--bg-2); min-height: 64px; width: 100%;
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  cursor: pointer; text-align: left; font-size: 12px;
}
.grid-item.empty { border-style: dashed; border-color: var(--border-soft); cursor: default; }
.grid-item .ic { --ic: 32px; }
.grid-item.empty .ic { opacity: 0.28; }
.grid-item .gi-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.grid-item .gi-slot { font-size: 10px; color: var(--muted-2); }
.grid-item .gi-name { font-size: 12px; line-height: 1.25; word-break: break-all; }
.grid-item .gi-sub { font-size: 10px; color: var(--muted); font-family: var(--mono); }

/* 九宫格：随身九件（武器/冠冕/法袍/护心/手镯/戒指/腰带/鞋子/敕令）固定 3×3。
   窄屏也不折成两列 —— 九宫格折列就不再是九宫格了。 */
.grid-equip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* 仓库格与背包格同款，只是「已入库」用另一种边框色区分 */
.bag-cell.stored { border-color: #3A4759; background: linear-gradient(180deg, rgba(55,138,221,0.06), var(--bg-2)); }
.bag-cell .bc-store { right: 3px; bottom: 3px; color: var(--blue); background: rgba(55,138,221,0.16); }

/* ---------- 分类圆片 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  min-height: 36px; padding: 6px 11px; font-size: 12px;
  background: transparent; border: 1px solid var(--border-soft); border-radius: 999px;
  color: var(--muted); display: inline-flex; align-items: center; gap: 5px;
}
.chip i { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.chip.on { border-color: var(--gold-dim); color: var(--gold); background: rgba(250,199,117,0.07); }
.chip.on i { color: var(--gold-dim); }

/* ---------- 行列表（更多页） ---------- */
.rows { display: flex; flex-direction: column; }
.row-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 48px; padding: 10px 2px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--border-soft);
}
.row-btn:last-child { border-bottom: 0; }
.row-btn .rb-name { font-size: 14px; color: var(--text); }
.row-btn .rb-sub { font-size: 11px; color: var(--muted-2); }
.row-btn .rb-arrow { margin-left: auto; color: var(--muted-2); font-size: 18px; }

/* ---------- 包裹 ---------- */
.bag-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.bag-tools select {
  flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 10px; color: var(--text); font-size: 13px; outline: none;
}
/* 回收 / 自动回收：都收在背包页的这条动作条上 */
.bag-acts { display: flex; gap: 8px; margin-bottom: 10px; }
.bag-acts .btn-ghost { flex: 1; }
.bag-cap { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: 11px; color: var(--muted); }
.bag-cap-bar { flex: 1; height: 5px; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 3px; overflow: hidden; }
.bag-cap-bar i { display: block; height: 100%; background: var(--blue); }
.bag-cap.full .bag-cap-bar i { background: var(--red); }
.bag-cap.full > span:first-child { color: var(--red); }
.bag-cap-note { color: var(--muted-2); white-space: nowrap; }

.bag-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.bag-cell {
  position: relative; height: 78px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; cursor: pointer;
}
.bag-cell.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.bag-cell.bc-q0 { border-color: #39424F; }
.bag-cell.bc-q1 { border-color: #2E5A4C; background: linear-gradient(180deg, rgba(93,202,165,0.07), var(--bg-2)); }
.bag-cell.bc-q2 { border-color: #27496E; background: linear-gradient(180deg, rgba(55,138,221,0.08), var(--bg-2)); }
.bag-cell.bc-q3 { border-color: #7A5E2E; background: linear-gradient(180deg, rgba(250,199,117,0.12), var(--bg-2)); }
.bag-cell .ic { --ic: 32px; }
.bag-cell .bc-name { font-size: 11px; line-height: 1.2; text-align: center; padding: 0 4px; }
.bag-cell .bc-sub { font-size: 10px; color: var(--muted); font-family: var(--mono); }
.bag-cell .bc-qty { font-size: 12px; color: var(--gold); }
.bag-cell .bc-badge {
  position: absolute; font-size: 9px; line-height: 1; padding: 2px 3px;
  border-radius: 4px; font-family: var(--mono);
}
.bag-cell .bc-enh { right: 3px; top: 3px; color: var(--gold); background: rgba(250,199,117,0.12); }
.bag-cell .bc-lock { left: 3px; top: 3px; color: var(--red); background: rgba(226,75,74,0.14); }
.bag-cell .bc-eq { left: 3px; bottom: 3px; color: var(--blue); background: rgba(55,138,221,0.16); }

/* ---------- 地图 ---------- */
.continent-list { display: flex; flex-direction: column; gap: 6px; }
.continent { border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.continent-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 48px; padding: 8px 12px; cursor: pointer; font-size: 13px;
}
.continent-head .cn { color: var(--text); }
.continent-head .cs { font-size: 11px; color: var(--muted-2); flex: none; }
.continent.open .continent-head .cs { color: var(--gold); }
.continent-maps { display: none; padding: 4px 6px 6px; border-top: 1px solid var(--border-soft); }
.continent.open .continent-maps { display: block; }
.map-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--muted);
}
.map-item.here { color: var(--gold); background: rgba(250,199,117,0.07); }
.map-item.locked { opacity: 0.42; cursor: not-allowed; }
.map-item .mi-lv { font-size: 10px; color: var(--muted-2); flex: none; }

/* ---------- 品质配色（天地玄黄四档） ---------- */
.q0 { color: var(--q0); } .q1 { color: var(--q1); }
.q2 { color: var(--q2); } .q3 { color: var(--q3); }

/* ---------- 底部抽屉（详情下钻） ---------- */
.panel-host { position: absolute; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.panel-backdrop { position: absolute; inset: 0; background: rgba(6,10,16,0.62); }
.float-panel {
  position: relative;
  width: 100%; max-width: var(--frame); max-height: 84%;
  background: var(--panel);
  border: 1px solid var(--border); border-bottom: 0;
  border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column;
  box-shadow: 0 -14px 44px rgba(0,0,0,0.5);
  animation: sheetUp .2s ease-out;
}
@keyframes sheetUp { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
.fp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border-soft); flex: none;
}
.fp-head h3 { margin: 0; font-size: 14px; color: var(--gold); font-weight: 500; letter-spacing: 1px; }
.fp-close {
  background: none; border: 0; font-size: 24px; line-height: 1;
  color: var(--muted); min-width: 44px; min-height: 44px; margin: -6px -8px -6px 0;
}
.fp-body {
  padding: 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}

/* ---------- 物品详情 ---------- */
.bd-head { display: flex; align-items: center; gap: 8px; }
.bd-head .ic { --ic: 48px; }
.bd-head .bd-name { flex: 1; min-width: 0; font-size: 14px; }
.bd-head .bd-q { font-size: 11px; color: var(--muted); flex: none; }
.bd-title { margin: 14px 0 8px; font-size: 13px; color: var(--gold); font-weight: 500; }
.tip-sep { height: 1px; background: var(--border-soft); margin: 9px 0; }
.bd-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; line-height: 1.9; }
.bd-row .k { color: var(--muted); flex: none; }
.bd-row .v { color: var(--text); font-family: var(--mono); text-align: right; word-break: break-all; }
.bd-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.bd-btns.one { grid-template-columns: 1fr; }
.bd-btns .btn-primary, .bd-btns .btn-ghost { padding: 10px; font-size: 12px; letter-spacing: 0; }

/* ---------- 规则列表 ---------- */
.rule-list { display: flex; flex-direction: column; gap: 7px; }
.rule {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; font-size: 12px;
}
.rule .ic { --ic: 32px; }
.rule .r-desc { flex: 1; min-width: 0; color: var(--text); }
/* 标签在 .rule 与回收四档里都用，故不再挂在 .rule 下限定 */
.r-tag { font-size: 10px; padding: 3px 6px; border-radius: 4px; border: 1px solid var(--border); flex: none; }
.r-tag.hard { color: var(--red); border-color: #5A2A2A; }
.r-tag.on { color: var(--green); border-color: #24513F; }
.r-tag.off { color: var(--muted-2); }
.rule.compact { flex-wrap: wrap; gap: 6px; }
.rule.compact .r-desc { flex: 1 1 100%; }

/* ---------- 回收：天地玄黄四档，每档「手动回收 + 设置自动」 ---------- */
.rec-tier { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.rt-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rt-name { flex: 1; min-width: 0; }
.rt-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.rt-acts .btn-ghost { padding: 8px; letter-spacing: 0; }

/* ---------- 天机阁表单 ---------- */
.admin-form { display: flex; flex-direction: column; gap: 12px; }
.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.admin-form label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--muted); min-width: 0; }
.admin-form input, .admin-form select {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; color: var(--text); font-size: 13px; outline: none; min-width: 0; width: 100%;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border-soft); }
.admin-table th { color: var(--muted); font-weight: 400; font-size: 11px; }
.admin-table td { font-family: var(--mono); }
.admin-table td.nm { font-family: inherit; color: var(--gold); }
.admin-table tr.sel { background: rgba(55,138,221,0.08); }
.admin-scroll { overflow-x: auto; }

/* ---------- 悬浮提示（仅桌面鼠标；触摸端走底部抽屉） ---------- */
.tip {
  position: absolute; z-index: 90; pointer-events: none;
  background: #0B1119; border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 12px; min-width: 190px; max-width: 280px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.tip .ic { --ic: 32px; }
.tip .tip-title { font-size: 13px; margin-bottom: 6px; }
.tip .tip-title.with-ic { display: flex; align-items: center; gap: 8px; }
.tip .tip-line { display: flex; justify-content: space-between; gap: 14px; font-size: 11px; color: var(--muted); line-height: 1.8; }
.tip .tip-line b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.tip .tip-hint { font-size: 10px; color: var(--muted-2); margin-top: 7px; }

/* ---------- 提示条 ---------- */
.toast-host {
  position: absolute; z-index: 95; top: 76px; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--frame); padding: 0 12px;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  max-width: 100%;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 14px; font-size: 12px; color: var(--text);
  box-shadow: 0 10px 26px rgba(0,0,0,0.4); animation: toastIn .18s ease-out;
}
.toast.good { border-color: #24513F; color: var(--green); }
.toast.bad { border-color: #5A2A2A; color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #26313F; border-radius: 3px; }

/* 矮屏（横放的小手机 / 桌面小窗口）：收紧战斗画面与宫格，别把内容区挤没 */
@media (max-height: 700px) {
  #canvasWrap { height: clamp(186px, 30vh, 252px); }
}
@media (max-width: 380px) {
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-item .ic { --ic: 16px; }
  .bag-cell .ic { --ic: 16px; }
  .bag-cells { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}
