/* ═══════════════════════════════════════════════════════════
   晨陨 · DAWNFALL — 石、青铜、血与烛火
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #080706;
  --stone-1: #1a1612;
  --stone-2: #110e0b;
  --stone-3: #0b0908;
  --bronze-d: #4a3a24;
  --bronze: #8a6a3e;
  --bronze-hi: #c9a25e;
  --gold: #d9b56c;
  --gold-hi: #f0d79c;
  --ink: #e8dbc0;
  --ink-2: #c7b694;
  --ink-dim: #968669;
  --ink-faint: #64594b;
  --blood-d: #3d0906;
  --blood: #8e1b16;
  --blood-hi: #d2402f;
  --arcane-d: #1b2a57;
  --arcane: #4f7bd9;
  --arcane-hi: #9dbdff;
  --boon: #9cc084;
  --mixed: #d8b25e;
  --neutral: #97a5b8;
  --bane: #d06a55;
  --tint: rgba(142, 27, 22, 0.1);
  --story-size: 18px;
  --f-body: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --f-title: 'Noto Serif SC', 'Songti SC', serif;
  --f-brush: 'Ma Shan Zheng', 'Kaiti SC', 'STKaiti', serif;
  --f-latin: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --f-deco: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-in: cubic-bezier(.6, 0, .8, .3);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.5);
  --bevel: inset 0 1px 0 rgba(255, 230, 180, 0.08), inset 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 0 2px rgba(201, 162, 94, 0.14);
  --c-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg fill='none' stroke='%23c9a25e'%3E%3Cpath d='M1.5 29V9Q1.5 1.5 9 1.5H29' stroke-width='1.4'/%3E%3Cpath d='M5 29V12Q5 5 12 5H29' stroke-opacity='.4'/%3E%3C/g%3E%3Cpath d='M9 4.5l4 4-4 4-4-4z' fill='%23c9a25e'/%3E%3C/svg%3E");
  --c-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg transform='translate(30 0) scale(-1 1)'%3E%3Cg fill='none' stroke='%23c9a25e'%3E%3Cpath d='M1.5 29V9Q1.5 1.5 9 1.5H29' stroke-width='1.4'/%3E%3Cpath d='M5 29V12Q5 5 12 5H29' stroke-opacity='.4'/%3E%3C/g%3E%3Cpath d='M9 4.5l4 4-4 4-4-4z' fill='%23c9a25e'/%3E%3C/g%3E%3C/svg%3E");
  --c-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg transform='translate(0 30) scale(1 -1)'%3E%3Cg fill='none' stroke='%23c9a25e'%3E%3Cpath d='M1.5 29V9Q1.5 1.5 9 1.5H29' stroke-width='1.4'/%3E%3Cpath d='M5 29V12Q5 5 12 5H29' stroke-opacity='.4'/%3E%3C/g%3E%3Cpath d='M9 4.5l4 4-4 4-4-4z' fill='%23c9a25e'/%3E%3C/g%3E%3C/svg%3E");
  --c-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg transform='translate(30 30) scale(-1 -1)'%3E%3Cg fill='none' stroke='%23c9a25e'%3E%3Cpath d='M1.5 29V9Q1.5 1.5 9 1.5H29' stroke-width='1.4'/%3E%3Cpath d='M5 29V12Q5 5 12 5H29' stroke-opacity='.4'/%3E%3C/g%3E%3Cpath d='M9 4.5l4 4-4 4-4-4z' fill='%23c9a25e'/%3E%3C/g%3E%3C/svg%3E");
  --corners: var(--c-tl) left top / 30px no-repeat, var(--c-tr) right top / 30px no-repeat, var(--c-bl) left bottom / 30px no-repeat, var(--c-br) right bottom / 30px no-repeat;
  --panel-bg: linear-gradient(180deg, rgba(28, 23, 18, 0.97), rgba(14, 11, 9, 0.97));
  color-scheme: dark;
}
body[data-mood="tavern"] { --tint: rgba(200, 120, 40, 0.12); }
body[data-mood="tension"] { --tint: rgba(142, 27, 22, 0.14); }
body[data-mood="combat"] { --tint: rgba(200, 30, 20, 0.2); }
body[data-mood="sacred"] { --tint: rgba(90, 120, 220, 0.14); }
body[data-mood="sorrow"] { --tint: rgba(80, 100, 130, 0.12); }
body[data-mood="calm"] { --tint: rgba(160, 120, 70, 0.08); }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(1400px 700px at 50% 120%, var(--tint), transparent 70%),
    radial-gradient(1000px 500px at 50% -20%, rgba(60, 45, 30, 0.35), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.008) 0 2px, transparent 2px 80px),
    linear-gradient(180deg, #0c0a08, #060504);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.7;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: rgba(142, 27, 22, 0.55); color: #fff; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #5a4528, #3a2c1a); border-radius: 2px; border: 1px solid #1a140d; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

/* ── 背景层 ── */
#embers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.fog { position: fixed; inset: -20%; pointer-events: none; z-index: 0; opacity: .5; }
.fog i { position: absolute; inset: 0; background: radial-gradient(40% 30% at 30% 60%, rgba(110, 95, 80, 0.1), transparent 70%), radial-gradient(35% 25% at 70% 40%, rgba(110, 95, 80, 0.08), transparent 70%); animation: fogDrift 70s ease-in-out infinite alternate; }
.fog i:nth-child(2) { animation-duration: 100s; animation-direction: alternate-reverse; opacity: .7; }
@keyframes fogDrift { from { transform: translate3d(-6%, 2%, 0) scale(1.1); } to { transform: translate3d(6%, -3%, 0) scale(1.25); } }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.8) 100%); }
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .07; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ── 屏幕 ── */
#app { position: relative; z-index: 2; height: 100%; }
.screen { position: absolute; inset: 0; display: none; opacity: 0; transition: opacity .9s var(--ease), filter .9s var(--ease), transform .9s var(--ease); filter: blur(6px); transform: scale(1.01); }
.screen.active { display: block; }
.screen.shown { opacity: 1; filter: none; transform: none; }

/* ── 边框：青铜角饰 ── */
.frame { position: relative; background: var(--corners), var(--panel-bg); border: 1px solid var(--bronze-d); box-shadow: var(--bevel), 0 12px 40px rgba(0, 0, 0, 0.55); }
.rule { height: 12px; background: linear-gradient(90deg, transparent, var(--bronze) 20%, var(--bronze-hi) 50%, var(--bronze) 80%, transparent) center / 100% 1px no-repeat; position: relative; }
.rule::after { content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; background: var(--bronze-hi); transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 8px rgba(201, 162, 94, .6); }

