* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #eef2f7; --card: #fff; --ink: #222; --sub: #888;
  --line: #e5e7eb; --pri: #534AB7;
}
html, body, #app { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg); overflow: hidden;
}
#app { position: relative; }
#town { position: absolute; inset: 0; }
#town canvas { display: block; }

#topbar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 12px;
  padding: 10px 14px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(6px);
  font-size: 13px; flex-wrap: wrap; z-index: 5;
}
.res { display: flex; align-items: center; gap: 5px; }
.res .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.res b { font-weight: 600; }

#panel {
  position: absolute; left: 0; right: 0; bottom: 56px; max-height: 64vh; overflow: auto;
  transform: translateY(110%); transition: transform .25s;
  background: var(--card); border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0, 0, 0, .12);
  z-index: 6; padding: 14px 16px 20px;
}
#panel.open { transform: translateY(0); }

#nav {
  position: absolute; bottom: 0; left: 0; right: 0; height: 56px; display: flex;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line); z-index: 7;
}
#nav button { flex: 1; border: 0; background: none; font-size: 12px; color: var(--sub); }
#nav button.active { color: var(--pri); font-weight: 600; }

.panel-inner h3 { font-size: 16px; margin-bottom: 8px; }
.panel-inner h4 { font-size: 14px; margin: 12px 0 6px; }
.hint { font-size: 12px; color: var(--sub); margin-bottom: 10px; line-height: 1.5; }
.warn { color: #D85A30; }

.card-row {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  background: var(--bg); border-radius: 10px; margin-bottom: 8px; font-size: 13px;
}
.card-row .sub { color: var(--sub); font-size: 12px; margin-left: auto; }
.card-row b { margin-left: auto; }

button.primary {
  background: var(--pri); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 14px; font-size: 14px; width: 100%; margin-top: 8px;
}
button.primary:disabled { opacity: .45; }
button.primary.sm { width: auto; padding: 7px 12px; font-size: 12px; margin: 0; }

.merc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.merc-grid.small { grid-template-columns: 1fr 1fr 1fr; }
.merc {
  border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px;
  padding: 10px; font-size: 12px; background: var(--bg);
}
.merc.pick { cursor: pointer; }
.merc.pick.on { outline: 2px solid var(--pri); background: #f3f1fe; }
.merc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.merc-head b { font-size: 13px; }
.cls { font-size: 11px; color: #fff; background: #888; padding: 1px 6px; border-radius: 6px; }
.rname { color: var(--sub); font-size: 11px; margin-left: auto; }
.merc-stats { color: var(--sub); margin-bottom: 6px; }

.bars .bar { display: flex; align-items: center; gap: 6px; margin: 3px 0; font-size: 11px; }
.bar .bl { width: 28px; color: var(--sub); }
.bar .bt { flex: 1; height: 6px; background: #e0e0e0; border-radius: 4px; overflow: hidden; }
.bar .bt i { display: block; height: 100%; }
.bar .bv { width: 22px; text-align: right; }

.eqchips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.eqchip { font-size: 10px; color: var(--sub); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.merc-act { display: flex; gap: 6px; margin-top: 4px; }

.eq-list .eq {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-left-width: 4px; border-radius: 10px; padding: 8px; margin-bottom: 8px; font-size: 12px;
}
.eq .rname { color: var(--sub); }
.eq-act select { font-size: 12px; padding: 5px; border-radius: 8px; border: 1px solid var(--line); }

.hint.tiny { font-size: 11px; line-height: 1.45; }
.bossflag { color: #D85A30; font-weight: 700; font-size: 12px; }

/* ---------- 回合制战斗演出 ---------- */
.battle-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(14, 18, 30, .72); backdrop-filter: blur(4px); animation: bfade .22s ease;
  padding: 16px;
}
@keyframes bfade { from { opacity: 0 } to { opacity: 1 } }
.battle-box {
  width: 100%; max-width: 460px; max-height: 92vh; overflow: auto;
  background: linear-gradient(160deg, #262c40 0%, #1b2030 100%);
  border-radius: 16px; padding: 14px; color: #eaeef7;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .09);
}
.battle-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 600; padding-bottom: 10px; margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.battle-turn { font-size: 12px; color: #a8b2c8; font-weight: 400; }

/* ---- 横版战场 ---- */
.arena {
  display: flex; align-items: center; gap: 4px; padding: 14px 0 12px; min-height: 168px;
  position: relative; transition: transform .16s ease, filter .16s ease;
}
.arena::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .12), transparent);
}
.team { flex: 1; display: flex; flex-wrap: wrap; align-content: center; gap: 10px 6px; }
.team.ally { justify-content: flex-end; }
.team.foe { justify-content: flex-start; }
.vsbar { width: 30px; flex: none; text-align: center; font-size: 10px; color: #6f7a94; letter-spacing: 1px; }

/* ---- 小人 ---- */
.fg { width: 44px; position: relative; }
.fg.boss { width: 62px; }
.fg-av {
  position: relative; height: 42px; display: flex; align-items: flex-end; justify-content: center;
}
.fg.boss .fg-av { height: 54px; }
.fg-av::after {
  content: ''; position: absolute; bottom: -3px; width: 24px; height: 5px;
  border-radius: 50%; background: rgba(0, 0, 0, .38);
}
.fg-head {
  position: absolute; top: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--c); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2);
}
.fg-body {
  width: 19px; height: 21px; border-radius: 7px 7px 5px 5px;
  background: var(--c); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2);
}
.fg-arm {
  position: absolute; bottom: 10px; width: 12px; height: 4px; border-radius: 2px;
  background: var(--c); filter: brightness(1.45);
}
.fg.ally .fg-arm { right: 2px; }
.fg.foe .fg-arm { left: 2px; }
.fg.foe .fg-head { border-radius: 4px; transform: rotate(45deg); }
.fg.boss .fg-head { width: 21px; height: 21px; top: 0; }
.fg.boss .fg-body { width: 27px; height: 29px; }

.fg-hp {
  position: relative; height: 5px; border-radius: 3px; margin-top: 5px;
  background: rgba(0, 0, 0, .5); overflow: hidden;
}
.fg-hp i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.fg-hp .gh { width: 100%; background: #f6e6ad; transition: width .42s ease; }
.fg-hp .fl { width: 100%; transition: width .07s linear; }
.fg.ally .fg-hp .fl { background: linear-gradient(#3ddb9b, #1D9E75); }
.fg.foe .fg-hp .fl { background: linear-gradient(#ff8f5f, #D85A30); }
.fg.healpop .fg-hp .fl { animation: hpop .34s ease; }
@keyframes hpop { 50% { filter: brightness(1.75) } }

.fg-name {
  font-size: 9px; color: #a4aec4; text-align: center; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fg.boss .fg-name { color: #ffbb8a; font-weight: 600; }

/* ---- 打击动作 ---- */
.fg.lunge.ally .fg-av { animation: lungeR .3s cubic-bezier(.3, 1.5, .5, 1); }
.fg.lunge.foe .fg-av { animation: lungeL .3s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes lungeR {
  0% { transform: translateX(0) } 32% { transform: translateX(13px) skewX(-7deg) } 100% { transform: translateX(0) }
}
@keyframes lungeL {
  0% { transform: translateX(0) } 32% { transform: translateX(-13px) skewX(7deg) } 100% { transform: translateX(0) }
}
.fg.cast .fg-av { animation: castp .38s ease; }
@keyframes castp { 0% { transform: translateY(0) } 42% { transform: translateY(-8px) } 100% { transform: translateY(0) } }
.fg.hurt.ally .fg-av { animation: hurtL .34s ease; }
.fg.hurt.foe .fg-av { animation: hurtR .34s ease; }
@keyframes hurtL {
  0% { transform: translateX(0); filter: none }
  18% { transform: translateX(-8px) rotate(-10deg); filter: brightness(3.4) }
  100% { transform: translateX(0); filter: none }
}
@keyframes hurtR {
  0% { transform: translateX(0); filter: none }
  18% { transform: translateX(8px) rotate(10deg); filter: brightness(3.4) }
  100% { transform: translateX(0); filter: none }
}
.fg.dead .fg-av { animation: fdie .5s ease forwards; }
@keyframes fdie { to { transform: translateY(12px) rotate(72deg); opacity: .2; filter: grayscale(1) } }
.fg.dead .fg-name, .fg.dead .fg-hp { opacity: .28; }

/* ---- 顿帧 / 慢镜头 / 屏幕震动 ---- */
.battle-overlay.freeze .arena {
  transition: none; transform: scale(1.02); filter: contrast(1.35) saturate(1.4) brightness(1.18);
}
.battle-overlay.slowmo { background: rgba(8, 10, 18, .9); }
.battle-overlay.slowmo .arena {
  transform: scale(1.05); filter: saturate(1.3) contrast(1.12);
  transition: transform .55s ease, filter .55s ease;
}
.battle-box.sk-s { animation: sks .18s ease; }
.battle-box.sk-m { animation: skm .26s ease; }
.battle-box.sk-l { animation: skl .44s ease; }
@keyframes sks {
  0%, 100% { transform: translate(0, 0) } 35% { transform: translate(-2px, 1px) } 70% { transform: translate(2px, -1px) }
}
@keyframes skm {
  0%, 100% { transform: translate(0, 0) rotate(0) }
  20% { transform: translate(-5px, 2px) rotate(-.35deg) }
  50% { transform: translate(4px, -2px) rotate(.35deg) }
  80% { transform: translate(-2px, 1px) rotate(0) }
}
@keyframes skl {
  0%, 100% { transform: translate(0, 0) rotate(0) }
  12% { transform: translate(-9px, 4px) rotate(-.7deg) }
  30% { transform: translate(8px, -4px) rotate(.7deg) }
  52% { transform: translate(-6px, 3px) rotate(-.45deg) }
  74% { transform: translate(4px, -2px) rotate(.25deg) }
}

.fly {
  position: absolute; left: 50%; top: -6px; font-weight: 800; font-size: 14px;
  pointer-events: none; animation: bfly .9s ease-out forwards;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .75); white-space: nowrap;
}
.fly.dmg { color: #ffb08f }
.fly.crit { color: #ffd34d; font-size: 19px; text-shadow: 0 0 10px rgba(255, 200, 60, .7), 0 1px 4px rgba(0, 0, 0, .8) }
.fly.heal { color: #6fe3a8 }
@keyframes bfly {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(.7) }
  22% { opacity: 1; transform: translate(-50%, -6px) scale(1.18) }
  100% { opacity: 0; transform: translate(-50%, -32px) scale(1) }
}

.battle-log {
  height: 74px; overflow: auto; background: rgba(0, 0, 0, .26); border-radius: 9px;
  padding: 7px 9px; font-size: 11px; line-height: 1.65; color: #9aa5bd; margin-top: 4px;
}
.blog.ok { color: #7fd6a5 } .blog.bad { color: #ff9b8a }
.battle-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.battle-foot button { background: rgba(255, 255, 255, .14); }
.ghostbtn {
  background: rgba(255, 255, 255, .1); color: #cfd6e6; border: 0; border-radius: 8px;
  padding: 7px 12px; font-size: 12px; min-width: 46px;
}

/* ---- 结算 ---- */
.battle-result { text-align: center; padding: 14px 4px 6px; }
.battle-result h2 { font-size: 22px; margin-bottom: 6px; }
.battle-result.win h2 { color: #6fe3a8 } .battle-result.lose h2 { color: #ff9b8a }
.battle-result .sub { font-size: 12px; color: #93a0ba; margin-bottom: 12px; }
.skipped-tip {
  display: inline-block; font-size: 11px; color: #e0c98a; margin-bottom: 10px;
  background: rgba(255, 207, 77, .12); border-radius: 20px; padding: 4px 12px;
}
.sec-t {
  font-size: 11px; color: #8794ad; text-align: left; margin: 12px 0 6px; letter-spacing: 1px;
}

.mvp {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: linear-gradient(100deg, rgba(255, 207, 77, .16), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 207, 77, .3); border-radius: 12px; padding: 10px 12px;
}
.mvp-av {
  position: relative; width: 34px; height: 40px; flex: none;
  display: flex; align-items: flex-end; justify-content: center;
}
.mvp-av .fg-head {
  position: absolute; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--c);
}
.mvp-av .fg-body {
  width: 21px; height: 23px; border-radius: 8px 8px 5px 5px; background: var(--c);
}
.mvp-info { flex: 1; min-width: 0; }
.mvp-line { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.mvp-line b { font-size: 14px; }
.mvp-badge {
  font-size: 10px; font-weight: 800; color: #3b2c00; background: #ffcf4d;
  padding: 1px 6px; border-radius: 5px; letter-spacing: .5px;
}
.mvp-tag { font-size: 10px; color: #ffcf4d; border: 1px solid rgba(255, 207, 77, .5); padding: 0 5px; border-radius: 5px; }
.mvp-stat { font-size: 11px; color: #9aa5bd; }
.mvp-stat b { color: #dfe6f3; }

.share-bar {
  display: flex; height: 10px; border-radius: 5px; overflow: hidden;
  background: rgba(0, 0, 0, .35);
}
.share-bar i { display: block; height: 100%; }
.share-lg {
  display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px;
  font-size: 10px; color: #93a0ba; text-align: left;
}
.share-lg span { display: flex; align-items: center; gap: 4px; }
.share-lg i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

.crit-note {
  margin-top: 8px; font-size: 11px; color: #d9c48a; text-align: left;
  background: rgba(255, 207, 77, .09); border-radius: 8px; padding: 7px 9px; line-height: 1.5;
}
.crit-note b { color: #ffcf4d; }

.diag { text-align: left; }
.dg {
  font-size: 12px; line-height: 1.6; padding: 8px 10px; margin-bottom: 6px;
  border-radius: 8px; border-left: 3px solid; background: rgba(255, 255, 255, .06); color: #c3ccdd;
}
.dg b { color: #ffd76a; }
.dg.danger { border-color: #ff6b52; background: rgba(255, 107, 82, .1); }
.dg.warn { border-color: #efab27; }
.dg.ok { border-color: #4ecb8f; }
.dg.info { border-color: #6f8cc7; }

.rw-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rw {
  display: flex; justify-content: space-between; background: rgba(255, 255, 255, .08);
  border-radius: 8px; padding: 8px 10px; font-size: 12px;
}
.rw b { color: #ffcf4d; }

.auto-row {
  display: flex; align-items: flex-start; gap: 7px; text-align: left;
  font-size: 11px; color: #9aa5bd; margin: 14px 0 2px; line-height: 1.45;
}
.auto-row input { margin-top: 1px; flex: none; accent-color: #7d74e8; }
.auto-row i { color: #6c7893; font-style: normal; }

/* ==================== 远征 ==================== */
#nav button { position: relative; }
#nav button .badge {
  position: absolute; top: 6px; left: 50%; margin-left: 10px; min-width: 15px; height: 15px;
  border-radius: 8px; background: #D85A30; color: #fff; font-size: 10px; font-style: normal;
  line-height: 15px; padding: 0 4px; font-weight: 600;
}

.sec-label {
  font-size: 12px; color: var(--sub); margin: 14px 0 7px; padding-bottom: 5px;
  border-bottom: 1px solid var(--line); letter-spacing: .5px;
}
.dim { color: var(--sub); font-weight: 400; }
.ghostbtn.xs {
  background: var(--bg); color: var(--sub); border: 1px solid var(--line);
  padding: 4px 10px; font-size: 11px; min-width: 0; border-radius: 7px;
}

/* ---- 路线 / 时长选择 ---- */
.chip-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; }
.chip {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg); border: 1.5px solid transparent; border-radius: 10px;
  padding: 7px 12px; font-size: 12px; color: var(--ink); line-height: 1.2; white-space: nowrap;
}
.chip i { font-style: normal; font-size: 10px; color: var(--sub); }
.chip.on { border-color: var(--pri); background: #efedfb; color: var(--pri); font-weight: 600; }
.chip.on i { color: #7a72cf; }
.chip.locked { opacity: .45; }

/* ---- 进行中 ---- */
.exp-run {
  background: var(--bg); border-radius: 11px; padding: 10px 12px; margin-bottom: 8px; position: relative;
}
.exp-run-top { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 7px; }
.exp-remain { margin-left: auto; font-size: 12px; color: var(--pri); font-weight: 600; }
.exp-prog { height: 4px; border-radius: 3px; background: #dfe4ec; overflow: hidden; margin-bottom: 7px; }
.exp-prog i { display: block; height: 100%; background: var(--pri); transition: width .9s linear; }
.exp-run-sub { font-size: 11px; color: #6b7280; line-height: 1.5; }
.exp-run-sub.dim { color: var(--sub); }
.exp-run [data-recall] { position: absolute; right: 10px; bottom: 10px; }
.exp-slot-empty {
  border: 1.5px dashed var(--line); border-radius: 11px; padding: 12px;
  text-align: center; font-size: 12px; color: #b6bcc7; margin-bottom: 8px;
}

.tier-chip {
  font-size: 10px; border: 1px solid; border-radius: 6px; padding: 1px 6px; font-weight: 600;
}
.tier-chip.lg { font-size: 12px; padding: 2px 9px; }

/* ---- 出发前预判 ---- */
.exp-predict {
  background: var(--bg); border-radius: 12px; padding: 12px; margin: 10px 0 12px;
}
.exp-pd-head { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 10px; }
.exp-pd-head > span:first-child { color: var(--sub); }
.exp-pd-head .dim { margin-left: auto; font-size: 11px; }
.exp-pw-bar {
  position: relative; height: 7px; border-radius: 4px; background: #dfe4ec;
  overflow: visible; margin-bottom: 6px;
}
.exp-pw-bar i { display: block; height: 100%; border-radius: 4px; transition: width .2s; }
/* 62.5% 标记的是「稳过」门槛，右侧到头才是完美 */
.exp-pw-bar u {
  position: absolute; top: -3px; width: 2px; height: 13px; background: #8b93a3; border-radius: 1px;
}
.exp-pw-txt { font-size: 11px; color: #6b7280; margin-bottom: 9px; }
.exp-bonds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.bond-chip { font-size: 11px; line-height: 1; padding: 4px 8px; border-radius: 20px;
  background: rgba(29,158,117,0.12); color: #1D9E75; border: 1px solid rgba(29,158,117,0.4); }
.bond-chip i { font-style: normal; font-weight: 700; margin-left: 4px; opacity: 0.85; }
.exp-pw-txt b { color: var(--ink); }

.exp-rw { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; margin-bottom: 9px; }
.exp-rw span { display: flex; align-items: center; gap: 4px; }
.exp-rw .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.exp-rw.dim { color: var(--sub); }

.exp-goal {
  font-size: 12px; color: #4b5563; background: #fff; border-radius: 8px;
  padding: 7px 10px; line-height: 1.5; margin-bottom: 8px;
}
.exp-goal b { color: var(--pri); }
.exp-goal.sm { font-size: 11px; padding: 6px 9px; margin-bottom: 6px; }

.exp-tips { display: flex; flex-direction: column; gap: 6px; }
.tip {
  font-size: 11px; line-height: 1.55; color: #4b5563; background: #fff;
  border-left: 3px solid #cbd2dd; border-radius: 0 7px 7px 0; padding: 6px 9px;
}
.tip.act { border-left-color: #1D9E75; }
.tip.warn { border-left-color: #D85A30; background: #fdf1ed; }
.tip.info { border-left-color: #8b93a3; }
.tip b { color: var(--ink); }
.tip .gain {
  display: inline-block; color: #1D9E75; background: #e1f5ee;
  border-radius: 5px; padding: 0 5px; margin-right: 6px; font-size: 11px;
}
.tip.sm { font-size: 11px; padding: 5px 8px; }

/* ---- 归来战报 ---- */
.exp-reports {
  background: #f6f4ec; border: 1px solid #e8e2cf; border-radius: 12px;
  padding: 10px 11px; margin-bottom: 12px;
}
.exp-rep-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; margin-bottom: 9px; color: #7a6a3c;
}
.exp-report {
  background: #fff; border-radius: 10px; padding: 10px; margin-bottom: 7px;
}
.exp-report:last-child { margin-bottom: 0; }
.exp-rp-top { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 4px; }
.exp-rp-top .dim { margin-left: auto; font-size: 11px; }
.exp-rp-sub { font-size: 11px; color: var(--sub); margin-bottom: 7px; line-height: 1.5; }
.exp-lv { font-size: 11px; color: #1D9E75; margin-bottom: 7px; }
.exp-lv b { font-weight: 600; }

/* ---------- 章节里程碑 ---------- */
.chap-strip { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #2b3a55, #1f2940); border: 1px solid #3a4a66; border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px; }
.chap-ico { font-size: 22px; }
.chap-mid { flex: 1; min-width: 0; }
.chap-name { font-weight: 600; font-size: 13px; color: #e8eefc; }
.chap-name .chap-ok { font-style: normal; font-size: 10px; color: #1D9E75; background: #1D9E7522; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.chap-prog { height: 6px; background: #0d1424; border-radius: 4px; overflow: hidden; margin: 5px 0 3px; }
.chap-prog i { display: block; height: 100%; background: linear-gradient(90deg, #EF9F27, #1D9E75); }
.chap-sub { font-size: 11px; color: #9aa6be; }
.chap-sub b { color: #EF9F27; }
.chap-next { font-size: 10px; color: #7f8aa3; text-align: right; line-height: 1.4; }
.chap-list { display: flex; flex-direction: column; gap: 10px; }
.chap-card { background: #1b2336; border: 1px solid #2c3a56; border-radius: 12px; padding: 12px 14px; }
.chap-card.active { border-color: #EF9F27; box-shadow: 0 0 0 1px #EF9F2755; }
.chap-card.done { background: #16241d; border-color: #1D9E7566; }
.chap-card.locked { opacity: .5; }
.chap-card-top { display: flex; align-items: center; gap: 10px; }
.chap-ico.lg { font-size: 26px; }
.chap-card-txt { flex: 1; }
.chap-card-name { font-weight: 600; font-size: 14px; color: #e8eefc; }
.chap-card-sub { font-size: 11px; color: #9aa6be; }
.chap-badge { font-style: normal; font-size: 11px; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.chap-badge.done { color: #1D9E75; background: #1D9E7522; }
.chap-badge.now { color: #EF9F27; background: #EF9F2722; }
.chap-badge.lock { color: #7f8aa3; background: #ffffff10; }
.chap-card-rw { margin-top: 10px; font-size: 12px; color: #c4cde0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chap-card-rw b { color: #9aa6be; font-weight: 600; }
.chap-rw-row { display: flex; gap: 12px; flex-wrap: wrap; }
.chap-rw-row span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- 集市（交易所） ---------- */
.mk-list { display: flex; flex-direction: column; gap: 10px; }
.mk-row { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 12px; }
.mk-row.special { border-color: #EF9F27; box-shadow: 0 0 0 1px rgba(239,159,39,.35) inset; }
.mk-info { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mk-info b { font-size: 14px; }
.mk-tag { background: #EF9F27; color: #1a1208; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.mk-prices { display: flex; gap: 14px; font-size: 12px; margin-bottom: 10px; }
.mk-sell { color: #1D9E75; }
.mk-buy { color: #D85A30; }
.mk-acts { display: flex; gap: 6px; flex-wrap: wrap; }

#toast {
  position: absolute; top: 56px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, .8); color: #fff; padding: 8px 16px; border-radius: 20px;
  font-size: 13px; opacity: 0; transition: .25s; z-index: 20; pointer-events: none; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 存档浮层 ---------- */
.hidden { display: none !important; }
.fab-save {
  position: fixed; top: 8px; right: 8px; z-index: 30;
  background: rgba(40,44,58,.92); color: #e7ecf3; border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px; padding: 6px 12px; font-size: 12px; cursor: pointer; backdrop-filter: blur(4px);
}
.fab-save:hover { background: rgba(60,66,84,.95); }
.fab-audio {
  position: fixed; top: 8px; right: 78px; z-index: 30;
  background: rgba(40,44,58,.92); color: #e7ecf3; border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px; padding: 6px 10px; font-size: 14px; line-height: 1; cursor: pointer; backdrop-filter: blur(4px);
}
.fab-audio:hover { background: rgba(60,66,84,.95); }
.modal-mask {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  width: min(440px, 100%); background: #1b1f2a; border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal h3 { margin: 0 0 6px; font-size: 17px; color: #f0f3f8; }
.modal .sec-label { margin: 14px 0 6px; }
.save-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.save-row.right { justify-content: flex-end; }
.save-text {
  width: 100%; height: 96px; resize: vertical; box-sizing: border-box;
  background: #0f1219; color: #c8d2e0; border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 8px; font-size: 11px; font-family: ui-monospace, monospace;
}
.filebtn {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); color: #cfd7e3; border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px; padding: 7px 12px; font-size: 12px; cursor: pointer;
}
.filebtn:hover { background: rgba(255,255,255,.12); }
.danger { background: #7a2520; color: #ffd9d2; border: 1px solid #b5483c; border-radius: 10px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.danger:hover { background: #93302a; }
