/* ================================================================
   回响深渊 · AI地下城 · 地牢火炬光主题
   ================================================================ */
:root {
  --bg0: #07090f;
  --bg1: #0d1119;
  --panel: #141926;
  --panel-2: #1a2132;
  --line: #2c3348;
  --line-gold: #5c4a22;
  --text: #e8e2d5;
  --dim: #93876f;
  --gold: #f0b452;
  --gold-2: #ffd47e;
  --gold-deep: #8a6420;
  --danger: #ff6b6b;
  --f-display: "ZCOOL QingKe HuangYou", "Microsoft YaHei", sans-serif;
  --f-body: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-color: #3a3220 var(--bg0); }
body {
  background-color: var(--bg0);
  background-image:
    radial-gradient(1400px 600px at 50% -12%, rgba(42, 31, 14, .6) 0%, transparent 55%),
    radial-gradient(900px 500px at 85% 110%, rgba(19, 26, 46, .65) 0%, transparent 60%),
    linear-gradient(180deg, rgba(7, 9, 15, .46) 0%, rgba(7, 9, 15, .8) 100%),
    url("/img/bg/abyss.webp");
  background-position: center top, center bottom, center, center;
  background-size: auto, auto, cover, cover;
  background-attachment: scroll, scroll, fixed, fixed;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--f-body);
  min-height: 100vh;
  font-size: 15px;
  overflow: hidden;
}
::selection { background: rgba(240, 180, 82, .35); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #3a3220; border-radius: 999px; border: 2px solid var(--bg0); }
a { color: inherit; text-decoration: none; }

/* ---- 环境火粒 ---- */
.embers { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.embers i {
  position: absolute; bottom: -12px; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, #ffd47e 0%, #f0b452 45%, transparent 70%);
  opacity: 0; animation: ember 11s linear infinite;
}
.embers i:nth-child(1) { left: 6%;  animation-delay: 0s;   transform: scale(.7); }
.embers i:nth-child(2) { left: 22%; animation-delay: 3.2s; }
.embers i:nth-child(3) { left: 41%; animation-delay: 6.1s; transform: scale(1.3); }
.embers i:nth-child(4) { left: 58%; animation-delay: 1.7s; transform: scale(.6); }
.embers i:nth-child(5) { left: 74%; animation-delay: 8.4s; }
.embers i:nth-child(6) { left: 88%; animation-delay: 4.6s; transform: scale(.9); }
.embers i:nth-child(7) { left: 33%; animation-delay: 9.8s; transform: scale(.5); }
@keyframes ember {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  8%   { opacity: .85; }
  60%  { opacity: .5; }
  100% { transform: translateY(-92vh) translateX(34px); opacity: 0; }
}

/* ---- 顶栏 ---- */
nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 20px; border-bottom: 1px solid var(--line-gold);
  background: linear-gradient(180deg, rgba(20, 15, 6, .92), rgba(11, 13, 20, .85));
  position: relative; z-index: 10; backdrop-filter: blur(8px);
}
.brand {
  font-family: var(--f-display); font-size: 20px; letter-spacing: 5px;
  color: var(--gold-2); text-shadow: 0 0 16px rgba(255, 212, 126, .45);
}
nav .sub { font-size: 12.5px; color: var(--dim); letter-spacing: 1px; }
.btn-ghost {
  background: none; border: 1px solid var(--line); color: var(--dim);
  padding: 6px 14px; border-radius: 10px; cursor: pointer; font-size: 13px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--dim); }

/* ---- 面板 ---- */
.panel {
  background:
    linear-gradient(160deg, rgba(240, 180, 82, .045), transparent 38%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-gold); border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(240, 180, 82, .05), 0 14px 34px rgba(0, 0, 0, .45);
  position: relative;
}
.panel::before, .panel::after {
  content: "✦"; position: absolute; color: var(--gold-deep); font-size: 13px; opacity: .9;
}
.panel::before { top: 7px; left: 11px; }
.panel::after { bottom: 7px; right: 11px; }