/* ── 按钮：金属铭牌 ── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .66em 1.6em; font-family: var(--f-title); font-weight: 600; font-size: 15px; letter-spacing: .18em; color: var(--ink-2);
  background: linear-gradient(180deg, #2a2219 0%, #1a1510 50%, #120e0b 100%);
  border: 1px solid var(--bronze-d); border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, .1), inset 0 0 0 1px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .5);
  transition: color .25s, border-color .25s, box-shadow .3s, transform .15s, filter .25s; white-space: nowrap;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
}
.btn:hover:not(:disabled) { color: var(--gold-hi); border-color: var(--bronze-hi); filter: brightness(1.2); box-shadow: inset 0 1px 0 rgba(255, 220, 160, .18), inset 0 0 18px rgba(201, 162, 94, .18), 0 0 18px rgba(201, 162, 94, .15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.primary { color: #f6e3b6; background: linear-gradient(180deg, #8e1b16 0%, #5c0f0b 55%, #3d0906 100%); border-color: #b0492f; text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
.btn.primary:hover:not(:disabled) { color: #fff2d0; border-color: #e0806a; box-shadow: inset 0 1px 0 rgba(255, 200, 160, .25), 0 0 26px rgba(210, 64, 47, .45); }
.btn.arcane { color: #dfe8ff; background: linear-gradient(180deg, #2f4f9c, #1b2a57 60%, #0f1733); border-color: #5d7fd0; }
.btn.arcane:hover:not(:disabled) { box-shadow: 0 0 24px rgba(79, 123, 217, .5); color: #fff; }
.btn.small { padding: .4em 1.1em; font-size: 13px; letter-spacing: .08em; }
.btn.danger:hover:not(:disabled) { color: #ffb3a3; border-color: #b0492f; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; color: var(--ink-dim); border: 1px solid transparent; transition: all .2s; position: relative; transform: rotate(45deg); }
.icon-btn > svg { transform: rotate(-45deg); width: 18px; height: 18px; }
.icon-btn:hover { color: var(--gold-hi); border-color: var(--bronze); background: rgba(201, 162, 94, .08); box-shadow: 0 0 14px rgba(201, 162, 94, .2); }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; transform: rotate(-45deg); min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px; background: var(--blood); border: 1px solid var(--blood-hi); color: #fff; font: 600 10px/15px var(--f-body); text-align: center; }
.icon-btn.pulse { animation: pulseGlow 1.6s ease-in-out 3; }
@keyframes pulseGlow { 50% { box-shadow: 0 0 0 5px rgba(201, 162, 94, .2), 0 0 24px rgba(201, 162, 94, .45); color: var(--gold-hi); } }
.close-x { transform: none; }
.close-x > svg { transform: none; }

/* ── 表单 ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12.5px; color: var(--ink-dim); letter-spacing: .12em; }
.field .hint { font-size: 12px; color: var(--ink-faint); }
.input, .textarea, .select { width: 100%; padding: .62em .9em; border-radius: 2px; border: 1px solid var(--bronze-d); background: rgba(5, 4, 3, 0.7); color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6); }
.input:focus, .textarea:focus { border-color: var(--bronze-hi); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 0 0 2px rgba(201, 162, 94, .12); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.seg { display: inline-flex; border: 1px solid var(--bronze-d); padding: 2px; background: rgba(0, 0, 0, .4); }
.seg button { padding: .36em 1.1em; color: var(--ink-dim); transition: all .2s; font-family: var(--f-title); letter-spacing: .1em; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: linear-gradient(180deg, #5c0f0b, #3d0906); color: var(--gold-hi); box-shadow: inset 0 0 0 1px #8e3a2a; }
.switch { position: relative; width: 44px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); border: 1px solid var(--bronze-d); transition: .3s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: var(--ink-faint); transform: rotate(45deg); transition: .3s var(--ease); }
.switch input:checked + span { background: rgba(142, 27, 22, .5); border-color: var(--blood-hi); }
.switch input:checked + span::before { transform: translateX(22px) rotate(45deg); background: var(--gold-hi); box-shadow: 0 0 10px rgba(240, 215, 156, .7); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: linear-gradient(90deg, var(--bronze-d), var(--bronze)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--gold-hi); transform: rotate(45deg); box-shadow: 0 0 10px rgba(240, 215, 156, .5); cursor: pointer; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; font-size: 12px; line-height: 20px; border: 1px solid rgba(151, 165, 184, 0.3); color: #bcc6d3; background: rgba(151, 165, 184, 0.07); white-space: nowrap; animation: tagIn .5s var(--ease) both; }
.tag.red { border-color: rgba(210, 64, 47, 0.55); color: #f3a898; background: rgba(142, 27, 22, 0.22); }
.tag.amber { border-color: rgba(216, 178, 94, 0.45); color: #ecd08e; background: rgba(216, 178, 94, 0.08); }
.tag.green { border-color: rgba(156, 192, 132, 0.4); color: #bfdca9; background: rgba(156, 192, 132, 0.08); }
.tag.blue { border-color: rgba(79, 123, 217, 0.5); color: #b8cdff; background: rgba(79, 123, 217, 0.12); }
.tag.dead { border-color: rgba(120, 120, 120, 0.5); color: #999; background: rgba(0, 0, 0, 0.3); text-decoration: line-through; }
@keyframes tagIn { from { opacity: 0; transform: scale(.85); } }
.kind { font-size: 11px; padding: 0 7px; letter-spacing: .08em; line-height: 18px; border: 1px solid; }
.kind.boon { color: var(--boon); border-color: rgba(156, 192, 132, .4); }
.kind.mixed { color: var(--mixed); border-color: rgba(216, 178, 94, .4); }
.kind.neutral { color: var(--neutral); border-color: rgba(151, 165, 184, .35); }
.kind.bane { color: var(--bane); border-color: rgba(208, 106, 85, .45); }
.mods { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.mod { font-size: 11.5px; padding: 0 7px; background: rgba(156, 192, 132, .1); color: var(--boon); border: 1px solid rgba(156, 192, 132, .2); }
.mod.neg { background: rgba(208, 106, 85, .1); color: var(--bane); border-color: rgba(208, 106, 85, .25); }

.emblem {
  --s: 56px; width: var(--s); height: var(--s); flex: none; display: grid; place-items: center; position: relative;
  font-family: var(--f-brush); font-size: calc(var(--s) * .52); color: var(--gold-hi); line-height: 1;
  background: radial-gradient(circle at 50% 35%, #5c1510, #2a0705 70%);
  border: 1px solid var(--bronze-hi); transform: rotate(45deg);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .6), inset 0 0 0 4px rgba(201, 162, 94, .3), 0 4px 14px rgba(0, 0, 0, .6);
  text-shadow: 0 0 12px rgba(240, 180, 90, .5);
}
.emblem > span { transform: rotate(-45deg); }
.panel-title { font-family: var(--f-title); font-weight: 700; font-size: 21px; letter-spacing: .3em; color: var(--gold-hi); margin: 0; text-shadow: 0 2px 0 #000, 0 0 18px rgba(201, 162, 94, .25); }
.section-title { font-family: var(--f-title); font-weight: 600; font-size: 13.5px; letter-spacing: .3em; color: var(--bronze-hi); margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; width: 6px; height: 6px; background: var(--blood-hi); transform: rotate(45deg); box-shadow: 0 0 6px rgba(210, 64, 47, .8); }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--bronze), transparent); }
.latin { font-family: var(--f-latin); letter-spacing: .35em; font-size: 11px; color: var(--ink-faint); text-transform: uppercase; }

/* ── 开场 ── */
#screen-splash { display: none; place-items: center; cursor: pointer; }
#screen-splash.active { display: grid; }
.splash-inner { text-align: center; }
.splash-sun { width: 60px; height: 60px; margin: 0 auto 30px; border-radius: 50%; background: radial-gradient(circle, #ff8a5a, #b3220f 50%, transparent 72%); filter: blur(1px); animation: sunPulse 2.4s ease-in-out infinite; }
@keyframes sunPulse { 50% { transform: scale(1.18); filter: blur(2px) brightness(1.4); } }
.splash-text { font-family: var(--f-title); letter-spacing: .6em; color: var(--ink-dim); font-size: 15px; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; } }

/* ── 标题 ── */
#screen-title.active { display: grid; place-items: center; }
.title-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.title-sun { position: absolute; left: 50%; bottom: -30vh; width: 76vh; height: 76vh; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 110, 70, .95) 0%, rgba(180, 30, 15, .85) 30%, rgba(90, 8, 5, .5) 55%, transparent 70%); filter: blur(4px); animation: sunBeat 5s ease-in-out infinite; }
@keyframes sunBeat { 0%, 100% { opacity: .75; transform: translateX(-50%) scale(1); } 8% { opacity: 1; transform: translateX(-50%) scale(1.05); } 16% { opacity: .8; } }
.title-sea { position: absolute; left: 0; right: 0; bottom: 0; height: 22vh; background: linear-gradient(180deg, rgba(40, 6, 4, .0), rgba(8, 3, 2, .95) 40%); }
.title-sea::before { content: ''; position: absolute; left: 50%; top: 0; width: 24vh; height: 100%; transform: translateX(-50%); background: repeating-linear-gradient(180deg, rgba(255, 90, 50, .35) 0 2px, transparent 2px 9px); filter: blur(1.5px); opacity: .6; mask-image: linear-gradient(180deg, #000, transparent); -webkit-mask-image: linear-gradient(180deg, #000, transparent); }
.title-wrap { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; margin-top: -8vh; }
.title-mark { margin: 0; font-family: var(--f-title); font-weight: 900; font-size: clamp(88px, 14vw, 170px); line-height: 1.05; letter-spacing: .12em; display: flex; justify-content: center; filter: drop-shadow(0 6px 0 #000) drop-shadow(0 0 30px rgba(210, 64, 47, .35)); }
.title-mark span { display: inline-block; opacity: 0; animation: charIn 1.8s var(--ease) forwards; background: linear-gradient(180deg, #fff3d0 0%, #e8c784 30%, #a67c3e 55%, #6b4a22 70%, #d9b56c 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 1px rgba(40, 25, 10, .6); }
.title-mark span:nth-child(2) { animation-delay: .3s; }
@keyframes charIn { from { opacity: 0; transform: translateY(20px) scale(.94); filter: blur(12px); } to { opacity: 1; transform: none; filter: none; } }
.title-sub { font-family: var(--f-deco); letter-spacing: .8em; color: var(--bronze-hi); font-size: 18px; margin-right: -.8em; opacity: 0; animation: fadeUp 1.2s .9s var(--ease) forwards; }
.title-tag { color: var(--ink-dim); letter-spacing: .4em; font-size: 14px; opacity: 0; animation: fadeUp 1.2s 1.1s var(--ease) forwards; }
.title-menu { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; min-width: 260px; }
.title-menu .btn { opacity: 0; animation: fadeUp .9s var(--ease) forwards; }
.title-menu .btn:nth-child(1) { animation-delay: 1.3s; } .title-menu .btn:nth-child(2) { animation-delay: 1.4s; } .title-menu .btn:nth-child(3) { animation-delay: 1.5s; } .title-menu .btn:nth-child(4) { animation-delay: 1.6s; } .title-menu .btn:nth-child(5) { animation-delay: 1.7s; }
.title-foot { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--ink-faint); letter-spacing: .35em; }
.title-warn { margin-top: 16px; font-size: 13px; color: #f0a595; opacity: 0; animation: fadeUp 1s 2s forwards; }
.title-warn a { color: var(--gold-hi); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── 角色创建 ── */
#screen-create.active { display: flex; flex-direction: column; }
.create-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 36px 8px; gap: 20px; }
.create-head .ttl { font-family: var(--f-title); font-weight: 700; font-size: 20px; letter-spacing: .3em; color: var(--gold-hi); }
.steps { display: flex; gap: 4px; align-items: center; }
.step { display: flex; align-items: center; gap: 8px; padding: 5px 12px; color: var(--ink-faint); font-family: var(--f-title); letter-spacing: .14em; transition: all .4s; font-size: 14px; }
.step b { font-family: var(--f-latin); font-weight: 400; font-size: 11px; width: 22px; height: 22px; border: 1px solid currentColor; display: grid; place-items: center; transform: rotate(45deg); }
.step b > i { transform: rotate(-45deg); font-style: normal; }
.step.on { color: var(--gold-hi); }
.step.on b { background: var(--blood); border-color: var(--blood-hi); box-shadow: 0 0 10px rgba(210, 64, 47, .6); }
.step.done { color: var(--ink-2); }
.step-sep { width: 18px; height: 1px; background: var(--bronze-d); }
.create-body { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.create-pane { position: absolute; inset: 0; overflow-y: auto; padding: 10px 36px 30px; animation: paneIn .7s var(--ease) both; }
.create-pane.out { animation: paneOut .35s var(--ease-in) both; }
@keyframes paneIn { from { opacity: 0; transform: translateX(30px); filter: blur(4px); } }
@keyframes paneOut { to { opacity: 0; transform: translateX(-30px); filter: blur(4px); } }
.create-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 36px 18px; border-top: 1px solid var(--bronze-d); background: linear-gradient(180deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, .6)); }
.create-foot .summary-line { color: var(--ink-dim); font-size: 13.5px; }
.pane-intro { max-width: 820px; margin: 4px 0 16px; }
.pane-intro h2 { font-family: var(--f-title); font-weight: 900; font-size: 30px; letter-spacing: .2em; margin: 0 0 4px; color: var(--gold-hi); text-shadow: 0 3px 0 #000; }
.pane-intro p { margin: 0; color: var(--ink-dim); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; align-items: start; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.card {
  position: relative; text-align: left; border: 1px solid var(--bronze-d); background: linear-gradient(180deg, rgba(30, 24, 18, .92), rgba(14, 11, 9, .92));
  box-shadow: var(--bevel); transition: transform .3s var(--ease), border-color .25s, box-shadow .3s; cursor: pointer; animation: cardIn .55s var(--ease) both;
}
.card:hover { transform: translateY(-2px); border-color: var(--bronze); box-shadow: var(--bevel), 0 10px 26px rgba(0, 0, 0, .55); }
.card.on { border-color: var(--bronze-hi); background: var(--corners), linear-gradient(180deg, rgba(70, 20, 14, .9), rgba(28, 10, 8, .92)); box-shadow: var(--bevel), 0 0 26px rgba(210, 64, 47, .25); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }
.pick-card { padding: 14px; display: flex; gap: 14px; align-items: center; }
.pick-card .emblem { --s: 40px; margin: 4px; transition: transform .5s var(--ease); }
.pick-card.on .emblem { transform: rotate(45deg) scale(1.12); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .6), 0 0 18px rgba(210, 64, 47, .6); }
.pick-card h3 { margin: 0; font-family: var(--f-title); font-weight: 700; font-size: 16px; letter-spacing: .08em; }
.pick-card p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }
.pick-card .sub { font-size: 11.5px; color: var(--ink-faint); letter-spacing: .12em; }
.detail { position: sticky; top: 0; padding: 26px 26px 22px; }
.detail .emblem { --s: 64px; margin: 10px 10px 18px; animation: stampIn .6s var(--ease) both; }
@keyframes stampIn { 0% { transform: rotate(45deg) scale(1.8); opacity: 0; } 60% { transform: rotate(45deg) scale(.94); opacity: 1; } 100% { transform: rotate(45deg); } }
.detail h3 { font-family: var(--f-title); font-weight: 900; font-size: 26px; margin: 0; letter-spacing: .12em; color: var(--gold-hi); text-shadow: 0 2px 0 #000; }
.detail .tagline { color: #e9937e; font-style: italic; margin: 4px 0 12px; }
.detail .story { color: var(--ink-2); text-align: justify; line-height: 1.9; font-size: 14.5px; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0 0; font-size: 13.5px; }
.detail dt { color: var(--ink-faint); letter-spacing: .1em; }
.detail dd { margin: 0; color: var(--ink-2); }
.fade-swap { animation: fadeSwap .45s var(--ease) both; }
@keyframes fadeSwap { from { opacity: 0; transform: translateY(8px); } }
.ident-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
.ident-form { display: flex; flex-direction: column; gap: 18px; }

/* 属性分配 */
.abil-assign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 820px; }
.abil-box { padding: 16px 14px 14px; text-align: center; }
.abil-box .an { font-family: var(--f-title); font-weight: 700; letter-spacing: .3em; color: var(--bronze-hi); font-size: 14px; }
.abil-box .ab { font-family: var(--f-latin); font-size: 10px; letter-spacing: .3em; color: var(--ink-faint); }
.abil-box .av { font-family: var(--f-latin); font-size: 40px; font-weight: 600; color: var(--gold-hi); line-height: 1.2; text-shadow: 0 2px 0 #000; }
.abil-box .am { display: inline-block; min-width: 42px; padding: 0 8px; font-family: var(--f-latin); font-size: 14px; border: 1px solid var(--bronze-d); background: rgba(0, 0, 0, .5); color: var(--ink); }
.abil-box .racial { font-size: 11.5px; color: var(--boon); min-height: 18px; margin-top: 4px; }
.abil-box .ctrl { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.abil-box .ctrl button { width: 28px; height: 28px; border: 1px solid var(--bronze-d); background: rgba(0, 0, 0, .4); color: var(--ink-2); font-family: var(--f-latin); }
.abil-box .ctrl button:hover:not(:disabled) { border-color: var(--bronze-hi); color: var(--gold-hi); }
.abil-box .ctrl button:disabled { opacity: .3; }
.abil-box .desc { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; line-height: 1.5; }
.pool { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; align-items: center; }
.pool .chip-val { width: 44px; height: 44px; display: grid; place-items: center; font-family: var(--f-latin); font-size: 18px; color: var(--gold-hi); border: 1px solid var(--bronze); background: rgba(0, 0, 0, .5); transform: rotate(45deg); }
.pool .chip-val > span { transform: rotate(-45deg); }
.pool .chip-val.used { opacity: .25; }

/* 法术挑选 */
.spell-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.spell-card { padding: 11px 13px 11px 60px; min-height: 76px; }
.spell-card .sicon { position: absolute; left: 12px; top: 13px; }
.spell-card h4 { margin: 0; font-family: var(--f-title); font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.spell-card h4 small { font-weight: 400; font-size: 11.5px; color: var(--ink-faint); letter-spacing: .1em; }
.spell-card p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-dim); line-height: 1.6; }
.spell-card.on::after { content: '✦'; position: absolute; right: 10px; top: 8px; color: var(--gold-hi); text-shadow: 0 0 8px var(--gold); }
.spell-card.locked { filter: grayscale(.8) brightness(.7); cursor: default; }
.spell-card.locked:hover { transform: none; }

/* 特质 */
.trait-top { display: flex; gap: 12px; align-items: stretch; margin-bottom: 14px; flex-wrap: wrap; }
.trait-slot { flex: 1; min-width: 180px; min-height: 58px; border: 1px dashed var(--bronze-d); padding: 10px 14px; display: flex; align-items: center; gap: 10px; color: var(--ink-faint); transition: all .3s; cursor: pointer; }
.trait-slot.filled { border-style: solid; border-color: var(--bronze); background: rgba(40, 14, 10, .6); color: var(--ink); animation: slotFill .5s var(--ease); }
.trait-slot .n { font-family: var(--f-latin); color: var(--blood-hi); font-size: 17px; width: 22px; }
.trait-slot b { font-family: var(--f-title); font-size: 16px; letter-spacing: .06em; }
@keyframes slotFill { 0% { transform: scale(.96); box-shadow: 0 0 0 0 rgba(210, 64, 47, .5); } 100% { box-shadow: 0 0 0 12px rgba(210, 64, 47, 0); } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.chip { padding: .25em .9em; border: 1px solid var(--bronze-d); color: var(--ink-dim); font-size: 13px; transition: all .2s; background: rgba(0, 0, 0, .3); }
.chip:hover { color: var(--ink); border-color: var(--bronze); }
.chip.on { color: var(--gold-hi); border-color: var(--blood-hi); background: rgba(142, 27, 22, .35); }
.trait-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 9px; }
.trait-card { padding: 11px 13px; }
.trait-card .thead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trait-card h4 { margin: 0; font-family: var(--f-title); font-weight: 700; font-size: 15.5px; }
.trait-card p { margin: 5px 0 0; font-size: 12.8px; color: var(--ink-dim); line-height: 1.6; }
.trait-card .cat { font-size: 11px; color: var(--ink-faint); letter-spacing: .1em; }
.trait-card.on::after { content: '✦'; position: absolute; right: -6px; top: -8px; color: var(--gold-hi); font-size: 18px; text-shadow: 0 0 10px var(--gold); animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(0); } }
.shake { animation: shakeX .4s; }
@keyframes shakeX { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.sheet { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }
.sheet-card { padding: 28px 24px; text-align: center; }
.sheet-card .emblem { --s: 72px; margin: 10px auto 22px; transform: rotate(45deg); }
.sheet-card h2 { font-family: var(--f-title); font-weight: 900; font-size: 28px; margin: 0; color: var(--gold-hi); letter-spacing: .12em; line-height: 1.3; text-shadow: 0 2px 0 #000; }
.sheet-card .who { color: var(--ink-dim); letter-spacing: .15em; font-size: 13px; }
.sheet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.stat-pill { border: 1px solid var(--bronze-d); background: rgba(0, 0, 0, .4); padding: 6px; }
.stat-pill .k { font-size: 11px; color: var(--ink-faint); letter-spacing: .2em; }
.stat-pill .v { font-family: var(--f-latin); font-size: 20px; color: var(--gold-hi); }
.stat-pill.hp .v { color: #f08a78; }
.stat-pill.sp .v { color: var(--arcane-hi); }

/* 小属性格 */
.abil-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.abil-mini div { border: 1px solid var(--bronze-d); background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, .25)); text-align: center; padding: 4px 2px 3px; }
.abil-mini .k { font-size: 11px; color: var(--ink-faint); letter-spacing: .1em; }
.abil-mini .v { font-family: var(--f-latin); font-size: 17px; color: var(--ink); line-height: 1.2; }
.abil-mini .m { font-family: var(--f-latin); font-size: 11px; color: var(--bronze-hi); }

/* ── 游戏主界面 ── */
#screen-game.active { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 20px; min-height: 54px; background: linear-gradient(180deg, #16120e, #0b0908); border-bottom: 1px solid var(--bronze-d); box-shadow: 0 1px 0 rgba(201, 162, 94, .15), 0 8px 20px rgba(0, 0, 0, .5); position: relative; z-index: 5; }
.where { display: flex; align-items: center; gap: 14px; min-width: 0; }
.where .loc { font-family: var(--f-title); font-weight: 700; font-size: 18px; letter-spacing: .14em; color: var(--gold-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 #000; }
.where .when { color: var(--ink-dim); font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.where .when svg { width: 15px; height: 15px; color: var(--bronze-hi); }
.where .dot { width: 5px; height: 5px; background: var(--blood-hi); transform: rotate(45deg); flex: none; }
.where .changed { animation: glint 1.6s var(--ease); }
@keyframes glint { 0% { text-shadow: 0 0 18px rgba(240, 215, 156, .9); color: #fff; } }
.nav { display: flex; align-items: center; gap: 8px; }
.nav .music-label { font-size: 12px; color: var(--ink-faint); letter-spacing: .15em; margin-right: 6px; }

.game-main { display: grid; grid-template-columns: 290px minmax(0, 1fr) 400px; min-height: 0; }
.side { min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, rgba(18, 14, 11, .9), rgba(8, 6, 5, .95)); }
.side.left { border-right: 1px solid var(--bronze-d); box-shadow: inset -1px 0 0 rgba(201, 162, 94, .08); }
.side.right { border-left: 1px solid var(--bronze-d); box-shadow: inset 1px 0 0 rgba(201, 162, 94, .08); }

.portrait-row { display: flex; gap: 14px; align-items: center; cursor: pointer; }
.portrait { --s: 84px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, #4a120d, #160403 72%);
  box-shadow: 0 0 0 2px #0a0806, 0 0 0 4px var(--bronze), 0 0 0 5px #0a0806, 0 0 0 6px var(--bronze-d), 0 8px 20px rgba(0, 0, 0, .7), inset 0 0 20px rgba(0, 0, 0, .8);
  font-family: var(--f-brush); font-size: calc(var(--s) * .5); color: var(--gold-hi); text-shadow: 0 0 16px rgba(255, 160, 80, .5); }
.portrait::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 1px dashed rgba(201, 162, 94, .3); animation: spin 60s linear infinite; }
.portrait.hurt { animation: hurt .6s; }
@keyframes hurt { 20% { box-shadow: 0 0 0 2px #0a0806, 0 0 0 4px var(--blood-hi), 0 0 30px rgba(255, 30, 20, .8); filter: brightness(1.6) saturate(2); } }
.who-block b { display: block; font-family: var(--f-title); font-weight: 900; font-size: 19px; letter-spacing: .08em; color: var(--ink); text-shadow: 0 2px 0 #000; }
.who-block span { font-size: 12.5px; color: var(--ink-dim); letter-spacing: .08em; }
.who-block .coin { color: var(--gold); display: block; margin-top: 2px; }
.bar { position: relative; height: 20px; background: #070504; border: 1px solid var(--bronze-d); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .8), 0 0 0 1px #000; overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .9s var(--ease); }
.bar i.ghost { background: rgba(255, 230, 200, .55); transition: width 1.4s .4s var(--ease); }
.bar.hp i.fill { background: linear-gradient(180deg, #e25640 0%, #a0170f 45%, #5c0806 100%); box-shadow: inset 0 1px 0 rgba(255, 200, 180, .4); }
.bar.sp i.fill { background: linear-gradient(180deg, #7ea4ff 0%, #3456b8 45%, #172a66 100%); box-shadow: inset 0 1px 0 rgba(200, 220, 255, .4); }
.bar.sp.empty { border-color: #3a2020; }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; font-size: 11.5px; letter-spacing: .1em; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; font-family: var(--f-latin); }
.bar span b { font-family: var(--f-body); font-weight: 600; letter-spacing: .2em; }
.bar.flash-heal { animation: flashHeal .9s; }
@keyframes flashHeal { 30% { box-shadow: 0 0 16px rgba(125, 232, 160, .9); } }
.pips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.pips i { width: 9px; height: 9px; transform: rotate(45deg); background: #1a2447; border: 1px solid #34467a; }
.pips i.on { background: radial-gradient(circle, #d4e2ff, #4f7bd9); border-color: #9dbdff; box-shadow: 0 0 6px rgba(120, 160, 255, .8); }
.side-block { padding: 12px; }
.side-label { display: flex; align-items: center; justify-content: space-between; font-family: var(--f-title); font-weight: 600; font-size: 12.5px; letter-spacing: .3em; color: var(--bronze-hi); margin-bottom: 8px; }
.side-label button { font-size: 12px; letter-spacing: .05em; color: var(--ink-faint); }
.side-label button:hover { color: var(--gold-hi); }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.present { display: flex; flex-direction: column; gap: 7px; }
.pchip { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--bronze-d); background: rgba(0, 0, 0, .35); cursor: pointer; transition: all .25s; text-align: left; animation: fadeUp .5s var(--ease) both; }
.pchip:hover { border-color: var(--bronze); background: rgba(40, 14, 10, .5); }
.pchip .av { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-brush); font-size: 16px; color: var(--gold-hi); background: radial-gradient(circle at 40% 35%, #3a2a18, #120c07); box-shadow: 0 0 0 1px var(--bronze); }
.pchip .pt { min-width: 0; flex: 1; }
.pchip b { font-family: var(--f-title); font-weight: 700; font-size: 14.5px; }
.pchip .pr { font-size: 11.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip .tags { margin-top: 3px; }
.pchip.new { border-color: var(--bronze-hi); box-shadow: 0 0 18px rgba(201, 162, 94, .25); }
.empty-note { font-size: 13px; color: var(--ink-faint); font-style: italic; }

/* 中间：书页 */
.story-col { position: relative; overflow-y: auto; overflow-x: hidden; padding: 36px 5vw 40vh; scroll-behavior: smooth; mask-image: linear-gradient(180deg, transparent 0, #000 60px, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 60px, #000 calc(100% - 40px), transparent); }
.story { max-width: 740px; margin: 0 auto; }
.story-head { text-align: center; margin: 6px 0 36px; }
.story-head .emblem { --s: 54px; margin: 10px auto 18px; }
.story-head h1 { font-family: var(--f-title); font-weight: 900; font-size: 34px; margin: 0; color: var(--gold-hi); letter-spacing: .14em; text-shadow: 0 3px 0 #000; }
.story-head .rule { width: 260px; margin: 10px auto; }
.turn { position: relative; margin: 0 0 10px; animation: turnIn .8s var(--ease) both; }
@keyframes turnIn { from { opacity: 0; transform: translateY(16px); } }
.turn-action { display: flex; gap: 10px; align-items: baseline; margin: 34px 0 20px; padding: 9px 16px; border-left: 3px solid var(--bronze-hi); background: linear-gradient(90deg, rgba(201, 162, 94, .1), transparent 80%); color: var(--ink-2); font-style: italic; font-size: 15px; }
.turn-action .q { color: var(--bronze-hi); font-style: normal; font-family: var(--f-title); font-weight: 700; letter-spacing: .15em; font-size: 12.5px; flex: none; }
.turn-action.custom { border-left-color: var(--blood-hi); }
.turn-action.cast { border-left-color: var(--arcane); background: linear-gradient(90deg, rgba(79, 123, 217, .14), transparent 80%); }
.turn-text { font-size: var(--story-size); line-height: 2.05; color: var(--ink); text-align: justify; letter-spacing: .02em; }
.turn-text p { margin: 0 0 1.1em; text-indent: 2em; }
.turn-text p.first { text-indent: 0; display: flow-root; }
.turn-text p.first::first-letter {
  float: left; font-family: var(--f-title); font-weight: 900; font-size: 2.6em; line-height: 1; margin: .12em .22em 0 0; padding: .14em .16em;
  color: #f6dfa4; background: linear-gradient(160deg, #7c1812, #3a0806); border: 1px solid var(--bronze-hi);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .6), 0 3px 10px rgba(0, 0, 0, .6); text-shadow: 0 2px 0 #000, 0 0 12px rgba(255, 180, 90, .4);
}
.turn-text .dlg { color: #f6e7c8; }
.turn-text .fresh { animation: inkIn .9s var(--ease) both; }
@keyframes inkIn { from { opacity: 0; filter: blur(3px); color: #ff9a7a; } 40% { color: inherit; } }
.turn-sep { margin: 26px auto 0; width: 200px; }
.turn-meta { display: flex; justify-content: flex-end; font-size: 12px; color: var(--ink-faint); margin-top: -4px; opacity: 0; transition: opacity .3s; }
.turn:hover .turn-meta { opacity: 1; }

.events { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.tool-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-faint); animation: fadeUp .5s var(--ease) both; }
.tool-chip i { font-style: normal; width: 20px; height: 20px; display: grid; place-items: center; font-family: var(--f-brush); font-size: 13px; color: var(--bronze-hi); border: 1px solid var(--bronze-d); }
.ev-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 18px; max-width: 600px; animation: fadeUp .5s var(--ease) both; }
.ev-card .ct { font-family: var(--f-title); font-weight: 700; letter-spacing: .12em; color: var(--ink); font-size: 15px; }
.ev-card .cr { color: var(--ink-dim); font-size: 13px; }
.ev-card .cm { color: var(--ink-faint); font-size: 12px; font-family: var(--f-latin); letter-spacing: .04em; }
.die { width: 54px; height: 54px; display: grid; place-items: center; position: relative; font-family: var(--f-latin); font-size: 20px; color: var(--gold-hi); font-weight: 600; }
.die svg { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--bronze-hi); filter: drop-shadow(0 0 6px rgba(201, 162, 94, .4)); }
.die.rolling svg { animation: spin .5s linear infinite; }
.die.landed { animation: land .5s var(--ease); }
.die.nat20 { color: #fff; text-shadow: 0 0 12px #ffd166; }
.die.nat1 { color: #ff7a6a; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes land { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.verdict { font-family: var(--f-title); font-weight: 900; font-size: 18px; letter-spacing: .15em; padding: 3px 12px; opacity: 0; transform: scale(1.6); }
.verdict.show { animation: stamp .45s var(--ease) forwards; }
@keyframes stamp { to { opacity: 1; transform: rotate(-4deg); } }
.verdict.crit { color: #ffe4a0; border: 2px solid rgba(255, 228, 160, .6); text-shadow: 0 0 14px rgba(255, 210, 120, .7); }
.verdict.ok { color: var(--boon); border: 2px solid rgba(156, 192, 132, .5); }
.verdict.meh { color: var(--mixed); border: 2px solid rgba(216, 178, 94, .5); }
.verdict.bad { color: var(--bane); border: 2px solid rgba(208, 106, 85, .55); }
.verdict.fumble { color: #ff7f6a; border: 2px solid rgba(255, 127, 106, .6); text-shadow: 0 0 14px rgba(255, 90, 60, .5); }
.spell-ev { border-color: #3a4e8c; background: var(--corners), linear-gradient(90deg, rgba(27, 42, 87, .75), rgba(10, 12, 24, .8)); }
.spell-ev .sicon { --s: 46px; }
.spell-ev .num { font-family: var(--f-latin); font-size: 22px; color: #fff; text-shadow: 0 0 12px var(--arcane-hi); text-align: center; line-height: 1.1; }
.spell-ev .num small { display: block; font-family: var(--f-body); font-size: 11px; color: var(--arcane-hi); letter-spacing: .1em; }
.rest-ev { border-color: #6b4a22; background: linear-gradient(90deg, rgba(90, 50, 15, .6), rgba(20, 12, 6, .7)); grid-template-columns: 44px 1fr; }
.rest-ev .ri, .learn-ev .ri { font-family: var(--f-brush); font-size: 30px; color: var(--gold-hi); text-align: center; text-shadow: 0 0 14px rgba(255, 170, 80, .6); }
.learn-ev { border-color: #6d5bb0; background: var(--corners), linear-gradient(90deg, rgba(60, 40, 110, .6), rgba(15, 10, 28, .75)); grid-template-columns: 44px 1fr; }
.fate { display: flex; align-items: center; gap: 14px; padding: 12px 18px; max-width: 600px; border: 1px solid rgba(160, 140, 220, 0.35); background: linear-gradient(90deg, rgba(40, 30, 60, 0.6), rgba(12, 10, 18, 0.6)); animation: fadeUp .6s var(--ease) both; }
.fate .wheel { width: 40px; height: 40px; color: #c9b8f0; flex: none; }
.fate .wheel svg { width: 100%; height: 100%; animation: spin 6s linear infinite; }
.fate.pending .wheel svg { animation-duration: 1.2s; }
.fate .fl { font-size: 12px; color: #a99bd0; letter-spacing: .25em; }
.fate .ft { font-family: var(--f-title); font-weight: 700; font-size: 16px; color: #e6dcff; letter-spacing: .1em; }
.thinking { display: flex; align-items: center; gap: 14px; color: var(--ink-faint); font-size: 14px; font-style: italic; padding: 8px 0; animation: fadeUp .5s var(--ease) both; }
.thinking .embers { display: flex; gap: 7px; }
.thinking .embers i { width: 7px; height: 7px; transform: rotate(45deg); background: var(--blood-hi); box-shadow: 0 0 10px var(--blood-hi); animation: emberPulse 1.2s ease-in-out infinite; }
.thinking .embers i:nth-child(2) { animation-delay: .2s; } .thinking .embers i:nth-child(3) { animation-delay: .4s; }
@keyframes emberPulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.error-card { border: 1px solid rgba(210, 64, 47, 0.5); background: rgba(60, 10, 8, 0.6); padding: 14px 18px; color: #f0b7a8; font-size: 14px; animation: fadeUp .5s var(--ease) both; }
.error-card .row { margin-top: 10px; }
.truncated-note { font-size: 12.5px; color: #e9937e; margin-top: -6px; }

/* 右侧：对话选项 */
.dialogue { display: flex; flex-direction: column; gap: 2px; }
.option { position: relative; text-align: left; display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; padding: 10px 12px 10px 10px; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); transition: color .2s, background .25s, opacity .3s; animation: optIn .55s var(--ease) both; border-left: 2px solid transparent; }
.option:nth-child(2) { animation-delay: .08s; } .option:nth-child(3) { animation-delay: .16s; }
@keyframes optIn { from { opacity: 0; transform: translateX(20px); } }
.option .num { font-family: var(--f-latin); font-weight: 600; color: var(--bronze-hi); }
.option:hover:not(:disabled) { color: #fff4dc; background: linear-gradient(90deg, rgba(142, 27, 22, .35), transparent); border-left-color: var(--blood-hi); }
.option:hover .num { color: var(--gold-hi); }
.option:disabled { opacity: .35; cursor: default; }
.option.chosen { color: var(--gold-hi); background: linear-gradient(90deg, rgba(201, 162, 94, .2), transparent); }
.option .otag { display: inline-block; margin-right: 6px; font-size: 13px; font-weight: 600; letter-spacing: .05em; }
.otag.力量 { color: #f28b6a; } .otag.敏捷 { color: #9ad67e; } .otag.体质 { color: #e8b35a; } .otag.智力 { color: #7fb0ff; } .otag.感知 { color: #6fd3c4; } .otag.魅力 { color: #d79bff; } .otag.施法 { color: var(--arcane-hi); text-shadow: 0 0 8px rgba(120, 160, 255, .6); } .otag.other { color: var(--gold); }
.dialogue.waiting .option { opacity: .25; pointer-events: none; }
.compose { position: relative; margin-top: 6px; }
.compose textarea { width: 100%; min-height: 90px; max-height: 220px; resize: none; padding: 12px 14px 44px; border: 1px solid var(--bronze-d); background: rgba(3, 2, 2, .75); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .8); line-height: 1.7; font-size: 15px; outline: none; transition: border-color .3s; }
.compose textarea:focus { border-color: var(--bronze-hi); }
.compose textarea::placeholder { color: var(--ink-faint); font-style: italic; }
.compose .send { position: absolute; right: 8px; bottom: 8px; }
.compose .hint { position: absolute; left: 14px; bottom: 12px; font-size: 11.5px; color: var(--ink-faint); pointer-events: none; }
.stop-btn { display: none !important; }
.busy .stop-btn { display: inline-flex !important; }
.busy .send:not(.stop-btn) { display: none; }
.rest-row { display: flex; gap: 8px; }
.rest-row .btn { flex: 1; }

/* 底部：技能栏 */
.hotbar { position: relative; z-index: 4; display: flex; align-items: center; gap: 14px; padding: 10px 18px 12px; background: linear-gradient(180deg, #1a150f, #0a0807); border-top: 1px solid var(--bronze-d); box-shadow: 0 -1px 0 rgba(201, 162, 94, .15), 0 -10px 30px rgba(0, 0, 0, .6); overflow-x: auto; }
.hot-group { display: flex; gap: 6px; align-items: center; flex: none; }
.hot-label { writing-mode: vertical-rl; font-family: var(--f-title); font-weight: 700; font-size: 11px; letter-spacing: .3em; color: var(--bronze); margin-right: 2px; }
.hot-sep { width: 1px; align-self: stretch; background: linear-gradient(180deg, transparent, var(--bronze-d), transparent); flex: none; }
.slot { --c: #4f7bd9; --c2: #9dbdff; position: relative; width: 54px; height: 54px; flex: none; display: grid; place-items: center; border: 1px solid #000; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 55%, #000), #07060a 80%); box-shadow: 0 0 0 1px var(--bronze-d), inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 -10px 18px rgba(0, 0, 0, .6); transition: transform .15s, box-shadow .25s, filter .25s; }
.slot .g { font-family: var(--f-brush); font-size: 27px; color: #fff; text-shadow: 0 0 10px var(--c2), 0 2px 0 #000; line-height: 1; }
.slot .ring { position: absolute; left: 3px; top: 2px; font-family: var(--f-latin); font-size: 10px; color: var(--c2); text-shadow: 0 1px 1px #000; }
.slot .cost { position: absolute; right: 3px; bottom: 1px; font-family: var(--f-latin); font-size: 10.5px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.slot .uses { position: absolute; right: -5px; top: -5px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--blood); border: 1px solid var(--blood-hi); color: #fff; font: 600 10.5px/16px var(--f-latin); text-align: center; }
.slot:hover:not(.off) { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--bronze-hi), 0 0 18px var(--c), inset 0 0 0 1px rgba(255, 255, 255, .15); }
.slot.off { filter: grayscale(.9) brightness(.45); cursor: not-allowed; }
.slot.feat { --c: #8e1b16; --c2: #ffb49c; border-radius: 50%; }
.slot.passive { filter: grayscale(.4) brightness(.8); cursor: help; }
.hotbar.waiting .slot { pointer-events: none; opacity: .45; }
.hot-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.tip { position: fixed; z-index: 95; width: 300px; padding: 14px 16px 12px; pointer-events: none; animation: tipIn .18s var(--ease); font-size: 13px; }
@keyframes tipIn { from { opacity: 0; transform: translateY(6px); } }
.tip h4 { margin: 0; font-family: var(--f-title); font-weight: 900; font-size: 17px; color: var(--gold-hi); letter-spacing: .08em; }
.tip .tl { font-size: 11.5px; color: var(--arcane-hi); letter-spacing: .12em; margin: 2px 0 8px; }
.tip p { margin: 0 0 8px; color: var(--ink-2); line-height: 1.65; }
.tip .tm { font-size: 12px; color: var(--ink-dim); border-top: 1px solid var(--bronze-d); padding-top: 6px; }
.tip .tw { color: #f0a595; font-size: 12px; margin-top: 4px; }

/* 施法对话框 */
.cast-head { display: flex; gap: 22px; align-items: center; padding: 26px 30px 6px; }
.cast-head .slot { --s: 64px; width: 64px; height: 64px; }
.cast-head .slot .g { font-size: 34px; }
.cast-head h2 { margin: 0; font-family: var(--f-title); font-weight: 900; font-size: 26px; color: var(--gold-hi); letter-spacing: .1em; text-shadow: 0 2px 0 #000; }
.cast-head .tl { color: var(--arcane-hi); font-size: 13px; letter-spacing: .12em; }
.ring-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.ring-pick button { padding: .35em .9em; border: 1px solid var(--bronze-d); color: var(--ink-dim); background: rgba(0, 0, 0, .4); font-size: 13px; }
.ring-pick button.on { color: #fff; border-color: var(--arcane); background: linear-gradient(180deg, #2f4f9c, #1b2a57); box-shadow: 0 0 12px rgba(79, 123, 217, .5); }
.ring-pick button:disabled { opacity: .3; }
.cast-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; margin: 6px 0 14px; }
.cast-info dt { color: var(--ink-faint); letter-spacing: .1em; }
.cast-info dd { margin: 0; color: var(--ink-2); }

/* ── 浮层 ── */
#layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.backdrop { position: absolute; inset: 0; background: rgba(3, 2, 1, 0.7); backdrop-filter: blur(3px); pointer-events: auto; animation: fadeIn .3s ease both; }
.backdrop.out { animation: fadeOut .3s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); pointer-events: auto; display: flex; flex-direction: column; background: var(--corners), var(--panel-bg); border-left: 1px solid var(--bronze); box-shadow: -30px 0 60px rgba(0, 0, 0, 0.7); animation: drawerIn .45s var(--ease) both; }
.drawer.out { animation: drawerOut .3s var(--ease-in) both; }
@keyframes drawerIn { from { transform: translateX(100%); } }
@keyframes drawerOut { to { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 14px; border-bottom: 1px solid var(--bronze-d); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px 30px; }
.modal-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.modal { pointer-events: auto; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--corners), var(--panel-bg); border: 1px solid var(--bronze); box-shadow: var(--bevel), var(--shadow); animation: modalIn .45s var(--ease) both; position: relative; }
.modal.wide { width: min(1000px, 100%); }
.modal.out { animation: modalOut .25s var(--ease-in) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97); filter: blur(4px); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { padding: 26px 30px 10px; text-align: center; }
.modal-body { padding: 10px 30px 26px; overflow-y: auto; }
.close-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.pause-menu { display: flex; flex-direction: column; gap: 10px; }
.pause-menu .btn { width: 100%; }
.pause-menu .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pause-menu .count { font-family: var(--f-latin); font-size: 12px; opacity: .7; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--bronze-d); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 10px 16px; color: var(--ink-dim); font-family: var(--f-title); font-weight: 600; letter-spacing: .15em; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .2s; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--gold-hi); border-bottom-color: var(--blood-hi); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.toggle-row .tx b { font-weight: 600; font-size: 14.5px; display: block; }
.toggle-row .tx span { font-size: 12.5px; color: var(--ink-faint); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.test-out { font-size: 13px; padding: 10px 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--bronze-d); color: var(--ink-2); white-space: pre-wrap; }
.test-out.err { color: #f0a595; border-color: rgba(210, 64, 47, .5); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.save-slot { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-height: 130px; animation: cardIn .45s var(--ease) both; }
.save-slot.empty { border-style: dashed; align-items: center; justify-content: center; color: var(--ink-faint); }
.save-slot .sh { display: flex; justify-content: space-between; align-items: baseline; }
.save-slot .sh b { font-family: var(--f-title); font-weight: 700; font-size: 16px; color: var(--gold-hi); }
.save-slot .sn { font-size: 11px; color: var(--ink-faint); font-family: var(--f-latin); letter-spacing: .2em; }
.save-slot .sm { font-size: 12.5px; color: var(--ink-dim); }
.save-slot .sx { font-size: 12px; color: var(--ink-faint); font-style: italic; flex: 1; }
.save-slot .row { gap: 6px; flex-wrap: wrap; }

/* 人物录 */
.person { border: 1px solid var(--bronze-d); background: rgba(0, 0, 0, 0.35); margin-bottom: 10px; overflow: hidden; transition: border-color .3s, box-shadow .3s; animation: fadeUp .45s var(--ease) both; }
.person.focus { border-color: var(--bronze-hi); box-shadow: 0 0 24px rgba(201, 162, 94, 0.2); }
.person-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; width: 100%; text-align: left; }
.person-head .av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--f-brush); font-size: 20px; color: var(--gold-hi); background: radial-gradient(circle at 40% 35%, #4a120d, #140403); box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--bronze); }
.person.absent .av { filter: grayscale(.7); opacity: .7; }
.person-head .pt { flex: 1; min-width: 0; }
.person-head b { font-family: var(--f-title); font-weight: 700; font-size: 16px; }
.person-head .rl { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-head .chev { color: var(--ink-faint); transition: transform .3s; }
.person.open .chev { transform: rotate(90deg); }
.person .tags { padding: 0 14px 10px 66px; }
.person-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.person.open .person-body { grid-template-rows: 1fr; }
.person-body > div { overflow: hidden; }
.person-body dl { margin: 0; padding: 4px 16px 6px 66px; display: grid; gap: 4px; font-size: 13.5px; }
.person-body dt { font-size: 11.5px; color: var(--bronze); letter-spacing: .2em; }
.person-body dd { margin: 0 0 4px; color: var(--ink-2); line-height: 1.7; }
.person-body .acts { padding: 4px 16px 14px 66px; display: flex; gap: 8px; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.history-list li { font-size: 13px; color: var(--ink-dim); padding-left: 12px; border-left: 1px solid var(--bronze-d); }
.group-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 0; color: var(--ink-dim); font-family: var(--f-title); font-weight: 600; letter-spacing: .2em; }
.group-toggle:hover { color: var(--gold-hi); }
.group-toggle .chev { transition: transform .3s; }
.group-toggle.open .chev { transform: rotate(90deg); }

/* 角色卷 */
.char-hero { display: flex; gap: 18px; align-items: center; margin: 14px 0 8px; }
.char-hero .portrait { --s: 72px; }
.char-hero h2 { margin: 0; font-family: var(--f-title); font-weight: 900; font-size: 26px; color: var(--gold-hi); letter-spacing: .08em; text-shadow: 0 2px 0 #000; }
.trait-mini { padding: 10px 12px; border: 1px solid var(--bronze-d); background: rgba(0, 0, 0, 0.35); margin-bottom: 8px; }
.trait-mini .thead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trait-mini b { font-family: var(--f-title); font-weight: 700; font-size: 15px; }
.trait-mini p { margin: 4px 0 0; font-size: 13px; color: var(--ink-dim); }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.items li { display: flex; gap: 10px; font-size: 14px; padding: 8px 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--bronze-d); }
.items li span { color: var(--ink-faint); font-size: 12.5px; }
.prose { color: var(--ink-2); font-size: 14.5px; line-height: 1.95; text-align: justify; }
.chapter { padding: 12px 0; border-bottom: 1px dashed var(--bronze-d); }
.chapter h4 { margin: 0 0 4px; font-family: var(--f-title); font-weight: 700; font-size: 16px; color: var(--gold-hi); letter-spacing: .1em; display: flex; justify-content: space-between; gap: 10px; }
.chapter h4 span { font-size: 12px; color: var(--ink-faint); font-weight: 400; }
.chapter p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.85; }
.thread { display: flex; gap: 10px; padding: 8px 0; font-size: 14px; }
.thread .st { flex: none; width: 20px; text-align: center; color: var(--blood-hi); }
.thread.done { color: var(--ink-faint); } .thread.done b { text-decoration: line-through; }
.thread.failed { color: var(--bane); }
.thread b { font-weight: 600; }
.thread span { color: var(--ink-dim); font-size: 13px; display: block; }

/* 典籍 */
.codex { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; min-height: 60vh; }
.codex-nav { border-right: 1px solid var(--bronze-d); padding-right: 14px; display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; }
.codex-nav button { text-align: left; padding: 6px 10px; color: var(--ink-dim); font-size: 14px; transition: all .2s; border-left: 2px solid transparent; }
.codex-nav button:hover { color: var(--ink); background: rgba(201, 162, 94, .06); }
.codex-nav button.on { color: var(--gold-hi); border-left-color: var(--blood-hi); background: rgba(142, 27, 22, .2); }
.codex-content { max-height: 70vh; overflow-y: auto; padding-right: 8px; }
.codex-content h3 { font-family: var(--f-title); font-weight: 700; font-size: 18px; color: var(--gold-hi); letter-spacing: .1em; margin: 20px 0 8px; }
.codex-content h3:first-child { margin-top: 0; }
.codex-content p { margin: 0 0 .8em; color: var(--ink-2); line-height: 1.95; font-size: 14.5px; text-align: justify; }
.codex-content mark { background: rgba(142, 27, 22, 0.5); color: #fff; }
.codex-title { font-family: var(--f-title); font-weight: 900; font-size: 26px; color: var(--gold-hi); margin: 0 0 12px; letter-spacing: .15em; }

/* 吐司与横幅 */
#toasts { position: fixed; left: 50%; top: 68px; transform: translateX(-50%); z-index: 96; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: var(--panel-bg); border: 1px solid var(--bronze); box-shadow: var(--shadow); font-size: 14px; color: var(--ink); animation: toastIn .5s var(--ease) both; }
.toast.out { animation: toastOut .4s var(--ease-in) both; }
.toast .ti { font-family: var(--f-brush); color: var(--gold-hi); font-size: 18px; }
.toast.err { border-color: var(--blood-hi); color: #f0b7a8; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }
.scene-banner { position: fixed; left: 0; right: 0; top: 36%; z-index: 40; text-align: center; pointer-events: none; font-family: var(--f-title); font-weight: 900; letter-spacing: .5em; color: var(--gold-hi); font-size: 30px; text-shadow: 0 3px 0 #000, 0 0 30px rgba(0, 0, 0, .9), 0 0 24px rgba(210, 64, 47, .4); animation: banner 3.2s var(--ease) both; }
.scene-banner small { display: block; font-size: 13px; letter-spacing: .4em; color: var(--ink-dim); margin-top: 6px; font-weight: 400; }
.scene-banner::before, .scene-banner::after { content: ''; display: block; width: 360px; max-width: 70vw; height: 1px; margin: 12px auto; background: linear-gradient(90deg, transparent, var(--bronze-hi), transparent); }
@keyframes banner { 0% { opacity: 0; transform: translateY(10px); filter: blur(8px); letter-spacing: .8em; } 20%, 70% { opacity: 1; transform: none; filter: none; } 100% { opacity: 0; filter: blur(6px); } }

/* ── 施法特效（DOM 部分） ── */
#vfx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }
.vfx-flash { position: fixed; inset: 0; z-index: 89; pointer-events: none; background: radial-gradient(circle at 50% 46%, var(--c), transparent 75%); opacity: 0; animation: vfxFlash .5s ease-out forwards; }
@keyframes vfxFlash { 10% { opacity: var(--s, .8); } 100% { opacity: 0; } }
.vfx-vignette { position: fixed; inset: 0; z-index: 88; pointer-events: none; background: radial-gradient(ellipse at center, transparent 35%, var(--c) 100%); opacity: 0; animation: vfxVig 1.8s ease-in-out forwards; }
@keyframes vfxVig { 20%, 60% { opacity: 1; } 100% { opacity: 0; } }
.vfx-dim { position: fixed; inset: 0; z-index: 88; pointer-events: none; background: rgba(0, 0, 10, .6); animation: vfxVig 2.8s ease-in-out forwards; opacity: 0; }
.vfx-card { position: fixed; left: 0; right: 0; top: 18%; z-index: 91; text-align: center; pointer-events: none; animation: vfxCard 2.4s var(--ease) forwards; }
.vfx-card .vfx-sub { font-family: var(--f-latin); letter-spacing: .6em; font-size: 13px; color: var(--c2); text-shadow: 0 0 10px var(--c); }
.vfx-card .vfx-name { font-family: var(--f-brush); font-size: clamp(48px, 7vw, 86px); color: #fff; line-height: 1.1; text-shadow: 0 0 20px var(--c), 0 0 50px var(--c), 0 4px 0 #000; }
@keyframes vfxCard { 0% { opacity: 0; transform: scale(1.3); filter: blur(10px); letter-spacing: .5em; } 18% { opacity: 1; transform: scale(1); filter: none; letter-spacing: .1em; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); filter: blur(4px); } }
.shake-s { animation: shk .35s linear; } .shake-m { animation: shk .5s linear; } .shake-l { animation: shkL .75s linear; }
@keyframes shk { 10%, 50%, 90% { transform: translate(-3px, 2px); } 30%, 70% { transform: translate(3px, -2px); } }
@keyframes shkL { 10%, 50%, 90% { transform: translate(-8px, 4px) rotate(-.3deg); } 30%, 70% { transform: translate(8px, -5px) rotate(.3deg); } }
.vfx-desat { filter: grayscale(.75) brightness(.8) hue-rotate(40deg); transition: filter .6s; }
.vfx-chroma { animation: chroma 1.4s ease-in-out; }
@keyframes chroma { 25% { filter: hue-rotate(40deg) saturate(1.8) blur(.6px); } 50% { filter: hue-rotate(-30deg) saturate(1.4); } 75% { filter: hue-rotate(20deg) blur(1px); } }
.vfx-blur { animation: vblur 1.2s ease-in-out; }
@keyframes vblur { 40% { filter: blur(3px) brightness(.7); } }

/* 升级图标（法术格上的元素色） */
.sicon { --s: 40px; width: var(--s); height: var(--s); display: grid; place-items: center; font-family: var(--f-brush); font-size: calc(var(--s) * .55); color: #fff; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 60%, #000), #06050a 80%); box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--bronze-d); text-shadow: 0 0 10px var(--c2); }

/* ── 响应式 ── */
@media (max-width: 1240px) {
  .game-main { grid-template-columns: 250px minmax(0, 1fr) 340px; }
  .two-col { grid-template-columns: 1fr; }
  .detail { position: relative; }
  .ident-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .game-main { grid-template-columns: minmax(0, 1fr) 330px; }
  .side.left { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .create-head, .create-pane, .create-foot { padding-left: 14px; padding-right: 14px; }
  .create-head { flex-direction: column; align-items: flex-start; }
  .step span { display: none; }
  .sheet { grid-template-columns: 1fr; }
  .abil-assign { grid-template-columns: repeat(2, 1fr); }
  .game-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .story-col { padding: 22px 16px 30px; }
  .side.right { border-left: 0; border-top: 1px solid var(--bronze-d); max-height: 42vh; padding: 12px 14px; }
  .topbar { padding: 6px 10px; }
  .where .when .wx, .nav .music-label { display: none; }
  .hotbar { padding: 8px 10px; gap: 8px; }
  .slot { width: 46px; height: 46px; }
  .codex { grid-template-columns: 1fr; }
  .codex-nav { border-right: 0; border-bottom: 1px solid var(--bronze-d); max-height: 150px; padding: 0 0 10px; }
  .modal-body { padding: 10px 16px 22px; }
  .form .two { grid-template-columns: 1fr; }
  .turn-text { text-align: left; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
.reduce-motion .fog { display: none; }
@media (prefers-reduced-motion: reduce) { .fog { display: none; } }
