:root {
  --bg: #07060a;
  --panel: #0d0b11;
  --panel-soft: #141019;
  --line: rgba(218, 198, 157, 0.22);
  --line-bright: rgba(236, 214, 168, 0.52);
  --ivory: #eee7da;
  --muted: #a59b91;
  --gold: #c8a86a;
  --gold-bright: #f1d497;
  --blood: #9c3e44;
  --pink: #d668a0;
  --pink-dark: #5f2748;
  --green: #7ea78e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ivory);
  background:
    radial-gradient(circle at 52% -15%, rgba(90, 65, 77, 0.3), transparent 38%),
    #050407;
  font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

button { font: inherit; }
button:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: 0.42; }

.app-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.ambient-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  z-index: 20;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.33'/%3E%3C/svg%3E");
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  padding: 0 34px;
  border-bottom: 1px solid rgba(221, 202, 168, 0.14);
  background: linear-gradient(180deg, rgba(8, 7, 10, 0.98), rgba(8, 7, 10, 0.82));
  backdrop-filter: blur(14px);
}

.topbar-lead {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  flex-shrink: 1;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  color: var(--ivory);
  border: 0;
  background: transparent;
  cursor: default;
  text-align: left;
}

.brand-button strong { display: block; font-family: Georgia, "Songti SC", serif; letter-spacing: 0.2em; }
.brand-button small { display: block; margin-top: 2px; color: #82786f; font-size: calc(8px * var(--fs, 1)); letter-spacing: 0.18em; }
.brand-mark { color: var(--gold); font-size: calc(28px * var(--fs, 1)); transform: rotate(45deg); }

.run-summary { display: flex; height: 72px; margin-left: auto; }
.summary-item {
  min-width: 100px;
  display: grid;
  place-content: center;
  padding: 0 20px;
  border-left: 1px solid rgba(221, 202, 168, 0.1);
  text-align: center;
}
.summary-item:last-child { border-right: 1px solid rgba(221, 202, 168, 0.1); }
.summary-item small { color: #756e68; font-size: calc(10px * var(--fs, 1)); letter-spacing: 0.22em; }
.summary-item b { margin-top: 2px; color: #ddd2c1; font-family: Georgia, serif; font-size: calc(14px * var(--fs, 1)); font-weight: 500; }
.summary-item.fog-summary { min-width: 132px; }
.fog-summary b { color: #e1b0ca; }
.top-fog-track { display: block; width: 88px; height: 3px; margin: 5px auto 0; overflow: hidden; background: rgba(215, 106, 163, .13); }
.top-fog-track > i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #8c3c68, #e883b8); box-shadow: 0 0 10px #d66aa3; transition: width .35s ease; }

.top-actions { display: flex; gap: 8px; margin-left: 18px; }
.icon-button, .text-button {
  color: #b9aea2;
  border: 1px solid rgba(220, 198, 160, 0.2);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}
.icon-button { min-width: 56px; padding: 9px 13px; font-size: calc(12px * var(--fs, 1)); letter-spacing: 0.12em; }
.return-title-button { min-width: 106px; color: #d2c5b7; border-color: rgba(220, 198, 160, .3); }
.icon-button:hover, .text-button:hover { color: var(--gold-bright); border-color: rgba(220, 188, 130, 0.48); }
.text-button { padding: 8px 15px; }

.screen-stack { min-height: 100vh; }
.screen { display: none; min-height: 100vh; padding-top: 72px; }
.screen.is-active { display: flex; }

.title-screen {
  position: relative;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4, 4, 6, 0.99) 0%, rgba(7, 6, 9, 0.89) 42%, rgba(9, 6, 10, 0.38) 75%, rgba(5, 4, 7, 0.7) 100%),
    radial-gradient(ellipse at 76% 40%, rgba(205, 106, 160, 0.24), transparent 22%),
    linear-gradient(145deg, #0b0a0e, #17111a 45%, #08070b 46%);
}

.title-screen::before {
  content: "";
  position: absolute;
  inset: 0 0 0 43%;
  opacity: 0.66;
  background:
    linear-gradient(90deg, transparent, rgba(10, 8, 12, 0.12)),
    repeating-linear-gradient(90deg, transparent 0 90px, rgba(195, 173, 139, 0.08) 91px 93px),
    repeating-linear-gradient(0deg, transparent 0 110px, rgba(195, 173, 139, 0.06) 111px 113px);
  clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%, 13% 78%, 3% 58%, 18% 34%);
}

.title-screen::after {
  content: "";
  position: absolute;
  right: 10%;
  bottom: -10%;
  width: min(38vw, 560px);
  aspect-ratio: .62;
  border-radius: 50% 50% 0 0;
  opacity: 0.25;
  filter: blur(2px);
  background: linear-gradient(90deg, transparent, #000 22% 78%, transparent);
  box-shadow: 0 -130px 130px rgba(0, 0, 0, 0.85);
}

.title-content {
  width: min(620px, 50vw);
  margin-left: clamp(7vw, 10vw, 150px);
  position: relative;
  z-index: 3;
}

.eyebrow { margin: 0 0 12px; color: var(--gold); font-size: calc(11px * var(--fs, 1)); letter-spacing: 0.32em; text-transform: uppercase; }
.title-content h1 {
  margin: 0;
  font-family: Georgia, "STSong", serif;
  font-size: calc(clamp(62px, 7.6vw, 116px) * var(--fs, 1));
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 0.96;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}
.title-content h1 span { color: var(--gold-bright); }
.title-subtitle { margin: 30px 0 38px; color: #b4aaa0; font-family: "STSong", serif; font-size: calc(17px * var(--fs, 1)); line-height: 1.9; letter-spacing: 0.08em; }
.title-menu { width: min(390px, 100%); display: grid; gap: 10px; }

.primary-button, .secondary-button {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px 14px 24px;
  cursor: pointer;
  text-align: left;
}
.primary-button {
  color: #17110a;
  border: 1px solid #e3c989;
  background: linear-gradient(110deg, #d8bc7e, #a7854b);
  box-shadow: 0 12px 30px rgba(160, 120, 61, 0.18);
}
.secondary-button { color: #c9bba9; border: 1px solid var(--line); background: rgba(12, 10, 14, 0.72); }
.primary-button span, .secondary-button span { font-family: "STSong", serif; font-size: calc(18px * var(--fs, 1)); letter-spacing: 0.16em; }
.primary-button small, .secondary-button small { max-width: 140px; opacity: 0.68; font-size: calc(10px * var(--fs, 1)); text-align: right; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.secondary-button:not(:disabled):hover { border-color: var(--gold); color: var(--gold-bright); }
.version-stamp { position: absolute; right: 28px; bottom: 24px; z-index: 3; color: #5e5651; font-size: calc(9px * var(--fs, 1)); letter-spacing: 0.18em; }

.title-mist { position: absolute; border-radius: 50%; filter: blur(60px); background: rgba(201, 92, 151, 0.22); animation: breathe 8s ease-in-out infinite alternate; }
.title-mist-a { width: 480px; height: 170px; right: -80px; bottom: 15%; }
.title-mist-b { width: 300px; height: 110px; right: 25%; top: 30%; animation-delay: -3s; }
@keyframes breathe { to { transform: translate(-42px, 18px) scale(1.13); opacity: .54; } }

.slot-screen, .character-screen {
  flex-direction: column;
  padding: 118px clamp(28px, 8vw, 120px) 46px;
  overflow: auto;
  background:
    radial-gradient(circle at 80% 20%, rgba(125, 69, 103, 0.13), transparent 30%),
    linear-gradient(130deg, #09080c, #110d14 55%, #070609);
}

.character-screen {
  background:
    radial-gradient(circle at 50% 24%, rgba(159, 124, 91, .12), transparent 30%),
    radial-gradient(circle at 82% 60%, rgba(126, 55, 94, .12), transparent 34%),
    linear-gradient(130deg, #09080c, #100d13 55%, #070609);
}

.character-select-grid {
  flex: 1;
  min-height: 470px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.character-card {
  min-width: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a090c;
  box-shadow: var(--shadow);
  color: var(--ivory);
  text-align: left;
}

button.character-card { padding: 0; cursor: pointer; }
.character-card.available:hover { border-color: var(--gold); transform: translateY(-3px); }
.character-card.available::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 45%, rgba(255,255,255,.09) 50%, transparent 55%);
  transform: translateX(-120%);
  transition: transform .7s ease;
}
.character-card.available:hover::after { transform: translateX(120%); }
.character-card img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 20%; filter: saturate(.82) contrast(1.08); }
.character-card-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(4,3,5,.96) 96%); }
.character-number { position: absolute; left: 18px; top: 18px; z-index: 3; color: var(--gold); font-family: Georgia, serif; font-size: calc(10px * var(--fs, 1)); letter-spacing: .2em; }
.character-card-copy { position: absolute; z-index: 3; left: 22px; right: 22px; bottom: 25px; border-left: 2px solid var(--gold); padding-left: 12px; }
.character-card-copy small, .character-card-copy strong, .character-card-copy em { display: block; }
.character-card-copy small { color: #9d9185; font-size: calc(9px * var(--fs, 1)); letter-spacing: .13em; }
.character-card-copy strong { margin: 5px 0 8px; font-family: Georgia, "STSong", serif; font-size: calc(clamp(24px, 2.6vw, 38px) * var(--fs, 1)); font-weight: 400; letter-spacing: .1em; }
.character-card-copy em { color: #9f9388; font-size: calc(10px * var(--fs, 1)); font-style: normal; }
.select-callout { position: absolute; z-index: 4; right: 20px; top: 17px; color: #e5c98d; font-size: calc(10px * var(--fs, 1)); letter-spacing: .12em; }
.character-card.locked { filter: saturate(.4); }
.character-card.locked::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,.8)); }
.locked-silhouette { position: absolute; left: 50%; bottom: 0; width: 74%; height: 88%; transform: translateX(-50%); background: radial-gradient(circle at 50% 15%, #17151a 0 10%, transparent 10.5%), linear-gradient(90deg, transparent 8%, #111014 24% 76%, transparent 92%); clip-path: polygon(30% 0, 70% 0, 78% 14%, 72% 22%, 94% 42%, 100% 100%, 0 100%, 6% 42%, 28% 22%, 22% 14%); filter: blur(1px); }
.locked-silhouette.alternate { width: 62%; height: 82%; clip-path: polygon(37% 0, 63% 0, 70% 18%, 91% 41%, 78% 100%, 22% 100%, 9% 41%, 30% 18%); }
.chain { position: absolute; z-index: 5; left: -18%; top: 44%; width: 140%; height: 15px; opacity: .72; transform: rotate(28deg); background: repeating-linear-gradient(90deg, #2a272c 0 8px, #797077 8px 10px, #18171a 10px 20px); border: 1px solid #0b0a0d; box-shadow: 0 4px 8px #000; }
.chain-b { top: 58%; transform: rotate(-24deg); }
.lock-seal { position: absolute; z-index: 7; left: 50%; top: 49%; transform: translate(-50%, -50%) rotate(-3deg); padding: 9px 18px; color: #8f8580; border: 1px solid #5c5555; background: #151316; font-size: calc(10px * var(--fs, 1)); letter-spacing: .24em; white-space: nowrap; }
.character-card.locked .character-card-copy { z-index: 7; border-color: #5f5754; }
.character-select-note { padding-top: 20px; color: #756d67; font-size: calc(10px * var(--fs, 1)); letter-spacing: .1em; text-align: center; }
.character-select-note span { margin-right: 8px; color: var(--gold); }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.panel-heading-actions { display: flex; gap: 8px; }
.panel-heading h2 { margin: 0; font-family: Georgia, "STSong", serif; font-size: calc(34px * var(--fs, 1)); font-weight: 400; letter-spacing: 0.12em; }
.panel-intro { margin: 18px 0 30px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
.save-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.save-card {
  position: relative;
  min-height: 236px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(29, 24, 32, .88), rgba(10, 9, 12, .96));
  box-shadow: var(--shadow);
}
.save-card::after { content: ""; position: absolute; width: 140px; height: 140px; top: -70px; right: -70px; transform: rotate(45deg); border: 1px solid rgba(213, 183, 126, 0.12); }
.save-card:hover { border-color: rgba(221, 191, 134, 0.5); transform: translateY(-2px); }
.save-index { color: var(--gold); font-family: Georgia, serif; font-size: calc(11px * var(--fs, 1)); letter-spacing: 0.2em; }
.save-card h3 { margin: 36px 0 8px; font-family: Georgia, "STSong", serif; font-size: calc(24px * var(--fs, 1)); font-weight: 400; }
.save-card p { min-height: 42px; margin: 0; color: #8e8379; font-size: calc(12px * var(--fs, 1)); line-height: 1.7; }
.save-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 22px 0; background: rgba(230, 205, 163, 0.12); }
.save-stats div { padding: 10px; background: #0d0b10; text-align: center; }
.save-stats small { display: block; color: #706861; font-size: calc(9px * var(--fs, 1)); }
.save-stats b { display: block; margin-top: 4px; color: #cbbfb0; font-size: calc(12px * var(--fs, 1)); font-weight: 500; }
.save-actions { display: flex; gap: 8px; }
.save-actions button { flex: 1; padding: 10px; cursor: pointer; }
.load-slot { color: #16110a; border: 1px solid #c3a15f; background: #c3a15f; }
.export-slot { color: #c7b79e; border: 1px solid var(--line); background: transparent; }
.export-slot:hover { color: var(--gold-bright); border-color: var(--gold); }
.delete-slot { flex: 0 0 42px !important; color: #9f8d82; border: 1px solid var(--line); background: transparent; }
.empty-slot-note { padding: 11px; color: #5f5853; border: 1px dashed rgba(220,197,157,.13); font-size: calc(9px * var(--fs, 1)); letter-spacing: .16em; text-align: center; }
.archive-footer { display: flex; justify-content: flex-end; gap: 50px; margin-top: auto; padding-top: 32px; color: #746b65; font-size: calc(11px * var(--fs, 1)); }
.archive-footer span, .archive-footer b { display: block; }
.archive-footer b { margin-top: 5px; color: #bbb0a5; font-size: calc(13px * var(--fs, 1)); font-weight: 500; }

.game-screen { flex-direction: column; height: 100vh; overflow: hidden; background: #07060a; }
.dungeon-stage { position: relative; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr) 310px; overflow: hidden; background: linear-gradient(180deg, #17131a 0%, #0b090d 100%); }
.dungeon-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.92;
  background:
    linear-gradient(180deg, rgba(6, 5, 8, .2), rgba(6, 5, 8, .78)),
    radial-gradient(ellipse at 50% 100%, rgba(112, 86, 69, .24), transparent 55%),
    repeating-linear-gradient(90deg, transparent 0 138px, rgba(167, 145, 116, .04) 139px 141px),
    repeating-linear-gradient(0deg, transparent 0 92px, rgba(167, 145, 116, .035) 93px 95px);
}
.dungeon-stage[data-room="safe"] { background: linear-gradient(180deg, #1e1a18, #0b0a0b); }
.dungeon-stage[data-room="altar"] { background: radial-gradient(circle at 50% 42%, rgba(92,24,43,.18), transparent 34%), linear-gradient(180deg, #181219, #08070a); }
.dungeon-stage[data-room="event"] { background: linear-gradient(180deg, #151927, #09090c); }
.dungeon-stage[data-room="battle"] { background: linear-gradient(180deg, #1b1115, #08070a); }
.stage-vignette { position: absolute; inset: 0; pointer-events: none; z-index: 7; box-shadow: inset 0 0 160px rgba(0, 0, 0, .92); }

.route-rail { position: relative; z-index: 9; display: flex; flex-direction: column; align-items: center; padding-top: 24px; border-right: 1px solid rgba(218, 198, 157, .14); background: rgba(8, 7, 10, .76); }
.floor-emblem { width: 55px; height: 64px; display: grid; place-content: center; border: 1px solid rgba(215, 185, 127, .28); clip-path: polygon(50% 0, 100% 22%, 90% 83%, 50% 100%, 10% 83%, 0 22%); text-align: center; }
.floor-emblem span { color: var(--gold-bright); font-family: Georgia, serif; font-size: calc(18px * var(--fs, 1)); }
.floor-emblem small { color: #776d63; font-size: calc(8px * var(--fs, 1)); letter-spacing: .18em; }
.route-track { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 3px; padding: 12px 0 18px; }
.route-track::before { content: ""; position: absolute; top: 13%; bottom: 13%; left: 50%; width: 1px; background: rgba(204, 174, 117, .24); }
.route-dot { position: relative; z-index: 1; width: 11px; height: 11px; transform: rotate(45deg); border: 1px solid #62584e; background: #0c0a0e; }
.route-dot.passed { border-color: #a68957; background: #7e633a; }
.route-dot.current { width: 15px; height: 15px; border-color: var(--gold-bright); background: var(--gold); box-shadow: 0 0 18px rgba(235, 202, 130, .45); }

.scene-area { position: relative; z-index: 8; min-width: 0; display: flex; flex-direction: column; padding: 24px clamp(26px, 4vw, 66px) 22px; }
.dungeon-stage.intro-chamber .scene-area {
  background:
    linear-gradient(180deg, rgba(4, 4, 7, .16), rgba(4, 3, 6, .08) 44%, rgba(4, 3, 6, .58)),
    url("场景/初始房间-召唤大厅.png") center 53% / cover no-repeat;
}
.dungeon-stage:not(.intro-chamber) .scene-area {
  background:
    linear-gradient(180deg, rgba(4, 4, 7, .28), rgba(4, 3, 6, .12) 44%, rgba(4, 3, 6, .66)),
    var(--room-bg, none) center / cover no-repeat;
}
.dungeon-stage:not(.intro-chamber)[data-room="battle"] .scene-header,
.dungeon-stage:not(.intro-chamber)[data-room="event"] .scene-header,
.dungeon-stage:not(.intro-chamber)[data-room="altar"] .scene-header,
.dungeon-stage:not(.intro-chamber)[data-room="safe"] .scene-header { position: relative; z-index: 5; text-shadow: 0 2px 16px #000; }
.dungeon-stage.intro-chamber::before { opacity: .18; }
.dungeon-stage.intro-chamber .scene-header { position: relative; z-index: 5; text-shadow: 0 2px 16px #000; }
.scene-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.scene-kicker { margin: 0 0 6px; color: var(--gold); font-size: calc(9px * var(--fs, 1)); letter-spacing: .25em; }
.scene-header h2 { margin: 0; font-family: Georgia, "STSong", serif; font-size: clamp(16px, 1.9vw, 26px); font-weight: 400; letter-spacing: .08em; }
.dice-history-rail { position: relative; z-index: 9; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid rgba(218, 198, 157, .14); background: linear-gradient(180deg, rgba(8, 7, 10, .92), rgba(8, 6, 10, .78)); }
.dice-history-heading { flex: 0 0 auto; padding: 18px 18px 14px; border-bottom: 1px solid rgba(218, 198, 157, .12); }
.dice-history-heading span, .dice-history-heading small { display: block; }
.dice-history-heading span { color: #d8cbbd; font: 500 calc(12px * var(--fs, 1)) Georgia, "Songti SC", serif; letter-spacing: .12em; }
.dice-history-heading small { margin-top: 4px; color: #665d58; font-size: calc(8px * var(--fs, 1)); letter-spacing: .2em; }
.dice-readout { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; scrollbar-width: thin; scrollbar-color: #5f4452 rgba(255,255,255,.03); }
.dice-readout:empty::before { content: "尚无判定记录\A你的每一次投掷都会留在这里。"; display: block; padding: 24px 10px; color: #615954; font-size: calc(9px * var(--fs, 1)); line-height: 1.8; white-space: pre-line; text-align: center; }
.dice-action-group { position: relative; margin-bottom: 12px; padding: 0 0 12px; border-bottom: 1px solid rgba(218, 190, 138, .18); }
.dice-action-group:last-child { margin-bottom: 0; }
.dice-action-heading { display: flex; justify-content: space-between; gap: 8px; margin: 1px 2px 8px; color: #9b8e82; font-size: calc(8px * var(--fs, 1)); letter-spacing: .12em; }
.dice-action-heading b { color: #c8b9aa; font-size: calc(9px * var(--fs, 1)); font-weight: 500; }
.dice-action-heading span { color: #625956; white-space: nowrap; }
.dice-entry { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 6px; padding: 8px 8px; border: 1px solid rgba(218, 190, 138, .2); background: rgba(12, 9, 13, .78); box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.dice-face { flex: 0 0 29px; height: 29px; display: grid; place-items: center; transform: rotate(45deg); border: 1px solid var(--gold); color: var(--gold-bright); background: #171117; font: 700 calc(12px * var(--fs, 1)) Georgia, serif; }
.dice-face b { transform: rotate(-45deg); }
.dice-face.enemy { border-color: #9a5969; color: #e0a1af; }
.dice-versus { color: #5f5753; font: calc(8px * var(--fs, 1)) Georgia, serif; }
.dice-copy { min-width: 0; }
.dice-copy b, .dice-copy small { display: block; overflow: hidden; }
.dice-copy b { color: #d9cdc0; font-size: calc(9px * var(--fs, 1)); font-weight: 500; letter-spacing: .06em; }
.dice-copy small { margin-top: 3px; color: #827871; font-size: calc(8px * var(--fs, 1)); line-height: 1.45; }
.dice-entry.success .dice-face { border-color: #87b696; color: #b5d8bf; box-shadow: 0 0 14px rgba(100,180,127,.2); }
.dice-entry.failure .dice-face { border-color: #b05a67; color: #e49aa6; box-shadow: 0 0 14px rgba(190,74,94,.22); }
.dice-entry.critical .dice-face { border-color: #f0d18a; color: #fff1bf; box-shadow: 0 0 18px rgba(238,195,101,.38); }

.fog-wall { position: absolute; z-index: 6; left: -26%; top: 0; bottom: 0; width: 42%; pointer-events: none; opacity: .13; filter: blur(18px); transition: left .55s ease, opacity .55s ease; }
.fog-wall i { position: absolute; border-radius: 50%; background: rgba(218, 88, 158, .88); animation: fogFloat 5s ease-in-out infinite alternate; }
.fog-wall i:nth-child(1) { width: 88%; height: 40%; left: 0; top: 4%; }
.fog-wall i:nth-child(2) { width: 70%; height: 48%; left: 12%; top: 30%; animation-delay: -1.5s; }
.fog-wall i:nth-child(3) { width: 92%; height: 44%; left: -8%; bottom: -6%; animation-delay: -3s; }
.fog-wall i:nth-child(4) { width: 52%; height: 30%; right: -8%; top: 20%; animation-delay: -2s; }
@keyframes fogFloat { to { transform: translate(22px, 15px) scale(1.1); } }

.scene-object { flex: 1; min-height: 170px; min-width: 0; position: relative; display: grid; place-items: center; overflow-x: hidden; overflow-y: auto; padding: 8px 0 12px; }
.intro-hotspots { position: absolute; z-index: 6; inset: 0; }
.scene-hotspot { position: absolute; min-width: 120px; padding: 12px 14px; color: #d9c8b2; border: 1px solid rgba(220, 187, 129, .25); background: rgba(5, 4, 7, .72); box-shadow: 0 12px 32px rgba(0,0,0,.48), inset 0 0 20px rgba(120,83,55,.08); cursor: pointer; backdrop-filter: blur(4px); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.scene-hotspot:hover, .scene-hotspot:focus-visible { transform: translateY(-3px); color: #f0dba7; border-color: rgba(238, 205, 142, .72); background: rgba(20, 12, 17, .88); outline: none; }
.scene-hotspot span, .scene-hotspot small { display: block; }
.scene-hotspot span { font: 500 calc(13px * var(--fs, 1)) Georgia, "Songti SC", serif; letter-spacing: .12em; }
.scene-hotspot small { margin-top: 5px; color: #8f7f73; font-size: calc(8px * var(--fs, 1)); letter-spacing: .08em; }
.altar-hotspot { left: 21%; top: 42%; }
.door-hotspot { right: 13%; top: 35%; }
.door-hotspot.unlocked { border-color: rgba(186, 120, 144, .58); box-shadow: 0 0 26px rgba(172, 72, 119, .2); }
.door-silhouette { position: relative; width: 120px; height: 190px; border: 1px solid rgba(203, 177, 132, .15); border-bottom: 0; border-radius: 60px 60px 0 0; background: linear-gradient(90deg, #08070a, #161119 50%, #08070a); box-shadow: 0 0 70px rgba(0, 0, 0, .9), inset 0 0 40px #000; }
.door-rune { position: absolute; left: 50%; top: 38%; width: 26px; height: 26px; transform: translateX(-50%) rotate(45deg); border: 1px solid rgba(218, 189, 132, .35); box-shadow: inset 0 0 12px rgba(219, 188, 125, .13); }

.enemy-figure { position: relative; width: 200px; height: 245px; filter: drop-shadow(0 25px 22px rgba(0, 0, 0, .75)); animation: enemyIdle 2.8s ease-in-out infinite alternate; }
@keyframes enemyIdle { to { transform: translateY(-4px); } }
.enemy-aura { position: absolute; inset: 5% 5% 12%; border-radius: 50%; background: radial-gradient(circle, rgba(166, 59, 91, .2), transparent 65%); filter: blur(10px); }
.enemy-head { position: absolute; z-index: 2; left: 69px; top: 12px; width: 62px; height: 70px; clip-path: polygon(50% 0, 95% 28%, 80% 100%, 20% 100%, 5% 28%); background: linear-gradient(135deg, #2f2a31, #09080a 60%); border: 1px solid #5c4c4f; }
.enemy-head i { position: absolute; top: 35px; width: 12px; height: 3px; background: #dc4a6c; box-shadow: 0 0 10px #ec416c; }
.enemy-head i:first-child { left: 13px; transform: rotate(8deg); }
.enemy-head i:last-child { right: 13px; transform: rotate(-8deg); }
.enemy-body { position: absolute; z-index: 1; left: 39px; top: 70px; width: 122px; height: 142px; clip-path: polygon(21% 0, 79% 0, 100% 28%, 84% 100%, 16% 100%, 0 28%); background: linear-gradient(110deg, #0b090c 0 28%, #30292f 48%, #0b090c 77%); border: 1px solid #51444a; }
.enemy-weapon { position: absolute; z-index: 3; right: 13px; top: 66px; width: 5px; height: 170px; transform: rotate(16deg); transform-origin: bottom; background: linear-gradient(90deg, #3b3437, #a18a75, #332c31); box-shadow: 0 0 0 1px #1a171a; }
.enemy-nameplate { position: absolute; z-index: 4; left: 50%; bottom: -9px; width: 220px; transform: translateX(-50%); text-align: center; }
.enemy-nameplate span { display: block; margin-bottom: 5px; font-family: "STSong", serif; letter-spacing: .16em; }
.enemy-hp { height: 5px; background: #251015; border: 1px solid rgba(189, 90, 104, .35); }
.enemy-hp i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #7d2737, #c8495b); transition: width .25s ease; }
.enemy-nameplate small { color: #9f8585; font-size: calc(9px * var(--fs, 1)); }
.enemy-portrait { display: none; }
.enemy-figure.has-portrait { position: absolute; z-index: 3; left: 50%; top: 8px; bottom: 20px; width: clamp(180px, 24vw, 310px); max-width: 92%; margin-left: calc(clamp(180px, 24vw, 310px) / -2); height: auto; max-height: calc(100% - 28px); }
.enemy-figure.has-portrait.boss-portrait { width: clamp(210px, 29vw, 360px); margin-left: calc(clamp(210px, 29vw, 360px) / -2); }
.enemy-figure.has-portrait .enemy-head,
.enemy-figure.has-portrait .enemy-body,
.enemy-figure.has-portrait .enemy-weapon { display: none; }
.enemy-figure.has-portrait .enemy-portrait { display: block; position: absolute; z-index: 2; left: 0; top: 0; width: 100%; height: calc(100% - 42px); object-fit: contain; object-position: center bottom; pointer-events: none; user-select: none; }
/* 失落英雄二阶段立绘暂为 怪物/失落英雄_PLACEHOLDER.svg；正式图替换该文件或改 MONSTER_PORTRAITS */
.enemy-figure.has-portrait .enemy-aura { inset: 8% 8% 14%; }
.enemy-figure.hit { animation: enemyHit .26s ease; }
@keyframes enemyHit { 40% { transform: translateX(10px); filter: brightness(1.5); } }

.enemy-party { position: absolute; z-index: 4; inset: 6px 0 18px; display: flex; align-items: stretch; justify-content: center; gap: clamp(4px, 1vw, 14px); overflow: hidden; }
.enemy-party[hidden] { display: none; }
.enemy-party .enemy-figure { position: relative; inset: auto; flex: 0 1 clamp(150px, 22vw, 260px); width: clamp(150px, 22vw, 260px); max-width: 31%; height: 100%; max-height: 100%; margin: 0; padding: 0; color: inherit; border: 1px solid transparent; background: transparent; cursor: pointer; }
.enemy-party .enemy-figure:hover,
.enemy-party .enemy-figure.targeted { border-color: rgba(224, 187, 115, .6); background: radial-gradient(circle at 50% 60%, rgba(104, 70, 38, .18), transparent 64%); }
.enemy-party .enemy-figure.acting,
.enemy-figure.acting { border-color: rgba(218, 83, 112, .82); box-shadow: inset 0 0 26px rgba(174, 42, 76, .2), 0 0 20px rgba(174, 42, 76, .22); }
.enemy-party .enemy-figure.defeated { opacity: .28; filter: grayscale(1); pointer-events: none; }
.enemy-party .enemy-figure .enemy-nameplate { bottom: 2px; width: min(210px, 96%); }
.enemy-party .enemy-figure .enemy-nameplate span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(10px * var(--fs, 1)); letter-spacing: .06em; }
.enemy-party .enemy-figure .enemy-nameplate em { display: block; margin-bottom: 3px; color: #b99a69; font-size: calc(8px * var(--fs, 1)); font-style: normal; }
.enemy-party .enemy-figure .enemy-portrait { height: calc(100% - 58px); }
.enemy-party .enemy-speech { max-width: 150%; }

.event-story { display: grid; gap: 10px; max-height: min(46vh, 420px); overflow-y: auto; padding-right: 6px; }
.event-story p { margin: 0; color: #c8bdb2; line-height: 1.8; }
.event-adult-note { padding: 8px 10px; color: #d3a5b9; border-left: 2px solid var(--pink); background: rgba(117,42,79,.14); font-size: calc(9px * var(--fs, 1)); }

.object-card { position: relative; z-index: 2; width: min(560px, 94%); max-width: 100%; max-height: min(46vh, 340px); overflow-x: hidden; overflow-y: auto; padding: 18px 20px; border: 1px solid var(--line-bright); background: rgba(13, 11, 16, .86); box-shadow: var(--shadow); text-align: center; box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgba(220,190,138,.34) rgba(255,255,255,.025); }
.object-glyph { display: block; color: var(--gold-bright); font-size: calc(28px * var(--fs, 1)); }
.object-card h3 { margin: 8px 0 6px; font-family: "STSong", serif; font-size: clamp(15px, 2.1vw, 19px); font-weight: 400; letter-spacing: .06em; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.object-card p { margin: 0; color: var(--muted); font-size: calc(12px * var(--fs, 1)); line-height: 1.7; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }

.choice-layer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: min(820px, 100%); margin: 0 auto; position: relative; z-index: 4; max-height: min(48vh, 420px); overflow-x: hidden; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(220,190,138,.34) rgba(255,255,255,.025); }
.choice-card {
  position: relative;
  min-height: 78px;
  height: auto;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  padding: 13px 16px;
  overflow: visible;
  color: var(--ivory);
  border: 1px solid var(--line);
  background: rgba(10, 9, 12, .86);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}
.choice-card:hover { border-color: var(--gold); background: rgba(26, 21, 26, .94); transform: translateY(-1px); }
.choice-card::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: 0; }
.choice-card:hover::after { opacity: .72; }
.choice-index { width: 34px; height: 34px; margin-top: 2px; display: grid; place-items: center; transform: rotate(45deg); border: 1px solid rgba(214, 183, 127, .3); color: var(--gold-bright); font-family: Georgia, serif; flex-shrink: 0; }
.choice-index i { transform: rotate(-45deg); font-style: normal; }
.choice-copy { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.choice-copy b, .choice-copy small { display: block; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.choice-copy b { margin-bottom: 5px; font-family: "STSong", serif; font-size: calc(15px * var(--fs, 1)); font-weight: 400; letter-spacing: .06em; line-height: 1.4; }
.choice-copy small { color: #8f847b; font-size: calc(10px * var(--fs, 1)); line-height: 1.55; }
.route-reveal { display: block; margin-top: 5px; color: #d8bd83; font-style: normal; letter-spacing: .08em; }
.choice-arrow { align-self: center; color: #6f635b; font-size: calc(18px * var(--fs, 1)); }

.combat-layer { width: min(820px, 100%); margin: 0 auto; }
.combat-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.combat-button { min-height: 64px; padding: 11px; color: #d8cec2; border: 1px solid var(--line); background: rgba(10, 9, 12, .9); cursor: pointer; text-align: left; }
.combat-button:hover { border-color: #b89255; color: var(--gold-bright); }
.combat-button.energy { border-color: rgba(207,171,92,.3); background: rgba(58,43,17,.32); }
.combat-button.status { border-color: rgba(118,112,165,.3); background: rgba(31,28,55,.32); }
.combat-button.ejaculate { border-color: rgba(232,120,170,.6); background: linear-gradient(145deg, rgba(140,36,88,.62), rgba(72,18,52,.78)); color: #f6c6da; }
.combat-button.ejaculate:hover { border-color: #f0a8c4; color: #ffe4f0; }
.combat-button.ejaculate small { color: #d090ae; }
.combat-button.counter { border-color: rgba(111,157,137,.3); }
.combat-button:disabled { filter: grayscale(.7); }
.combat-button b, .combat-button small { display: block; }
.combat-button b { margin-bottom: 5px; font-family: "STSong", serif; font-weight: 400; }
.combat-button small { color: #7e746d; font-size: calc(9px * var(--fs, 1)); }

.hud-panel { flex: 0 0 350px; min-height: 320px; height: 350px; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: 270px 202px minmax(0, 1fr) 170px 170px; position: relative; z-index: 15; border-top: 1px solid rgba(223, 199, 154, .25); background: linear-gradient(180deg, #0e0c11, #09080b); box-shadow: 0 -20px 50px rgba(0, 0, 0, .48); }
.portrait-frame { position: relative; overflow: hidden; padding: 0; color: inherit; border: 0; border-right: 1px solid rgba(220, 197, 157, .2); background: #17141a; cursor: pointer; text-align: left; }
.portrait-frame img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 18%; filter: saturate(.78) contrast(1.06); transition: filter .2s ease; }
.portrait-frame:hover img { filter: saturate(.9) contrast(1.04) brightness(1.08); }
.portrait-frame.is-hit img { animation: portraitHit .32s ease; }
@keyframes portraitHit { 45% { transform: translateX(-7px); filter: saturate(.65) contrast(1.3) sepia(.25); } }
.portrait-frame.fog-engulfed { box-shadow: inset 0 0 28px rgba(239,74,159,.72), 0 0 24px rgba(216,54,137,.3); }
.portrait-frame.fog-engulfed::before { content: ""; position: absolute; z-index: 2; inset: -15% -35%; pointer-events: none; background: radial-gradient(ellipse at 8% 20%, rgba(244,94,174,.64), transparent 27%), radial-gradient(ellipse at 92% 46%, rgba(220,61,151,.56), transparent 31%), radial-gradient(ellipse at 25% 92%, rgba(246,128,191,.5), transparent 30%); filter: blur(11px); animation: portraitFogDrift 3.8s ease-in-out infinite alternate; }
.portrait-frame.fog-engulfed::after { content: ""; position: absolute; z-index: 3; inset: 0; pointer-events: none; border: 1px solid rgba(255,111,189,.64); box-shadow: inset 0 0 20px rgba(232,70,157,.7); animation: portraitFogPulse 2.2s ease-in-out infinite alternate; }
@keyframes portraitFogDrift { to { transform: translateX(12%) translateY(-4%) scale(1.08); opacity: .72; } }
@keyframes portraitFogPulse { to { border-color: rgba(255,164,211,.86); box-shadow: inset 0 0 34px rgba(232,70,157,.88); } }
.portrait-fade { position: absolute; z-index: 4; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(7, 6, 9, .97)); }
.portrait-open-hint { position: absolute; z-index: 5; left: 0; right: 0; top: 0; padding: 8px 10px; color: #e0c58b; background: linear-gradient(180deg, rgba(5,4,6,.88), transparent); opacity: 0; font-size: calc(8px * var(--fs, 1)); letter-spacing: .12em; text-align: center; transition: opacity .2s ease; }
.portrait-frame:hover .portrait-open-hint, .portrait-frame:focus-visible .portrait-open-hint { opacity: 1; }
.portrait-name { position: absolute; z-index: 5; left: 14px; right: 14px; bottom: 14px; border-left: 2px solid var(--gold); padding-left: 9px; }
.portrait-name small, .portrait-name b { display: block; }
.portrait-name small { color: #8f8378; font-size: calc(8px * var(--fs, 1)); letter-spacing: .14em; }
.portrait-name b { margin-top: 2px; font-family: "STSong", serif; font-weight: 400; letter-spacing: .12em; }

.status-column { display: grid; grid-template-rows: auto minmax(0, 1fr); border-right: 1px solid rgba(220, 197, 157, .18); }
.data-slot { padding: 12px 17px; }
.data-slot { border-bottom: 1px solid rgba(220, 197, 157, .13); }
.vital-row { display: flex; justify-content: space-between; align-items: baseline; color: #8f857c; font-size: calc(10px * var(--fs, 1)); }
.vital-row b { color: #d8cbc0; font-family: Georgia, serif; font-size: calc(13px * var(--fs, 1)); font-weight: 500; }
.vital-row.compact { margin-top: 13px; }
.vital-row.compact span { display: flex; align-items: center; gap: 6px; }
.bar { height: 5px; margin-top: 8px; background: #261015; }
.bar i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #7d2b36, #bd4e58); transition: width .3s ease; }
.resource-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; color: #817872; font-size: calc(8px * var(--fs, 1)); }
.resource-row b { color: #cfc4b8; font: 500 calc(9px * var(--fs, 1)) Georgia, serif; }
.resource-row + .bar { height: 4px; margin-top: 4px; position: relative; overflow: hidden; }
.desire-bar { background: #21101b; }
.desire-bar i { background: linear-gradient(90deg, #7e2e5c, #d467a5); }
.sanity-bar { background: #111728; }
.sanity-bar i { background: linear-gradient(90deg, #516d9f, #9bb2d9); }
.energy-bar { background: #1c180e; }
.energy-bar i { position: relative; z-index: 1; background: linear-gradient(90deg, #a67d31, #f1d497); }
.energy-bar em { position: absolute; z-index: 2; top: 0; right: 0; bottom: 0; width: 0; background: repeating-linear-gradient(135deg, rgba(38,20,27,.96) 0 4px, rgba(117,43,76,.88) 4px 7px); border-left: 1px solid #e073aa; transition: width .3s ease; }
.attribute-slot { min-width: 0; min-height: 0; padding: 12px 15px 10px; overflow: visible; }
.attribute-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.attribute-heading span { color: #8e8378; font-size: calc(9px * var(--fs, 1)); letter-spacing: .18em; }
.attribute-heading small { color: #554e4a; font-size: calc(7px * var(--fs, 1)); }
.attribute-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px; }
.attribute-chip { position: relative; display: flex; justify-content: space-between; gap: 5px; padding: 5px 6px; color: #817873; border: 1px solid rgba(220,197,157,.1); background: rgba(255,255,255,.018); font-size: calc(9px * var(--fs, 1)); cursor: help; }
.attribute-chip:first-child { grid-column: 1 / -1; }
.attribute-chip b { color: #eee7da; font: 500 calc(10px * var(--fs, 1)) Georgia, serif; }
.attribute-chip.increased b { color: #84c79a; }
.attribute-chip.decreased b { color: #db747c; }
.attribute-tooltip, .equipment-tooltip { position: absolute; z-index: 60; left: 50%; bottom: calc(100% + 9px); width: 220px; transform: translate(-50%, 6px); padding: 10px 12px; color: #bdb1a7; border: 1px solid rgba(220,190,138,.34); background: rgba(12,10,14,.98); box-shadow: 0 12px 34px #000; opacity: 0; visibility: hidden; pointer-events: none; font-size: calc(9px * var(--fs, 1)); line-height: 1.6; transition: .18s ease; }
.attribute-tooltip::after, .equipment-tooltip::after { content: ""; position: absolute; left: 50%; top: 100%; width: 8px; height: 8px; transform: translate(-50%,-4px) rotate(45deg); border-right: 1px solid rgba(220,190,138,.34); border-bottom: 1px solid rgba(220,190,138,.34); background: #0c0a0e; }
.attribute-chip:hover .attribute-tooltip, .attribute-chip:focus-visible .attribute-tooltip, .equipment-card:hover .equipment-tooltip, .equipment-card:focus-within .equipment-tooltip { opacity: 1; visibility: visible; transform: translate(-50%,0); }
.attribute-chip:nth-child(even) .attribute-tooltip { left: 0; transform: translate(0,6px); }
.attribute-chip:nth-child(odd):not(:first-child) .attribute-tooltip { left: auto; right: 0; transform: translate(0,6px); }
.attribute-chip:nth-child(even):hover .attribute-tooltip, .attribute-chip:nth-child(even):focus-visible .attribute-tooltip,
.attribute-chip:nth-child(odd):not(:first-child):hover .attribute-tooltip, .attribute-chip:nth-child(odd):not(:first-child):focus-visible .attribute-tooltip { transform: translate(0,0); }
.status-list { display: flex; flex-wrap: wrap; gap: 6px; }
.status-chip { width: 100%; padding: 6px 7px; color: #cdbbc2; border: 1px solid rgba(208, 107, 160, .28); background: rgba(107, 40, 76, .16); font-size: calc(8px * var(--fs, 1)); line-height: 1.35; }
.status-chip.positive { color: #b8ccb9; border-color: rgba(122, 170, 138, .3); background: rgba(48, 92, 64, .14); }
.empty-status { color: #5f5854; font-size: calc(10px * var(--fs, 1)); }

.dialogue-box { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding: 26px 30px 18px; background: linear-gradient(110deg, rgba(19, 16, 22, .96), rgba(9, 8, 11, .96)); }
.dialogue-box::before { content: ""; position: absolute; left: 0; top: 26px; bottom: 26px; width: 1px; background: linear-gradient(transparent, var(--gold), transparent); }
.speaker-line { display: flex; align-items: center; gap: 12px; color: var(--gold-bright); font-family: "STSong", serif; font-size: calc(13px * var(--fs, 1)); letter-spacing: .15em; }
.speaker-line i { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(204, 171, 110, .34), transparent); }
.dialogue-box > p { white-space: normal; min-height: 70px; flex: 1 1 auto; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(204,171,110,.4) transparent; margin: 19px 0 16px; color: #d3c9bf; font-family: "STSong", serif; font-size: calc(clamp(14px, 1.25vw, 17px) * var(--fs, 1)); line-height: 1.8; letter-spacing: .04em; }
.dialogue-line { display: block; color: #d3c9bf; }
.dialogue-line + .dialogue-line { margin-top: .22em; }
.dialogue-line.dialogue-enemy { color: #9fd1df; text-shadow: 0 0 10px rgba(76, 153, 180, .13); }
.dialogue-line.dialogue-intimate { color: #efa0d5; font-family: "STKaiti", "KaiTi", "FangSong", serif; font-style: italic; font-weight: 500; letter-spacing: .065em; text-shadow: 0 0 12px rgba(222, 83, 170, .22); }
.dialogue-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.dialogue-footer > span { color: #665f5a; font-size: calc(9px * var(--fs, 1)); letter-spacing: .08em; }
.advance-button { min-width: 92px; padding: 9px 14px; color: #cfbd9e; border: 1px solid rgba(214, 183, 127, .3); background: rgba(203, 165, 95, .05); cursor: pointer; }
.advance-button:hover { color: #16110a; background: var(--gold); }
.advance-button[hidden] { display: none; }

.quick-status-rail, .body-monitor-rail { min-width: 0; overflow: hidden; padding: 13px 10px 10px; display: flex; flex-direction: column; border-left: 1px solid rgba(220,197,157,.16); background: rgba(7,6,9,.48); }
.quick-status-heading, .body-monitor-heading { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 9px; margin-bottom: 9px; border-bottom: 1px solid rgba(220,197,157,.12); }
.quick-status-heading span, .body-monitor-heading span { color: #a99b8d; font-family: "STSong", serif; font-size: calc(12px * var(--fs, 1)); letter-spacing: .16em; }
.quick-status-heading small, .body-monitor-heading small { color: #514b47; font-size: calc(7px * var(--fs, 1)); letter-spacing: .12em; }
.quick-status-rail > .status-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: flex-start; align-items: flex-start; padding-right: 2px; scrollbar-width: thin; scrollbar-color: rgba(99, 190, 124, .3) transparent; }
.quick-status-rail .status-chip { flex: 0 0 auto; }

.body-monitor { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; border: 1px solid rgba(101, 210, 132, .22); background: radial-gradient(circle at 50% 34%, rgba(39, 96, 59, .16), rgba(5, 13, 9, .7) 67%, rgba(2, 6, 4, .9)); box-shadow: inset 0 0 24px rgba(43, 117, 65, .11); }
.body-monitor::before, .body-monitor::after { content: ""; position: absolute; z-index: 0; pointer-events: none; }
.body-monitor::before { inset: 7px; border: 1px solid rgba(109, 209, 137, .08); }
.body-monitor::after { left: 12%; right: 12%; top: 12px; height: 1px; background: linear-gradient(90deg, transparent, rgba(123, 230, 151, .42), transparent); animation: bodyScan 4.8s linear infinite; }
@keyframes bodyScan { 0% { transform: translateY(0); opacity: .2; } 45% { opacity: .75; } 100% { transform: translateY(160px); opacity: .12; } }
.body-monitor-svg { position: relative; z-index: 1; display: block; width: 100%; height: calc(100% - 20px); }
.body-grid path { fill: none; stroke: rgba(108, 192, 130, .065); stroke-width: 4; }
.body-lineart-raster { opacity: .9; filter: url(#bodyLineGreen); }
.body-eye-glow { display: none; fill: #ff76bd; opacity: var(--eye-glow-intensity, .45); filter: url(#bodyPinkGlow) drop-shadow(0 0 18px rgba(255, 92, 184, .98)); transform-box: fill-box; transform-origin: center; animation: bodyEyePulse 3.4s ease-in-out infinite; }
.body-monitor.sanity-low .body-eye-glow { display: inline; }
.body-mouth-mist { display: none; fill: none; stroke: #f778bb; stroke-width: 12; stroke-linecap: round; opacity: .22; filter: url(#bodyPinkGlow); transform-box: fill-box; transform-origin: left center; animation: bodyBreathMist 4.2s ease-in-out infinite; }
.body-monitor.desire-high .body-mouth-mist { display: inline; }
.body-mouth-mist path:nth-child(2) { opacity: .64; }
.body-mouth-mist path:nth-child(3) { opacity: .32; }
.body-negative-accessory { display: none; fill: none; stroke: #ff78bd; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(246, 67, 165, .9)); animation: invasiveEquipmentPulse 2.8s ease-in-out infinite; }
.body-negative-accessory.is-visible { display: inline; }
.body-invasion { display: none; fill: #df3e8b; opacity: .32; filter: url(#bodyInvasionGlow); transform-box: fill-box; transform-origin: center; }
.body-invasion.is-visible { display: inline; animation: bodyInvasionPulse 3.3s ease-in-out infinite; }
.body-curse-glow { display: none; fill: #209553; opacity: .42; filter: url(#bodyCurseGlow); transform-box: fill-box; transform-origin: center; }
.body-curse-glow.is-visible { display: inline; animation: bodyCursePulse 3.8s ease-in-out infinite; }
.body-parasite { display: none; fill: rgba(255, 140, 40, .14); stroke: #ff9a2e; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transform-box: fill-box; }
.body-parasite * { vector-effect: non-scaling-stroke; }
.body-parasite path:not([class]), .body-parasite circle:not([class]), .body-parasite ellipse:not([class]) { fill: rgba(255, 140, 40, .16); }
.body-parasite .body-parasite-thin { stroke-width: 1.1; fill: none; opacity: .85; }
.body-parasite .body-parasite-dot { fill: #ffb25c; stroke: none; }
.body-parasite.is-visible { display: inline; animation: bodyParasiteGlow 5.2s ease-in-out infinite; }
@keyframes bodyParasiteGlow { 0%, 100% { opacity: .55; filter: drop-shadow(0 0 3px rgba(255, 140, 40, .55)); } 50% { opacity: 1; filter: drop-shadow(0 0 11px rgba(255, 150, 50, .98)); } }
@keyframes bodyInvasionPulse { 0%, 100% { opacity: .2; transform: scale(.82); } 50% { opacity: .62; transform: scale(1.12); } }
@keyframes bodyCursePulse { 0%, 100% { opacity: .26; transform: scale(.86); } 50% { opacity: .78; transform: scale(1.1); } }
@keyframes invasiveEquipmentPulse { 0%, 100% { opacity: .72; } 50% { opacity: 1; } }
@keyframes bodyEyePulse { 0%, 100% { transform: scale(.92); } 50% { transform: scale(1.08); } }
@keyframes bodyBreathMist { 0%, 100% { opacity: 0; transform: translateX(-12px) scale(.72); } 24% { opacity: .2; } 58% { opacity: .58; transform: translateX(20px) scale(1.04); } 82% { opacity: 0; transform: translateX(46px) scale(1.22); } }

.modal.character-sheet-modal { width: min(930px, 94vw); min-height: min(600px, 88vh); padding: 26px; }
.character-sheet-head { display: grid; grid-template-columns: 72px 1fr auto; gap: 15px; align-items: center; padding: 12px 0 20px; border-bottom: 1px solid var(--line); }
.sheet-level { width: 62px; height: 62px; display: grid; place-content: center; border: 1px solid var(--gold); transform: rotate(45deg); text-align: center; }
.sheet-level span { transform: rotate(-45deg); color: var(--gold-bright); font: calc(18px * var(--fs, 1)) Georgia, serif; }
.sheet-level small { display: block; font-size: calc(7px * var(--fs, 1)); }
.sheet-title small, .sheet-title strong { display: block; }
.sheet-title small { color: #8c8177; font-size: calc(9px * var(--fs, 1)); letter-spacing: .14em; }
.sheet-title strong { margin-top: 5px; font-family: Georgia,"STSong",serif; font-size: calc(27px * var(--fs, 1)); font-weight: 400; letter-spacing: .12em; }
.sheet-summary { color: #8f857d; font-size: calc(10px * var(--fs, 1)); text-align: right; line-height: 1.7; }
.sheet-tabs { display: flex; gap: 4px; margin: 18px 0 14px; }
.sheet-tab { padding: 8px 14px; color: #8e8379; border: 1px solid rgba(220,197,157,.13); background: transparent; cursor: pointer; font-size: calc(10px * var(--fs, 1)); }
.sheet-tab.active { color: #1a130b; border-color: var(--gold); background: var(--gold); }
.sheet-body { min-height: 300px; max-height: 48vh; overflow-y: auto; padding: 4px 2px 10px; }
.sheet-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-stat-card { padding: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.sheet-stat-card span, .sheet-stat-card b, .sheet-stat-card small { display: block; }
.sheet-stat-card span { color: #8e837b; font-size: calc(9px * var(--fs, 1)); letter-spacing: .12em; }
.sheet-stat-card b { margin: 7px 0 5px; color: #eee6d9; font: calc(24px * var(--fs, 1)) Georgia, serif; }
.sheet-stat-card b.increased { color: #84c79a; }
.sheet-stat-card b.decreased { color: #db747c; }
.sheet-stat-card small { color: #665f5a; font-size: calc(8px * var(--fs, 1)); line-height: 1.55; }
.resource-detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.resource-detail-grid article { padding: 12px; border: 1px solid rgba(220,197,157,.16); background: rgba(255,255,255,.02); }
.resource-detail-grid span, .resource-detail-grid b, .resource-detail-grid small { display: block; }
.resource-detail-grid span { color: #8c8178; font-size: calc(8px * var(--fs, 1)); letter-spacing: .12em; }
.resource-detail-grid b { margin: 6px 0; color: var(--gold-bright); font: calc(18px * var(--fs, 1)) Georgia,serif; }
.resource-detail-grid small { color: #6f6660; font-size: calc(8px * var(--fs, 1)); line-height: 1.5; }
.equipment-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.equipment-card { position: relative; display: grid; grid-template-columns: 45px 1fr auto; gap: 12px; align-items: center; min-height: 88px; padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.equipment-icon { width: 42px; height: 42px; display: grid; place-items: center; transform: rotate(45deg); border: 1px solid rgba(220,190,138,.35); color: var(--gold-bright); }
.equipment-icon span { transform: rotate(-45deg); font-size: calc(19px * var(--fs, 1)); }
.equipment-copy small, .equipment-copy b { display: block; }
.equipment-copy small { color: #766d66; font-size: calc(8px * var(--fs, 1)); letter-spacing: .12em; }
.equipment-copy b { margin-top: 5px; font-family: "STSong",serif; font-size: calc(14px * var(--fs, 1)); font-weight: 400; }
.equipment-action { padding: 7px 10px; color: #b9aa99; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: calc(9px * var(--fs, 1)); }
.equipment-action:hover { color: #16110a; border-color: var(--gold); background: var(--gold); }
.equipment-action.locked, .equipment-action.locked:hover { color: #bc758e; border-color: rgba(190,73,104,.34); background: rgba(100,31,54,.14); cursor: not-allowed; }
.equipment-card.empty { border-style: dashed; opacity: .75; }
.equipment-tooltip { left: auto; right: 10px; width: min(320px,80vw); transform: translate(0,6px); }
.equipment-card:hover .equipment-tooltip, .equipment-card:focus-within .equipment-tooltip { transform: translate(0,0); }
.equipment-tooltip::after { left: 78%; }
.inventory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.inventory-item { min-height: 92px; padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.inventory-item b, .inventory-item small { display: block; }
.inventory-item b { margin-bottom: 7px; color: #d8cbbb; font-size: calc(12px * var(--fs, 1)); font-weight: 500; }
.inventory-item small { color: #716962; font-size: calc(8px * var(--fs, 1)); line-height: 1.55; }
.sheet-status-list { display: grid; gap: 8px; }
.sheet-status-row { display: grid; grid-template-columns: 150px 1fr; gap: 15px; padding: 12px 14px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.sheet-status-row b { color: #d1bec5; font-size: calc(11px * var(--fs, 1)); font-weight: 500; }
.sheet-status-row span { color: #817670; font-size: calc(9px * var(--fs, 1)); line-height: 1.6; }
.sheet-status-row.positive { border-color: rgba(111,167,126,.27); background: rgba(43,84,56,.1); }
.sheet-status-row.positive b { color: #a9d2b2; }
.sheet-status-row.negative { border-color: rgba(190,73,104,.29); background: rgba(100,31,54,.12); }
.sheet-status-row.negative b { color: #dda0b1; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(3, 3, 5, .78); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 30px; border: 1px solid var(--line-bright); background: linear-gradient(145deg, #17131a, #0b090d); box-shadow: 0 35px 100px #000; scrollbar-width: thin; scrollbar-color: rgba(220,190,138,.34) rgba(255,255,255,.025); }
.modal h2 { margin: 0 0 18px; font-family: Georgia, "STSong", serif; font-size: calc(28px * var(--fs, 1)); font-weight: 400; }
.modal-close { position: absolute; right: 14px; top: 12px; color: #80756e; border: 0; background: transparent; font-size: calc(25px * var(--fs, 1)); cursor: pointer; }
.modal-copy { color: #aaa097; font-size: calc(13px * var(--fs, 1)); line-height: 1.8; }
.modal-copy strong { color: #dfd1bf; }
.modal-warning { padding: 12px 14px; color: #cda9b9; border-left: 2px solid var(--pink); background: rgba(117, 42, 79, .14); font-size: calc(11px * var(--fs, 1)); line-height: 1.6; }
.offering-grid { display: grid; gap: 8px; margin-top: 16px; }
.offering-card { padding: 13px 14px; border: 1px solid rgba(190,73,104,.24); background: linear-gradient(90deg, rgba(104,31,55,.13), rgba(255,255,255,.012)); }
.offering-card small, .offering-card b, .offering-card p, .offering-card em { display: block; }
.offering-card small { color: #9c6679; font-size: calc(8px * var(--fs, 1)); letter-spacing: .16em; }
.offering-card b { margin-top: 4px; color: #dfc1cb; font: 500 calc(13px * var(--fs, 1)) Georgia, "Songti SC", serif; }
.offering-card p { margin: 6px 0 3px; color: #9b8f88; font-size: calc(10px * var(--fs, 1)); }
.offering-card em { color: #766b66; font-size: calc(9px * var(--fs, 1)); font-style: normal; line-height: 1.55; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.modal-actions button { padding: 10px 17px; cursor: pointer; }
.modal-primary { color: #1a130a; border: 1px solid var(--gold); background: var(--gold); }
.modal-secondary { color: #b8aca0; border: 1px solid var(--line); background: transparent; }

.toast { position: fixed; z-index: 120; left: 50%; bottom: 28px; transform: translate(-50%, 24px); padding: 11px 18px; color: #e4d7c7; border: 1px solid rgba(218, 188, 132, .35); background: rgba(12, 10, 14, .94); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s ease; font-size: calc(11px * var(--fs, 1)); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .topbar { padding: 0 18px; }
  .run-summary { margin-left: auto; }
  .summary-item { min-width: 74px; padding: 0 10px; }
  .summary-item.fog-summary { min-width: 98px; }
  .top-fog-track { width: 62px; }
  .top-actions { margin-left: 8px; gap: 5px; }
  .return-title-button { min-width: 88px; padding-inline: 9px; }
  .title-content { width: 76vw; margin-left: 9vw; }
  .save-grid { grid-template-columns: 1fr; }
  .character-select-grid { min-height: 420px; }
  .save-card { min-height: 240px; }
  .save-card h3 { margin-top: 22px; }
  .slot-screen, .character-screen { overflow: auto; }
  .hud-panel { flex-basis: 335px; grid-template-columns: 230px 150px minmax(0,1fr) 145px 145px; }
  .dialogue-box { padding: 20px 22px 14px; }
  .portrait-name b { font-size: calc(13px * var(--fs, 1)); }
  .quick-status-rail, .body-monitor-rail { padding: 11px 7px 8px; }
  .dungeon-stage { grid-template-columns: 72px minmax(0, 1fr) 250px; }
  .dice-history-heading { padding-inline: 13px; }
  .dice-readout { padding: 9px; }
}

@media (max-width: 680px) {
  body { overflow: auto; }
  .topbar { height: 60px; }
  .screen { padding-top: 60px; }
  .brand-button small { display: none; }
  .brand-button strong { font-size: calc(13px * var(--fs, 1)); }
  .soul-core-chip { height: 60px; min-width: 72px; padding: 0 10px; }
  .soul-core-chip small { display: none; }
  .run-summary { height: 60px; }
  .summary-item { min-width: 60px; padding: 0 6px; }
  .summary-item.fog-summary { min-width: 72px; }
  .summary-item small { display: none; }
  .top-fog-track { width: 50px; }
  .top-actions .icon-button { min-width: 44px; padding: 7px; }
  .return-title-button { font-size: calc(10px * var(--fs, 1)); }
  .panel-heading { align-items: flex-start; gap: 12px; }
  .panel-heading-actions { flex-direction: column; }
  .character-screen { padding: 90px 18px 30px; }
  .character-select-grid { grid-template-columns: 1fr; min-height: 1180px; }
  .character-card { min-height: 360px; }
  .game-screen { height: auto; min-height: 100vh; overflow: visible; }
  .dungeon-stage { min-height: 1040px; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: 800px 240px; }
  .route-rail { grid-column: 1; grid-row: 1; }
  .scene-area { grid-column: 2; grid-row: 1; }
  .dice-history-rail { grid-column: 1 / -1; grid-row: 2; border-left: 0; border-top: 1px solid rgba(218, 198, 157, .14); }
  .dice-history-heading { padding: 11px 14px 9px; }
  .dice-readout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
  .dice-action-group { margin: 0; padding: 0 8px 0 0; border-bottom: 0; border-right: 1px solid rgba(218,190,138,.18); }
  .scene-area { padding: 18px 14px; }
  .scene-header { gap: 10px; }
  .altar-hotspot { left: 9%; }
  .door-hotspot { right: 5%; }
  .choice-layer { grid-template-columns: 1fr; }
  .scene-object { min-height: 200px; }
  .combat-actions { grid-template-columns: 1fr; }
  .combat-button { min-height: 50px; }
  .hud-panel { height: auto; min-height: 790px; grid-template-columns: 185px 1fr; grid-template-rows: 340px auto 240px; }
  .status-column { grid-row: 1; grid-column: 1; }
  .portrait-frame { grid-row: 1; grid-column: 2; }
  .dialogue-box { grid-column: 1 / -1; grid-row: 2; min-height: 170px; border-top: 1px solid var(--line); }
  .body-monitor-rail { grid-column: 1; grid-row: 3; min-height: 230px; border-left: 0; border-top: 1px solid var(--line); }
  .quick-status-rail { grid-column: 2; grid-row: 3; min-height: 230px; border-top: 1px solid var(--line); }
  .quick-status-rail .status-list { display: grid; grid-template-columns: 1fr; align-content: start; }
  .dialogue-box > p { min-height: 52px; }
  .sheet-stat-grid, .equipment-grid { grid-template-columns: 1fr; }
  .resource-detail-grid { grid-template-columns: repeat(2,1fr); }
  .inventory-grid { grid-template-columns: repeat(2,1fr); }
  .character-sheet-head { grid-template-columns: 58px 1fr; }
  .sheet-summary { grid-column: 1 / -1; text-align: left; }
  .archive-footer { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.choice-copy small .curse-flavor, .choice-copy small .curse-effect, .choice-copy small .curse-hint { display: block; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.choice-copy small .curse-flavor { color: #a89c92; line-height: 1.6; }
.choice-copy small .curse-effect { margin-top: 6px; color: #d8bd83; }
.choice-copy small .curse-hint { margin-top: 4px; color: #8f847b; }

/* 祭坛三选一诅咒：单列完整展示 flavor/effect，避免卡片内裁切 */
.choice-layer.altar-curse-picks {
  grid-template-columns: 1fr;
  max-height: min(42vh, 360px);
  align-content: start;
}
.choice-layer.altar-curse-picks .choice-card {
  min-height: 0;
  padding: 10px 12px;
}
.choice-layer.altar-curse-picks .choice-copy small {
  font-size: calc(10.5px * var(--fs, 1));
  line-height: 1.55;
}

.story-overlay { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; padding: 56px clamp(24px, 8vw, 140px) 28px; background: radial-gradient(ellipse at 50% 30%, #1d1219 0%, #0a070b 70%, #050305 100%); animation: storyFade .6s ease; }
@keyframes storyFade { from { opacity: 0; } to { opacity: 1; } }
.story-close { position: absolute; right: 22px; top: 16px; color: #8d8179; border: 0; background: transparent; font-size: calc(34px * var(--fs, 1)); line-height: 1; cursor: pointer; }
.story-close:hover { color: var(--gold-bright, #e6c98c); }
.story-page { flex: 1; overflow-y: auto; max-width: 860px; width: 100%; margin: 0 auto; padding-right: 10px; cursor: pointer; scrollbar-width: thin; }
.story-kicker { margin: 0 0 6px; color: #8a6b78; font-size: calc(11px * var(--fs, 1)); letter-spacing: .3em; }
.story-title { margin: 0 0 26px; color: #d8bd83; font-family: "STSong", Georgia, serif; font-size: calc(30px * var(--fs, 1)); font-weight: 400; letter-spacing: .14em; }
.story-body p { margin: 0 0 20px; color: #cfc4b8; font-family: "STSong", "Songti SC", Georgia, serif; font-size: calc(17px * var(--fs, 1)); line-height: 2; text-indent: 2em; text-align: justify; min-height: 2em; }
.story-body p.story-quote { color: #e6d3c0; text-indent: 0; }
.story-foot { display: flex; align-items: center; justify-content: space-between; max-width: 860px; width: 100%; margin: 14px auto 0; }
.story-hint { color: #6f635b; font-size: calc(11px * var(--fs, 1)); }
.story-continue { margin-left: auto; padding: 10px 26px; color: #1a130a; border: 1px solid var(--gold, #cfab5c); background: var(--gold, #cfab5c); cursor: pointer; }


/* —— 暗精灵祭司战败：视频剧情弹窗（仅 .story-overlay--video；纯文字弹窗样式不变） —— */
.story-overlay.story-overlay--video {
  flex-direction: row;
  padding: 56px 56px 0 0; /* 右侧留出关闭按钮安全带，避免压视频 */
}
.story-overlay.story-overlay--video .story-main {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.story-overlay.story-overlay--video .story-page {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow-y: auto;
  padding: 8px 24px 28px 20px;
  cursor: default;
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 190, 138, .35) transparent;
}
.story-overlay.story-overlay--video .story-kicker {
  margin: 0 0 6px;
  font-size: calc(11px * var(--fs, 1)); /* 与纯文字战败弹窗一致 */
  letter-spacing: .3em;
}
.story-overlay.story-overlay--video .story-title {
  margin: 0 0 26px;
  font-size: calc(30px * var(--fs, 1));
}
.story-overlay.story-overlay--video .story-body p {
  margin: 0 0 20px;
  font-size: calc(17px * var(--fs, 1));
  line-height: 2;
}
.story-overlay.story-overlay--video .story-video-anchor {
  display: block;
  width: 100%;
  height: 2px;
  margin: 1.2em 0 1.6em;
  padding: 0;
  border: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}
.story-overlay.story-overlay--video .story-video-col {
  flex: 0 0 auto;
  --stage-h: calc(100vh - 80px);
  width: min(42vw, calc(var(--stage-h) * 9 / 16));
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 8px 20px 4px;
  position: sticky;
  top: 0;
  align-self: stretch;
}
.story-overlay.story-overlay--video .story-video-stage {
  position: relative;
  width: 100%;
  height: var(--stage-h);
  max-height: var(--stage-h);
  aspect-ratio: 9 / 16;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.story-overlay.story-overlay--video .story-video-stage video {
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.story-overlay.story-overlay--video .story-video-stage video.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.story-overlay.story-overlay--video .story-video-stage.is-playing {
  box-shadow: 0 0 0 1px rgba(216, 189, 131, .28);
}
.story-overlay.story-overlay--video .story-video-mute-tip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(10, 7, 9, .78);
  color: #c9b8a4;
  font-size: 11px;
  letter-spacing: .04em;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.story-overlay.story-overlay--video .story-video-stage.is-muted-fallback .story-video-mute-tip {
  opacity: 1;
}
.story-overlay.story-overlay--video .story-foot--inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: none;
  width: auto;
  margin: 32px 0 0;
  padding-top: 16px;
  padding-bottom: 8px;
  border-top: 1px solid rgba(180, 140, 100, .12);
}
.story-overlay.story-overlay--video .story-foot--inline .story-hint {
  font-size: calc(11px * var(--fs, 1));
}
.story-overlay.story-overlay--video .story-foot--inline .story-continue {
  margin-left: auto;
  flex-shrink: 0;
}
.story-overlay.story-overlay--video .story-close {
  z-index: 30;
  right: 10px;
  top: 8px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(8, 6, 10, .78);
  border: 1px solid rgba(220, 190, 138, .22);
  font-size: calc(28px * var(--fs, 1)); /* 略小于纯文字 34，避免抢画面 */
  line-height: 1;
}
@media (max-width: 820px) {
  .story-overlay.story-overlay--video { flex-direction: column; padding-top: 44px; }
  .story-overlay.story-overlay--video .story-main { flex-direction: column; }
  .story-overlay.story-overlay--video .story-page {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: 55%;
    padding-left: 16px;
    padding-right: 16px;
  }
  .story-overlay.story-overlay--video .story-video-col {
    flex: 0 0 42%;
    width: 100%;
    max-width: 100%;
    height: 42%;
    padding: 4px 16px 16px;
  }
  .story-overlay.story-overlay--video .story-video-stage {
    max-height: none;
    height: 100%;
  }
}

.hero-speech { position: absolute; z-index: 6; padding: 7px 10px; color: #1b1418; border-radius: 9px; background: rgba(244, 236, 226, .96); box-shadow: 0 4px 14px rgba(0,0,0,.55); font-size: calc(12px * var(--fs, 1)); font-weight: 700; line-height: 1.45; letter-spacing: .02em; pointer-events: none; opacity: 0; transform: translateY(6px) scale(.92); transition: opacity .18s ease, transform .18s ease; width: max-content; }
.hero-speech.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.hero-speech::before { content: ""; position: absolute; top: -7px; left: var(--tail-x, 50%); margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom: 8px solid rgba(244, 236, 226, .96); }
.hero-speech[data-mood="anger"] { color: #3a0d0d; background: rgba(255, 226, 214, .97); }
.hero-speech[data-mood="anger"]::before { border-bottom-color: rgba(255, 226, 214, .97); }
.hero-speech[data-mood="lost"] { color: #4a1230; background: rgba(255, 214, 234, .97); }
.hero-speech[data-mood="lost"]::before { border-bottom-color: rgba(255, 214, 234, .97); }

/* 安全房间的“自慰”选项：粉色诱惑框 */
.choice-card.choice-lust { border-color: rgba(255, 105, 180, .65); background: linear-gradient(90deg, rgba(150, 30, 90, .45), rgba(60, 14, 44, .88)); box-shadow: 0 0 14px rgba(255, 105, 180, .25), inset 0 0 18px rgba(255, 105, 180, .1); }
.choice-card.choice-lust:hover { border-color: #ff8fc7; background: linear-gradient(90deg, rgba(180, 40, 110, .55), rgba(76, 18, 56, .92)); }
.choice-card.choice-lust .choice-copy b { color: #ffb3d9; }
.choice-card.choice-lust .choice-copy small { color: #e7a6c8; }
.choice-card.choice-lust .choice-index { border-color: rgba(255, 140, 200, .6); color: #ff9ed0; }
.choice-card.is-disabled { opacity: .5; filter: grayscale(.5); cursor: not-allowed; }

/* 放大字号后场景区内容变高时，允许场景区自己上下滚动，避免选项被截断 */
.dungeon-stage { grid-template-rows: minmax(0, 1fr); }
.scene-area { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(220, 190, 138, .35) transparent; }

/* 左侧状态栏：顶部生命/欲望/理智/精能区更紧凑，被动属性栏整体上移，避免 125% 字号下超出显示 */
.status-column .data-slot:first-child { padding: 8px 17px 6px; }
.status-column .vital-row.compact { margin-top: 8px; }
.attribute-slot { padding: 7px 12px 6px; overflow: visible; }
.attribute-heading { margin-bottom: 5px; }
.attribute-list { gap: 4px; width: 100%; }
.attribute-chip { min-width: 0; padding: 4px 6px; }

/* 选人界面：桌面窗口下整页一屏显示，卡片高度随窗口自适应，不再需要滚动 */
@media (min-width: 901px) {
  .character-screen.is-active { height: 100vh; min-height: 0; padding-top: 84px; padding-bottom: 20px; overflow: hidden; }
  .character-screen .panel-heading { padding-bottom: 12px; }
  .character-screen .panel-intro { margin: 12px 0 16px; }
  .character-screen .character-select-grid { min-height: 0; }
  .character-screen .character-select-note { padding-top: 12px; }
}

.enemy-speech { position: absolute; z-index: 9; left: 50%; top: 36%; width: max-content; max-width: 92%; padding: 7px 11px; color: #f1dede; border: 1px solid rgba(200, 73, 91, .65); border-radius: 9px; background: rgba(38, 10, 18, .94); box-shadow: 0 4px 14px rgba(0,0,0,.6); font-size: calc(12px * var(--fs, 1)); font-weight: 700; line-height: 1.5; letter-spacing: .02em; pointer-events: none; opacity: 0; transform: translate(-50%, 6px) scale(.94); transition: opacity .2s ease, transform .2s ease; }
.enemy-speech.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.enemy-speech::after { content: ""; position: absolute; top: -8px; left: var(--tail-x, 50%); margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom: 8px solid rgba(38, 10, 18, .94); }
/* 缠茎藤图标较小，描边相应变细 */
.body-parasite[data-parasite-id="stemVine"] { stroke-width: .9; }
.body-parasite[data-parasite-id="stemVine"] .body-parasite-thin { stroke-width: .6; }
/* 第一次屈服献祭后出现的另一侧（左胸）欲根蛭图标：以画布原点为变换基准，便于左右对称。 */
.body-parasite[data-parasite-id="desireLeech"] { transform-box: view-box; transform-origin: 0 0; stroke-width: 1.2; }
.body-parasite[data-parasite-id="desireLeech"] .body-parasite-thin { stroke-width: .8; }

/* 回响之虫：魅惑低语的回答气泡（粉紫色） */
.hero-speech[data-mood="echo"] { color: #3c0f55; background: rgba(228, 186, 255, .97); box-shadow: 0 0 16px rgba(214, 120, 255, .65), 0 4px 14px rgba(0,0,0,.55); }
.hero-speech[data-mood="echo"]::before { border-bottom-color: rgba(228, 186, 255, .97); }
.body-parasite[data-parasite-id="echoWorm"] { stroke: #e08cff; fill: rgba(214, 120, 255, .16); stroke-width: 1; }
.body-parasite[data-parasite-id="echoWorm"] .body-parasite-dot { fill: #f0b8ff; }
.body-parasite[data-parasite-id="echoWorm"].is-visible { animation: bodyEchoGlow 3.6s ease-in-out infinite; }
@keyframes bodyEchoGlow { 0%, 100% { opacity: .55; filter: drop-shadow(0 0 3px rgba(214, 120, 255, .55)); } 50% { opacity: 1; filter: drop-shadow(0 0 11px rgba(226, 140, 255, .98)); } }

/* 释放完毕界面：粉色羞辱文字；有剧情弹窗时，卡片等弹窗关闭后才淡入 */
.object-card p.lust-mockery { color: #ff8fc4; font-size: calc(14px * var(--fs, 1)); line-height: 1.9; text-shadow: 0 0 10px rgba(255, 105, 180, .35); }
.object-card.release-await { opacity: 0; pointer-events: none; }
.object-card:not(.release-await) { transition: opacity .7s ease; }

/* 释放完毕 / 屈服献祭界面上方的爱心：粉色 */
.object-glyph.glyph-pink { color: #ff8fc4; text-shadow: 0 0 12px rgba(255, 105, 180, .55); }

/* 闪避成功的粗口气泡：淡金（自信）/ 白（动摇）/ 淡粉（渴望被打） */
.hero-speech[data-mood="dodge-gold"] { color: #4a3406; background: rgba(252, 237, 183, .97); box-shadow: 0 0 14px rgba(240, 200, 100, .55), 0 4px 14px rgba(0,0,0,.55); }
.hero-speech[data-mood="dodge-gold"]::before { border-bottom-color: rgba(252, 237, 183, .97); }
.hero-speech[data-mood="dodge-white"] { color: #1c1c22; background: rgba(255, 255, 255, .98); }
.hero-speech[data-mood="dodge-white"]::before { border-bottom-color: rgba(255, 255, 255, .98); }
.hero-speech[data-mood="dodge-pink"] { color: #5a1033; background: rgba(255, 205, 226, .97); box-shadow: 0 0 14px rgba(255, 120, 180, .5), 0 4px 14px rgba(0,0,0,.55); }
.hero-speech[data-mood="dodge-pink"]::before { border-bottom-color: rgba(255, 205, 226, .97); }

/* 颅内菌丝：脑部的青白色菌丝，随阶数扩大 */
.body-parasite[data-parasite-id="mycelium"] { stroke: #8fe8d0; fill: rgba(143, 232, 208, .14); stroke-width: 1; transform-box: view-box; transform-origin: 0 0; }
.body-parasite[data-parasite-id="mycelium"] .body-parasite-dot { fill: #c9fff0; }
.body-parasite[data-parasite-id="mycelium"].is-visible { animation: bodyMyceliumGlow 4.2s ease-in-out infinite; }
@keyframes bodyMyceliumGlow { 0%, 100% { opacity: .6; filter: drop-shadow(0 0 3px rgba(143, 232, 208, .5)); } 50% { opacity: 1; filter: drop-shadow(0 0 10px rgba(160, 255, 225, .95)); } }

/* 互动自慰：粉色射精槽 */
.jerk-gauge { margin: 14px 0 0; padding: 6px 12px; text-align: left; border: 1px solid rgba(255, 105, 180, .6); border-radius: 8px; background: linear-gradient(90deg, rgba(110, 22, 70, .55), rgba(40, 10, 32, .9)); box-shadow: 0 0 14px rgba(255, 105, 180, .22); }
.jerk-gauge-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; color: #ffb3d9; font-size: 14px; }
.jerk-gauge-head span { color: #ffd2e8; font-variant-numeric: tabular-nums; }
.jerk-gauge-track { position: relative; height: 12px; border-radius: 6px; background: rgba(20, 4, 14, .85); border: 1px solid rgba(255, 140, 200, .35); overflow: hidden; }
.jerk-gauge-track i { display: block; height: 100%; background: linear-gradient(90deg, #ff6fb5, #ff9ed0); box-shadow: 0 0 10px rgba(255, 120, 190, .8); transition: width .3s ease; }
.jerk-gauge-track em { position: absolute; top: 0; bottom: 0; left: 90%; width: 2px; background: rgba(255, 255, 255, .7); }
/* 互动自慰：射精槽放在“释放中”卡片内，卡片压缩以免被下方按钮盖住 */
.object-card:has(.jerk-gauge) { padding: 14px 28px 16px; }
.object-card:has(.jerk-gauge) .object-glyph { display: none; }
.object-card:has(.jerk-gauge) h3 { margin: 0; }
.object-card:has(.jerk-gauge) p { display: none; }
.object-card .jerk-gauge { margin-top: 12px; }

/* 互动自慰：“释放中”右侧粉色闪动爱心 */
.jerk-heart { display: inline-block; margin-left: 12px; color: #ff5fae; text-shadow: 0 0 10px rgba(255, 95, 174, .9), 0 0 20px rgba(255, 95, 174, .5); animation: jerkHeartBeat 1s ease-in-out infinite; }
@keyframes jerkHeartBeat { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.25); } }


/* 门扉之主·阿刻戎：二/三阶段时间之轮蓝色闪烁 */
@keyframes acheronTimeWheelPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(80, 170, 255, .35)) drop-shadow(0 0 14px rgba(40, 120, 255, .25)); }
  50% { filter: drop-shadow(0 0 16px rgba(120, 200, 255, .95)) drop-shadow(0 0 28px rgba(60, 140, 255, .7)); }
}
.enemy-figure.time-wheel-glow,
.enemy-figure.time-wheel-glow .enemy-portrait,
body.acheron-time-wheel-glow .enemy-figure.has-portrait.boss-portrait .enemy-portrait {
  animation: acheronTimeWheelPulse 1.35s ease-in-out infinite;
}
.enemy-figure.spectating {
  opacity: .92;
}
.enemy-figure.spectating .enemy-nameplate small::after {
  content: " · 旁观";
  color: #7ec8ff;
}
body.acheron-time-wheel-glow .combat-layer {
  box-shadow: inset 0 0 48px rgba(40, 120, 255, .18);
}


/* ===== 祭坛 · 阿刻戎 NPC / 小对话 / 左右分栏（防溢出、一屏看完） ===== */
/* scene-area：header 跨列；左 scene-object=立绘(+旁侧对话)；右 choice-layer=祭坛按钮 */
.dungeon-stage[data-room="altar"] .scene-area {
  display: grid;
  grid-template-columns: minmax(300px, 0.58fr) minmax(210px, 0.42fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: clamp(12px, 1.8vw, 24px);
  row-gap: 8px;
  align-content: stretch;
  min-height: 0;
  overflow: hidden;
  position: relative;
  padding: 18px clamp(16px, 2.2vw, 36px) 14px;
}
.dungeon-stage[data-room="altar"] .scene-header {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  z-index: 5;
}
/* 左区：立绘 | 对话窗（对话打开时并排；关闭时立绘占满） */
.dungeon-stage[data-room="altar"] .scene-object {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  justify-items: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  gap: 8px;
}
.dungeon-stage[data-room="altar"] .scene-object:has(.altar-talk:not([hidden])) {
  grid-template-columns: minmax(118px, 0.42fr) minmax(150px, 0.58fr);
}
/* 有卡且无选项（如诅咒烙成 roomResult）：主区单列，卡片正中 */
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):not(:has(.choice-layer > .choice-card)) {
  grid-template-columns: minmax(0, 1fr);
}
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):not(:has(.choice-layer > .choice-card)) .scene-object {
  grid-column: 1;
  grid-row: 2;
  z-index: 4;
  pointer-events: none;
}
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):not(:has(.choice-layer > .choice-card)) .choice-layer {
  display: none;
}
/* 有卡且有选项：三栏 —— 立绘 | 居中卡 | 选项，避免 choice 挤偏/盖住卡 */
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):has(.choice-layer > .choice-card) {
  grid-template-columns: minmax(120px, 0.28fr) minmax(240px, 0.44fr) minmax(190px, 0.28fr);
}
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):has(.choice-layer > .choice-card) .scene-object {
  grid-column: 1 / 3;
  grid-row: 2;
  z-index: 4;
  pointer-events: none;
}
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):has(.choice-layer > .choice-card) .choice-layer,
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):has(.choice-layer > .choice-card) .choice-layer.altar-curse-picks {
  grid-column: 3;
  grid-row: 2;
  z-index: 6;
}
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])) .altar-npc {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: clamp(120px, 34%, 260px);
  height: auto;
  max-height: 100%;
  z-index: 5;
  pointer-events: none;
}
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])) .altar-npc-hit {
  pointer-events: auto;
}
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])) .altar-talk:not([hidden]) {
  position: absolute;
  left: clamp(120px, 34%, 260px);
  top: 50%;
  transform: translateY(-50%);
  width: min(280px, 36%);
  max-width: 36%;
  z-index: 9;
  pointer-events: auto;
  grid-column: auto;
  grid-row: auto;
}
.dungeon-stage[data-room="altar"] .object-card {
  position: absolute;
  z-index: 8;
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 52%);
  max-width: min(480px, 62%);
  max-height: min(68%, 260px);
  margin: 0;
  padding: 12px 16px;
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
}
/* 有右侧选项时，卡片在「立绘+卡」两列区域内居中，略偏右以躲开立绘 */
.dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):has(.choice-layer > .choice-card) .object-card {
  left: 56%;
  width: min(380px, 58%);
  max-width: min(420px, 66%);
}
.dungeon-stage[data-room="altar"] .object-card h3 {
  font-size: clamp(12px, 1.5vw, 15px);
  line-height: 1.35;
}
.dungeon-stage[data-room="altar"] .object-card p {
  font-size: calc(10.5px * var(--fs, 1));
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}
.dungeon-stage[data-room="altar"] .object-glyph {
  font-size: calc(20px * var(--fs, 1));
}

/* 右列：整栏只给祭坛交互按钮；一屏内尽量不滚动 */
.dungeon-stage[data-room="altar"] .choice-layer {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 100%;
  z-index: 6;
  box-sizing: border-box;
  overflow: hidden;
  align-content: center;
}
.dungeon-stage[data-room="altar"] .choice-layer .choice-card {
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 7px 10px;
  gap: 8px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: start;
  overflow: hidden;
}
.dungeon-stage[data-room="altar"] .choice-layer .choice-index {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  font-size: calc(10px * var(--fs, 1));
}
.dungeon-stage[data-room="altar"] .choice-layer .choice-copy {
  min-width: 0;
  overflow: hidden;
}
.dungeon-stage[data-room="altar"] .choice-layer .choice-copy b {
  margin-bottom: 2px;
  font-size: calc(12px * var(--fs, 1));
  line-height: 1.3;
  letter-spacing: .04em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dungeon-stage[data-room="altar"] .choice-layer .choice-copy small {
  font-size: calc(9px * var(--fs, 1));
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dungeon-stage[data-room="altar"] .choice-layer .choice-arrow {
  font-size: calc(13px * var(--fs, 1));
  align-self: center;
}
.dungeon-stage[data-room="altar"] .choice-layer.altar-curse-picks {
  width: 100%;
  max-height: 100%;
  gap: 5px;
  align-content: center;
  overflow: hidden;
}
.dungeon-stage[data-room="altar"] .choice-layer.altar-curse-picks .choice-card {
  padding: 6px 9px;
}
.dungeon-stage[data-room="altar"] .choice-layer.altar-curse-picks .choice-copy small {
  -webkit-line-clamp: 4;
  font-size: calc(8.5px * var(--fs, 1));
  line-height: 1.32;
}
.dungeon-stage[data-room="altar"] .combat-layer {
  grid-column: 1 / -1;
  grid-row: 2;
  z-index: 7;
}
.dungeon-stage[data-room="altar"] .combat-layer[hidden] {
  display: none !important;
}

.dungeon-stage[data-room="altar"].altar-bare-object .scene-object {
  min-height: 0;
  max-height: none;
}
.dungeon-stage[data-room="altar"].altar-bare-object .choice-layer,
.dungeon-stage[data-room="altar"].altar-bare-object .choice-layer.altar-curse-picks {
  max-height: 100%;
  overflow: hidden;
}

/* 左侧阿刻戎立绘：占左区第一子列，可点 */
.dungeon-stage[data-room="altar"] .altar-npc,
.altar-npc {
  position: relative;
  z-index: 5;
  inset: auto;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  pointer-events: none;
  box-sizing: border-box;
  grid-column: 1;
  grid-row: 1;
}
.dungeon-stage[data-room="altar"] .scene-object:has(.altar-talk:not([hidden])) .altar-npc {
  width: 100%;
}
.altar-npc[hidden] { display: none !important; }
.altar-npc-hit {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  padding: 0 0 26px;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 14px 16px rgba(0,0,0,.65));
  box-sizing: border-box;
}
.altar-npc-hit:hover .altar-npc-portrait,
.altar-npc-hit:focus-visible .altar-npc-portrait {
  filter: brightness(1.08) drop-shadow(0 0 12px rgba(220, 180, 110, .45));
  outline: none;
}
.altar-npc-portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
  transition: filter .18s ease;
}
.altar-npc-tag {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  max-width: calc(100% - 4px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 8px;
  color: #e6d3b0;
  border: 1px solid rgba(220, 187, 129, .35);
  border-radius: 999px;
  background: rgba(8, 6, 10, .82);
  font-size: calc(9px * var(--fs, 1));
  letter-spacing: .1em;
  pointer-events: none;
  box-sizing: border-box;
}

/* 立绘气泡：贴在立绘上，尽量一屏不滚 */
.altar-npc-speech {
  position: absolute;
  z-index: 6;
  left: 4px;
  right: 4px;
  top: 4%;
  width: auto;
  max-width: calc(100% - 8px);
  max-height: min(36%, 110px);
  overflow: hidden;
  padding: 5px 7px;
  color: #f3e7d4;
  border: 1px solid rgba(200, 170, 110, .55);
  border-radius: 9px;
  background: rgba(28, 18, 12, .94);
  box-shadow: 0 4px 14px rgba(0,0,0,.55);
  font-size: calc(10px * var(--fs, 1));
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .02em;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px) scale(.94);
  transition: opacity .2s ease, transform .2s ease;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}
.altar-npc-speech.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.altar-npc-speech::after {
  content: "";
  position: absolute;
  left: 16px;
  bottom: -7px;
  border: 6px solid transparent;
  border-bottom: 0;
  border-top: 8px solid rgba(28, 18, 12, .94);
}

/* 对话窗：立绘旁（左区第二子列），绝不盖住右侧祭坛按钮；一屏看完 */
.dungeon-stage[data-room="altar"] .altar-talk,
.altar-talk {
  position: relative;
  z-index: 14;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  transform: none;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 11px 8px;
  border: 1px solid rgba(218, 190, 138, .28);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(22, 16, 20, .97), rgba(10, 8, 12, .98));
  box-shadow: 0 12px 28px rgba(0,0,0,.5);
  overflow: hidden;
  box-sizing: border-box;
}
.altar-talk[hidden] { display: none !important; }
.altar-talk-close {
  position: absolute;
  right: 6px;
  top: 2px;
  color: #8d8179;
  border: 0;
  background: transparent;
  font-size: calc(20px * var(--fs, 1));
  line-height: 1;
  cursor: pointer;
}
.altar-talk-close:hover { color: var(--gold-bright, #e6c98c); }
.altar-talk-kicker {
  margin: 0 0 2px;
  padding-right: 22px;
  color: #8a6b78;
  font-size: calc(8.5px * var(--fs, 1));
  letter-spacing: .2em;
}
.altar-talk-name {
  flex: 0 0 auto;
  margin: 0 0 6px;
  padding-right: 22px;
  color: #d8bd83;
  font-family: "STSong", Georgia, serif;
  font-size: calc(14px * var(--fs, 1));
  font-weight: 400;
  letter-spacing: .06em;
}
.altar-talk-body {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 34%;
  overflow: hidden;
  margin-bottom: 6px;
  color: #d3c9bf;
  font-family: "STSong", serif;
  font-size: calc(11.5px * var(--fs, 1));
  line-height: 1.45;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}
.altar-talk-choices {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}
.altar-talk-choice {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  color: #e8dcc8;
  border: 1px solid rgba(218, 190, 138, .28);
  border-radius: 6px;
  background: rgba(255,255,255,.03);
  cursor: pointer;
  font-size: calc(11px * var(--fs, 1));
  letter-spacing: .03em;
  line-height: 1.3;
  transition: border-color .15s ease, background .15s ease;
  box-sizing: border-box;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.altar-talk-choice:hover,
.altar-talk-choice:focus-visible {
  border-color: rgba(238, 205, 142, .7);
  background: rgba(80, 55, 30, .35);
  outline: none;
}
.altar-talk-choice.is-pink {
  color: #ffb3d9;
  border-color: rgba(255, 105, 180, .65);
  background: linear-gradient(90deg, rgba(150, 30, 90, .4), rgba(60, 14, 44, .85));
  box-shadow: 0 0 12px rgba(255, 105, 180, .2);
}
.altar-talk-choice.is-pink:hover {
  border-color: #ff8fc7;
  background: linear-gradient(90deg, rgba(180, 40, 110, .5), rgba(76, 18, 56, .9));
}
.altar-talk-choice.is-muted {
  color: #9a9086;
  border-style: dashed;
}

@media (max-width: 900px) {
  .dungeon-stage[data-room="altar"] .scene-area {
    grid-template-columns: minmax(240px, 0.52fr) minmax(0, 0.48fr);
    padding: 14px 12px 10px;
    column-gap: 10px;
  }
  .dungeon-stage[data-room="altar"] .scene-object:has(.altar-talk:not([hidden])) {
    grid-template-columns: minmax(96px, 0.4fr) minmax(120px, 0.6fr);
  }
  .dungeon-stage[data-room="altar"] .object-card {
    width: min(360px, 70%);
    max-width: min(400px, 78%);
    max-height: min(58%, 200px);
  }
  .dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])) .altar-npc {
    width: clamp(96px, 30%, 180px);
  }
  .altar-talk-body { -webkit-line-clamp: 5; font-size: calc(11px * var(--fs, 1)); }
  .altar-talk-choice { font-size: calc(10.5px * var(--fs, 1)); padding: 4px 7px; }
}
@media (max-width: 680px) {
  .dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])),
  .dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):has(.choice-layer > .choice-card) {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(200px, 46vh) minmax(0, 1fr);
  }
  .dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):has(.choice-layer > .choice-card) .scene-object {
    grid-column: 1;
    grid-row: 2;
  }
  .dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):has(.choice-layer > .choice-card) .choice-layer,
  .dungeon-stage[data-room="altar"] .scene-area:has(.object-card:not([hidden])):has(.choice-layer > .choice-card) .choice-layer.altar-curse-picks {
    grid-column: 1;
    grid-row: 3;
  }
  .dungeon-stage[data-room="altar"] .scene-area {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(200px, 46vh) minmax(0, 1fr);
  }
  .dungeon-stage[data-room="altar"] .scene-object {
    grid-column: 1;
    grid-row: 2;
    min-height: 180px;
  }
  .dungeon-stage[data-room="altar"] .scene-object:has(.altar-talk:not([hidden])) {
    grid-template-columns: minmax(90px, 0.38fr) minmax(0, 0.62fr);
  }
  .dungeon-stage[data-room="altar"] .choice-layer,
  .dungeon-stage[data-room="altar"] .choice-layer.altar-curse-picks {
    grid-column: 1;
    grid-row: 3;
    align-self: stretch;
    width: 100%;
    max-height: 100%;
    overflow: hidden;
  }
  .altar-npc-speech {
    font-size: calc(9.5px * var(--fs, 1));
    max-height: min(32%, 90px);
    -webkit-line-clamp: 4;
  }
}


/* 灵魂核心顶栏入口 / 商店（主界面 topbar-lead，局内只读） */
.soul-core-chip {
  min-width: 108px;
  height: 72px;
  padding: 0 16px;
  color: inherit;
  border: 0;
  border-left: 1px solid rgba(221, 202, 168, 0.1);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-content: center;
  text-align: center;
  flex-shrink: 0;
}
.soul-core-chip:hover b { color: var(--gold-bright); }
.soul-core-chip b { color: #e7c48a; }
.soul-core-chip.is-locked-run { opacity: 0.92; }
.soul-core-chip.is-locked-run:hover b { color: #c9b089; }
.soul-core-shop-modal { width: min(720px, 94vw); }
.soul-shop-lock-banner {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 170, 120, 0.28);
  background: rgba(180, 120, 60, 0.08);
  color: #e2c8a0;
}
.soul-shop-toggle.is-disabled { opacity: 0.55; cursor: not-allowed; }
.soul-shop-toggle input:disabled { cursor: not-allowed; }
.modal.return-home-modal { width: min(620px, 94vw); }
.modal.settlement-modal { width: min(760px, 94vw); }
.modal.settlement-modal .settlement-lead { margin: 0 0 14px; }
.modal.settlement-modal .settlement-grid { margin-top: 0; }
.return-home-story { max-height: min(52vh, 460px); }
.return-home-story p + p { margin-top: 2px; }
.return-home-story p:last-child { color: #dfd1bf; }
.soul-shop-grid { display: grid; gap: 12px; margin-top: 14px; }
.soul-shop-card {
  padding: 14px 16px;
  border: 1px solid rgba(220, 198, 160, 0.18);
  background: rgba(255, 255, 255, 0.03);
}
.soul-shop-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.soul-shop-head b { color: #eadcc6; font-size: calc(15px * var(--fs, 1)); }
.soul-shop-head small { color: #9a8f82; letter-spacing: 0.08em; }
.soul-shop-desc { margin: 8px 0 12px; color: #aea297; font-size: calc(12px * var(--fs, 1)); line-height: 1.7; }
.soul-shop-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.soul-shop-buy:disabled { opacity: .45; cursor: not-allowed; }
.soul-shop-toggle { display: inline-flex; align-items: center; gap: 8px; color: #cbbba7; font-size: calc(12px * var(--fs, 1)); cursor: pointer; }
.soul-shop-toggle input { accent-color: #d4b06a; width: 16px; height: 16px; }
.soul-shop-locked { color: #7d746c; font-size: calc(11px * var(--fs, 1)); }


/* ENDING_VOID_SETTLEMENT_CSS */
.ending-hotspots { position: absolute; z-index: 6; inset: 0; pointer-events: none; }
.ending-hotspots .scene-hotspot { pointer-events: auto; }
.time-wheel-hotspot {
  left: 50%; top: 58%; transform: translate(-50%, -50%);
  min-width: 168px; text-align: center;
  border-color: rgba(110, 180, 255, .45);
  box-shadow: 0 0 28px rgba(60, 140, 255, .28), inset 0 0 22px rgba(40, 100, 200, .12);
  animation: acheronTimeWheelPulse 1.6s ease-in-out infinite;
}
.time-wheel-hotspot:hover, .time-wheel-hotspot:focus-visible {
  transform: translate(-50%, calc(-50% - 3px));
  border-color: rgba(160, 210, 255, .85);
}
.dungeon-stage[data-room="acheronWheel"] {
  background:
    radial-gradient(circle at 50% 62%, rgba(70, 140, 255, .16), transparent 28%),
    linear-gradient(180deg, #12151c, #07080c);
}
.dungeon-stage[data-room="acheronWheel"]::before {
  opacity: .35;
  background-image: radial-gradient(circle at 50% 58%, rgba(120, 190, 255, .18), transparent 40%);
}
.dungeon-stage[data-room="void"] {
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(220,230,255,.35), transparent),
    radial-gradient(1px 1px at 28% 72%, rgba(200,210,255,.22), transparent),
    radial-gradient(1px 1px at 63% 24%, rgba(230,240,255,.28), transparent),
    radial-gradient(1px 1px at 81% 61%, rgba(190,205,255,.2), transparent),
    radial-gradient(1.5px 1.5px at 47% 44%, rgba(255,255,255,.18), transparent),
    radial-gradient(circle at 50% 40%, rgba(40, 55, 90, .14), transparent 42%),
    linear-gradient(180deg, #05060a 0%, #020308 55%, #000 100%);
}
.dungeon-stage[data-room="void"]::before { opacity: .12; }
.dungeon-stage[data-room="void"] .scene-header,
.dungeon-stage[data-room="acheronWheel"] .scene-header,
.dungeon-stage[data-room="settlement"] .scene-header {
  position: relative; z-index: 5; text-shadow: 0 2px 16px #000;
}
.dungeon-stage[data-room="void"] .dialogue-box {
  background: linear-gradient(110deg, rgba(10, 12, 20, .92), rgba(4, 5, 10, .96));
}
.dungeon-stage[data-room="settlement"] {
  background: linear-gradient(180deg, #15131a, #08070b);
}
.choice-layer:has(.settlement-panel) {
  grid-template-columns: 1fr;
  width: min(760px, 100%);
  max-height: min(68vh, 620px);
}
.settlement-panel {
  width: 100%;
  margin: 0;
  padding: 18px 20px 16px;
  border: 1px solid rgba(214, 183, 127, .28);
  background: linear-gradient(160deg, rgba(22, 18, 24, .96), rgba(8, 7, 11, .96));
  box-shadow: 0 18px 40px rgba(0,0,0,.45), inset 0 0 24px rgba(120, 90, 55, .06);
  position: relative; z-index: 4;
}
.settlement-actions {
  margin-top: 14px;
  display: grid;
}
.settlement-panel h3 {
  margin: 0 0 6px;
  font: 400 calc(18px * var(--fs, 1)) "STSong", serif;
  letter-spacing: .12em;
  color: #efd7a4;
}
.settlement-panel .settlement-lead {
  margin: 0 0 14px;
  color: #8f847b;
  font-size: calc(11px * var(--fs, 1));
  letter-spacing: .06em;
}
.settlement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.settlement-card {
  padding: 12px 12px 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.025);
}
.settlement-card b {
  display: block;
  margin-bottom: 4px;
  color: #d8bd83;
  font: 500 calc(12px * var(--fs, 1)) Georgia, serif;
  letter-spacing: .08em;
}
.settlement-card span, .settlement-card small {
  display: block;
  color: #d3c9bf;
  font-size: calc(13px * var(--fs, 1));
  line-height: 1.55;
  white-space: pre-wrap;
}
.settlement-card.full { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .settlement-grid { grid-template-columns: 1fr; }
  .time-wheel-hotspot { top: 64%; }
}


/* ===== 文集 & 画廊 ===== */
.archive-screen {
  display: none;
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 96px 18px 48px; /* 顶栏 72px + 间距，避免大标题叠进 topbar */
  box-sizing: border-box;
}
.archive-screen.is-active { display: flex; flex-direction: column; }
.archive-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 8px;
  flex-wrap: wrap;
}
.archive-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(16, 12, 18, 0.85);
  color: #b9aa98;
  padding: 10px 18px;
  border-radius: 999px;
  letter-spacing: 0.18em;
  cursor: pointer;
  font-family: inherit;
}
.archive-tab.is-active {
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(212, 175, 95, 0.25) inset;
}
.archive-pane { display: none; margin-top: 10px; }
.archive-pane.is-active { display: block; }

.codex-shelf { margin: 18px 0 26px; }
.codex-shelf > header,
.gallery-section > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(212, 175, 95, 0.18);
  padding-bottom: 6px;
}
.codex-shelf h3,
.gallery-section h3 {
  margin: 0;
  font-size: calc(15px * var(--fs, 1));
  letter-spacing: 0.2em;
  color: var(--gold-bright);
  font-weight: 500;
}
.codex-shelf small,
.gallery-section small {
  opacity: 0.65;
  font-size: calc(11px * var(--fs, 1));
}
.codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}
.codex-book {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 158px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.codex-spine {
  width: 10px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, #5a4632, #2a1c14 55%, #1a120e);
  box-shadow: inset -1px 0 0 rgba(255, 220, 160, 0.18);
}
.codex-cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 12px 12px;
  border-radius: 0 8px 8px 0;
  border: 1px solid rgba(180, 150, 110, 0.28);
  background:
    linear-gradient(145deg, rgba(58, 42, 32, 0.95), rgba(22, 16, 20, 0.96)),
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(0,0,0,0.08) 3px, rgba(0,0,0,0.08) 4px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  min-width: 0;
}
.codex-cover small {
  opacity: 0.55;
  letter-spacing: 0.14em;
  font-size: calc(9px * var(--fs, 1));
}
.codex-cover b {
  font-weight: 500;
  font-size: calc(13px * var(--fs, 1));
  line-height: 1.35;
  color: #e6d7c3;
  word-break: break-word;
}
.codex-book.is-locked .codex-cover {
  filter: grayscale(0.35) brightness(0.72);
  border-color: rgba(120, 100, 90, 0.25);
}
.codex-book.is-locked .codex-cover b { color: #8d8074; letter-spacing: 0.28em; }
.codex-book.is-unlocked:hover .codex-cover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.codex-lock,
.gallery-lock {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #a8947d;
  opacity: 0.8;
  border: 1px solid rgba(168, 148, 125, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(0,0,0,0.35);
}

.gallery-section { margin: 18px 0 26px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
}
.gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(180, 150, 110, 0.22);
  background: rgba(14, 10, 14, 0.78);
  color: #d8cbb8;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.gallery-card.is-unlocked:hover { border-color: var(--gold); }
.gallery-frame {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, rgba(80, 60, 50, 0.35), rgba(8, 6, 10, 0.95));
  display: grid;
  place-items: center;
}
.gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gallery-silhouette {
  width: 58%;
  height: 72%;
  border-radius: 40% 40% 28% 28%;
  background: linear-gradient(180deg, #2a2228, #0c0a0e);
  box-shadow: inset 0 0 24px rgba(0,0,0,0.8);
  filter: blur(0.2px);
}
.gallery-card b {
  font-size: calc(12px * var(--fs, 1));
  font-weight: 500;
  line-height: 1.35;
}
.gallery-card.is-locked { filter: saturate(0.7); opacity: 0.88; }
.gallery-preview-body {
  display: grid;
  place-items: center;
  min-height: 280px;
  max-height: min(70vh, 560px);
  background: radial-gradient(circle at 50% 20%, rgba(70,50,40,0.35), rgba(8,6,10,0.95));
  border-radius: 12px;
  overflow: auto;
}
.gallery-preview-body img {
  max-width: 100%;
  max-height: min(68vh, 520px);
  object-fit: contain;
}
.gallery-frame video,
.gallery-frame .gallery-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a080c;
  pointer-events: none;
}
.gallery-card.is-video .gallery-frame {
  aspect-ratio: 9 / 16;
  background: radial-gradient(circle at 50% 35%, rgba(60, 40, 70, 0.4), rgba(8, 6, 10, 0.96));
}
.gallery-preview-body--video {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-height: min(78vh, 720px);
}
.gallery-preview-body--video video {
  width: min(100%, 360px);
  max-height: min(68vh, 620px);
  object-fit: contain;
  background: #050408;
  border-radius: 8px;
}
.gallery-video-tip {
  margin: 0;
  opacity: 0.65;
  font-size: calc(12px * var(--fs, 1));
  letter-spacing: 0.08em;
}

@media (max-width: 640px) {
  .codex-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
  .codex-book { min-height: 142px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}


/* 文集&画廊 · 调试锁 */
.archive-title-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.archive-debug-lock {
  appearance: none;
  border: 1px solid rgba(180, 150, 110, 0.35);
  background: rgba(20, 14, 18, 0.72);
  color: #d4b86a;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset;
}
.archive-debug-lock:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.archive-screen .panel-heading {
  align-items: flex-start;
  gap: 12px;
  margin-top: 0;
  padding-top: 4px;
}
.archive-screen .panel-heading h2 {
  line-height: 1.25;
}
