/* 拼拼肉鸽原型 · 星图碎镜风格 */
:root {
  --bg: #070a1d;
  --navy: #0f1633;
  --panel: rgba(17, 23, 54, 0.82);
  --panel2: rgba(26, 35, 80, 0.85);
  --glass: rgba(255, 255, 255, 0.04);
  --gold: #d9b86a;
  --gold2: #f5d78e;
  --gold-line: rgba(217, 184, 106, 0.38);
  --gold-soft: rgba(217, 184, 106, 0.16);
  --line: rgba(140, 155, 230, 0.22);
  --text: #ece9f8;
  --muted: #9aa1c4;
  --fire: #ff8a4c;
  --fire2: #ffb86b;
  --fire-bg: rgba(255, 138, 76, 0.13);
  --ice: #5cc8ff;
  --ice2: #a9e4ff;
  --ice-bg: rgba(92, 200, 255, 0.12);
  --neu: #b8bfdc;
  --neu-bg: rgba(143, 123, 255, 0.12);
  --violet: #8f7bff;
  --r1: #aab1c6;
  --r2: #7a9cff;
  --r3: #f5c95e;
  --hp: #e85a6a;
  --mp: #5cb4ff;
  --block: #a8c8de;
  --shield: #5fe0b4;
  --good: #6ee0a8;
  --bad: #ff7a7a;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(ellipse at 18% -8%, rgba(98, 76, 214, 0.38) 0%, transparent 48%),
    radial-gradient(ellipse at 100% 105%, rgba(160, 60, 160, 0.26) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 50%, rgba(30, 60, 140, 0.25) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
#app { position: relative; z-index: 1; min-height: 100vh; }
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#sky svg { position: absolute; inset: 0; }
#sky .tw { animation: twinkle 3.6s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: 0.1; } }
.shard { position: absolute; opacity: 0.16; clip-path: polygon(50% 0, 100% 38%, 72% 100%, 8% 82%, 0 28%); animation: drift linear infinite; }
@keyframes drift { 0% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-40px) rotate(160deg); } 100% { transform: translateY(0) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .shard, #sky .tw { animation: none; } }

h1, h2, h3 { margin: 0.4em 0; font-weight: 600; }
h2 { font-family: var(--serif); font-size: 24px; letter-spacing: 2px; color: #fff3d6; }
h3 { font-size: 15px; color: #d8dcf6; margin-top: 18px; }
small { font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.gold { color: var(--gold2); }
.cc { color: var(--cc, var(--gold2)); }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.row-l { display: flex; gap: 8px; flex-wrap: wrap; }
kbd { font: 11px monospace; border: 1px solid var(--gold-line); border-radius: 4px; padding: 0 4px; opacity: 0.85; }
svg { display: block; }
h2 svg, h3 svg, p svg, .option svg, .cdelta svg { display: inline-block; vertical-align: -0.12em; }
.stat svg, .btn svg, .chip svg, .intent svg, .card-mp svg, .pile svg, .power svg, .state svg, .mp svg, .ficon svg, .step svg, .big svg, .pn-icon svg, .ch-info svg, .bias-note svg, .ic svg { display: inline-block; vertical-align: -0.15em; }

/* ---------- 按钮 ---------- */
.btn {
  font: inherit; color: var(--text); background: linear-gradient(180deg, rgba(40, 50, 104, 0.9), rgba(24, 31, 70, 0.9));
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s; display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover:not(:disabled) { border-color: var(--gold-line); box-shadow: 0 0 12px rgba(217, 184, 106, 0.18); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #4a3ba8, #2c236e); border-color: var(--gold); color: #fff3d6; }
.btn.primary:hover:not(:disabled) { box-shadow: 0 0 16px rgba(245, 215, 142, 0.35); }
.btn.ghost { background: rgba(10, 14, 36, 0.4); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.xs { padding: 0 7px; font-size: 12px; border-radius: 5px; }
.btn.lg { padding: 10px 26px; font-size: 16px; letter-spacing: 1px; }

/* ---------- 提示气泡 ---------- */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: 280px; white-space: normal; z-index: 60; pointer-events: none;
  background: rgba(6, 8, 22, 0.97); color: #eef0ff; border: 1px solid var(--gold-line); border-radius: 6px;
  padding: 7px 10px; font-size: 12px; font-weight: 400; line-height: 1.55; text-align: left; letter-spacing: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
[data-tip=""]:hover::after { display: none; }
.top [data-tip]:hover::after, .enemy-art[data-tip]:hover::after, .mage-art[data-tip]:hover::after { bottom: auto; top: calc(100% + 8px); }
.kw { color: #ffd98a; cursor: help; }

/* ---------- 顶栏 ---------- */
.top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 7px 14px;
  background: linear-gradient(180deg, rgba(8, 11, 30, 0.95), rgba(12, 16, 42, 0.88));
  border-bottom: 1px solid var(--gold-line); position: sticky; top: 0; z-index: 20;
}
.brand { font-family: var(--serif); font-size: 18px; letter-spacing: 3px; color: var(--gold2); }
.stat { font-weight: 700; display: flex; align-items: center; gap: 4px; font-size: 15px; }
.stat small { color: var(--muted); font-weight: 400; }
.stat.hp { color: #ffb0b8; }
.stat.gold { color: var(--gold2); }
.starbtn { border-color: var(--gold-line); }
.relics { display: flex; gap: 4px; flex-wrap: wrap; }
.relic { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(43, 36, 80, 0.8); border: 1px solid var(--gold-line); cursor: help; font-size: 11px; }
.relic svg { width: 24px; height: 24px; }
.progress { display: flex; align-items: center; }
.step { width: 26px; height: 26px; display: grid; place-items: center; font-size: 14px; border-radius: 50%; border: 1px solid var(--line); background: rgba(10, 14, 36, 0.6); }
.step.k-elite { border-color: #b98a3a; }
.step.k-boss { border-color: var(--bad); }
.step.done { opacity: 0.35; }
.step.cur { border-color: var(--gold2); box-shadow: 0 0 10px rgba(245, 215, 142, 0.6); background: rgba(60, 48, 130, 0.9); }
.sep { width: 8px; height: 1px; background: var(--gold-line); }
.spacer { flex: 1; }
.cmark { display: inline-grid; place-items: center; width: 17px; height: 17px; font-size: 10px; font-style: normal; font-weight: 700; border-radius: 50%; color: #0b0f24; background: var(--cc); margin-left: 3px; vertical-align: 1px; cursor: help; flex: none; }

/* ---------- 卡牌 ---------- */
.card {
  position: relative; width: 142px; min-height: 196px; flex: none; padding: 20px 7px 8px;
  background: linear-gradient(170deg, rgba(36, 46, 100, 0.97), rgba(16, 21, 52, 0.98));
  border: 1px solid var(--gold-line); border-radius: 10px;
  box-shadow: inset 0 0 0 3px rgba(10, 14, 36, 0.8), inset 0 0 0 4px rgba(217, 184, 106, 0.18), 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s; user-select: none;
}
.card.pure-fire { border-color: rgba(255, 138, 76, 0.75); }
.card.pure-ice { border-color: rgba(92, 200, 255, 0.75); }
.card.playable { cursor: pointer; }
.card.playable:hover { transform: translateY(-8px); border-color: var(--gold2); box-shadow: inset 0 0 0 3px rgba(10, 14, 36, 0.8), inset 0 0 0 4px rgba(245, 215, 142, 0.3), 0 12px 26px rgba(0, 0, 0, 0.5), 0 0 18px rgba(245, 215, 142, 0.18); z-index: 5; }
.card.unplayable { opacity: 0.5; cursor: not-allowed; filter: saturate(0.6); }
.card.selected { transform: translateY(-12px); border-color: var(--gold2); box-shadow: 0 0 0 2px var(--gold2), 0 0 24px rgba(245, 215, 142, 0.5); }
.card-cost {
  position: absolute; top: -10px; left: -10px; width: 30px; height: 30px; border-radius: 50%; z-index: 2;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff6dc;
  background: radial-gradient(circle at 35% 30%, #6a5ae0, #2a2170 70%); border: 2px solid var(--gold);
  box-shadow: 0 0 8px rgba(245, 215, 142, 0.4);
}
.card-cost.up { border-color: var(--bad); color: #ffd0d0; background: radial-gradient(circle at 35% 30%, #a04060, #4a1830 70%); }
.card-mp { position: absolute; top: 3px; right: 6px; font-size: 11px; color: var(--mp); font-weight: 700; display: flex; align-items: center; gap: 2px; }
.card-name { display: flex; flex-direction: column; align-items: center; font-family: var(--serif); font-weight: 700; font-size: 13px; line-height: 1.25; margin-bottom: 5px; color: #fff3d6; text-align: center; }
.card-art { height: 52px; margin: 0 0 5px; border-radius: 5px; overflow: hidden; border: 1px solid var(--gold-line); background: #0b1030; }
.card-art svg { width: 100%; height: 100%; }
.card-body { display: flex; flex-direction: column; gap: 4px; }
.frag { position: relative; font-size: 11.5px; line-height: 1.42; padding: 4px 6px; border-radius: 4px; border-left: 3px solid; }
.frag.el-fire { background: linear-gradient(90deg, rgba(255, 138, 76, 0.2), var(--fire-bg)); border-color: var(--fire); }
.frag.el-ice { background: linear-gradient(90deg, rgba(92, 200, 255, 0.2), var(--ice-bg)); border-color: var(--ice); }
.frag.el-neutral { background: linear-gradient(90deg, rgba(143, 123, 255, 0.2), var(--neu-bg)); border-color: var(--violet); }
.frag.spent { opacity: 0.3; text-decoration: line-through; }
.frag .cmark { width: 14px; height: 14px; font-size: 9px; }
.rtag { display: inline-block; font-size: 10px; font-weight: 800; padding: 0 4px; margin-right: 4px; border-radius: 3px; color: #0c1024; vertical-align: 1px; }
.rtag.r1 { background: var(--r1); }
.rtag.r2 { background: var(--r2); }
.rtag.r3 { background: linear-gradient(90deg, #f5c95e, #ffe9a8); }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.tag { font-size: 10px; padding: 0 5px; border-radius: 3px; background: rgba(80, 90, 160, 0.5); }
.tag.fire { background: rgba(255, 138, 76, 0.3); }
.tag.ice { background: rgba(92, 200, 255, 0.28); }
.tag.dual { background: color-mix(in srgb, var(--cc) 35%, transparent); }
.card.mini { width: 124px; min-height: 132px; padding-top: 16px; }
.card.mini .card-art { height: 24px; }
.card.mini .frag { font-size: 10.5px; padding: 3px 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.mini .card-name { font-size: 12px; }
.card.mini .card-tags { display: none; }
.hover-full { display: none; position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); z-index: 90; pointer-events: none; }
.card.mini:hover .hover-full { display: block; }
.card.zoom { width: 190px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--gold2); }
.card.zoom .card-art { height: 64px; }
.card.zoom .frag { font-size: 12px; }
.destiny .card.mini .frag, .card.mini.static .frag { display: block; }
.card.mini .hover-full .frag { display: block; -webkit-line-clamp: unset; font-size: 12px; padding: 4px 6px; }
.card.mini .hover-full .card-tags { display: flex; }
.card.mini .hover-full .card-name { font-size: 13px; }
.card.preview { width: 196px; min-height: 230px; }
.card.preview .card-art { height: 62px; }
.card.preview .frag { font-size: 12.5px; }
.ghost-card { display: grid; place-items: center; text-align: center; color: var(--muted); width: 196px; min-height: 200px; border-style: dashed; background: rgba(10, 14, 36, 0.4); }
.cards-grid { display: flex; flex-wrap: wrap; gap: 18px 14px; padding: 12px 8px; }

/* ---------- 战斗 ---------- */
.combat { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 8px 14px; padding: 10px 14px 14px; }
.field { grid-column: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.log { grid-column: 2; grid-row: 1 / span 5; background: rgba(8, 11, 30, 0.78); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: #c2c8e6; max-height: calc(100vh - 80px); overflow: auto; }
.log .lh { color: var(--gold); margin-top: 5px; }
.log .ld { color: #8f97bf; }
.log-title { font-family: var(--serif); font-weight: 700; color: var(--gold2); margin-bottom: 4px; position: sticky; top: -8px; background: rgba(8, 11, 30, 0.98); padding: 3px 0; }
.player, .enemy { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; backdrop-filter: blur(2px); }
.player { display: flex; gap: 10px; width: 330px; align-items: center; }
.player.s-fire { border-color: rgba(255, 138, 76, 0.55); box-shadow: 0 0 22px rgba(255, 138, 76, 0.16); }
.player.s-ice { border-color: rgba(92, 200, 255, 0.55); box-shadow: 0 0 22px rgba(92, 200, 255, 0.16); }
.mage-art { width: 96px; height: 112px; flex: none; }
.mage-art svg { width: 100%; height: 100%; }
.pinfo { flex: 1; min-width: 0; }
.pname { font-family: var(--serif); font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: center; margin-bottom: 2px; color: #fff3d6; }
.avatar { width: 52px; height: 52px; display: grid; place-items: center; font-weight: 700; font-size: 18px; margin: 0 auto;
  clip-path: polygon(50% 0, 100% 30%, 88% 100%, 12% 100%, 0 30%); background: #3b3474; color: #e9e4ff; }
.state { font-family: -apple-system, "PingFang SC", sans-serif; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: rgba(60, 66, 120, 0.7); font-weight: 500; display: inline-flex; align-items: center; gap: 3px; }
.state.s-fire { background: rgba(140, 50, 20, 0.85); color: #ffd2bd; }
.state.s-ice { background: rgba(20, 70, 110, 0.85); color: #cdeeff; }
.bar { position: relative; height: 15px; background: rgba(40, 20, 40, 0.8); border-radius: 8px; overflow: hidden; margin: 4px 0; border: 1px solid rgba(255, 255, 255, 0.06); }
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #a62b45, var(--hp)); transition: width 0.35s; }
.bar span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 14px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.mp { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #b9dcff; font-weight: 600; }
.pips { display: inline-flex; gap: 2px; }
.pips i { width: 8px; height: 11px; clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0 70%, 0 30%); background: #1d2a4c; }
.pips i.on { background: linear-gradient(180deg, #a9e4ff, var(--mp)); }
.pips.v i.on { background: linear-gradient(180deg, #ffe9a8, var(--r3)); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-height: 20px; }
.chip { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: rgba(60, 66, 120, 0.7); cursor: help; display: inline-flex; align-items: center; gap: 3px; }
.chip.block { background: rgba(50, 75, 95, 0.85); color: var(--block); }
.chip.shield { background: rgba(25, 80, 65, 0.85); color: var(--shield); }
.chip.st-炎爆, .chip.st-灼烧, .chip.st-火易伤 { background: rgba(110, 40, 20, 0.85); color: #ffcdb4; }
.chip.st-深寒, .chip.st-冰盾, .chip.st-极寒斩杀 { background: rgba(20, 60, 100, 0.85); color: #cbeaff; }
.chip.st-力量 { background: rgba(110, 30, 50, 0.85); color: #ffb9c8; }
.enemies { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: flex-end; flex: 1; }
.enemy { width: 160px; text-align: center; }
.enemy-art { width: 92px; height: 92px; margin: 0 auto; cursor: help; }
.enemy-art svg { width: 100%; height: 100%; }
.enemy.elite { border-color: rgba(217, 160, 70, 0.7); box-shadow: 0 0 18px rgba(217, 160, 70, 0.15); }
.enemy.boss { border-color: rgba(255, 110, 110, 0.7); width: 200px; box-shadow: 0 0 26px rgba(255, 80, 100, 0.2); }
.enemy.boss .enemy-art { width: 124px; height: 124px; }
.enemy.dead { opacity: 0.25; filter: grayscale(1); }
.enemy.targetable { cursor: crosshair; border-color: var(--gold2); box-shadow: 0 0 0 2px rgba(245, 215, 142, 0.55), 0 0 20px rgba(245, 215, 142, 0.25); }
.enemy.targetable:hover { background: rgba(70, 55, 30, 0.85); }
.ename { font-family: var(--serif); font-weight: 700; font-size: 13px; color: #fff3d6; }
.ename em { font-family: -apple-system, sans-serif; font-style: normal; font-size: 10px; padding: 0 4px; margin-left: 4px; border-radius: 3px; background: #7a5418; vertical-align: 1px; }
.ename em.b { background: #8a2030; }
.enemy .chips { justify-content: center; }
.intent { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 12px; margin-bottom: 4px; padding: 3px 6px; background: rgba(5, 7, 20, 0.85); border: 1px solid var(--line); border-radius: 14px; cursor: help; }
.intent b { color: #d9def7; font-weight: 600; }
.i-atk { color: #ff9a9a; font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.i-def { color: var(--block); font-weight: 800; display: inline-flex; align-items: center; gap: 2px; }
.i-buff { color: #e4bcff; font-weight: 800; display: inline-flex; align-items: center; gap: 2px; }
.dead-tag { color: var(--muted); }
.powers { grid-column: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 28px; }
.plabel { font-size: 12px; color: var(--muted); margin-right: 4px; cursor: help; }
.power { font-size: 12px; padding: 2px 10px; border-radius: 12px; background: rgba(42, 37, 82, 0.85); border: 1px solid #5a4aa8; cursor: help; display: inline-flex; align-items: center; gap: 4px; }
.power.const { border-color: var(--cc); color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, rgba(10, 14, 36, 0.9)); }
.power.aura { background: rgba(22, 58, 90, 0.85); border-color: var(--ice); }
.power.delay { background: rgba(61, 44, 24, 0.85); border-color: #b98a3a; }
.banner { grid-column: 1; text-align: center; padding: 6px; border-radius: 8px; background: rgba(70, 55, 20, 0.85); border: 1px solid var(--gold-line); color: #ffe6a8; font-size: 13px; }
.banner.enemy-turn { background: rgba(80, 20, 35, 0.85); border-color: rgba(255, 110, 110, 0.5); color: #ffc8d0; }
.tray { grid-column: 1; display: flex; flex-direction: column; gap: 8px; }
.zones { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; padding: 6px 10px 10px; background: rgba(8, 11, 30, 0.55); border: 1px solid var(--line); border-radius: 12px; }
.zone { display: flex; flex-direction: column; gap: 6px; }
.zlabel { font-size: 12px; font-weight: 700; color: var(--gold2); cursor: help; font-family: var(--serif); }
.zlabel small { font-family: -apple-system, sans-serif; font-weight: 400; color: #ffaaaa; margin-left: 4px; }
.zcards { display: flex; gap: 10px; padding-top: 8px; padding-left: 6px; }
.piles-r { display: flex; flex-direction: column; gap: 8px; margin-left: auto; }
.pile { width: 76px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; color: var(--muted); border: 1px dashed var(--gold-line); border-radius: 10px; cursor: pointer; background: rgba(10, 14, 36, 0.5); }
.pile b { font-size: 18px; color: var(--text); line-height: 1; }
.pile:hover { background: rgba(40, 46, 90, 0.7); }
.handrow { display: flex; gap: 14px; align-items: flex-end; }
.hand { flex: 1; display: flex; gap: 12px; flex-wrap: wrap; padding: 12px 0 0 10px; min-height: 200px; }
.empty { color: var(--muted); font-size: 12px; padding: 20px 10px; }
.endbox { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 6px; }
.cp { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 800; line-height: 1; color: #fff6dc;
  background: radial-gradient(circle at 38% 32%, #9a88ff, #3a2ea6 62%, #1d1660); border: 2px solid var(--gold); box-shadow: 0 0 18px rgba(143, 123, 255, 0.5); cursor: help; }
.cp small { font-size: 10px; display: block; margin-top: -16px; color: var(--gold2); }

/* 飘字与闪光 */
.floater { position: absolute; top: 28%; transform: translateX(-50%); font-weight: 900; font-size: 22px; pointer-events: none; z-index: 30;
  text-shadow: 0 2px 4px #000, 0 0 10px rgba(0, 0, 0, 0.6); animation: floatUp 1.25s ease-out both; white-space: nowrap; }
.f-dmg { color: #ff6b7a; }
.f-dmg.el-fire { color: #ffa060; }
.f-dmg.el-ice { color: #9edcff; }
.f-block { color: var(--block); font-size: 15px; }
.f-shield { color: var(--shield); font-size: 15px; }
.f-mp { color: var(--mp); font-size: 15px; }
.f-state { font-size: 15px; font-family: var(--serif); }
.f-state.s-fire { color: var(--fire); }
.f-state.s-ice { color: var(--ice); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -50px) scale(1); } }
.hit { animation: shake 0.32s; }
@keyframes shake { 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-2px); } }
.flash-fire { animation: flashFire 0.7s; }
.flash-ice { animation: flashIce 0.7s; }
@keyframes flashFire { 30% { box-shadow: 0 0 40px rgba(255, 138, 76, 0.8); } }
@keyframes flashIce { 30% { box-shadow: 0 0 40px rgba(92, 200, 255, 0.8); } }

/* ---------- 通用面板 ---------- */
.panel { position: relative; max-width: 1040px; margin: 20px auto; padding: 18px 24px; background: var(--panel); border: 1px solid var(--gold-line); border-radius: 14px; box-shadow: inset 0 0 0 4px rgba(10, 14, 36, 0.6), inset 0 0 0 5px var(--gold-soft), 0 10px 40px rgba(0, 0, 0, 0.4); }
.panel.center { text-align: center; }
.big { font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.relic-choices { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 10px 0 16px; }
.relic-card { width: 210px; padding: 12px; border-radius: 12px; background: rgba(34, 29, 69, 0.9); border: 1px solid var(--gold-line); text-align: center; }
.relic-art { width: 54px; height: 54px; margin: 0 auto 4px; }
.relic-art svg { width: 100%; height: 100%; }
.relic-card[data-act] { cursor: pointer; }
.relic-card[data-act]:hover { border-color: var(--gold2); box-shadow: 0 0 16px rgba(245, 215, 142, 0.25); }
.relic-card.sel { border-color: var(--gold2); box-shadow: 0 0 0 2px var(--gold2); }
.relic-card.disabled { opacity: 0.4; }
.relic-card p { margin: 6px 0; font-size: 13px; color: #cfd4f0; }
.price { font-size: 12px; color: var(--muted); margin-top: 6px; }
.pn-icon { font-size: 34px; line-height: 1; }
.pn-icon.big { font-size: 48px; display: flex; justify-content: center; }

/* ---------- 开场 / 命途 / 章节 ---------- */
.intro { max-width: 860px; margin: 30px auto; padding: 0 20px; text-align: center; }
.intro-emblem { width: 180px; height: 120px; margin: 0 auto; opacity: 0.9; }
.intro-emblem svg { width: 100%; height: 100%; }
.title { font-family: var(--serif); font-size: 54px; letter-spacing: 10px; margin: 0.1em 0; color: #fff3d6;
  text-shadow: 0 0 24px rgba(245, 215, 142, 0.45), 0 2px 0 rgba(0, 0, 0, 0.4); }
.subtitle { color: var(--gold); letter-spacing: 4px; font-size: 14px; }
.intro-lines { margin: 22px auto; max-width: 620px; }
.intro-lines p, .ending p, .end-const { opacity: 0; animation: fadeUp 1.2s ease forwards; font-family: var(--serif); font-size: 16px; color: #dfe2f8; margin: 8px 0; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; }
.intro-card { padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--gold-line); text-align: left; }
.intro-card .ic { font-size: 22px; float: right; }
.intro-card b { font-family: var(--serif); font-size: 16px; color: #fff3d6; }
.intro-card p { margin: 6px 0 0; font-size: 13px; color: #c8cdea; }
.start-row { display: flex; gap: 10px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.start-row input { font: inherit; color: var(--text); background: rgba(10, 14, 36, 0.8); border: 1px solid var(--gold-line); border-radius: 8px; padding: 9px 12px; width: 180px; }
.destiny { max-width: 1080px; margin: 18px auto; padding: 0 16px; text-align: center; }
.destiny-grid { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.destiny-card { width: 320px; padding: 14px 16px 16px; border-radius: 14px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 12%, rgba(16, 22, 52, 0.95)), rgba(12, 16, 40, 0.95));
  border: 1px solid color-mix(in srgb, var(--cc) 55%, transparent); transition: transform 0.15s, box-shadow 0.15s; }
.destiny-card:hover { transform: translateY(-4px); box-shadow: 0 0 28px color-mix(in srgb, var(--cc) 35%, transparent); }
.dc-art { height: 96px; }
.dc-art svg { width: 100%; height: 100%; }
.dc-name { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; }
.dc-name b { font-family: var(--serif); font-size: 22px; color: var(--cc); letter-spacing: 2px; }
.dc-name span { color: var(--muted); }
.dc-lore { font-family: var(--serif); font-size: 13px; color: #cfd3ee; margin: 4px 0 8px; }
.dc-goal { font-size: 13px; margin: 6px 0; }
.dc-goal b, .tier b { display: inline-block; font-size: 11px; padding: 0 5px; border-radius: 3px; margin-right: 6px; background: color-mix(in srgb, var(--cc, var(--gold)) 30%, transparent); color: var(--cc, var(--gold2)); }
.tier { font-size: 12.5px; margin: 4px 0; color: #c9cde8; }
.tier.on { color: #fff3d6; }
.tier.on b { background: var(--cc, var(--gold)); color: #0b0f24; }
.dc-starter { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 12px 0; font-size: 12px; }
.destiny-card .btn { width: 100%; justify-content: center; }
.chapter { max-width: 720px; margin: 70px auto; padding: 0 20px; text-align: center; }
.ch-no { color: var(--gold); letter-spacing: 8px; font-family: var(--serif); font-size: 16px; }
.ch-text { font-family: var(--serif); font-size: 17px; line-height: 2; color: #dfe2f8; margin: 20px auto 26px; max-width: 560px; }
.ch-info { display: flex; flex-direction: column; gap: 8px; align-items: center; font-size: 13px; color: #c9cde8; margin-bottom: 26px; }
.chapter .title, .chapter .ch-no, .chapter .ch-text, .chapter .ch-info, .chapter .btn { opacity: 0; animation: fadeUp 1.1s ease forwards; }
.chapter .title { animation-delay: 0.4s; }
.chapter .ch-text { animation-delay: 1.1s; }
.chapter .ch-info { animation-delay: 1.8s; }
.chapter .btn { animation-delay: 2.3s; }

/* ---------- 拼卡台 ---------- */
.craft { padding: 12px 16px 24px; max-width: 1240px; margin: 0 auto; }
.craft-head { display: flex; align-items: baseline; gap: 12px; }
.bias-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; padding: 7px 12px; margin: 4px 0 6px; border-radius: 8px;
  background: color-mix(in srgb, var(--cc) 12%, rgba(10, 14, 36, 0.85)); border: 1px solid color-mix(in srgb, var(--cc) 50%, transparent); }
.craft-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.ftile { position: relative; width: 206px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid; cursor: pointer; transition: transform 0.1s, box-shadow 0.12s; }
.ftile.el-fire { background: linear-gradient(160deg, rgba(255, 138, 76, 0.2), rgba(20, 22, 50, 0.92) 55%); border-left-color: var(--fire); }
.ftile.el-ice { background: linear-gradient(160deg, rgba(92, 200, 255, 0.18), rgba(20, 22, 50, 0.92) 55%); border-left-color: var(--ice); }
.ftile.el-neutral { background: linear-gradient(160deg, rgba(143, 123, 255, 0.18), rgba(20, 22, 50, 0.92) 55%); border-left-color: var(--violet); }
.ftile.r2 { border-top-color: rgba(122, 156, 255, 0.7); border-right-color: rgba(122, 156, 255, 0.7); border-bottom-color: rgba(122, 156, 255, 0.7); }
.ftile.r3 { border-top-color: var(--r3); border-right-color: var(--r3); border-bottom-color: var(--r3); box-shadow: 0 0 14px rgba(245, 201, 94, 0.2); }
.ftile:hover { transform: translateY(-2px); }
.ftile.sel { box-shadow: 0 0 0 2px var(--gold2), 0 0 18px rgba(245, 215, 142, 0.35); }
.ftile.disabled { opacity: 0.32; cursor: not-allowed; }
.ftile.sold { opacity: 0.4; }
.ftile.small { width: 176px; cursor: default; }
.shop .ftile { cursor: default; }
.ftile-head { display: flex; align-items: center; gap: 5px; }
.ftile-head b { flex: 1; font-family: var(--serif); color: #fff3d6; }
.ficon { font-size: 15px; }
.ftile-meta { font-size: 11px; color: var(--muted); margin: 2px 0 3px; }
.cbadges { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 3px; }
.cbadge { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 8px; color: var(--cc); border: 1px solid var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent); }
.ftile-text { font-size: 12px; line-height: 1.45; }
.ftile-note { font-size: 10.5px; color: #9aa0c0; margin-top: 4px; font-style: italic; }
.ftile-badge { position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #1a1430; display: grid; place-items: center; font-weight: 800; font-size: 13px; box-shadow: 0 0 10px rgba(245, 215, 142, 0.6); }
.ftile .btn { margin-top: 8px; width: 100%; justify-content: center; }
.costs { display: flex; gap: 10px; }
.costfrag { width: 78px; padding: 8px 4px; text-align: center; border-radius: 10px; border: 1px solid var(--gold-line); background: radial-gradient(circle at 50% 30%, rgba(90, 74, 200, 0.5), rgba(20, 24, 60, 0.95)); cursor: pointer; }
.costfrag b { display: block; font-size: 26px; color: #fff3d6; font-family: var(--serif); }
.costfrag small { font-size: 11px; color: var(--muted); }
.costfrag.sel { box-shadow: 0 0 0 2px var(--gold2), 0 0 18px rgba(245, 215, 142, 0.4); }
.costfrag.na { opacity: 0.22; cursor: not-allowed; }
.help { margin-top: 16px; font-size: 13px; color: #c7cdea; background: rgba(10, 14, 36, 0.7); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.help summary { cursor: pointer; font-weight: 700; color: var(--gold2); }
.craft-right { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 18px; }
.summary { width: 100%; background: rgba(10, 14, 36, 0.78); border: 1px solid var(--gold-line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; }
.const-delta { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; }
.cdelta { font-size: 12.5px; }
.cdelta b { color: var(--cc); margin-right: 4px; }
.reason { color: var(--bad); margin-top: 4px; }
.order { width: 100%; font-size: 13px; }
.orow { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.orow span { flex: 1; }
.craft-actions { display: flex; gap: 10px; }

/* ---------- 路线 / 商店 / 事件 ---------- */
.paths { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 20px 0; flex-wrap: wrap; }
.pathnode { width: 240px; padding: 18px; border-radius: 14px; border: 1px solid var(--gold-line); background: var(--panel2); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.pathnode:hover { transform: translateY(-4px); box-shadow: 0 0 24px rgba(245, 215, 142, 0.25); }
.pathnode b { font-family: var(--serif); font-size: 20px; color: #fff3d6; }
.pathnode.n-rest { background: linear-gradient(180deg, rgba(40, 100, 80, 0.5), rgba(14, 24, 40, 0.9)); }
.pathnode.n-shop { background: linear-gradient(180deg, rgba(120, 90, 30, 0.5), rgba(24, 20, 30, 0.9)); }
.pathnode.n-event { background: linear-gradient(180deg, rgba(90, 50, 150, 0.5), rgba(20, 16, 44, 0.9)); }
.or { color: var(--gold); font-family: var(--serif); }
.shop-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.event .story { font-family: var(--serif); font-size: 16px; line-height: 1.9; color: #dfe2f8; max-width: 620px; margin: 10px auto 18px; }
.options { display: flex; flex-direction: column; gap: 10px; max-width: 580px; margin: 0 auto; }
.option { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 10px 14px; }
.option b { font-family: var(--serif); color: #fff3d6; }
.option span { font-size: 13px; color: #c7cdea; }

/* ---------- 结局 ---------- */
.ending { font-size: 16px; line-height: 1.9; margin: 10px auto 20px; max-width: 640px; }
.ending .q { font-size: 19px; color: var(--gold2); }
.ending .world { color: #fff3d6; font-size: 17px; }
.end-const { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 14px 0; }
.end-const svg { width: 180px; height: 120px; }
.glitch { position: relative; font-family: monospace !important; color: #ff5e7e !important; letter-spacing: 1px; }
.glitch { animation: fadeUp 1.2s ease forwards, glitch 1.8s 6.8s infinite steps(2) !important; }
@keyframes glitch {
  0%, 88%, 100% { transform: none; text-shadow: none; }
  91% { transform: translateX(-3px) skewX(12deg); text-shadow: 3px 0 #5cc8ff, -3px 0 #ff8a4c; }
  95% { transform: translateX(3px); text-shadow: -3px 0 #5cc8ff, 3px 0 #ff8a4c; }
}
.end-title { margin-top: 10px; }
.end .cards-grid { justify-content: center; }

/* ---------- 星图 ---------- */
.starmap { display: flex; flex-direction: column; gap: 12px; }
.starcard { display: flex; gap: 14px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--cc) 8%, rgba(12, 16, 40, 0.92)); border: 1px solid color-mix(in srgb, var(--cc) 40%, transparent); }
.starcard.destiny { box-shadow: 0 0 0 1px var(--cc), 0 0 22px color-mix(in srgb, var(--cc) 25%, transparent); }
.sc-art { width: 160px; flex: none; }
.sc-art svg { width: 100%; height: auto; }
.sc-body { flex: 1; min-width: 0; }
.sc-head { display: flex; align-items: baseline; gap: 8px; }
.sc-head b { font-family: var(--serif); font-size: 19px; letter-spacing: 2px; }
.sc-head em { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 3px; background: var(--cc); color: #0b0f24; font-weight: 700; }
.sc-stars { margin-left: auto; color: var(--gold2); font-weight: 700; }
.sc-goal { margin: 4px 0; font-size: 13px; }
.sc-need { margin: 6px 0; font-size: 12.5px; color: var(--muted); }
.sc-members { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-members span { font-size: 11.5px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); cursor: help; }
.sc-members span.own { border-color: var(--cc); color: var(--cc); background: color-mix(in srgb, var(--cc) 15%, transparent); }

/* ---------- 弹窗 / 提示 / 新手引导 ---------- */
.modal { position: fixed; inset: 0; background: rgba(3, 4, 14, 0.78); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 36px 16px; overflow: auto; }
.modal-box { width: min(1020px, 100%); background: linear-gradient(180deg, rgba(20, 27, 64, 0.98), rgba(12, 16, 40, 0.98)); border: 1px solid var(--gold-line); border-radius: 14px; padding: 14px 18px 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.rules { max-width: 780px; font-size: 14px; color: #d6daf3; }
.rules h3 { margin-top: 14px; color: var(--gold2); font-family: var(--serif); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; background: rgba(28, 22, 64, 0.97); border: 1px solid var(--gold); padding: 9px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); animation: toastIn 0.2s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.tut { position: fixed; right: 14px; bottom: 18px; z-index: 150; width: 330px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(42, 34, 100, 0.98), rgba(18, 16, 52, 0.98)); border: 1px solid var(--gold); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(245, 215, 142, 0.2); }
.tut.tut-combat { top: 56px; bottom: auto; width: 250px; }
.tut.tut-craft { top: 56px; bottom: auto; width: 290px; }
.tut-step { font-size: 11px; color: var(--gold); letter-spacing: 1px; }
.tut b { font-family: var(--serif); font-size: 16px; color: #fff3d6; }
.tut p { font-size: 13px; color: #dde0f6; margin: 6px 0 10px; }
.tut-focus { position: relative; z-index: 40; border-radius: 12px; box-shadow: 0 0 0 2px var(--gold2), 0 0 0 6px rgba(245, 215, 142, 0.25), 0 0 30px rgba(245, 215, 142, 0.35) !important; animation: tutPulse 1.6s ease-in-out infinite; }
@keyframes tutPulse { 50% { box-shadow: 0 0 0 2px var(--gold2), 0 0 0 10px rgba(245, 215, 142, 0.12), 0 0 40px rgba(245, 215, 142, 0.45); } }

/* ---------- 窄屏 ---------- */
@media (max-width: 1000px) {
  .combat { grid-template-columns: 1fr; }
  .log { grid-column: 1; grid-row: auto; max-height: 180px; order: 10; }
  .craft-grid { grid-template-columns: 1fr; }
  .craft-right { padding-top: 0; }
  .player { width: 100%; }
  .enemies { justify-content: center; }
  .intro-grid { grid-template-columns: 1fr; }
  .tut { left: 12px; right: 12px; width: auto; }
}

/* =========================================================
   角色存在感：战斗舞台、动作、气泡、陪伴（覆盖上面的旧布局）
   ========================================================= */
.combat { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.stage {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  min-height: 300px; padding: 34px 36px 8px; border-radius: 18px; overflow: visible;
  background:
    radial-gradient(ellipse at 22% 92%, rgba(92, 200, 255, 0.14), transparent 42%),
    radial-gradient(ellipse at 76% 92%, rgba(255, 120, 140, 0.10), transparent 45%),
    linear-gradient(180deg, rgba(20, 26, 70, 0.35), rgba(8, 11, 30, 0.55));
  border: 1px solid var(--line);
}
.stage.elite { background: radial-gradient(ellipse at 22% 92%, rgba(92, 200, 255, 0.14), transparent 42%), radial-gradient(ellipse at 76% 92%, rgba(217, 160, 70, 0.16), transparent 45%), linear-gradient(180deg, rgba(30, 24, 60, 0.4), rgba(8, 11, 30, 0.55)); }
.stage.boss { background: radial-gradient(ellipse at 22% 92%, rgba(92, 200, 255, 0.12), transparent 40%), radial-gradient(ellipse at 74% 80%, rgba(255, 60, 90, 0.2), transparent 50%), linear-gradient(180deg, rgba(40, 14, 40, 0.45), rgba(8, 8, 24, 0.6)); }
.logbtn { position: absolute; top: 8px; right: 10px; }
.log { position: fixed; top: 52px; right: 12px; width: 300px; max-height: 66vh; z-index: 70; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); }
.plat { position: absolute; left: 50%; transform: translateX(-50%); width: 150px; height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(245, 215, 142, 0.35), rgba(143, 123, 255, 0.18) 55%, transparent 72%); z-index: 0; pointer-events: none; }

/* 主角 */
.hero { position: relative; display: flex; align-items: flex-end; gap: 16px; padding-left: 6px; }
.hero > .plat { left: 100px; bottom: 6px; width: 190px; }
.hero-art { position: relative; z-index: 2; width: 196px; height: 216px; cursor: help; }
.hero-art svg { width: 100%; height: 100%; overflow: visible; }
.hero-info { width: 230px; padding-bottom: 12px; position: relative; z-index: 2; }
.hero .pname { font-size: 18px; }
.hero.s-fire .hero-art { filter: drop-shadow(0 0 18px rgba(255, 138, 76, 0.45)); }
.hero.s-ice .hero-art { filter: drop-shadow(0 0 18px rgba(92, 200, 255, 0.45)); }
.hero-art.atk { animation: heroLunge 0.45s ease-out; }
.hero-art.cast { animation: heroCast 0.6s ease-out; }
.hero-art.hurt { animation: heroHurt 0.45s ease-out; }
@keyframes heroLunge { 35% { transform: translateX(34px) scale(1.06); } }
@keyframes heroCast { 30% { transform: translateY(-10px) scale(1.04); } }
@keyframes heroHurt { 25% { transform: translateX(-16px) rotate(-5deg); } 60% { transform: translateX(-6px); } }

/* 敌人 */
.foes { display: flex; gap: 22px; align-items: flex-end; justify-content: flex-end; flex: 1; flex-wrap: wrap; padding-right: 30px; }
.foe { position: relative; width: 158px; text-align: center; }
.foe > .plat { bottom: 74px; width: 140px; background: radial-gradient(ellipse, rgba(255, 140, 160, 0.28), rgba(143, 123, 255, 0.14) 55%, transparent 72%); }
.foe-art { position: relative; z-index: 2; width: 124px; height: 124px; margin: 0 auto; cursor: help; }
.foe-art svg { width: 100%; height: 100%; overflow: visible; }
.foe.elite .foe-art { width: 140px; height: 140px; }
.foe.boss { width: 220px; }
.foe.boss .foe-art { width: 190px; height: 190px; }
.foe.boss > .plat { width: 210px; background: radial-gradient(ellipse, rgba(255, 70, 100, 0.35), rgba(120, 40, 120, 0.2) 55%, transparent 72%); }
.foe-info { position: relative; z-index: 2; padding: 4px 6px 2px; border-radius: 10px; background: rgba(8, 11, 30, 0.6); }
.foe .chips { justify-content: center; }
.foe.dead { opacity: 0.25; filter: grayscale(1); }
.foe.targetable { cursor: crosshair; }
.foe.targetable .foe-art { filter: drop-shadow(0 0 10px rgba(245, 215, 142, 0.9)); }
.foe.targetable .foe-info { box-shadow: 0 0 0 2px rgba(245, 215, 142, 0.7); }
.foe.targetable:hover .foe-art { transform: scale(1.05); }
.foe.lunge .foe-art { animation: foeLunge 0.42s ease-out; }
@keyframes foeLunge { 40% { transform: translateX(-40px) scale(1.08); } }
.foe.dissolve .foe-art { animation: dissolve 0.7s ease-in forwards; }
@keyframes dissolve { to { opacity: 0; transform: scale(1.25) translateY(-14px); filter: blur(3px) brightness(1.8); } }

/* 角色与敌人的待机动作（作用在美术分组上） */
.ch-body { transform-box: view-box; transform-origin: 100px 205px; animation: breathe 2.8s ease-in-out infinite; }
.ch-eyes, .en-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: blink 4.4s infinite; }
.ch-aura { transform-box: fill-box; transform-origin: 50% 50%; animation: auraPulse 3.2s ease-in-out infinite; }
.en-body { transform-box: fill-box; transform-origin: 50% 100%; animation: bob 2.4s ease-in-out infinite; }
.foe:nth-child(2) .en-body { animation-delay: -0.9s; }
.foe:nth-child(3) .en-body { animation-delay: -1.6s; }
.foe:nth-child(2) .en-eyes { animation-delay: -1.7s; }
@keyframes breathe { 50% { transform: translateY(1.5px) scaleY(0.975) scaleX(1.012); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.08); } }
@keyframes auraPulse { 50% { opacity: 0.65; transform: scale(1.04); } }
@keyframes bob { 50% { transform: translateY(-4px) scaleY(1.02); } }
@media (prefers-reduced-motion: reduce) { .ch-body, .ch-eyes, .ch-aura, .en-body, .en-eyes { animation: none; } }

/* 对话气泡 */
.bubble { position: absolute; z-index: 40; left: 50%; bottom: calc(100% - 6px); transform: translateX(-50%);
  width: max-content; max-width: 230px; padding: 7px 12px; border-radius: 14px;
  background: #fff8ec; color: #2a1f4a; font-size: 13px; font-weight: 700; line-height: 1.45; text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); pointer-events: none; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fff8ec; }
.hero .bubble { left: 104px; bottom: 214px; }
.foe .bubble { bottom: auto; top: 56px; left: auto; right: calc(100% - 14px); transform: none; background: #efe9ff; }
.foe .bubble::after { left: auto; right: -7px; bottom: auto; top: 50%; margin: -7px 0 0; border: 7px solid transparent; border-right: 0; border-left-color: #efe9ff; }
.foe .bubble.pop { animation: bubblePopL 0.28s cubic-bezier(0.3, 1.6, 0.6, 1); }
@keyframes bubblePopL { from { opacity: 0; transform: scale(0.6) translateX(10px); } }
.bubble.pop { animation: bubblePop 0.28s cubic-bezier(0.3, 1.6, 0.6, 1); }
@keyframes bubblePop { from { opacity: 0; transform: translateX(-50%) scale(0.6) translateY(8px); } }

/* 飞行物 */
.proj { position: absolute; z-index: 35; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; pointer-events: none;
  transition: transform 0.23s cubic-bezier(0.45, 0, 0.9, 0.55); }
.p-fire { background: radial-gradient(circle, #fff6dc 0 22%, #ffb86b 42%, #ff6a2a 66%, transparent 70%); box-shadow: 0 0 20px #ff8a4c, -14px 0 18px rgba(255, 138, 76, 0.55); }
.p-ice { width: 30px; height: 12px; margin: -6px 0 0 -15px; border-radius: 50% 8px 8px 50%; background: linear-gradient(90deg, rgba(232, 251, 255, 0.2), #e8fbff 40%, #5cc8ff); box-shadow: 0 0 16px #5cc8ff; }
.p-neutral { background: radial-gradient(circle, #fff 0 20%, #f5d78e 46%, transparent 70%); box-shadow: 0 0 18px #f5d78e; }
.f-gold { color: var(--gold2); font-size: 15px; }

/* 陪伴头像 */
.companion { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; text-align: left; }
.companion.center { justify-content: center; }
.companion.fade { opacity: 0; animation: fadeUp 1s 2.2s ease forwards; }
.comp-face { width: 66px; height: 66px; flex: none; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(143, 123, 255, 0.45), rgba(16, 20, 50, 0.95)); border: 2px solid var(--gold-line); box-shadow: 0 0 16px rgba(143, 123, 255, 0.3); }
.comp-face svg { width: 100%; height: 100%; }
.comp-bubble { position: relative; max-width: 560px; padding: 9px 14px; border-radius: 14px; background: #fff8ec; color: #2a1f4a; font-size: 13.5px; font-weight: 600; line-height: 1.55; }
.comp-bubble::before { content: ''; position: absolute; left: -8px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-left: 0; border-right-color: #fff8ec; }
.comp-bubble .kw { color: #b25d00; }
.comp-bubble .cc { color: var(--cc, #6a4ad0); }
.comp-bubble .muted { color: #7a7196; }
.comp-bubble .btn { padding: 1px 8px; font-size: 12px; color: var(--text); }
.bias-note { padding: 0; background: none; border: none; margin: 2px 0 4px; }
.bias-note .companion { margin: 0; }

/* 音频开关 */
.btn.off { opacity: 0.45; text-decoration: line-through; }

/* 新手提示在战斗里放到手牌上方右侧，避免挡住舞台 */
.tut.tut-combat { top: auto; bottom: 236px; width: 270px; }

/* 卡牌略缩小，让舞台成为主角；悬停浮出完整卡面 */
.combat .hand .card { width: 134px; min-height: 168px; }
.combat .hand .card-art { height: 40px; }
.combat .hand { min-height: 180px; }
.combat .hand .card > .card-body .frag { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.combat .hand .card > .card-tags { display: none; }
.combat .hand { align-items: flex-end; }
.combat .hand .card:hover .hover-full { display: block; }
.combat .hand .card.playable:hover { transform: translateY(-4px); }
.hover-full .card.zoom, .combat .hand .hover-full .card.zoom { width: 196px; min-height: 0; }
.hover-full .card.zoom .card-art { height: 60px; }
.hover-full .frag, .combat .hand .hover-full .frag { display: block; -webkit-line-clamp: unset; overflow: visible; font-size: 12px; }
.stage { min-height: 262px; padding-top: 30px; }
.hero-art { width: 178px; height: 196px; }
.hero > .plat { left: 92px; width: 176px; }
.hero .bubble { left: 92px; bottom: 192px; }
.foe-art { width: 112px; height: 112px; }
.foe.elite .foe-art { width: 128px; height: 128px; }
.foe.boss .foe-art { width: 172px; height: 172px; }
@media (max-width: 1000px) {
  .stage { flex-direction: column; align-items: center; padding: 30px 12px 8px; }
  .foes { justify-content: center; padding-right: 0; }
  .hero { flex-direction: column; align-items: center; }
  .hero > .plat { left: 50%; }
  .hero .bubble { left: 50%; }
  .log { left: 12px; width: auto; }
}

/* 提示横幅浮在舞台底部，不推动布局 */
.stage .banner { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 30; width: max-content; max-width: 90%; padding: 6px 16px; }

/* =========================================================
   长线：营地「裂隙边」、记忆之书、回忆演出、真名卡
   ========================================================= */
.btn.on { border-color: var(--gold2); background: linear-gradient(180deg, #4a3ba8, #2c236e); color: #fff3d6; }
.camp { max-width: 1100px; margin: 0 auto; padding: 10px 16px 24px; }
.camp-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.camp-head .spacer { flex: 1; }
.camp-stage { position: relative; width: 100%; aspect-ratio: 960 / 360; border-radius: 18px; overflow: hidden; border: 1px solid var(--gold-line);
  background: radial-gradient(ellipse at 50% 80%, rgba(255, 170, 90, 0.18), transparent 50%), linear-gradient(180deg, #0c1238, #070a1d); }
.camp-scene { position: absolute; inset: 0; }
.camp-scene svg { width: 100%; height: 100%; }
.camp-npc, .camp-hero { position: absolute; text-align: center; z-index: 3; }
.camp-hero { z-index: 4; }
.camp-npc { cursor: pointer; transition: transform 0.15s; }
.camp-npc:hover { transform: translateY(-4px); }
.camp-npc .npc-art, .camp-hero .npc-art { width: 100%; height: 100%; }
.camp-npc .npc-art svg, .camp-hero .npc-art svg { width: 100%; height: 100%; }
.camp-npc .npc-name { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); }
.camp-npc .npc-new { top: 4%; }
.camp-hero .bubble { bottom: 92%; }
.camp-npc:hover .npc-art { filter: drop-shadow(0 0 12px rgba(245, 215, 142, 0.7)); }
.camp-npc.talking .npc-art { filter: drop-shadow(0 0 14px rgba(245, 215, 142, 0.9)); }
.npc-art svg { width: 100%; height: auto; overflow: visible; display: block; }
.npc-name { display: inline-block; margin-top: 2px; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: rgba(8, 11, 30, 0.75); border: 1px solid var(--gold-line); color: #fff3d6; white-space: nowrap; }
.npc-new { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); z-index: 5; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-weight: 900; color: #2a1f4a; background: var(--gold2); box-shadow: 0 0 12px rgba(245, 215, 142, 0.8); animation: bob 1.2s ease-in-out infinite; }
.camp-hero .bubble { bottom: 100%; }
.npc-body { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
.npc-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: blink 5s infinite; }
.camp-fire { transform-box: fill-box; transform-origin: 50% 100%; animation: fireFlicker 0.9s ease-in-out infinite alternate; }
@keyframes fireFlicker { 0% { transform: scaleY(1) scaleX(1); } 50% { transform: scaleY(1.08) scaleX(0.96); } 100% { transform: scaleY(0.95) scaleX(1.03); } }
.dialog { display: flex; align-items: center; gap: 14px; margin: 12px 0; padding: 12px 16px; border-radius: 14px; background: rgba(255, 248, 236, 0.97); color: #2a1f4a; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45); }
.dialog.hint { background: rgba(17, 23, 54, 0.85); color: #cfd4f0; border: 1px solid var(--line); font-size: 13px; box-shadow: none; }
.dlg-face { width: 64px; height: 64px; flex: none; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 40%, #d8ccff, #6a5ae0); border: 2px solid var(--gold); }
.dlg-face svg { width: 100%; height: 100%; }
.dlg-body { flex: 1; }
.dlg-body b { font-family: var(--serif); font-size: 15px; }
.dlg-body em { font-style: normal; font-size: 11px; margin-left: 6px; padding: 0 6px; border-radius: 8px; background: var(--gold); color: #2a1f4a; font-weight: 700; }
.dlg-body p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.7; font-weight: 600; }
.dialog .btn { color: var(--text); }
.camp-bottom { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.camp-news { flex: 1; min-width: 260px; padding: 10px 14px; border-radius: 12px; background: rgba(60, 48, 130, 0.35); border: 1px solid var(--gold-line); font-size: 13px; }
.camp-news b { display: flex; align-items: center; gap: 4px; color: var(--gold2); margin-bottom: 4px; }
.camp-news div { padding: 2px 0; }
.camp-go { flex: 1.4; min-width: 320px; display: flex; flex-direction: column; gap: 10px; }
.depths { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* 记忆之书 */
.codex-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.codex-grid.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.centry { position: relative; padding: 10px 12px; border-radius: 12px; background: rgba(26, 35, 80, 0.85); border: 1px solid var(--gold-line); }
.centry[data-act] { cursor: pointer; }
.centry[data-act]:hover { border-color: var(--gold2); box-shadow: 0 0 14px rgba(245, 215, 142, 0.25); }
.centry.locked { opacity: 0.62; border-style: dashed; }
.ce-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ce-head b { font-family: var(--serif); font-size: 15px; color: #fff3d6; }
.ce-head svg { display: inline-block; }
.ce-frags { font-size: 12px; color: var(--gold); margin: 4px 0; }
.ce-text { font-size: 12.5px; color: #d0d5f2; margin: 6px 0 0; line-height: 1.6; }
.ce-text.veil { color: var(--muted); font-style: italic; }
.ce-hint { font-size: 12.5px; color: #ffd98a; margin: 6px 0 0; }
.ce-art { width: 72px; height: 72px; float: right; margin-left: 6px; }
.ce-art svg { width: 100%; height: 100%; }
.ce-art.wide { width: 120px; height: 80px; }
.ce-art.silhouette { filter: brightness(0) opacity(0.5); }
.mem-bar { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.bar.mem i { background: linear-gradient(90deg, #6a5ae0, var(--gold2)); }
.unlock { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 6px 10px; margin: 4px 0; border-radius: 8px; border: 1px dashed var(--line); opacity: 0.6; }
.unlock.on { opacity: 1; border-style: solid; border-color: var(--gold-line); background: rgba(60, 48, 130, 0.25); }
.unlock b { font-family: var(--serif); color: #fff3d6; min-width: 90px; }

/* 回忆演出 */
.vignette { position: fixed; inset: 0; z-index: 180; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px;
  background: radial-gradient(ellipse at 50% 30%, rgba(90, 70, 200, 0.35), transparent 60%), rgba(3, 4, 14, 0.92); animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.vg-box { max-width: 720px; width: 100%; text-align: center; }
.vg-seal { width: 46px; height: 46px; margin: 0 auto; font-size: 46px; }
.vg-seal svg { width: 100%; height: 100%; }
.vg-cat { color: var(--gold); letter-spacing: 3px; font-size: 13px; margin-top: 6px; }
.vignette .title { font-size: 40px; letter-spacing: 6px; margin: 6px 0 14px; }
.vg-lines p { opacity: 0; animation: fadeUp 1.1s ease forwards; font-family: var(--serif); font-size: 17px; line-height: 1.9; color: #e6e8fa; margin: 6px 0; }
.vg-foot { opacity: 0; animation: fadeUp 1s ease forwards; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; }
.vg-card { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* 真名卡与共鸣碎片 */
.card.true-card { border-color: var(--gold2); box-shadow: inset 0 0 0 3px rgba(10, 14, 36, 0.8), inset 0 0 0 4px rgba(245, 215, 142, 0.45), 0 0 16px rgba(199, 155, 255, 0.35); }
.card.true-card .card-name .truename { font-size: 14px; color: var(--gold2); letter-spacing: 1px; }
.card.true-card .card-name .fragnames { font-family: -apple-system, sans-serif; font-size: 10px; font-weight: 400; color: var(--muted); }
.tag.true { background: linear-gradient(90deg, rgba(245, 215, 142, 0.45), rgba(199, 155, 255, 0.45)); color: #fff3d6; }
.ftile.resonate { animation: resonate 1.6s ease-in-out infinite; }
@keyframes resonate { 0%, 100% { box-shadow: 0 0 0 1px rgba(245, 215, 142, 0.5), 0 0 10px rgba(199, 155, 255, 0.35); } 50% { box-shadow: 0 0 0 2px var(--gold2), 0 0 22px rgba(199, 155, 255, 0.7); } }
.ftile.resonate.sel { animation: none; }

/* 营地场景动画（分组见 art-camp.js） */
.camp-fire-core { transform-box: fill-box; transform-origin: 50% 100%; animation: fireFlicker 0.7s ease-in-out infinite alternate-reverse; }
.camp-fire-glow, .camp-lamp-glow { animation: glowFlicker 2.2s ease-in-out infinite; }
.camp-embers { animation: embersRise 2.6s linear infinite; }
.camp-twinkle { animation: twinkle 3.4s ease-in-out infinite; }
.camp-drift { transform-box: fill-box; animation: drift2 7s ease-in-out infinite; }
.camp-drift:nth-of-type(2n) { animation-duration: 9s; animation-delay: -3s; }
@keyframes glowFlicker { 0%, 100% { opacity: 1; } 40% { opacity: 0.75; } 70% { opacity: 0.9; } }
@keyframes embersRise { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
@keyframes drift2 { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .camp-fire, .camp-fire-core, .camp-fire-glow, .camp-lamp-glow, .camp-embers, .camp-twinkle, .camp-drift, .npc-body, .npc-eyes { animation: none; } }