.btn-gold {
  background: linear-gradient(180deg, #ffd47e 0%, #f0b452 45%, #c98d2e 100%);
  color: #2a1c05; font-family: var(--f-display); font-weight: 400;
  border: 1px solid #6b4d16; border-bottom: 3px solid #6b4d16;
  cursor: pointer; padding: 10px 26px; border-radius: 12px;
  font-size: 16px; letter-spacing: 3px;
  box-shadow: 0 4px 22px rgba(240, 180, 82, .3), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: .15s; text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-gold:hover {
  transform: translateY(-2px); filter: brightness(1.06);
  box-shadow: 0 8px 30px rgba(240, 180, 82, .45), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn-gold:active { transform: translateY(1px); border-bottom-width: 1px; }
.btn-gold:disabled { opacity: .55; cursor: wait; transform: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; position: relative; z-index: 1; }
.game-grid { display: grid; grid-template-columns: 1fr 330px; gap: 16px; height: calc(100vh - 62px); }
@media (max-width: 940px) {
  body { overflow: auto; }
  .game-grid { grid-template-columns: 1fr; height: auto; }
  .story-col { height: 78vh !important; }
}

/* ---- 剧情流 ---- */
.story-col { display: flex; flex-direction: column; overflow: hidden; }
.feed {
  flex: 1; overflow-y: auto; padding: 20px 18px 14px;
  display: flex; flex-direction: column; gap: 14px;
}
.empty-tip { text-align: center; color: var(--dim); padding: 60px 0; font-size: 14px; letter-spacing: 2px; }
.msg { max-width: 88%; animation: msgIn .3s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.msg.player {
  align-self: flex-end;
  background: linear-gradient(180deg, #2b2513, #221d10);
  border: 1px solid var(--line-gold);
  padding: 9px 14px; border-radius: 12px 12px 2px 12px;
  font-size: 14.5px; line-height: 1.7;
}
.msg.player .who, .msg.dm .who {
  display: block; font-family: var(--f-body); font-weight: 600; font-size: 12px;
  letter-spacing: 1.5px; color: var(--gold); margin-bottom: 4px;
}
.msg.dm {
  align-self: flex-start;
  background: rgba(6, 8, 13, .65);
  border: 1px solid var(--line);
  padding: 11px 15px; border-radius: 2px 12px 12px 12px;
  font-size: 14.5px; line-height: 1.95; white-space: pre-wrap;
}
.msg.dm.prologue {
  border-color: var(--gold-deep);
  background: linear-gradient(180deg, rgba(240, 180, 82, .09), rgba(6, 8, 13, .7));
}
.msg.dm.event { border-color: #7c3a3a; box-shadow: 0 0 16px rgba(200, 60, 60, .12); }
.msg.dm.event .who { color: var(--danger); }
.tag-event {
  color: var(--danger); border: 1px solid #7c3a3a;
  padding: 1px 10px; border-radius: 999px; font-size: 12px;
}
.msg.dm.chest { border-color: var(--gold); }
.tag-chest {
  color: var(--gold-2); border: 1px solid var(--gold-deep);
  padding: 1px 10px; border-radius: 999px; font-size: 12px;
}
.msg.dm.end { border-width: 1px; }
.msg.dm.end.lose { border-color: #7c3a3a; }
.msg.dm.end.won { border-color: var(--gold); box-shadow: 0 0 20px rgba(240, 180, 82, .15); }
.badges { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim);
}
.badge.hp-neg { color: #ff8f8f; border-color: #5c2b2b; }
.badge.hp-pos { color: #7ee0a3; border-color: #2b5c43; }
.badge.depth { color: var(--gold); border-color: var(--line-gold); }
.badge.attr { color: #9ecbff; border-color: #2b4468; }

/* ---- 输入条 ---- */
.input-bar {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 12px; border-top: 1px solid var(--line);
  background: rgba(6, 8, 13, .55);
}
#actionText {
  flex: 1; resize: none; background: #0a0d14; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 14.5px; font-family: var(--f-body);
  line-height: 1.6; max-height: 130px; min-height: 46px;
}
#actionText:focus {
  outline: none; border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(240, 180, 82, .12);
}
#btnSend { padding: 10px 20px; }

/* ---- 侧栏 ---- */
.side-col { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding-bottom: 4px; }
.inv-card > b {
  font-family: var(--f-display); font-weight: 400; font-size: 15px;
  letter-spacing: 2px; color: var(--gold);
}
.char-card { padding: 16px; }
.char-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.char-name {
  font-family: var(--f-display); font-size: 24px; letter-spacing: 2px;
  color: var(--gold-2); text-shadow: 0 0 14px rgba(255, 212, 126, .35);
}
.hp-row { display: flex; align-items: center; gap: 10px; }
.hp-label { font-size: 12.5px; color: var(--dim); }
.hp-bar {
  flex: 1; height: 13px; background: #0a0d14; border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden;
}
.hp-bar i { display: block; height: 100%; border-radius: 999px; transition: width .5s; }
.hp-bar i.ok { background: linear-gradient(90deg, #3f9c6b, #7ee0a3); box-shadow: 0 0 8px rgba(126, 224, 163, .5); }
.hp-bar i.warn { background: linear-gradient(90deg, #b3822d, #ffd47e); box-shadow: 0 0 8px rgba(255, 212, 126, .5); }
.hp-bar i.bad { background: linear-gradient(90deg, #a33c3c, #ff6b6b); box-shadow: 0 0 8px rgba(255, 107, 107, .5); }
.hp-num { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.depth-row { display: flex; align-items: center; gap: 10px; margin: 11px 0 2px; font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.depth-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #0a0d14; border: 1px solid var(--line); }
.dot.passed { background: #5c4a22; border-color: var(--gold-deep); }
.dot.cur { background: var(--gold); border-color: var(--gold-2); box-shadow: 0 0 8px var(--gold); animation: dotPulse 1.6s infinite; }
@keyframes dotPulse { 50% { box-shadow: 0 0 14px var(--gold); } }
#radar { width: 100%; margin-top: 4px; }
.attr-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.attr-chip {
  font-size: 12px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 3px; text-align: center; white-space: nowrap;
}
.attr-chip b { font-family: var(--f-body); font-weight: 700; margin-left: 2px; }
.inv-card { padding: 16px; }
.inv-card ul { list-style: none; margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.inv-card li {
  font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 10px;
}
.inv-card li.empty { color: var(--dim); border-style: dashed; }

/* ---- 弹窗 ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(4, 5, 9, .82);
  display: none; align-items: center; justify-content: center; z-index: 50;
  backdrop-filter: blur(4px);
}
.overlay.show { display: flex; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(560px, 93vw); max-height: 88vh; overflow-y: auto;
  background:
    radial-gradient(420px 200px at 50% 0%, rgba(240, 180, 82, .1), transparent 70%),
    linear-gradient(180deg, #1d2436, #12161f);
  border: 1px solid var(--gold-deep);
  outline: 1px solid rgba(240, 180, 82, .22); outline-offset: 4px;
  border-radius: 16px; padding: 26px;
  animation: popIn .45s cubic-bezier(.18, 1.35, .4, 1);
}
@keyframes popIn { from { transform: scale(.8) translateY(24px); opacity: 0; } }
.modal h3 {
  color: var(--gold); letter-spacing: 8px; text-align: center;
  margin-bottom: 16px; font-family: var(--f-display); font-size: 18px;
  text-shadow: 0 0 16px rgba(240, 180, 82, .45);
}
.modal-foot { text-align: center; margin-top: 20px; }

/* 起名 / 设置 */
.create-box { text-align: center; }
.create-box h1 {
  font-family: var(--f-display); font-size: 38px; letter-spacing: 12px;
  color: var(--gold-2); margin: 4px 0 12px;
  text-shadow: 0 0 30px rgba(255, 212, 126, .5), 0 3px 0 #4a3410;
}
.create-box p { color: var(--dim); font-size: 13.5px; margin-bottom: 20px; line-height: 2.1; letter-spacing: 1px; }
.create-box p b { color: var(--text); }
.create-box input {
  width: 250px; text-align: center;
  background: rgba(6, 8, 13, .85); color: var(--gold-2);
  border: 1px solid var(--line-gold); border-radius: 10px;
  padding: 11px 14px; font-size: 17px; font-family: var(--f-display); letter-spacing: 3px;
}
.create-box input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 180, 82, .14);
}
.create-box .btn-ghost { margin-top: 14px; }

/* AI 配置表单 */
.cfg-field { margin: 0 auto 12px; max-width: 420px; text-align: left; }
.cfg-field label {
  display: block; font-size: 12.5px; color: var(--dim);
  letter-spacing: 1px; margin-bottom: 5px;
}
.cfg-field input {
  width: 100%; text-align: left;
  background: rgba(6, 8, 13, .85); color: var(--text);
  border: 1px solid var(--line-gold); border-radius: 10px;
  padding: 10px 13px; font-size: 14px; font-family: var(--f-body);
}
.cfg-field input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 180, 82, .14);
}
.cfg-msg {
  min-height: 20px; font-size: 13px; margin-top: 4px; line-height: 1.6;
  word-break: break-all;
}
.cfg-msg.ok { color: #7ee0a3; }
.cfg-msg.err { color: var(--danger); }
.nav-btns { display: flex; gap: 8px; }

/* 教程 */
.tut-step {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 12px 4px; border-bottom: 1px dashed var(--line);
  font-size: 13.5px; line-height: 1.8; color: var(--dim);
}
.tut-step:last-of-type { border-bottom: none; }
.tut-step .ico {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-display); font-size: 13px; letter-spacing: 0;
  color: var(--gold-2); border: 1px solid var(--line-gold);
  background: rgba(240, 180, 82, .08);
}
.tut-step b {
  color: var(--gold-2); font-size: 14.5px; font-family: var(--f-display);
  font-weight: 400; letter-spacing: 1.5px;
}

/* 宝箱 */
.chest-box .chest-tip { color: var(--dim); font-size: 13.5px; margin-bottom: 12px; line-height: 1.8; }
#chestContent {
  width: 100%; resize: vertical; background: rgba(6, 8, 13, .85); color: var(--gold-2);
  border: 1px solid var(--line-gold); border-radius: 10px;
  padding: 12px 14px; font-size: 15px; font-family: var(--f-body); line-height: 1.7;
}
#chestContent:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 180, 82, .14), 0 0 18px rgba(240, 180, 82, .1);
}

/* 结束 */
.end-box { text-align: center; }
.end-art {
  height: 148px; margin: -12px -26px 16px;
  background-size: cover; background-position: center 42%;
  border-radius: 14px 14px 0 0;
  border-bottom: 1px solid var(--line-gold);
}
.end-title { font-family: var(--f-display); font-size: 30px; letter-spacing: 6px; margin-bottom: 12px; }
.end-title.win { color: var(--gold-2); text-shadow: 0 0 26px rgba(255, 212, 126, .6); }
.end-title.lose { color: var(--danger); }
.end-box p { color: var(--dim); font-size: 14px; line-height: 2.1; }

/* ---- 怪物卡 ---- */
.monster-card { padding: 14px 16px; border-color: #7c3a3a; box-shadow: 0 0 18px rgba(200, 60, 60, .18); animation: monPulse 1.8s infinite; }
@keyframes monPulse { 50% { box-shadow: 0 0 26px rgba(200, 60, 60, .32); } }
.mon-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.mon-icon {
  width: 62px; height: 62px; flex-shrink: 0; display: block;
  object-fit: cover; object-position: center 40%;
  border-radius: 12px; border: 1px solid #7c3a3a;
  background: #0a0d14;
  box-shadow: 0 0 18px rgba(200, 60, 60, .3), inset 0 0 0 1px rgba(255, 140, 140, .08);
}
.mon-head b { font-family: var(--f-display); font-weight: 400; font-size: 17px; letter-spacing: 2px; color: #ff8f8f; display: block; }
.mon-trait { font-size: 12px; color: var(--dim); }
.mon-hp { display: flex; align-items: center; gap: 10px; }
.mon-flag { margin-top: 9px; font-size: 12px; color: var(--danger); letter-spacing: .5px; }

/* ---- 行动建议 ---- */
.chips { display: flex; gap: 6px; padding: 8px 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.chip-btn {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--dim);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; transition: .15s;
}
.chip-btn:hover { color: var(--gold); border-color: var(--gold-deep); }

/* ---- 战斗徽章 ---- */
.badge.atk { color: #ffb37e; border-color: #6b4326; }
.badge.crit { color: var(--gold-2); border-color: var(--gold-deep); box-shadow: 0 0 8px rgba(255, 212, 126, .3); }
.badge.dodge { color: #7ee0a3; border-color: #2b5c43; }

/* ---- 自定义结局 ---- */
.msg.dm.custom-end { border-color: var(--gold); background: linear-gradient(180deg, rgba(240, 180, 82, .12), rgba(6, 8, 13, .7)); }
.end-sign { margin-top: 10px; font-size: 12px; color: var(--gold); letter-spacing: 2px; }

/* ---- 场景横幅(画面感) ---- */
/* AI 生成的场景图垫在横幅里,文字压在渐变上 */
.scene-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
  opacity: 1; z-index: 0; transition: opacity .6s ease;
  filter: brightness(1.32) saturate(1.08) contrast(1.04);
}
.scene-bg.hide { opacity: 0; }
.scene::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 9, 15, .84) 0%, rgba(7, 9, 15, .3) 46%, rgba(7, 9, 15, 0) 100%),
    linear-gradient(180deg, rgba(7, 9, 15, 0) 0%, rgba(7, 9, 15, .45) 100%);
}
.scene-layers { z-index: 1; }
.scene-text { z-index: 2; }

body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}
body.hurt::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 6;
  background: radial-gradient(120% 90% at 50% 50%, transparent 40%, rgba(200, 30, 30, .45) 100%);
  animation: hurtFlash .55s ease-out forwards;
}
@keyframes hurtFlash { from { opacity: 1; } to { opacity: 0; } }

.scene {
  position: relative; height: 124px; overflow: hidden;
  border-bottom: 1px solid var(--line-gold); display: flex; align-items: center;
  justify-content: space-between; padding: 0 20px;
  background:
    radial-gradient(320px 70px at 22% 108%, rgba(255, 166, 61, .35), transparent 70%),
    linear-gradient(180deg, #10141f 0%, #0a0d14 100%);
  transition: background 1s;
}
.scene[data-tier="1"] { background:
    radial-gradient(320px 70px at 22% 108%, rgba(90, 167, 255, .28), transparent 70%),
    linear-gradient(180deg, #0e1520 0%, #090c13 100%); }
.scene[data-tier="2"] { background:
    radial-gradient(320px 70px at 22% 108%, rgba(158, 109, 255, .3), transparent 70%),
    linear-gradient(180deg, #131022 0%, #0b0913 100%); }
.scene[data-tier="3"] { background:
    radial-gradient(320px 70px at 22% 108%, rgba(220, 60, 60, .3), transparent 70%),
    linear-gradient(180deg, #1d0f12 0%, #0d080a 100%); }
.scene-layers { position: absolute; inset: 0; pointer-events: none; }
.scene-layers i { position: absolute; bottom: 0; left: 0; right: 0; }
.scene-layers .l1 {
  height: 55%;
  background: repeating-linear-gradient(100deg, transparent 0 26px, rgba(0, 0, 0, .5) 26px 34px, transparent 34px 80px);
  opacity: .28; animation: drift 26s linear infinite;
}
.scene-layers .l2 {
  height: 34%;
  background: repeating-linear-gradient(80deg, transparent 0 40px, rgba(0, 0, 0, .65) 40px 52px, transparent 52px 120px);
  opacity: .42; animation: drift 16s linear infinite reverse;
}
.scene-layers .l3 {
  height: 20%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .8));
}
@keyframes drift { to { background-position: 340px 0; } }
.scene-text { position: relative; display: flex; align-items: baseline; gap: 12px; }
.scene-depth { font-size: 12.5px; color: var(--dim); letter-spacing: 1px; }
.scene-name {
  font-family: var(--f-display); font-size: 21px; letter-spacing: 4px;
  color: var(--gold-2); text-shadow: 0 0 18px rgba(255, 212, 126, .4);
}

/* ---- 断面图 ---- */
.map-card { padding: 14px 16px; }
#mapList { margin-top: 9px; display: flex; flex-direction: column; gap: 3px; }
.map-floor {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  color: var(--dim); padding: 3px 8px; border-radius: 7px;
  border-left: 2px solid var(--line);
}
.map-floor .mf-ico { width: 14px; text-align: center; }
.map-floor.seen { color: var(--text); border-left-color: var(--gold-deep); }
.map-floor.cur {
  color: var(--gold-2); border-left-color: var(--gold);
  background: rgba(240, 180, 82, .08);
  text-shadow: 0 0 10px rgba(255, 212, 126, .35);
}

/* ---- 商人 ---- */
.merchant-card { padding: 14px 16px; border-color: var(--gold-deep); }
#wares { margin-top: 9px; display: flex; flex-direction: column; gap: 8px; }
.ware { display: flex; align-items: center; gap: 10px; }
.ware-info { flex: 1; font-size: 12.5px; line-height: 1.5; }
.ware-info b { color: var(--gold-2); display: block; font-family: var(--f-body); font-weight: 600; font-size: 13px; letter-spacing: .5px; }
.ware-info span { color: var(--dim); }
.buy-btn {
  background: linear-gradient(180deg, #ffd47e, #c98d2e); color: #2a1c05;
  border: 1px solid #6b4d16; border-radius: 8px; padding: 6px 10px;
  font-size: 12.5px; cursor: pointer; font-family: var(--f-display); white-space: nowrap;
}
.buy-btn:disabled { opacity: .4; cursor: not-allowed; }
.buy-btn:hover:not(:disabled) { filter: brightness(1.1); }
.merchant-tip { margin-top: 10px; font-size: 11.5px; color: var(--dim); line-height: 1.6; }
.badge.gold { color: var(--gold-2); border-color: var(--gold-deep); }

/* ---- 下潜提示条 ---- */
.floor-hint {
  padding: 7px 14px; font-size: 12.5px; letter-spacing: .5px;
  color: var(--gold-2); background: rgba(240, 180, 82, .07);
  border-top: 1px dashed var(--line-gold);
}
.chip-btn.opt { color: var(--gold-2); border-color: var(--gold-deep); background: rgba(240, 180, 82, .08); }
.chip-btn.opt:hover { box-shadow: 0 0 10px rgba(240, 180, 82, .25); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================================================================
   v2:状态条 / 建议 chips / 行囊操作 / 地图折叠 / toast / 画廊 / 移动端
   ================================================================ */

/* ---- 剧情列:容纳状态条与 chips 后仍能正常滚动 ---- */
.story-col { position: relative; }
.feed { min-height: 0; }

/* ---- 顶部状态条:自己的血、钱、层数一直在 ----
   侧栏滚到哪都不影响,战斗时也不会看不见自己 */
.status-strip {
  display: flex; align-items: center; gap: 9px; flex-shrink: 0;
  padding: 7px 14px; font-size: 12.5px; color: var(--dim);
  background: linear-gradient(180deg, rgba(240, 180, 82, .06), rgba(6, 8, 13, .5));
  border-bottom: 1px solid var(--line);
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: none;
}
.status-strip::-webkit-scrollbar { display: none; }
.ss-name {
  font-family: var(--f-display); font-size: 14px; letter-spacing: 1.5px;
  color: var(--gold-2); flex-shrink: 0;
}
.ss-hp {
  width: 74px; height: 8px; border-radius: 999px; overflow: hidden;
  background: #0a0d14; border: 1px solid var(--line); flex-shrink: 0;
}
.ss-hp i { display: block; height: 100%; border-radius: 999px; transition: width .45s; }
.ss-hp i.ok { background: linear-gradient(90deg, #3f9c6b, #7ee0a3); }
.ss-hp i.warn { background: linear-gradient(90deg, #b3822d, #ffd47e); }
.ss-hp i.bad { background: linear-gradient(90deg, #a33c3c, #ff6b6b); }
.ss-hpnum { color: var(--text); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ss-chip {
  flex-shrink: 0; border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 9px; background: rgba(6, 8, 13, .4);
}
.ss-wake {
  flex-shrink: 0; margin-left: auto; color: #ff8f8f;
  border: 1px solid #7c3a3a; border-radius: 999px; padding: 1px 9px;
  letter-spacing: 1px;
}
.ss-wake.hot { animation: wakePulse 1s infinite; }
@keyframes wakePulse { 50% { box-shadow: 0 0 12px rgba(255, 90, 90, .55); } }

/* ---- 建议 chips:AI 每回合给的行动,点一下填进输入框 ---- */
.chips {
  display: flex; gap: 6px; padding: 8px 12px 0; border-top: 1px solid var(--line);
  flex-wrap: wrap; flex-shrink: 0; background: rgba(6, 8, 13, .4);
}
.chips:empty { display: none; }
.chips.disabled { opacity: .45; pointer-events: none; }
.chip-btn.opt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 有新消息提示 ---- */
.new-msg {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  opacity: 0; pointer-events: none; z-index: 20;
  background: linear-gradient(180deg, #ffd47e, #c98d2e); color: #2a1c05;
  border: 1px solid #6b4d16; border-radius: 999px; padding: 6px 16px;
  font-family: var(--f-display); font-size: 13px; letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5); transition: .2s;
}
.new-msg.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }

/* ---- 输入条 ---- */
.input-bar { flex-shrink: 0; }
#actionText { transition: height .12s; }

/* ---- 卡片折叠抬头 ---- */
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; padding: 0; cursor: pointer; text-align: left;
}
.card-head b {
  font-family: var(--f-display); font-weight: 400; font-size: 15px;
  letter-spacing: 2px; color: var(--gold);
}
.card-hint { font-size: 11.5px; color: var(--dim); letter-spacing: .5px; }
.map-card.collapsed #mapList { display: none; }
.goal-line {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--dim); line-height: 1.7;
}
.goal-line::before { content: "目标 · "; color: var(--gold); letter-spacing: 1px; }

/* ---- 角色卡装备行 ---- */
.char-head { justify-content: space-between; }
.char-gear { font-size: 11.5px; color: var(--gold); letter-spacing: .5px; }

/* ---- 行囊:一件一行,带说明和按钮 ---- */
.inv-card ul { flex-direction: column; gap: 8px; }
.inv-card .inv-item {
  display: block; width: 100%; padding: 8px 10px;
  background: rgba(6, 8, 13, .35); border: 1px solid var(--line); border-radius: 9px;
}
.inv-card .inv-item.equipped { border-color: var(--gold-deep); background: rgba(240, 180, 82, .06); }
.inv-main { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.inv-name { font-size: 13px; color: var(--text); }
.inv-tag {
  font-size: 10.5px; padding: 0 7px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim); flex-shrink: 0;
}
.inv-tag.use { color: #7ee0a3; border-color: #2b5c43; }
.inv-tag.gear { color: var(--gold-2); border-color: var(--gold-deep); }
.inv-tag.clue { color: #c9b8ff; border-color: #4a3b78; }
.inv-tag.misc { color: #9ecbff; border-color: #2b4468; }
.inv-desc { font-size: 11.5px; color: var(--dim); line-height: 1.55; margin-top: 3px; }
.inv-btns { display: flex; gap: 6px; margin-top: 6px; }
.inv-btns button {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--gold-2);
  border-radius: 7px; padding: 3px 10px; font-size: 11.5px; cursor: pointer;
}
.inv-btns button:hover { border-color: var(--gold-deep); }
.inv-btns button.danger { color: #c98f8f; margin-left: auto; }
.inv-btns button:disabled { opacity: .5; cursor: wait; }

/* ---- 提示条:逃亡态 ---- */
.floor-hint.danger { color: #ff9d9d; background: rgba(200, 60, 60, .1); border-top-color: #7c3a3a; }

/* ---- 打字指示 ---- */
.msg.dm.typing { color: var(--dim); }
.msg.dm.typing .dots { display: inline-flex; gap: 3px; margin: 0 3px; }
.msg.dm.typing .dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
  animation: dotBounce 1.1s infinite;
}
.msg.dm.typing .dots i:nth-child(2) { animation-delay: .15s; }
.msg.dm.typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotBounce { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---- 行动中 / 待发消息 ---- */
.msg.player.temp { opacity: .72; }
.tag-item { color: #9ecbff; border: 1px solid #2b4468; padding: 1px 10px; border-radius: 999px; font-size: 12px; }

/* ---- toast ---- */
.toast-wrap {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 90; pointer-events: none;
  width: min(520px, 92vw);
}
.toast {
  background: linear-gradient(180deg, #1d2436, #12161f);
  border: 1px solid var(--line-gold); border-left: 3px solid var(--gold);
  color: var(--text); font-size: 13px; line-height: 1.6;
  border-radius: 10px; padding: 9px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(10px); transition: .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: #7ee0a3; }

/* ---- 结局页:战绩 ---- */
.end-stats { display: flex; gap: 10px; justify-content: center; margin: 18px 0 20px; flex-wrap: wrap; }
.end-stat {
  min-width: 74px; padding: 8px 12px; border-radius: 10px;
  background: rgba(240, 180, 82, .06); border: 1px solid var(--line-gold);
}
.end-stat b { display: block; font-family: var(--f-display); font-size: 20px; color: var(--gold-2); font-weight: 400; }
.end-stat span { font-size: 11.5px; color: var(--dim); letter-spacing: 1px; }
.end-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---- 结局画廊 ---- */
.gallery-box { width: min(680px, 94vw); }
#galleryList { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.gal-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: rgba(6, 8, 13, .35); cursor: pointer;
}
.gal-item.win { border-color: var(--line-gold); }
.gal-item.lose { border-color: #5c2b2b; }
.gal-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.gal-name { font-family: var(--f-display); font-size: 15px; color: var(--gold-2); letter-spacing: 1px; }
.gal-flag { font-size: 11.5px; color: var(--dim); }
.gal-meta { font-size: 11.5px; color: var(--dim); margin-left: auto; }
.gal-body { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.gal-item.open .gal-body { display: block; }
.gal-title { font-size: 13.5px; color: var(--gold); margin-bottom: 4px; }
.gal-body p { font-size: 13px; color: var(--text); line-height: 1.85; white-space: pre-wrap; }
.gal-body p.dim { color: var(--dim); }
.gal-date { font-size: 11px; color: var(--dim); margin-top: 6px; }

/* ---- 移动端 ---- */
@media (max-width: 940px) {
  .story-col { height: 82vh !important; }
  .status-strip { font-size: 12px; }
  .ss-hp { width: 56px; }
  .chips { padding-bottom: 6px; }
  .new-msg { bottom: 126px; }
  #actionText { min-height: 70px; }
}
@media (max-width: 430px) {
  #ssBag, #ssGold { display: none; }
  .ss-name { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 640px) {
  nav { padding: 8px 10px; gap: 6px; flex-wrap: wrap; }
  .brand { font-size: 16px; letter-spacing: 2px; }
  nav .sub { font-size: 11px; }
  .nav-btns { gap: 5px; }
  .btn-ghost { padding: 5px 9px; font-size: 12px; }
  .wrap { padding: 10px; }
  .game-grid { gap: 10px; }
  .status-strip { padding: 6px 10px; }
  .msg { max-width: 94%; }
  .end-stat { min-width: 62px; padding: 6px 9px; }
  .end-actions .btn-ghost, .end-actions .btn-gold { padding: 8px 12px; font-size: 13px; letter-spacing: 1px; }
}
.chip-btn.chest-chip {
  color: #2a1c05; background: linear-gradient(180deg, #ffd47e, #c98d2e);
  border-color: #6b4d16; font-weight: 600;
}
.chip-btn.chest-chip:hover { filter: brightness(1.08); }

/* ---- AI 立绘与图标(v3) ---- */
.attr-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
  box-shadow: 0 0 6px currentColor;
}
.gal-flag.win { color: #ffd47e; }
.gal-flag.lose { color: #ff9d9d; }
.scene-name { text-shadow: 0 0 18px rgba(0, 0, 0, .9), 0 2px 6px rgba(0, 0, 0, .85); }
.scene-depth { color: #cfc6b4; text-shadow: 0 1px 4px rgba(0, 0, 0, .9); }
@media (max-width: 640px) {
  .scene { height: 96px; padding: 0 14px; }
  .scene-name { font-size: 18px; letter-spacing: 3px; }
}

/* 立绘卡片:别让角落的 ✦ 压在图上 */
.monster-card::before, .monster-card::after { display: none; }
/* 角色卡:名字一行,装备另起一行,长装备名不挤 */
.char-head { flex-direction: column; align-items: flex-start; gap: 3px; }
.char-gear { display: block; line-height: 1.6; }


/* ---- 配置预设 + 等待秒数 ---- */
.cfg-presets {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  align-items: center; margin: 0 auto 14px; max-width: 440px;
}
.preset {
  background: rgba(240, 180, 82, .08); border: 1px solid var(--line-gold);
  color: var(--gold-2); border-radius: 999px; padding: 5px 13px;
  font-size: 12.5px; cursor: pointer; font-family: var(--f-body);
}
.preset:hover { border-color: var(--gold); }
.preset-tip { width: 100%; font-size: 11px; color: var(--dim); }
.msg.dm.typing #typingElapsed { color: var(--dim); font-variant-numeric: tabular-nums; }

/* ================================================================
   v4:音效状态 / 战斗飘字 / 粒子 / 震屏 / 场景切换
   ================================================================ */
.fx-float {
  position: fixed; z-index: 96; pointer-events: none;
  transform: translate(-50%, -50%);
  font-family: var(--f-display); font-size: 24px; letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .85), 0 0 18px rgba(0, 0, 0, .6);
  animation: fxFloat 1.05s cubic-bezier(.2, .8, .2, 1) forwards;
}
.fx-float.dmg { color: #ff8f8f; }
.fx-float.crit { color: var(--gold-2); font-size: 34px; }
.fx-float.heal { color: #7ee0a3; }
.fx-float.gold { color: var(--gold-2); font-size: 19px; }
.fx-float.depth { color: #c9b8ff; font-size: 19px; }
.fx-float.kill { color: var(--gold-2); font-size: 20px; letter-spacing: 3px; }
@keyframes fxFloat {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  18%  { opacity: 1; transform: translate(-50%, -62%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -155%) scale(1); }
}

.fx-particle {
  position: fixed; width: 6px; height: 6px; border-radius: 50%;
  z-index: 95; pointer-events: none; opacity: .95;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px currentColor;
  animation: fxParticle .9s ease-out forwards;
}
@keyframes fxParticle {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); }
}

body.fx-shake { animation: fxShake .42s ease-in-out; }
@keyframes fxShake {
  0%, 100% { transform: translate(0, 0); }
  18% { transform: translate(-5px, 2px); }
  36% { transform: translate(5px, -2px); }
  54% { transform: translate(-4px, -2px); }
  72% { transform: translate(4px, 2px); }
  88% { transform: translate(-2px, 1px); }
}

.fx-flash {
  position: fixed; inset: 0; z-index: 94; pointer-events: none;
  animation: fxFlash .52s ease-out forwards;
}
@keyframes fxFlash { from { opacity: .95; } to { opacity: 0; } }

.scene.scene-in .scene-bg { animation: sceneIn .9s ease-out; }
@keyframes sceneIn {
  from { opacity: 0; transform: scale(1.05); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---- 前情提要卡片 ---- */
.recap-card { padding: 14px 16px; }
.recap-card.collapsed .recap-text { display: none; }
.recap-text {
  margin-top: 8px; font-size: 12.5px; line-height: 1.85; color: var(--dim);
  white-space: pre-wrap; max-height: 170px; overflow-y: auto;
  padding-right: 4px; border-top: 1px dashed var(--line); padding-top: 8px;
}

/* ---- 守门 Boss ---- */
.monster-card.boss { border-color: var(--gold-deep); box-shadow: 0 0 26px rgba(240, 180, 82, .2); }
.monster-card.boss .mon-head b { color: var(--gold-2); }
.monster-card.boss .mon-icon { border-color: var(--gold-deep); box-shadow: 0 0 20px rgba(240, 180, 82, .28); }
.mon-boss {
  margin-top: 8px; padding: 4px 9px; border: 1px solid var(--gold-deep);
  border-radius: 8px; color: var(--gold-2); font-size: 11.5px;
  text-align: center; letter-spacing: 1px; background: rgba(240, 180, 82, .07);
}

/* 守门 Boss 提示条 */
.floor-hint.boss {
  color: var(--gold-2); background: rgba(240, 180, 82, .09);
  border-top: 1px dashed var(--line-gold);
}

/* ---- 状态:中毒 / 燃烧 ---- */
.status-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.status-row:empty { display: none; }
.ss-status { display: inline-flex; gap: 5px; flex-shrink: 0; }
.status-chip {
  font-size: 11.5px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap;
}
.status-chip.poison { color: #7ee0a3; border-color: #2b5c43; background: rgba(126, 224, 163, .08); }
.status-chip.burn { color: #ffa94d; border-color: #6b4326; background: rgba(255, 169, 77, .08); }
.badge.poison { color: #7ee0a3; border-color: #2b5c43; }
.badge.burn { color: #ffa94d; border-color: #6b4326; }

/* 教程底部的关于链接 */
.tut-about { margin-top: 12px; font-size: 12px; }
.tut-about a { color: var(--dim); border-bottom: 1px dashed var(--line); }
.tut-about a:hover { color: var(--gold-2); }

.status-chip.shield { color: #9ecbff; border-color: #2b4468; background: rgba(158, 203, 255, .08); }
.badge.shield { color: #9ecbff; border-color: #2b4468; }
.fx-float.shield { color: #9ecbff; font-size: 20px; }

/* ---- 怪物图鉴 ---- */
.codex-btn {
  width: 100%; margin-top: 10px; padding: 7px 10px;
  background: rgba(6, 8, 13, .4); border: 1px dashed var(--line-gold);
  border-radius: 9px; color: var(--gold-2); font-size: 12.5px;
  cursor: pointer; font-family: var(--f-body); letter-spacing: .5px;
}
.codex-btn:hover { background: rgba(240, 180, 82, .08); }
.codex-btn span { color: var(--dim); margin-left: 4px; }
.codex-box { width: min(720px, 94vw); }
.codex-tip { text-align: center; color: var(--dim); font-size: 12.5px; margin: -6px 0 12px; }
.codex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.codex-item {
  display: flex; gap: 9px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: rgba(6, 8, 13, .35);
}
.codex-item.locked { opacity: .5; }
.codex-item.boss { border-color: var(--gold-deep); }
.codex-art {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 8px;
  overflow: hidden; background: #0a0d14; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--dim); font-size: 20px;
}
.codex-art img { width: 100%; height: 100%; object-fit: cover; }
.codex-info { min-width: 0; }
.codex-name { font-size: 13px; color: var(--gold-2); }
.codex-item.locked .codex-name { color: var(--dim); }
.codex-trait { font-size: 11.5px; color: var(--dim); line-height: 1.5; }
.codex-weak { font-size: 11.5px; color: #ffb37e; margin-top: 2px; }
.codex-kill { font-size: 11px; color: #7ee0a3; }
@media (max-width: 560px) { .codex-grid { grid-template-columns: 1fr; } }

.usage-line { margin-top: 6px; font-size: 10.5px; color: var(--dim); letter-spacing: .3px; }

/* 结局输入框 */
.cfg-field textarea {
  width: 100%; min-height: 112px; resize: vertical;
  background: rgba(6, 8, 13, .85); color: var(--text);
  border: 1px solid var(--line-gold); border-radius: 10px;
  padding: 10px 13px; font-size: 14px; line-height: 1.8;
  font-family: var(--f-body); text-align: left;
}
.cfg-field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 180, 82, .14);
}
.cfg-field textarea::placeholder { color: #6f6654; }

/* 成就 */
.end-badges { margin: 10px 0 2px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.end-badges b { font-size: 11px; color: var(--dim); font-weight: 400; letter-spacing: 1px; }
.end-badge { font-size: 11.5px; color: var(--gold-2); border: 1px solid var(--line-gold); border-radius: 999px; padding: 2px 9px; }
.ach-grid { max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.ach-cat { font-size: 11.5px; color: var(--dim); letter-spacing: 2px; margin: 12px 0 5px; }
.ach-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; background: rgba(6,8,13,.35); }
.ach-item.locked { opacity: .5; }
.ach-mark { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; border: 1px solid var(--line-gold); color: var(--gold-2); }
.ach-item.locked .ach-mark { border-color: var(--line); color: var(--dim); }
.ach-title { font-size: 13px; color: var(--gold-2); }
.ach-item.locked .ach-title { color: var(--dim); }
.ach-desc { font-size: 11.5px; color: var(--dim); line-height: 1.5; }

/* 结局弹窗过长时可滚动 */
.end-box { max-height: 92vh; overflow-y: auto; }
.end-box::-webkit-scrollbar { width: 6px; }
.end-box::-webkit-scrollbar-thumb { background: #3a4054; border-radius: 6px; }

.end-badge.fail { color: #ff8f8f; border-color: #6b2b2b; }

.clue-line { margin-top: 4px; font-size: 10.5px; color: #c9a86a; letter-spacing: .3px; }
.clue-line:empty { display: none; }

/* ================================================================
   v12:地牢石殿 UI / 电影感场景卡 / 尘埃与火光
   ================================================================ */
body.dungeon-v2 {
  background-color: #05070b;
  background-image:
    radial-gradient(1100px 520px at 50% -10%, rgba(240, 180, 82, .16) 0%, transparent 60%),
    radial-gradient(900px 600px at 14% 68%, rgba(255, 120, 40, .08) 0%, transparent 55%),
    linear-gradient(180deg, rgba(4, 6, 10, .42) 0%, rgba(4, 6, 10, .82) 100%),
    url("/img/bg/dungeon.webp");
  background-position: center top, left center, center, center;
  background-size: auto, auto, cover, cover;
  background-attachment: scroll, scroll, fixed, fixed;
}
body.dungeon-v2::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(420px 260px at 8% 72%, rgba(255, 138, 42, .16), transparent 70%),
    radial-gradient(380px 240px at 92% 38%, rgba(86, 160, 200, .10), transparent 70%);
  animation: torchGlow 8s ease-in-out infinite alternate;
}
body.dungeon-v2::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 48%, rgba(0, 0, 0, .66) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
body.dungeon-v2 nav {
  background:
    linear-gradient(180deg, rgba(24, 18, 8, .96), rgba(9, 11, 16, .92)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 7px);
  border-bottom: 1px solid #6b5426;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .6), inset 0 -1px 0 rgba(255, 212, 126, .12);
}
body.dungeon-v2 .brand { text-shadow: 0 0 28px rgba(255, 180, 70, .55), 0 2px 0 #3a280c; }
body.dungeon-v2 .panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .04), transparent 26%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #181d29 0%, #0d1119 100%);
  border-color: #4b3d24;
  box-shadow:
    inset 0 0 0 1px rgba(255, 212, 126, .05),
    inset 0 0 44px rgba(0, 0, 0, .5),
    0 18px 48px rgba(0, 0, 0, .62);
}
body.dungeon-v2 .panel::before,
body.dungeon-v2 .panel::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, #e8bd6e, #6b4c1c 70%);
  box-shadow: 0 0 8px rgba(255, 190, 90, .55);
  opacity: .9;
}
body.dungeon-v2 .panel::before { top: 8px; left: 9px; }
body.dungeon-v2 .panel::after { bottom: 8px; right: 9px; }
body.dungeon-v2 .scene {
  border: 1px solid #5a4826; border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 212, 126, .07), inset 0 0 70px rgba(0, 0, 0, .55), 0 14px 40px rgba(0, 0, 0, .5);
}
body.dungeon-v2 .scene-bg { filter: brightness(1.05) saturate(.96) contrast(1.06); }
body.dungeon-v2 .scene::after {
  background:
    linear-gradient(90deg, rgba(5, 7, 11, .92) 0%, rgba(5, 7, 11, .42) 52%, rgba(5, 7, 11, .04) 100%),
    linear-gradient(0deg, rgba(5, 7, 11, .8), transparent 55%);
}
body.dungeon-v2 .scene-name { text-shadow: 0 2px 20px rgba(0, 0, 0, .9), 0 0 18px rgba(255, 180, 80, .25); letter-spacing: 3px; }
body.dungeon-v2 .story-col { background: rgba(8, 11, 17, .78); }
body.dungeon-v2 .status-strip {
  background:
    linear-gradient(180deg, rgba(30, 24, 13, .94), rgba(10, 13, 20, .94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 6px);
  border-top: 1px solid #5d4926; border-bottom: 1px solid #2b2a24;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .4);
}
body.dungeon-v2 .msg.dm {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .025), transparent 40%),
    linear-gradient(180deg, rgba(17, 21, 30, .92), rgba(8, 11, 17, .88));
  border-color: #343b4e; border-left: 2px solid #5a4826;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
}
body.dungeon-v2 .msg.player {
  background: linear-gradient(180deg, #2b2513, #1e190d);
  border-color: #6b5426;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3), inset 0 0 18px rgba(255, 190, 90, .035);
}
body.dungeon-v2 .btn-ghost {
  background: linear-gradient(180deg, rgba(36, 31, 20, .9), rgba(14, 17, 24, .9));
  border-color: #4a3d24; color: #c7b896;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
body.dungeon-v2 .btn-ghost:hover { color: var(--gold-2); border-color: var(--gold-deep); box-shadow: 0 0 14px rgba(240, 180, 82, .16); }
body.dungeon-v2 .chip-btn {
  background: linear-gradient(180deg, #1d2330, #131824);
  border-color: #3b3a33;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
body.dungeon-v2 .chip-btn:hover { box-shadow: 0 0 12px rgba(240, 180, 82, .18); }
body.dungeon-v2 .monster-card {
  background:
    radial-gradient(180px 80px at 85% 0%, rgba(180, 40, 40, .12), transparent 70%),
    linear-gradient(180deg, #1c1a22, #0e1118);
}
body.dungeon-v2 .monster-card.boss { animation: bossPulse 4.2s ease-in-out infinite; }
body.dungeon-v2 .codex-item,
body.dungeon-v2 .ach-item,
body.dungeon-v2 .inv-card li {
  background: linear-gradient(180deg, rgba(26, 31, 43, .8), rgba(11, 14, 20, .8));
  border-color: #353b47;
}

/* 尘埃 */
.dust { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.dust i {
  position: absolute; bottom: -6px; width: 2px; height: 2px; border-radius: 50%;
  background: rgba(255, 221, 160, .55); opacity: 0;
  animation: dustRise 18s linear infinite;
}
.dust i:nth-child(1) { left: 4%; animation-delay: 1s; }
.dust i:nth-child(2) { left: 13%; animation-delay: 7s; }
.dust i:nth-child(3) { left: 24%; animation-delay: 3s; }
.dust i:nth-child(4) { left: 36%; animation-delay: 11s; }
.dust i:nth-child(5) { left: 47%; animation-delay: 5s; }
.dust i:nth-child(6) { left: 58%; animation-delay: 14s; }
.dust i:nth-child(7) { left: 69%; animation-delay: 2s; }
.dust i:nth-child(8) { left: 77%; animation-delay: 9s; }
.dust i:nth-child(9) { left: 85%; animation-delay: 16s; }
.dust i:nth-child(10) { left: 92%; animation-delay: 6s; }
.dust i:nth-child(11) { left: 31%; animation-delay: 12s; }
.dust i:nth-child(12) { left: 64%; animation-delay: 17s; }

/* 电影感场景卡 */
.cinema {
  position: fixed; inset: 0; z-index: 45; pointer-events: none;
  opacity: 0; transition: opacity .45s ease; overflow: hidden;
}
.cinema.show { opacity: 1; }
.cinema-bg {
  position: absolute; inset: -4%; background-size: cover; background-position: center;
  filter: brightness(.78) saturate(1.02) contrast(1.05);
  transform: scale(1.04); transition: transform 3.2s ease-out;
}
.cinema.show .cinema-bg { transform: scale(1.12); }
.cinema-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(4, 6, 10, .94) 0%, rgba(4, 6, 10, .28) 46%, rgba(4, 6, 10, .08) 100%),
    radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(0, 0, 0, .55) 100%);
}
.cinema-caption {
  position: absolute; left: 6%; bottom: 12%; max-width: 62%;
  display: flex; flex-direction: column; gap: 6px;
  padding-left: 14px; border-left: 2px solid var(--gold);
  text-shadow: 0 2px 24px rgba(0, 0, 0, .9);
}
.cinema-caption b {
  font-family: var(--f-display); font-size: clamp(24px, 3.6vw, 40px);
  letter-spacing: 5px; color: var(--gold-2); font-weight: 400;
}
.cinema-caption span { font-size: 13px; color: #cbbd9f; letter-spacing: 2px; }
.cinema.show .cinema-caption { animation: cinemaCaption 3.4s ease-out both; }

@keyframes torchGlow {
  0% { opacity: .72; } 48% { opacity: 1; } 100% { opacity: .8; }
}
@keyframes bossPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(240, 180, 82, .12), 0 0 22px rgba(190, 50, 40, .08); }
  50% { box-shadow: 0 0 0 1px rgba(240, 180, 82, .3), 0 0 34px rgba(220, 60, 40, .18); }
}
@keyframes dustRise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  12% { opacity: .5; }
  70% { opacity: .28; }
  100% { transform: translateY(-92vh) translateX(22px); opacity: 0; }
}
@keyframes cinemaCaption {
  0% { opacity: 0; transform: translateY(12px); }
  18% { opacity: 1; transform: translateY(0); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .cinema, .cinema-bg, .cinema-caption, .dust i, body.dungeon-v2::before, body.dungeon-v2 .monster-card.boss { animation: none !important; transition: none !important; }
}

/* 移动端:标题不再被挤掉 */
@media (max-width: 640px) {
  body.dungeon-v2 nav { flex-wrap: wrap; row-gap: 6px; padding: 8px 12px; }
  body.dungeon-v2 .brand { font-size: 17px; letter-spacing: 3px; flex: 0 0 auto; }
  body.dungeon-v2 nav .sub {
    order: 3; flex-basis: 100%; text-align: center;
    font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body.dungeon-v2 .nav-btns { margin-left: auto; display: flex; gap: 4px; }
  body.dungeon-v2 .nav-btns .btn-ghost { padding: 4px 8px; font-size: 11px; }
  body.dungeon-v2 .cinema-caption { left: 8%; bottom: 16%; max-width: 78%; }
  body.dungeon-v2 .cinema-caption b { font-size: 26px; letter-spacing: 3px; }
  body.dungeon-v2 .cinema-caption span { font-size: 11px; }
}

@media (max-width: 640px) {
  body.dungeon-v2 nav { padding-left: 18px; }
  body.dungeon-v2 .brand { padding-left: 2px; }
}

/* 真正的石纹面板 + 更多火把光 */
body.dungeon-v2 .panel {
  background-color: #0d1119;
  background-image:
    linear-gradient(180deg, rgba(7, 10, 16, .58) 0%, rgba(7, 10, 16, .78) 100%),
    url("/img/ui/stone.webp");
  background-size: auto, 460px auto;
  background-position: center, top left;
  background-repeat: repeat;
  border: 2px solid #4a3c22;
  border-radius: 9px;
  box-shadow:
    inset 0 0 0 1px rgba(190, 145, 62, .22),
    inset 0 0 38px rgba(0, 0, 0, .72),
    0 18px 46px rgba(0, 0, 0, .6);
}
body.dungeon-v2 .story-col { background: transparent; }
body.dungeon-v2 .panel::before {
  content: ""; width: 22px; height: 22px; border-radius: 3px 0 0 0;
  border-top: 2px solid #a77e36; border-left: 2px solid #a77e36;
  background: none; box-shadow: 0 0 10px rgba(255, 180, 70, .2);
  top: 5px; left: 5px;
}
body.dungeon-v2 .panel::after {
  content: ""; width: 22px; height: 22px; border-radius: 0 0 3px 0;
  border-bottom: 2px solid #a77e36; border-right: 2px solid #a77e36;
  background: none; box-shadow: 0 0 10px rgba(255, 180, 70, .2);
  bottom: 5px; right: 5px;
}
body.dungeon-v2 .char-card,
body.dungeon-v2 .map-card,
body.dungeon-v2 .recap-card,
body.dungeon-v2 .inv-card,
body.dungeon-v2 .merchant-card { background-color: transparent; }
body.dungeon-v2 .scene::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(190px 170px at 5% 92%, rgba(255, 140, 40, .28), transparent 70%),
    radial-gradient(150px 140px at 94% 12%, rgba(255, 110, 20, .18), transparent 72%);
  animation: torchSconce 5.2s ease-in-out infinite alternate;
}
.torches { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.torches i {
  position: absolute; width: 430px; height: 430px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 156, 58, .34) 0%, rgba(255, 96, 20, .12) 42%, transparent 70%);
  filter: blur(18px); animation: torchFlicker 5.4s ease-in-out infinite;
}
.torches i:nth-child(1) { left: -120px; bottom: 4%; animation-delay: 0s; }
.torches i:nth-child(2) { right: -130px; top: 12%; animation-delay: 1.4s; animation-duration: 6.2s; }
.torches i:nth-child(3) { left: 8%; top: -150px; animation-delay: 2.2s; animation-duration: 4.8s; }
.torches i:nth-child(4) { right: 10%; bottom: -170px; animation-delay: 3.1s; animation-duration: 6.8s; }
.torches i:nth-child(5) { left: 42%; top: -190px; animation-delay: 0.8s; opacity: .75; }
.torches i:nth-child(6) { left: 23%; top: 34%; animation-delay: 4.3s; animation-duration: 7.4s; opacity: .55; }
.torches i:nth-child(7) { right: 24%; bottom: 18%; animation-delay: 2.7s; animation-duration: 5.8s; opacity: .5; }

@keyframes torchFlicker {
  0%, 100% { opacity: .62; transform: scale(.96); }
  18% { opacity: .95; transform: scale(1.03); }
  37% { opacity: .72; transform: scale(.99); }
  58% { opacity: 1; transform: scale(1.06); }
  76% { opacity: .68; transform: scale(.98); }
}
@keyframes torchSconce {
  0% { opacity: .55; } 45% { opacity: .9; } 100% { opacity: .62; }
}
@media (max-width: 640px) {
  .torches i { width: 260px; height: 260px; }
}

/* 石纹再压暗一点,保证正文可读 */
body.dungeon-v2 .panel {
  background-image:
    linear-gradient(180deg, rgba(6, 9, 14, .70) 0%, rgba(6, 9, 14, .86) 100%),
    url("/img/ui/stone.webp");
}
body.dungeon-v2 .feed {
  background: linear-gradient(180deg, rgba(5, 8, 13, .48), rgba(5, 8, 13, .66));
}
body.dungeon-v2 .char-card,
body.dungeon-v2 .map-card,
body.dungeon-v2 .recap-card {
  background-color: rgba(6, 9, 14, .24);
}
body.dungeon-v2 .brand { padding-left: 5px; }


body.dungeon-v2 .story-col { animation: panelTorch 7.5s ease-in-out infinite; }
body.dungeon-v2 nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 160, 60, .55), transparent);
  animation: torchLine 4.8s ease-in-out infinite;
}
@keyframes panelTorch {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(190,145,62,.22), inset 0 0 38px rgba(0,0,0,.72), 0 18px 46px rgba(0,0,0,.6), inset 0 0 60px rgba(255,120,30,.02); }
  50% { box-shadow: inset 0 0 0 1px rgba(220,160,60,.32), inset 0 0 38px rgba(0,0,0,.72), 0 18px 46px rgba(0,0,0,.6), inset 0 0 80px rgba(255,120,30,.09); }
}
@keyframes torchLine {
  0%, 100% { opacity: .35; } 45% { opacity: .9; } 70% { opacity: .5; }
}

/* API 方案选择 */
.setup-box { width: min(760px, 94vw); text-align: left; }
.setup-box h1 { text-align: center; font-size: 25px; margin-bottom: 4px; }
.setup-sub { text-align: center; color: var(--dim); font-size: 12.5px; margin: 0 0 16px; line-height: 1.8; }
.api-choice {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(20, 25, 36, .9), rgba(8, 11, 17, .9));
}
.api-choice + .api-choice { margin-top: 12px; }
.api-choice.own { border-color: var(--line-gold); box-shadow: inset 0 0 30px rgba(240, 180, 82, .03); }
.api-choice-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.api-choice-head b { font-size: 16px; color: var(--gold-2); }
.api-badge { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; letter-spacing: 1px; }
.api-badge.warn { color: #ff9b9b; border: 1px solid #6b2b2b; background: rgba(255, 80, 80, .06); }
.api-badge.rec { color: #9ee6b8; border: 1px solid #2b5c43; background: rgba(90, 220, 150, .07); }
.api-choice p { color: var(--dim); font-size: 12.5px; line-height: 1.8; margin: 2px 0 10px; }
.api-choice p b { color: var(--text); }
.api-link { margin: 4px 0 12px; font-size: 12px; }
.api-link a { color: var(--gold-2); border-bottom: 1px dashed var(--line-gold); }
.api-choice .cfg-field { max-width: none; margin-bottom: 9px; }
.api-choice .btn-gold, .api-choice .btn-ghost { margin-top: 4px; }
.setup-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
#cfgCurrent { color: var(--dim); font-size: 11.5px; }
@media (max-width: 560px) {
  .setup-box { padding: 16px 14px; }
  .api-choice { padding: 12px; }
}
