:root {
  --bg: #1b1c1f;
  --panel: #232529;
  --panel2: #2b2e33;
  --line: #3a3d44;
  --text: #e6e6e6;
  --dim: #9aa0a8;
  --accent: #4ea1ff;
  --enemy: #e0605a;
  --me: #4cc38a;
  --c1: #8a8f98; --c2: #1fb655; --c3: #2f7fe6; --c4: #c13fe0; --c5: #f0b232; --c6: #ff6b6b;
  --w: 64px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 13px/1.4 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}
button { font: inherit; color: inherit; }

.topbar {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); flex: none;
}
.brand { font-size: 15px; font-weight: 700; }
.brand .sub { color: var(--dim); font-weight: 400; margin-left: 4px; }
.setpick select {
  margin-left: 6px; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px;
}
.datainfo { color: var(--dim); font-size: 12px; }
.spacer { flex: 1; }
.btn {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 4px;
  padding: 5px 12px; cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 2px 8px; font-size: 12px; }

.layout { flex: 1; display: flex; min-height: 0; }

/* ---------- 左侧棋子面板 ---------- */
.picker {
  position: relative; width: 300px; flex: none; background: var(--panel);
  border-right: 1px solid var(--line); transition: width .18s ease;
  contain: layout style;                 /* 内部重排不外溢到棋盘那一侧 */
}
.picker.animating .picker-body { content-visibility: hidden; }   /* 动画期间不排 5000+ 节点 */
.picker.closed { width: 0; }
.picker.closed .picker-body { display: none; }
.picker-toggle {
  position: absolute; right: -18px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 56px; z-index: 5; padding: 0; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-left: 0;
  border-radius: 0 6px 6px 0; font-size: 16px; line-height: 1;
}
.picker-toggle:hover { color: var(--accent); }
.picker-body { height: 100%; display: flex; flex-direction: column; min-width: 300px; }
.picker-head { padding: 10px 10px 6px; }
.picker-head input {
  width: 100%; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px;
}
.target { margin-top: 6px; color: var(--dim); font-size: 12px; }
.target b.enemy { color: var(--enemy); }
.target b.me { color: var(--me); }
.trait-filter {
  padding: 4px 10px 8px; display: flex; flex-wrap: wrap; gap: 4px;
  max-height: 34%; overflow-y: auto; border-bottom: 1px solid var(--line); flex: none;
}
.chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 3px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; font-size: 12px; white-space: nowrap;
}
.chip img { width: 16px; height: 16px; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: #274a70; border-color: var(--accent); }
.unit-list { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.cost-group { margin-top: 8px; }
.cost-title { font-size: 12px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.cost-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cc); }
.cost-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.pick {
  position: relative; padding: 0; border: 2px solid var(--cc); border-radius: 5px;
  background: #111; cursor: pointer; overflow: hidden; aspect-ratio: 1;
}
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick span {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; line-height: 14px;
  background: rgba(0,0,0,.72); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pick:hover { filter: brightness(1.25); }
.pick .n {
  position: absolute; top: 0; right: 0; left: auto; bottom: auto; padding: 0 4px;
  background: var(--accent); color: #fff; border-radius: 0 0 0 5px; font-size: 10px;
}
.empty { color: var(--dim); padding: 12px 0; }

/* ---------- 棋盘 ---------- */
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 8px 26px 6px; }
.side-head { width: 100%; max-width: 640px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; }
.side-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.count { color: var(--dim); font-size: 12px; }
.count.over { color: var(--enemy); }
.tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.tab {
  padding: 3px 9px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px 4px 0 0; cursor: pointer; font-size: 12px; color: var(--dim);
}
.tab i { font-style: normal; margin-left: 3px; opacity: .7; }
.tab.on { color: #fff; border-color: var(--enemy); background: #3a2625; }
.side-title { font-weight: 700; padding: 3px 9px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; color: var(--dim); }
.side-title.on { color: #fff; border-color: var(--me); background: #1f3a2e; }
.board-wrap { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.board { position: relative; --h: calc(var(--w) * 1.1547); }
.cell {
  position: absolute; width: var(--w); height: var(--h);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: #2a2c31; cursor: pointer;
}
.cell::after {
  content: ""; position: absolute; inset: 2px; background: #1f2024;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.cell.enemy.active { background: #6a3532; }
.cell.me.active { background: #2c5a45; }
.cell.drop { background: var(--accent); }
/* 海之歌·乐器范围：周围一圈 6 格轻微高亮，跟着乐器位置走 */
.cell.inst-ring::after { background: rgba(243, 189, 82, .20); }
.divider { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--line); }
/* 叠层顺序：越靠下的排越在上层（--uz 由渲染时按显示行号写入），
   这样上一排棋子压下来的下尖角不会盖住本排的星级 / 装备 / 名字 */
.unit { position: absolute; width: var(--w); height: var(--h); cursor: grab; z-index: var(--uz, 2); }
.unit .hex {
  position: absolute; inset: 0; background: var(--cc);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.unit .hex img {
  position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: cover;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); pointer-events: none;
}
/* 名字：固定贴在格子下部同一条基线上；宽度不缩，装备列一律在它上面收住，
   所以有没有装备、几件装备，名字都落在同一行、同一中心线 */
.unit .nm {
  position: absolute; left: -6px; right: -6px; bottom: 12%; z-index: 5; text-align: center; pointer-events: none;
  font-size: calc(var(--w) * .17); line-height: 1.15; font-weight: 700; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 星级：压在头像上缘（不再悬在格子尖顶外面，免得看着像上一排棋子的内容） */
.unit .st {
  position: absolute; left: 0; right: 0; top: 3%; z-index: 5; text-align: center; pointer-events: none;
  font-size: calc(var(--w) * .19); line-height: 1; letter-spacing: -1px;
  text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 3px #000; white-space: nowrap;
}
.unit .st.s1 { color: #c9a37a; } .unit .st.s2 { color: #d9e2ec; } .unit .st.s3 { color: #ffd34d; }
/* 星级就地编辑：默认只亮已点亮的星；鼠标放上去展开 3 个槽位，悬停到第 N 颗就按 N 星配色预览
   未点亮的槽位用"空心星"（透明填充 + 描边）画，别靠降低透明度糊成一片 */
.unit .st i { font-style: normal; display: inline-block; width: 0; opacity: 0; overflow: hidden;
  color: transparent; -webkit-text-stroke: 1px rgba(206, 218, 234, .85); }
.unit .st i.on { width: .92em; opacity: 1; color: inherit; -webkit-text-stroke: .35px rgba(0, 0, 0, .55); }
.unit:hover .st[data-uid] { pointer-events: auto; cursor: pointer; }
.unit:hover .st i, .unit .st[data-hv] i { width: .92em; opacity: .72; }
.unit:hover .st i:hover { transform: translateY(-1px) scale(1.18); }
.unit .st[data-hv="1"] i[data-star="1"],
.unit .st[data-hv="2"] i[data-star="1"],
.unit .st[data-hv="2"] i[data-star="2"],
.unit .st[data-hv="3"] i { opacity: 1; -webkit-text-stroke: .35px rgba(0, 0, 0, .55); }
.unit .st[data-hv="1"] i[data-star="1"] { color: #c9a37a; }
.unit .st[data-hv="2"] i[data-star="1"], .unit .st[data-hv="2"] i[data-star="2"] { color: #d9e2ec; }
.unit .st[data-hv="3"] i { color: #ffd34d; }
/* 装备：贴头像右侧的一列，整列从头部下沿起、在名字上方收住，
   所以装备不会盖住名字，也不会因为有没有装备把别的元素挤动 */
.unit .its { position: absolute; right: -5px; top: 3%; bottom: auto; left: auto; z-index: 4; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; pointer-events: auto; }
.unit .its .item-icon { width: calc(var(--w) * .27); height: calc(var(--w) * .27); }
/* 三件装备整列太高会顶到名字，缩一档保持列底留空 */
.unit .its:has(.item-icon:nth-child(3)) .item-icon { width: calc(var(--w) * .225); height: calc(var(--w) * .225); }
.unit .its img { border: 1px solid #000; box-shadow: 0 1px 3px #000a; }
.unit.sel .hex { filter: drop-shadow(0 0 0 #fff); background: #fff; }
.unit:hover { z-index: calc(var(--uz, 2) + 1); filter: brightness(1.15); }
/* 海之歌·乐器：棋子下层占位，半透明、虚线感，不随棋子选中态变化 */
.unit.instrument { z-index: 1; cursor: grab; opacity: .92; }
.unit.instrument .hex { background: rgba(28, 40, 54, .92); }
.unit.instrument .hex img { inset: 14%; width: 72%; height: 72%; object-fit: contain; }
.unit.instrument .nm { bottom: 12%; color: #f3bd52; font-size: calc(var(--w) * .15); }
.unit.instrument:hover { z-index: 1; filter: brightness(1.08); }
.unit.instrument.readonly { cursor: default; opacity: .82; }
.hint { color: var(--dim); font-size: 12px; padding-top: 4px; flex: none; text-align: center; }

/* ---------- 羁绊 ---------- */
.traits { width: 190px; flex: none; background: var(--panel); border-left: 1px solid var(--line); padding: 8px 10px; overflow-y: auto; }
.traits h3 { margin: 6px 0; font-size: 12px; color: var(--dim); font-weight: 400; }
.trait-list { min-height: 40px; margin-bottom: 10px; }
.tr { display: flex; align-items: center; gap: 6px; padding: 2px 0; opacity: .55; }
.tr.act { opacity: 1; }
.tr .ic { width: 22px; height: 22px; border-radius: 50%; background: #3a3d44; display: grid; place-items: center; flex: none; }
.tr .ic img { width: 15px; height: 15px; }
.tr.t1 .ic { background: #a0714c; } .tr.t3 .ic { background: #8fa3b3; } .tr.t4 .ic { background: #d6a520; }
.tr.t5 .ic, .tr.t6 .ic { background: linear-gradient(135deg, #7fe0ff, #d28bff, #ffd27f); }
.tr .tn { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .tc { color: var(--dim); font-size: 12px; white-space: nowrap; }
.tr .tc b { color: #fff; }

/* ---------- 装备浮层 ---------- */
.pop {
  position: fixed; z-index: 20; width: 348px; max-height: 78vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.pop[hidden] { display: none; }
.pop-head { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.pop-head img.pt { width: 40px; height: 40px; border-radius: 4px; border: 2px solid var(--cc); object-fit: cover; }
.pop-head .ti { flex: 1; min-width: 0; }
.pop-head .ti b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-head .ti span { color: var(--dim); font-size: 12px; }
.stars { display: flex; gap: 2px; }
.stars button { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; padding: 2px 6px; color: var(--dim); }
.stars button.on { color: #ffd34d; border-color: #ffd34d; }
.x { background: none; border: 0; cursor: pointer; font-size: 18px; color: var(--dim); padding: 0 4px; }
.x:hover { color: #fff; }
.slots { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.slot { width: 38px; height: 38px; border: 1px dashed var(--line); border-radius: 4px; background: #17181b; padding: 0; cursor: pointer; }
.slot .item-icon { display: block; width: 100%; height: 100%; }
.slot img { width: 100%; height: 100%; display: block; border-radius: 3px; }
.slot.full { border-style: solid; }
.slots .rm { margin-left: auto; }
.ptabs { display: flex; padding: 0 10px; border-bottom: 1px solid var(--line); }
.ptabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 12px; cursor: pointer; color: var(--dim); }
.ptabs button.on { color: #fff; border-color: var(--accent); }
.ptabs .right { margin-left: 0; }
.pbody { overflow-y: auto; padding: 6px 10px 10px; }.pbody h4 { margin: 8px 0 4px; font-size: 12px; color: var(--dim); font-weight: 400; }
.igrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.it { padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #111; cursor: pointer; aspect-ratio: 1; overflow: visible; }
.it .item-icon { display: block; width: 100%; height: 100%; }
.it img { width: 100%; height: 100%; display: block; }
.it:hover { border-color: var(--accent); filter: brightness(1.2); }
.it:disabled { opacity: .35; cursor: not-allowed; }

@media (max-width: 900px) { .traits { display: none; } .picker { width: 250px; } .picker-body { min-width: 250px; } }

/* ---------- 战斗模拟 ---------- */
.sim-overlay { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; }
.sim-overlay[hidden] { display: none; }
.sim-box { width: 820px; max-width: 96vw; max-height: 94vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sim-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sim-head b { font-size: 15px; }
.sim-note { color: var(--dim); font-size: 11px; flex: 1; }
.sim-stat { padding: 12px; text-align: center; border-bottom: 1px solid var(--line); }
.sim-stat .big { font-size: 26px; font-weight: 800; display: block; }
.sim-stat .sub { color: var(--dim); font-size: 12px; }
.sim-replay { display: flex; justify-content: center; padding: 8px; overflow: auto; }
.sim-main { display: flex; min-height: 0; flex: 1; }
.sim-damage { width: 280px; flex: none; overflow-y: auto; border-left: 1px solid var(--line); padding: 8px; }
.sd-head, .sd-row { display: grid; grid-template-columns: 1fr 64px 58px; gap: 5px; align-items: center; }
.sd-head { color: var(--dim); font-size: 11px; padding: 0 3px 6px; }
.sd-side { font-weight: 700; padding: 7px 3px 4px; }
.sd-side.me { color: var(--me); } .sd-side.enemy { color: var(--enemy); }
.sd-row { min-height: 34px; font-size: 11px; }
.sd-unit { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sd-unit img { width: 26px; height: 26px; border-radius: 3px; object-fit: cover; }
.sd-unit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-num { position: relative; text-align: right; padding-bottom: 4px; }
.sd-num i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); }
.sd-taken { text-align: right; color: #e8a06c; }

/* 截图导入按钮 */
.vip-btn { color: #ffd34d; border-color: #806b2b; }
.import-box { width: 820px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.import-drop { padding: 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.import-drop input { max-width: 280px; }
#importStatus { color: var(--dim); font-size: 12px; }
.import-content { display: flex; gap: 12px; min-height: 0; overflow: hidden; padding: 12px; }
#importPreview { width: 300px; height: 280px; object-fit: contain; background: #111; border-radius: 6px; }
#importReview { flex: 1; overflow-y: auto; display: flex; gap: 12px; }
#importReview section { flex: 1; min-width: 0; }
#importReview h3 { margin: 0 0 8px; font-size: 13px; }
.import-unit { display: grid; grid-template-columns: 28px 1fr 52px 36px 62px; gap: 5px; align-items: center; padding: 4px; border-radius: 4px; }
.import-unit.uncertain { background: #4b3520; }
.import-unit img { width: 28px; height: 28px; border-radius: 3px; }
.import-unit select { min-width: 0; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 3px; }
.import-unit .conf { color: var(--dim); font-size: 11px; }
.import-unit .dmg { color: var(--dim); font-size: 11px; text-align: right; }
.import-actions { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-top: 1px solid var(--line); }
.import-sub { display: flex; align-items: center; gap: 3px; color: var(--dim); font-size: 11px; padding: 0 4px 4px 37px; }
.import-sub .sub-item { width: 17px; height: 17px; border-radius: 2px; }
.uncertain-text { color: #e6b800; }

/* 网页内屏幕捕获与框选 */
.capture-box { max-width: 94vw; max-height: 94vh; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.capture-title { color: var(--dim); margin-bottom: 8px; }
.capture-stage { position: relative; display: inline-block; max-width: 90vw; max-height: 80vh; line-height: 0; overflow: hidden; cursor: crosshair; }
#captureCanvas { max-width: 88vw; max-height: 78vh; width: auto; height: auto; }
.capture-selection { position: absolute; border: 2px solid #4ea1ff; background: rgba(78,161,255,.12); pointer-events: none; }
.capture-actions { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 10px; line-height: normal; z-index: 10; }
.capture-action { position: relative; z-index: 11; }
.capture-action { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff; font-size: 25px; cursor: pointer; box-shadow: 0 2px 8px #000; }
.capture-action.confirm { background: #1c9b62; color: #fff; }
.capture-action.cancel { background: #c74e4e; color: #fff; }
.sim-replay canvas { background: #1a1b1e; border-radius: 6px; max-width: 100%; }
.sim-ctrl { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.sim-ctrl input[type=range] { flex: 1; }

/* ---------- 阵容中心 / 战斗模拟子页面 ---------- */
:root { --gold: #f3bd52; --gold-hi: #ffd979; --gold-deep: #b77a24; --ink: #21180b; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 14px; }
.breadcrumb i { color: #626872; font-style: normal; }
.breadcrumb b { color: var(--gold); font-weight: 600; }
.patch-badge { padding: 4px 9px; border: 1px solid #56503e; border-radius: 4px; color: #d9c491; font-size: 12px; letter-spacing: .4px; }
.datainfo { max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.picker { width: 300px; }
.picker.comp-mode { width: clamp(320px, 27vw, 410px); }
/* 收起时必须真的收起：.picker.comp-mode 在上面后面又给了宽度，光靠 .picker.closed 会被压回去，
   所以这里用更高优先级把宽度归零，让棋盘把这列吃掉 */
.picker.comp-mode.closed, .picker.closed { width: 0; min-width: 0; border-right-width: 0; }
.picker.closed .picker-body { display: none; }
.picker-body { min-width: 0; width: 100%; }
.library-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.library-head h2 { margin: 0 0 2px; font-size: 18px; line-height: 1.25; }
.library-head > div > span { color: var(--dim); font-size: 12px; }
.picker-modes { display: flex; padding: 3px; background: #191a1e; border: 1px solid var(--line); border-radius: 7px; }
.picker-modes button { min-width: 48px; padding: 5px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--dim); cursor: pointer; }
.picker-modes button.on { background: #3b3e45; color: #fff; box-shadow: 0 1px 3px #0006; }
.picker-modes button:hover { color: #fff; }
.comp-browser, .unit-browser { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.comp-browser[hidden], .unit-browser[hidden] { display: none; }
.comp-tools { padding: 12px 12px 8px; border-bottom: 1px solid var(--line); }
.search-box { display: flex; align-items: center; gap: 7px; padding: 0 10px; background: #1b1d21; border: 1px solid #41454d; border-radius: 6px; }
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 2px #f3bd5218; }
.search-box > span { color: #b5bbc5; font-size: 22px; line-height: 1; }
.search-box input { flex: 1; min-width: 0; height: 38px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.code-import { display: flex; gap: 7px; margin-top: 8px; }
.code-import input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #1b1d21; color: var(--text); font-size: 12px; }
.code-import input:focus { outline: 2px solid #f3bd5240; border-color: var(--gold); }
.import-btn { border-color: #70603e; color: var(--gold-hi); background: #363024; }
.import-btn:hover:not(:disabled) { border-color: var(--gold); background: #463b26; }
.import-target { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--dim); font-size: 12px; }
.segmented { display: flex; gap: 2px; padding: 2px; background: #191a1e; border-radius: 5px; }
.segmented button { padding: 4px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--dim); cursor: pointer; }
.segmented button.on { background: #344b41; color: #9ee6c3; }
.segmented button:last-child.on { background: #513634; color: #ffaaa5; }
.comp-list-meta { display: flex; justify-content: space-between; margin-top: 10px; color: var(--dim); font-size: 12px; }
.comp-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px 18px; scrollbar-color: #4a4d55 transparent; scrollbar-width: thin; }
.comp-card {
  display: block; width: 100%; margin-bottom: 8px; padding: 10px; text-align: left; background: #24262b; border: 1px solid #35383f; border-radius: 8px; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease;
  content-visibility: auto; contain-intrinsic-size: auto 96px;   /* 屏幕外的阵容卡不参与布局/绘制 */
}
.comp-card:hover { background: #2b2d32; border-color: #8a7345; transform: translateY(-1px); }
.comp-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.comp-card-head { display: flex; align-items: center; gap: 8px; }
.tier-badge { display: grid; place-items: center; width: 28px; height: 30px; flex: none; border-radius: 5px; background: #a64c55; color: #fff; font-size: 17px; font-weight: 800; box-shadow: inset 0 0 0 1px #ffffff20; }
.tier-A { background: #8a68ad; } .tier-B { background: #477ea5; } .tier-C { background: #5f666e; }
.comp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f0f0f0; font-size: 14px; font-weight: 700; }
.comp-avg { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.comp-avg b { color: #8bd8b2; font-size: 17px; line-height: 1.1; }
.comp-avg small { color: var(--dim); font-size: 10px; }
.comp-unit-icons { display: flex; align-items: flex-start; gap: 4px; margin-top: 9px; }
.comp-unit-icon { position: relative; display: block; flex: 1 1 0; min-width: 0; max-width: 42px; }
.comp-unit-icon > img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border: 2px solid var(--cc); border-radius: 4px; background: #111; }
.comp-unit-icon > i { position: absolute; top: -5px; right: -2px; padding: 0 3px; border-radius: 4px; background: #151619; color: #ffd45e; font-size: 10px; font-style: normal; line-height: 14px; }
.comp-item-icons { display: flex; justify-content: center; gap: 1px; width: 100%; height: auto; margin-top: 2px; }
.comp-item-icons .item-icon { flex: 0 1 32%; width: 32%; max-width: 12px; min-width: 0; aspect-ratio: 1; }
.comp-item-icons img { width: 100%; height: 100%; border: 1px solid #111; border-radius: 2px; }
.comp-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; color: var(--dim); font-size: 11px; }
.comp-trait-icons { display: flex; min-width: 0; gap: 9px; }
.comp-trait-icons > span { display: flex; align-items: center; min-width: 0; gap: 3px; white-space: nowrap; }
.comp-trait-icons img { width: 14px; height: 14px; }
.comp-sample { flex: none; }
.comp-empty { padding: 36px 12px; text-align: center; white-space: pre-line; }

.sim-launch { position: relative; display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; min-height: 82px; padding: 8px 0 5px; }
.sim-launch-btn { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 244px; min-height: 54px; padding: 8px 18px; border: 1px solid var(--gold-hi); border-radius: 9px; background: linear-gradient(180deg, var(--gold-hi), var(--gold) 52%, #d99b35); color: var(--ink); box-shadow: 0 4px 0 #8d5c20, 0 7px 20px #0007, inset 0 1px 0 #fff7; cursor: pointer; text-shadow: 0 1px #fff3; transition: filter .16s ease, transform .16s ease, box-shadow .16s ease; }
.sim-launch-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 5px 0 #8d5c20, 0 9px 24px #0008, 0 0 20px #f3bd5220; }
.sim-launch-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8d5c20, 0 3px 10px #0007; }
.sim-launch-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.launch-icon { display: grid; place-items: center; width: 30px; height: 30px; padding-left: 2px; border: 2px solid #4b350f; border-radius: 50%; font-size: 14px; }
.launch-copy { display: flex; flex-direction: column; align-items: flex-start; }
.launch-copy b { font-size: 19px; line-height: 1.15; letter-spacing: 1px; }
.launch-copy small { margin-top: 2px; color: #5c451d; font-size: 11px; font-weight: 600; }
.launch-arrow { margin-left: 5px; font-size: 22px; font-weight: 800; }
.launch-summary { margin-top: 7px; color: #b5bac2; font-size: 11px; }

.tactical-panel { display: flex; flex-direction: column; flex: none; width: clamp(230px, 20vw, 300px); min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.current-comp { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 14px 12px 12px; }
.panel-eyebrow { color: #8f969f; font-size: 10px; font-weight: 700; letter-spacing: 1.6px; }
.current-comp-title { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; }
.current-comp-title h2 { flex: 1; min-width: 0; margin: 0; color: #f4f4f4; font-size: 17px; line-height: 1.35; }
.current-comp-title > span { flex: none; padding: 2px 6px; border: 1px solid #466654; border-radius: 4px; color: #8ed7b3; font-size: 11px; }
.current-comp-title > span.enemy { border-color: #744743; color: #f59b95; }
.summary-side-tabs { display: flex; gap: 4px; margin-top: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.summary-side-tabs button { flex: 1; padding: 6px 4px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--dim); cursor: pointer; }
.summary-side-tabs button.on { border-color: #456553; background: #263a30; color: #b5e8ce; }
.summary-side-tabs button:last-child.on { border-color: #714743; background: #412c2a; color: #ffb1ac; }
.current-comp-meta { padding: 9px 0; color: var(--dim); font-size: 12px; }
.current-comp-units { flex: 1; min-height: 70px; overflow-y: auto; scrollbar-color: #4a4d55 transparent; scrollbar-width: thin; }
.lineup-unit { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 5px 3px; border-bottom: 1px solid #32353a; }
.lineup-portrait { width: 38px; height: 38px; flex: none; object-fit: cover; border: 2px solid var(--cc); border-radius: 5px; }
.lineup-info { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.lineup-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.lineup-info small { color: var(--dim); font-size: 11px; }
.lineup-info i { color: #ffd45e; font-style: normal; }
.lineup-items { display: flex; flex: none; gap: 2px; }
.lineup-items .item-icon { width: 22px; height: 22px; }
.lineup-items img { width: 100%; height: 100%; border: 1px solid #111; border-radius: 3px; }
.lineup-items small { color: #737983; font-size: 11px; }
.lineup-empty { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 190px; padding: 20px 8px; text-align: center; color: var(--dim); }
.lineup-empty > span { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border: 1px dashed #5b6068; border-radius: 50%; color: var(--gold); font-size: 26px; }
.lineup-empty b { color: #c7cbd1; font-size: 14px; }
.lineup-empty small { margin-top: 5px; font-size: 12px; }
.copy-code-btn { flex: none; width: 100%; margin-top: 10px; padding: 8px; border-color: #555a63; }
.copy-code-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-hi); }
.traits-panel { flex: none; max-height: 32%; padding: 8px 12px 12px; overflow-y: auto; border-top: 1px solid var(--line); scrollbar-color: #4a4d55 transparent; scrollbar-width: thin; display: flex; flex-direction: column; }
/* 两组羁绊始终都在，只是谁在前跟着右侧"我方阵容 / 当前敌方"切换 */
.trait-group { display: flex; flex-direction: column; min-width: 0; }
.traits-panel[data-first="me"] .trait-group[data-side="me"] { order: -1; }
.traits-panel h3 { margin: 6px 0; color: var(--dim); font-size: 12px; font-weight: 400; }
.item-tip {
  position: fixed; z-index: 55; width: 320px; padding: 12px 14px;
  background: #202227; border: 1px solid #565b65; border-radius: 8px;
  box-shadow: 0 10px 30px #000c, inset 0 1px 0 #ffffff0d; pointer-events: none;
}
.item-tip[hidden] { display: none; }
.tip-top { display: flex; align-items: center; gap: 14px; }
.tip-top > b { flex: 1; min-width: 0; color: #f4f4f4; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip-formula { display: flex; align-items: center; flex: none; gap: 5px; }
.tip-part { display: flex; align-items: center; justify-content: center; width: 42px; }
.tip-part img { width: 36px; height: 36px; object-fit: cover; border: 1px solid #5b5f68; border-radius: 4px; background: #111; }
.tip-plus { margin: 0 2px; color: #fff; font-size: 20px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.tip-noformula { flex: none; color: #8f959e; font-size: 12px; }
.tip-note { margin-top: 7px; padding-top: 7px; border-top: 1px solid #343840; color: #8f959e; font-size: 11px; }
.tip-desc { max-height: 210px; margin-top: 10px; padding-top: 9px; overflow: hidden; border-top: 1px solid #363a42; color: #c8cdd5; font-size: 12px; line-height: 1.65; }
.trait-tip {
  position: fixed; z-index: 62; width: 400px; max-height: 76vh; overflow: hidden; padding: 14px 16px;
  background: #202227; border: 1px solid #565b65; border-radius: 9px;
  box-shadow: 0 12px 36px #000d, inset 0 1px 0 #ffffff0d; pointer-events: none;
}
.trait-tip[hidden] { display: none; }
.tt-head { display: flex; align-items: center; gap: 9px; padding-bottom: 9px; }
.tt-rank { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 5px; background: #343841; color: #e7c66c; font-size: 18px; font-weight: 800; }
.tt-head b { font-size: 19px; color: #f5f5f5; }
.tt-head small { margin-left: auto; color: #9299a3; font-size: 11px; }
.tt-desc { color: #ccd1d8; font-size: 12px; line-height: 1.65; }
.tt-tiers { margin-top: 10px; padding-top: 8px; border-top: 1px solid #373b43; }
.tt-tier { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; color: #b9bec6; font-size: 12px; line-height: 1.55; }
.tt-count { display: grid; place-items: center; flex: none; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 4px; background: #30343b; color: #cfd4db; font-weight: 700; }
.tt-tier.on .tt-count { background: #2c5542; color: #8ff0bb; box-shadow: inset 0 0 0 1px #4d8467; }
.tt-tier.ots3 .tt-count { color: #d9e2ec; } .tt-tier.ots4 .tt-count { color: #ffd463; } .tt-tier.ots5 .tt-count, .tt-tier.ots6 .tt-count { color: #e4b4ff; }
.tt-units-label { margin-top: 11px; padding-top: 9px; border-top: 1px solid #373b43; color: #9aa1ab; font-size: 11px; }
.tt-units { display: flex; flex-wrap: wrap; gap: 7px 6px; margin-top: 7px; }
.tt-unit { display: flex; align-items: center; flex-direction: column; width: 42px; gap: 2px; }
.tt-portrait { display: block; width: 36px; height: 36px; padding: 2px; border: 1px solid var(--cc); border-radius: 4px; background: #111; }
.tt-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.tt-unit small { width: 100%; overflow: hidden; color: #aab0b9; font-size: 9px; line-height: 1.2; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; max-width: min(560px, 90vw); padding: 11px 18px; transform: translateX(-50%); border: 1px solid #527561; border-radius: 8px; background: #263d31; color: #d8f4e5; box-shadow: 0 8px 30px #0009; font-size: 14px; }.toast.error { border-color: #8b514b; background: #482e2c; color: #ffd5d1; }
.toast[hidden] { display: none; }

@media (max-width: 1350px) {
  .breadcrumb { display: none; }
  .datainfo { max-width: 250px; }
  .picker.comp-mode { width: 320px; }
  .tactical-panel { width: 230px; }
  .stage { padding-left: 12px; padding-right: 12px; }
  .enemy-head .tabs { flex: 1; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .enemy-head .tabs::-webkit-scrollbar { display: none; }
  .enemy-head .tab { flex: none; padding-left: 7px; padding-right: 7px; }
  .comp-trait-icons > span:nth-child(3) { display: none; }
  .lineup-items .item-icon { width: 19px; height: 19px; }
}
@media (max-width: 1050px) {
  .patch-badge { display: none; }
  .picker.comp-mode { width: 300px; }
  .tactical-panel { width: 210px; }
  .library-head { padding-left: 10px; padding-right: 10px; }
  .library-head > div > span { display: none; }
  .comp-tools { padding-left: 8px; padding-right: 8px; }
  .comp-list { padding-left: 7px; padding-right: 7px; }
  .current-comp { padding-left: 8px; padding-right: 8px; }
  .lineup-info small { display: none; }
}
@media (max-width: 820px) {
  .tactical-panel { display: none; }
  .datainfo { display: none; }
}
/* 光明装备框：从用户提供的原图提取金属黑金外框，透明中心覆盖在普通图标上。 */
.item-icon { position: relative; display: inline-flex; flex: none; line-height: 0; vertical-align: middle; }
.item-icon > img { display: block; width: 100%; height: 100%; object-fit: cover; border: 1px solid #111; border-radius: 2px; background: #111; }
.item-icon.radiant { border-radius: 2px; }
.item-icon.radiant::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: url("img/radiant-frame.png") center / 100% 100% no-repeat;
}
@media (prefers-reduced-motion: reduce) {
  .comp-card, .sim-launch-btn, .picker { transition: none; }
  .comp-card:hover, .sim-launch-btn:hover { transform: none; }
}

/* 棋子面板（羁绊+装备生效后的真实数值） */
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; padding: 4px 10px 8px; }
.statgrid .st { display: flex; align-items: baseline; gap: 4px; font-size: 11px; }
.statgrid .st i { color: var(--dim); font-style: normal; }
.statgrid .st b { color: #fff; font-size: 13px; }
.trag { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 0 10px 8px; font-size: 11px; }
.trag .lbl { color: var(--dim); }
.trag .tg { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 1px 7px; }
.trag .tg b { color: var(--accent); }

/* 广告位与账号（内容站共用样式补充） */
.ad-slot { display: block; min-height: 90px; margin: 8px auto; }
.ad-slot[hidden] { display: none; }
.ad-label { color: #797d70; font-size: 10px; letter-spacing: .12em; text-align: center; line-height: 1.4; }
.sim-ad { width: min(970px, calc(100% - 32px)); min-height: 0; flex: none; }
#accountMount { flex: none; }

/* 语言切换栏（i18n.js 注入，纯本地样式，无第三方图标/字体） */
#langMount { flex: none; display: flex; align-items: center; margin-right: 10px; }
.lang-switch { position: relative; }
.lang-current {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  background: var(--panel2, #26282e); border: 1px solid var(--line, #343840); border-radius: 4px;
  color: #c6cbd3; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.lang-current:hover { border-color: var(--accent, #e9b949); color: #fff; }
.lang-drop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 128px; z-index: 60;
  background: #22242a; border: 1px solid #343840; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  padding: 4px; display: none; flex-direction: column;
}
.lang-switch.open .lang-drop { display: flex; }
.lang-item {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 4px;
  background: transparent; color: #c6cbd3; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.lang-item:hover { background: #2e3138; color: #fff; }
.lang-item.on { color: #ffd76b; font-weight: 700; }

.sim-side-ad { width: 100%; margin: 10px 0; }

/* 全局工具导航 */
.topbar.app-topbar {
  height: 62px; min-height: 62px; padding: 0 14px;
  background: rgba(27,29,33,.94); backdrop-filter: blur(14px);
  border-bottom: 1px solid #343840;
  box-shadow: 0 1px 0 rgba(255,255,255,.03), 0 8px 26px rgba(0,0,0,.28);
}
.app-topbar .brand {
  flex: 0 0 240px; min-width: 0; display: flex; align-items: center;
  color: var(--text); text-decoration: none; white-space: nowrap;
  font-size: 15px; font-weight: 700;
}
.app-topbar .brand .sub { color: #9aa0a9; font-weight: 400; margin-left: 4px; }
.app-topbar .app-nav { height: 62px; }
.app-nav { display: flex; align-items: stretch; height: 100%; gap: 0; }
.app-nav a { display: flex; align-items: center; padding: 0 17px; color: #9aa0a9; text-decoration: none; border-bottom: 2px solid transparent; font-size: 13.5px; font-weight: 600; }
.app-nav a:hover { color: var(--text); }
.app-nav a.on { color: #ffd76b; border-bottom-color: #e9b949; text-shadow: 0 0 18px rgba(233,185,73,.35); }
.app-topbar .btn.sm { min-height: 32px; padding: 0 11px; font-size: 12px; }
.new-round-btn { color: #b5e8ce; border-color: #456553; background: #263a30; }
.new-round-btn:hover { color: #e2fff0; border-color: #5f9173; background: #315040; }

/* ================= 战斗回放弹层（sim.js 专用，2026-12-03 重做） ================= */
.sim-overlay {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 50% 0%, rgba(18,26,38,.94), rgba(4,6,10,.96));
  backdrop-filter: blur(4px); padding: 14px;
}
.sim-overlay[hidden] { display: none; }

.sxv {
  width: min(1180px, 98vw); height: min(calc(100vh - 34px), 940px); max-height: calc(100vh - 34px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #171b22, #101419);
  border: 1px solid #2c333d; border-radius: 14px; overflow: hidden;
  box-shadow: 0 26px 70px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,255,255,.05);
}

.sxv-head {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px;
  border-bottom: 1px solid #262d36; background: linear-gradient(180deg, #1d232b, #161b21);
}
.sxv-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.sxv-title b { font-size: 15px; letter-spacing: .5px; color: #f3f6fb; }
.sxv-note { color: #7d8794; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sxv-stat { flex: 1; display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; min-width: 0; }
.sx-win { font-size: 27px; font-weight: 900; line-height: 1; letter-spacing: -.5px; }
.sx-win i { font-size: 15px; font-style: normal; margin-left: 1px; opacity: .85; }
.sx-winlab { color: #8d97a4; font-size: 11px; }
.sx-meta { color: #7d8794; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sxv-x {
  flex: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid #333b46;
  background: #1d232b; color: #c9d2de; font-size: 19px; line-height: 1; cursor: pointer;
}
.sxv-x:hover { background: #2a3240; color: #fff; border-color: #4a5666; }

.sxv-body { display: flex; min-height: 0; flex: 1; }
.sxv-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 10px 12px 6px; }
.sxv-badges { display: flex; align-items: center; gap: 10px; padding: 0 2px 6px; font-size: 11.5px; }
.sxv-badges .en { color: #ff8d85; }
.sxv-badges .me { color: #66dda4; }
.sxv-badges b { font-size: 13px; }
.sxv-badges .rt { margin-left: auto; color: #8d97a4; font-variant-numeric: tabular-nums; }
.sxv-canvas { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.sxv-canvas canvas {
  /* 尺寸由 sim.js 的 fitCanvas() 按容器等比算好（内联 px），这里只做兜底约束：
     绝不用 width:100% + 固定高度，否则容器比例一变画面就被拉伸 */
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  aspect-ratio: 720 / 690; object-fit: contain;
  border-radius: 12px; border: 1px solid #232a33;
  box-shadow: 0 12px 34px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.03);
  background: #070a10;
}
.sxv-legend { display: flex; align-items: center; gap: 12px; padding: 7px 4px 2px; font-size: 11px; color: #8d97a4; flex-wrap: wrap; }
.sxv-legend .lg { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.sxv-legend .lg.p { background: #ff7a4d; box-shadow: 0 0 8px #ff7a4d88; }
.sxv-legend .lg.m { background: #57b6ff; box-shadow: 0 0 8px #57b6ff88; }
.sxv-legend .lg.t { background: #f0e6c8; box-shadow: 0 0 8px #f0e6c888; }
.sxv-legend .lg.c { background: #ffd45c; box-shadow: 0 0 8px #ffd45c88; }
.sxv-legend .sep { width: 1px; height: 12px; background: #2b333d; }
.sxv-legend .tip { color: #6f7885; }

.sxv-panel { width: 302px; flex: none; border-left: 1px solid #262d36; display: flex; flex-direction: column; min-height: 0; background: #12161c; }
.sxv-panel-head {
  display: flex; justify-content: space-between; padding: 8px 12px; font-size: 11px; color: #7d8794;
  border-bottom: 1px solid #222932; letter-spacing: .5px;
}
.sxv-dmg { flex: 1; overflow-y: auto; padding: 6px 8px 10px; }
.sxd-side {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 4px 5px; font-size: 11px; letter-spacing: .5px;
}
.sxd-side.me { color: #6fdcab; } .sxd-side.enemy { color: #ff938b; }
.sxd-side b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sxd-holder { display: flex; flex-direction: column; }
.sxd-row { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 7px; }
.sxd-row:hover { background: #1a2028; }
.sxd-port { width: 26px; height: 26px; flex: none; border-radius: 50%; overflow: hidden; background: #1b222b; border: 1px solid #333c47; }
.sxd-port img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sxd-main { flex: 1; min-width: 0; }
.sxd-top { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; }
.sxd-top b { color: #dfe6ef; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sxd-top i { font-style: normal; color: #f0f4fa; font-variant-numeric: tabular-nums; font-weight: 700; }
.sxd-meter { display: flex; height: 5px; margin-top: 3px; border-radius: 3px; overflow: hidden; background: #1c232c; }
.sxd-meter i { display: block; height: 100%; }
.sxd-meter .p { background: linear-gradient(90deg, #ff8f66, #ff5f3d); }
.sxd-meter .m { background: linear-gradient(90deg, #6cc4ff, #2f8fe8); }
.sxd-meter .t { background: #e8dfc0; }
.sxd-meter .k { background: linear-gradient(90deg, #ffb3a6, #e0574c); }
.sxd-taken { width: 46px; flex: none; text-align: right; font-size: 10.5px; color: #7d8794; font-variant-numeric: tabular-nums; }

/* 榜单切换（造成伤害 / 承伤） */
.sxv-panel-head.sxd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; }
.sxd-tabs { display: flex; gap: 4px; flex: none; }
.sxd-tab {
  height: 24px; padding: 0 9px; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 700;
  border: 1px solid #2c333d; background: #171d25; color: #93a0b0; white-space: nowrap; flex: none;
}
.sxd-tab:hover { color: #e6edf6; border-color: #46525f; }
.sxd-tab.on { color: #1b1405; background: linear-gradient(180deg, #ffd873, #e9b949); border-color: #e9b949; }
.sxd-note { flex: 1; min-width: 0; text-align: right; font-size: 10px; color: #7b8695; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sxv-ctrl {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-top: 1px solid #262d36; background: linear-gradient(180deg, #171c23, #12161b);
}
.sxv-play {
  flex: none; min-width: 88px; height: 32px; border-radius: 8px; cursor: pointer;
  border: 1px solid #e0a93c; color: #2a1f08; font-weight: 800; font-size: 12.5px;
  background: linear-gradient(180deg, #ffd873, #eab63f);
  box-shadow: 0 2px 0 #8d5c20, 0 6px 16px rgba(0,0,0,.45);
}
.sxv-play:hover { filter: brightness(1.06); }
.sxv-ctrl input[type=range] { flex: 1; min-width: 80px; accent-color: #e9b949; }
.sxv-time { flex: none; color: #9aa4b2; font-size: 11.5px; font-variant-numeric: tabular-nums; min-width: 96px; text-align: right; }
.sxv-speeds { display: flex; gap: 3px; flex: none; }
.sxv-speeds button {
  width: 38px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 11.5px;
  border: 1px solid #333b46; background: #1b212a; color: #98a2af;
}
.sxv-speeds button:hover { color: #e9eef5; border-color: #4b5766; }
.sxv-speeds button.on { color: #1b1405; background: linear-gradient(180deg, #ffd873, #e9b949); border-color: #e9b949; font-weight: 800; }

/* 音频控件：静音键 + 音量条 */
.sxv-audio { display: flex; align-items: center; gap: 6px; flex: none; }
.sxv-mute {
  width: 30px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 13px; line-height: 1;
  border: 1px solid #333b46; background: #1b212a; color: #cfd8e3; padding: 0;
}
.sxv-mute:hover { border-color: #4b5766; }
.sxv-mute.off { opacity: .5; }
.sxv-audio input[type=range] {
  flex: none; width: 74px; min-width: 0; accent-color: #e9b949; height: 4px;
}

@media (max-width: 900px) {
  .sxv-body { flex-direction: column; }
  .sxv-panel { width: auto; border-left: none; border-top: 1px solid #262d36; max-height: 34vh; }
  .sxv-note { display: none; }
  .sxv-audio input[type=range] { width: 56px; }
}


/* ---------- 海克斯面板（棋盘左右两侧，敌方右上 / 我方左下） ---------- */
.board-wrap { position: relative; }
.aug-rail { position: absolute; width: 178px; max-height: 44%; overflow: auto; display: flex; flex-direction: column; gap: 5px; padding: 8px 9px; border: 1px solid #ffffff12; border-radius: 10px; background: linear-gradient(180deg, #14161bdd, #0e1014ee); box-shadow: 0 6px 18px #0006; font-size: 12px; z-index: 3; scrollbar-width: thin; }
.aug-rail.enemy { right: 4px; top: 10%; }
.aug-rail.me { left: 4px; bottom: 12%; }
.aug-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 5px; border-bottom: 1px solid #ffffff10; }
.aug-title { font-size: 10.5px; letter-spacing: .1em; color: #c8aa6e; text-transform: uppercase; }
.aug-count { font-size: 10px; color: #7f8794; }
.aug-list { display: flex; flex-direction: column; gap: 4px; }
.aug-row { position: relative; display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; background: #ffffff08; cursor: pointer; transition: background .14s ease; }
.aug-row:hover { background: #ffffff16; }
.aug-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.aug-row.silver .aug-dot, .aug-opt.silver .aug-dot { background: #a9b4c2; box-shadow: 0 0 6px #a9b4c2aa; }
.aug-row.gold .aug-dot, .aug-opt.gold .aug-dot { background: #f3bd52; box-shadow: 0 0 7px #f3bd52aa; }
.aug-row.prism .aug-dot, .aug-opt.prism .aug-dot { background: #b96bff; box-shadow: 0 0 8px #b96bffcc; }
.aug-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e6e8ec; }
.aug-tag { flex: none; font-size: 9px; padding: 1px 4px; border-radius: 3px; background: #f3bd5222; color: #f3bd52; }
.aug-del { flex: none; opacity: 0; width: 15px; height: 15px; border: 0; border-radius: 3px; background: #ffffff18; color: #c9ced6; cursor: pointer; line-height: 1; transition: opacity .14s ease; }
.aug-row:hover .aug-del { opacity: 1; }
.aug-add { padding: 6px; border: 1px dashed #ffffff26; border-radius: 6px; background: none; color: #7f8794; font-size: 11px; cursor: pointer; transition: border-color .14s ease, color .14s ease; }
.aug-add:hover { border-color: #c8aa6e88; color: #c8aa6e; }
.aug-picker-mask { position: fixed; inset: 0; background: #000000b0; display: flex; align-items: center; justify-content: center; z-index: 60; }
.aug-picker { width: min(580px, 92vw); max-height: 78vh; display: flex; flex-direction: column; gap: 9px; padding: 15px; border: 1px solid #ffffff1a; border-radius: 12px; background: #12141a; box-shadow: 0 20px 60px #000a; }
.aug-picker-head { display: flex; align-items: center; gap: 9px; }
.aug-picker-head b { font-size: 14px; color: #f3e3c3; }
.aug-picker-head span { font-size: 11px; color: #7f8794; flex: 1; }
.aug-picker-x { width: 22px; height: 22px; border: 0; border-radius: 5px; background: #ffffff14; color: #c9ced6; cursor: pointer; }
.aug-search { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #ffffff1a; border-radius: 7px; background: #ffffff08; }
.aug-search input { flex: 1; border: 0; background: none; color: #e6e8ec; outline: none; font-size: 12px; }
.aug-filter { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #7f8794; }
.aug-options { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.aug-opt { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #ffffff0f; border-radius: 7px; background: #ffffff06; color: #e6e8ec; text-align: left; cursor: pointer; }
.aug-opt:hover { background: #ffffff14; border-color: #f3bd5240; }
.ao-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ao-main b { font-size: 12px; font-weight: 600; }
.ao-main small { font-size: 10.5px; color: #7f8794; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ao-meta { flex: none; font-size: 10px; color: #7f8794; }
