/* ==========================================================================
   《焰色沉海》三层固定敦煌惊燕锦边装裱框架 & 宋刻古绢题跋 UI
   - 顶层 z-30：左右各 7.4% 固定宝相花惊燕锦边（取自 cg_ruby_blood.png）
   - 中层 z-32 / z-20：八角海棠/双璜玉牌按钮、双轴罗盘、红宝槽、居中对话框
   - 底层 z-10 / z-15：85.2% 古绢画芯 + Canvas 粒子物理特效层
   ========================================================================== */

#app-viewport {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(41, 86, 122, 0.16) 0%, rgba(9, 7, 6, 0.98) 76%);
}

.dunhuang-stage {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  min-width: 960px;
  min-height: 540px;
  overflow: hidden;
  background-color: #141210;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(217, 167, 74, 0.28);
  container-type: inline-size;
}

@media (max-width: 980px) {
  .dunhuang-stage {
    min-width: 0;
    min-height: 0;
    width: 100vw;
    height: min(100vh, calc(100vw * 9 / 16));
  }
}

/* --------------------------------------------------------------------------
   1. 底层 z-10：85.2% 古绢画芯层 + 桑蚕经纬暗纹
   -------------------------------------------------------------------------- */
.painting-core {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7.4%;
  right: 7.4%;
  z-index: var(--z-painting-core);
  overflow: hidden;
  background-color: #1a222b;
}

.painting-artwork {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
  transform-origin: center center;
  transition: opacity 480ms ease, filter 450ms ease;
}

/* 仅对历史遗留的 3 张自带双边框旧 PNG 做去框放大，新入库满幅 PNG 保持原比例 */
.painting-artwork[src$="map_siyi_atlas.png"],
.painting-artwork[src$="char_yin_ke_cat.png"],
.painting-artwork[src$="char_yue_zhang_plaque.png"] {
  transform: scale(1.174);
}

.painting-artwork.is-dimmed {
  filter: brightness(0.72) saturate(0.85);
}

/* 陈年桑蚕古绢十字经纬肌理叠加 */
.silk-weave-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  opacity: 0.16;
  background-image:
    repeating-linear-gradient(0deg, rgba(242, 234, 217, 0.12) 0px, rgba(242, 234, 217, 0.12) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(242, 234, 217, 0.10) 0px, rgba(242, 234, 217, 0.10) 1px, transparent 1px, transparent 4px);
}

/* 底层 Canvas 粒子物理层 */
.canvas-fx-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-canvas-fx);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   2. 顶层 z-30：固定左/右 7.4% 敦煌乌丝描金装裱侧栏（去除旧版 1351% 模糊拉伸底图）
   -------------------------------------------------------------------------- */
.brocade-pillar-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7.4%;
  z-index: var(--z-brocade-frame);
  pointer-events: none;
  background-color: #100d0b;
  background-image:
    repeating-linear-gradient(0deg, rgba(217, 167, 74, 0.045) 0px, rgba(217, 167, 74, 0.045) 1px, transparent 1px, transparent 5px),
    repeating-linear-gradient(90deg, rgba(217, 167, 74, 0.035) 0px, rgba(217, 167, 74, 0.035) 1px, transparent 1px, transparent 5px),
    linear-gradient(180deg, rgba(26, 20, 17, 0.96) 0%, rgba(14, 12, 11, 0.94) 50%, rgba(22, 16, 15, 0.97) 100%);
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.brocade-pillar-bg::before {
  content: '';
  position: absolute;
  inset: 6px 4px;
  border-top: 1px solid rgba(217, 167, 74, 0.32);
  border-bottom: 1px solid rgba(217, 167, 74, 0.32);
  background: radial-gradient(circle at 50% 50%, rgba(92, 16, 30, 0.14) 0%, transparent 75%);
}

.brocade-pillar-bg.is-left {
  left: 0;
  border-right: 1.5px solid var(--dh-gold-leaf);
  box-shadow:
    inset -1px 0 0 rgba(245, 208, 118, 0.38),
    10px 0 26px rgba(6, 5, 4, 0.82);
}

.brocade-pillar-bg.is-right {
  right: 0;
  border-left: 1.5px solid var(--dh-gold-leaf);
  box-shadow:
    inset 1px 0 0 rgba(245, 208, 118, 0.38),
    -10px 0 26px rgba(6, 5, 4, 0.82);
}

/* 第4次超额读血 · 强制昏迷三日 · 左右锦边卷轴合拢门帘 */
.brocade-scroll-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: var(--z-coma-veil);
  pointer-events: none;
  opacity: 0;
  background-color: rgba(12, 10, 8, 0.96);
  background-image:
    repeating-linear-gradient(0deg, rgba(217, 167, 74, 0.05) 0px, rgba(217, 167, 74, 0.05) 1px, transparent 1px, transparent 6px),
    radial-gradient(circle at center, rgba(42, 27, 56, 0.45), rgba(10, 8, 7, 0.98));
  transition: transform 760ms cubic-bezier(0.65, 0, 0.35, 1), opacity 260ms ease;
}

.brocade-scroll-door.is-left {
  left: 0;
  transform: translateX(-100%);
  border-right: 3px solid var(--dh-gold-leaf);
}

.brocade-scroll-door.is-right {
  right: 0;
  transform: translateX(100%);
  border-left: 3px solid var(--dh-gold-leaf);
}

.dunhuang-stage.is-coma-closed .brocade-scroll-door.is-left,
.dunhuang-stage.is-coma-closed .brocade-scroll-door.is-right {
  opacity: 1;
  transform: translateX(0);
}

/* 昏迷苏醒时眼睑微启一线遮罩 */
.eyelid-slit-veil {
  position: absolute;
  inset: 0;
  z-index: var(--z-coma-veil);
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 6, 6, 0.96) 0%,
    rgba(8, 6, 6, 0.82) 22%,
    transparent 42%,
    transparent 58%,
    rgba(8, 6, 6, 0.82) 78%,
    rgba(8, 6, 6, 0.96) 100%
  );
  transition: opacity 700ms ease;
}

.dunhuang-stage.is-eyelid-slit .eyelid-slit-veil {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   3. 锦边柱内嵌 HUD 容器（z-32，严格停留在左右 7.4% 锦边内）
   -------------------------------------------------------------------------- */
.hud-pillar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7.4%;
  z-index: var(--z-brocade-widgets);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 12px;
  pointer-events: auto;
}

.hud-pillar.is-left {
  left: 0;
}

.hud-pillar.is-right {
  right: 0;
}

.pillar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* 双轴罗盘容器 */
.compass-widget {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  background: rgba(14, 11, 9, 0.72);
  border-top: 1px solid rgba(217, 167, 74, 0.65);
  border-bottom: 1px solid rgba(217, 167, 74, 0.65);
}

.compass-svg {
  width: 68px;
  height: 68px;
  max-width: 92%;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.85));
}

.compass-readout {
  font-size: var(--text-label-min);
  line-height: 1.25;
  text-align: center;
  color: var(--dh-gold-bright);
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.04em;
}

.compass-readout.is-blood {
  color: var(--dh-ruby-bright);
}

/* 悬浮数值详情小牌（不遮挡主画芯，悬停显现） */
.compass-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 6px;
  width: 210px;
  padding: 10px 12px;
  background: rgba(16, 13, 11, 0.94);
  border: 1px solid var(--dh-gold-leaf);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
  font-size: 13px;
  line-height: 1.65;
  color: var(--dh-rice-paper);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 45;
}

.compass-widget:hover .compass-tooltip,
.compass-widget:focus-within .compass-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* --------------------------------------------------------------------------
   SVG 描金八角海棠牌 / 先秦双璜玉牌按钮（严格零胶囊圆角）
   -------------------------------------------------------------------------- */
.jade-plaque-btn {
  position: relative;
  width: 92%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, filter 160ms ease;
}

.jade-plaque-btn svg.plaque-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.jade-plaque-btn .plaque-label {
  position: relative;
  z-index: 2;
  font-size: var(--text-label-min);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--dh-rice-paper);
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}

.jade-plaque-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.16) drop-shadow(0 0 8px rgba(217, 167, 74, 0.52));
}

.jade-plaque-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.jade-plaque-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.jade-plaque-btn.is-active .plaque-label {
  color: var(--dh-gold-bright);
}

.jade-plaque-btn.is-blood-ready {
  filter: drop-shadow(0 0 10px rgba(200, 30, 58, 0.85));
}

.jade-plaque-btn.is-blood-ready .plaque-label {
  color: #FFEBF0;
}

.jade-plaque-btn.is-overdose-warn .plaque-label {
  color: #FF8AA0;
}

/* 右侧【触血识忆】3枚八面体红宝石槽 */
.ruby-slots-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 2px 8px;
  background: rgba(14, 11, 9, 0.76);
  border-top: 1px solid rgba(217, 167, 74, 0.65);
  border-bottom: 1px solid rgba(217, 167, 74, 0.65);
}

.ruby-slots-title {
  font-size: var(--text-label-min);
  color: var(--dh-gold-bright);
  letter-spacing: 0.1em;
  text-shadow: 0 1px 2px #000;
}

.ruby-slots-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ruby-gem-slot {
  width: 40px;
  height: 46px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ruby-gem-slot svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ruby-slots-count {
  font-size: var(--text-label-min);
  color: #FFEBF0;
  text-shadow: 0 1px 2px #000;
}

.bside-badge-count {
  position: absolute;
  top: -4px;
  right: 2px;
  padding: 0 4px;
  background: var(--dh-cinnabar);
  border: 1px solid var(--dh-gold-bright);
  color: #FFF8E7;
  font-size: 11px;
  line-height: 14px;
  z-index: 3;
}

/* --------------------------------------------------------------------------
   4. 中层 z-20：画芯上方章节幕卡 & 专用瞬时反馈带（双调对比三元组）
   -------------------------------------------------------------------------- */
.chapter-placard {
  position: absolute;
  top: 12px;
  left: 9.2%;
  z-index: var(--z-hud-dialogue);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--dh-glaze-silk);
  color: var(--dh-ink-slate);
  border: 1px solid var(--dh-malachite-jade);
  box-shadow: 0 0 0 1px rgba(217, 167, 74, 0.55), 0 4px 16px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.chapter-placard .placard-seal {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dh-cinnabar);
  color: #FFF8E7;
  font-size: 12px;
  border: 1px solid var(--dh-gold-leaf);
}

.chapter-placard .placard-chapter {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.chapter-placard .placard-location {
  font-size: var(--text-label-min);
  color: var(--dh-ink-charcoal);
  border-left: 1px solid rgba(74, 155, 155, 0.55);
  padding-left: 10px;
}

/* 专用瞬时飘字反馈带 */
.feedback-band {
  position: absolute;
  z-index: var(--z-feedback-band);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-band.is-left {
  left: 9.2%;
  top: 56px;
  align-items: flex-start;
}

.feedback-band.is-right {
  right: 9.2%;
  top: 14px;
  align-items: flex-end;
}

.feedback-band.is-center-law {
  left: 25%;
  right: 25%;
  top: 46%;
  align-items: center;
}

.toast-triad {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  animation: toastFloatUp 1400ms ease forwards;
}

.toast-triad.is-karma {
  color: #FFF8E7;
  background: var(--dh-glaze-celadon);
  border: 1px solid var(--dh-gold-leaf);
  text-shadow: 0 0 2px #16262E, 1px 1px 0 #16262E, -1px -1px 0 #16262E;
}

.toast-triad.is-blood {
  color: #FFEBF0;
  background: var(--dh-glaze-crimson);
  border: 1px solid var(--dh-gold-leaf);
  text-shadow: 0 0 2px #3D0A14, 1px 1px 0 #3D0A14, -1px -1px 0 #3D0A14;
}

.toast-triad.is-law {
  font-size: 20px;
  padding: 10px 22px;
  color: var(--dh-gold-bright);
  background: rgba(18, 16, 26, 0.92);
  border: 1.5px solid var(--dh-gold-leaf);
  box-shadow: 0 0 24px rgba(217, 167, 74, 0.45);
  text-shadow: 0 0 3px #0D0C12, 1px 1px 0 #0D0C12, -1px -1px 0 #0D0C12;
}

/* --------------------------------------------------------------------------
   5. 剧场核心：居中半透题跋对话框（严格卡在 7.6% ~ 7.6% 之间）
   -------------------------------------------------------------------------- */
.dialogue-dock {
  position: absolute;
  left: 7.6%;
  right: 7.6%;
  bottom: 10px;
  z-index: var(--z-hud-dialogue);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 宋刻竹简 / 描金宣纸长笺选项区 */
.choices-tray {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 78%;
  margin: 0 auto 2px;
}

.choice-slip {
  position: relative;
  width: 100%;
  min-height: 44px;
  padding: 9px 18px 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background:
    linear-gradient(90deg, rgba(26, 22, 17, 0.92) 0%, rgba(22, 28, 34, 0.88) 60%, rgba(26, 22, 17, 0.92) 100%);
  border-top: 1px solid var(--dh-gold-leaf);
  border-bottom: 1px solid var(--dh-gold-leaf);
  border-left: 4px solid var(--dh-cinnabar);
  border-right: 4px solid var(--dh-gold-antique);
  box-shadow:
    inset 0 0 0 1px rgba(245, 208, 118, 0.22),
    0 4px 14px rgba(0, 0, 0, 0.68);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.choice-slip::before,
.choice-slip::after {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 4px;
  border-left: 1px solid rgba(217, 167, 74, 0.45);
}

.choice-slip::before { left: 4px; }
.choice-slip::after { right: 4px; }

.choice-slip:hover {
  transform: translateX(4px);
  background: linear-gradient(90deg, rgba(44, 24, 24, 0.94) 0%, rgba(30, 52, 60, 0.92) 60%, rgba(28, 22, 17, 0.94) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(245, 208, 118, 0.55),
    0 6px 18px rgba(0, 0, 0, 0.82);
}

.choice-slip-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.choice-seal-prefix {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dh-gold-bright);
  font-size: 14px;
}

.choice-ink-circle {
  position: absolute;
  inset: -2px;
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.choice-ink-circle circle {
  fill: none;
  stroke: var(--dh-cinnabar);
  stroke-width: 1.8;
  stroke-dasharray: 76;
  stroke-dashoffset: 76;
  transition: stroke-dashoffset 280ms ease;
}

.choice-slip:hover .choice-ink-circle circle {
  stroke-dashoffset: 0;
}

.choice-slip-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--dh-rice-paper);
}

.choice-slip-cue {
  font-size: 13px;
  color: rgba(217, 167, 74, 0.78);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

/* 重彩绢本半透题跋匣对话框 */
.dialogue-box {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 14px;
  min-height: 146px;
  padding: 12px 18px 12px 12px;
  background-color: var(--dh-lacquer-ebony);
  background-image:
    repeating-linear-gradient(0deg, rgba(242, 234, 217, 0.03) 0px, rgba(242, 234, 217, 0.03) 1px, transparent 1px, transparent 5px),
    repeating-linear-gradient(90deg, rgba(242, 234, 217, 0.03) 0px, rgba(242, 234, 217, 0.03) 1px, transparent 1px, transparent 5px);
  border-top: 2px solid var(--dh-gold-leaf);
  border-bottom: 2px solid var(--dh-gold-leaf);
  border-left: 1px solid rgba(217, 167, 74, 0.5);
  border-right: 1px solid rgba(217, 167, 74, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(245, 208, 118, 0.3),
    inset 0 -1px 0 rgba(245, 208, 118, 0.3),
    0 -8px 28px rgba(0, 0, 0, 0.65);
}

/* 敦煌回纹角饰 */
.fret-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border-color: var(--dh-gold-bright);
  border-style: solid;
}
.fret-corner.tl { top: 3px; left: 3px; border-width: 1.5px 0 0 1.5px; }
.fret-corner.tr { top: 3px; right: 3px; border-width: 1.5px 1.5px 0 0; }
.fret-corner.bl { bottom: 3px; left: 3px; border-width: 0 0 1.5px 1.5px; }
.fret-corner.br { bottom: 3px; right: 3px; border-width: 0 1.5px 1.5px 0; }

/* 左下角 1:1 宫廷团扇/朱砂方印三无微表情窗 */
.kuudere-seal-dock {
  width: 122px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.kuudere-seal-frame {
  position: relative;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle at center, rgba(44, 58, 71, 0.55), rgba(14, 11, 9, 0.92));
  border: 1.5px solid var(--dh-gold-leaf);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.72), 0 0 12px rgba(217, 167, 74, 0.25);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kuudere-seal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kuudere-seal-svg {
  width: 100%;
  height: 100%;
}

.kuudere-stage-caption {
  font-size: var(--text-label-min);
  color: var(--dh-gold-bright);
  letter-spacing: 0.08em;
  text-align: center;
}

/* 对话主文本区 */
.dialogue-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.dialogue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(217, 167, 74, 0.28);
  padding-bottom: 5px;
}

.speaker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speaker-seal {
  padding: 2px 10px;
  background: linear-gradient(135deg, rgba(184, 29, 56, 0.85), rgba(92, 16, 30, 0.92));
  border: 1px solid var(--dh-gold-leaf);
  color: #FFF8E7;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.speaker-seal.is-narration {
  background: linear-gradient(135deg, rgba(41, 86, 122, 0.85), rgba(22, 50, 79, 0.92));
}

.speaker-title {
  font-size: var(--text-label-min);
  color: var(--dh-mist-celadon);
  letter-spacing: 0.08em;
}

.dialogue-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-toggle-btn {
  padding: 2px 10px;
  border: 1px solid rgba(217, 167, 74, 0.65);
  background: rgba(26, 34, 43, 0.78);
  color: var(--dh-gold-bright);
  font-size: var(--text-label-min);
  letter-spacing: 0.06em;
  transition: background 150ms ease, border-color 150ms ease;
}

.font-toggle-btn:hover {
  background: rgba(74, 155, 155, 0.32);
  border-color: var(--dh-gold-bright);
}

.dialogue-body {
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
  color: var(--dh-rice-paper);
  letter-spacing: 0.03em;
  max-width: none; /* 宽屏铺满对话框；原 44em 在桌面留出右侧大块空白 */
  min-height: 62px;
  cursor: pointer;
}

.dialogue-body.is-relaxed {
  --text-body-size: 20px;
  --text-body-line: 1.85;
}

.dialogue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-label-min);
  color: rgba(220, 230, 232, 0.75);
}

.blood-inline-btn {
  padding: 3px 12px;
  background: rgba(92, 16, 30, 0.88);
  border: 1px solid var(--dh-gold-leaf);
  color: #FFEBF0;
  font-size: var(--text-label-min);
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.blood-inline-btn:hover {
  background: rgba(184, 29, 56, 0.92);
  box-shadow: 0 0 12px rgba(255, 94, 126, 0.55);
}

.advance-hint {
  margin-left: auto;
  color: var(--dh-gold-bright);
  letter-spacing: 0.1em;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   6. 通用半透明古卷弹窗层（记忆画框 / 星芒舆图 / B面切片 / 锁线金字塔 / 存档）
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7.4%;
  right: 7.4%;
  z-index: var(--z-modal);
  background: rgba(10, 12, 14, 0.84);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 26px;
}

.scroll-modal {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(160deg, rgba(22, 30, 36, 0.94) 0%, rgba(16, 14, 13, 0.96) 100%);
  border: 2px solid var(--dh-gold-leaf);
  box-shadow: inset 0 0 0 1px rgba(74, 155, 155, 0.45), 0 18px 48px rgba(0, 0, 0, 0.9);
  padding: 18px 22px;
  overflow: hidden;
}

.scroll-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(217, 167, 74, 0.42);
  padding-bottom: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.scroll-modal-title {
  margin: 0;
  font-size: var(--text-title-min);
  color: var(--dh-gold-bright);
  letter-spacing: 0.15em;
}

.scroll-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

/* 触血记忆浮现半透明画框 */
.memory-scroll-card {
  position: absolute;
  top: 16%;
  left: 14%;
  right: 14%;
  z-index: 42;
  padding: 18px 22px;
  background: rgba(22, 16, 20, 0.92);
  border: 1.5px solid var(--dh-gold-leaf);
  box-shadow: 0 0 0 1px rgba(200, 30, 58, 0.65), 0 14px 36px rgba(0, 0, 0, 0.85);
}

.memory-scroll-card.is-ruby {
  background: rgba(20, 18, 28, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 94, 126, 0.75), 0 14px 36px rgba(184, 29, 56, 0.35);
}

.memory-card-title {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--dh-gold-bright);
  letter-spacing: 0.1em;
}

.memory-card-text {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--dh-rice-paper);
}

/* 标题与三阶锁线星芒鉴 */
.pyramid-grid {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 12px;
  margin-top: 8px;
}

.pyramid-tier {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.route-card {
  width: 224px;
  padding: 12px 14px;
  background: rgba(24, 30, 36, 0.88);
  border: 1.5px solid var(--dh-gold-leaf);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.route-card-portrait-stage {
  position: relative;
  width: 100%;
  height: 128px;
  margin-bottom: 4px;
  border: 1px solid rgba(217, 167, 74, 0.42);
  background:
    radial-gradient(circle at 50% 42%, rgba(200, 30, 58, 0.22) 0%, rgba(22, 50, 79, 0.45) 55%, rgba(12, 10, 14, 0.95) 100%);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.route-card-portrait-stage.is-silhouette {
  border-color: rgba(159, 117, 45, 0.35);
  background:
    radial-gradient(circle at 50% 48%, rgba(42, 27, 56, 0.48) 0%, rgba(12, 10, 14, 0.96) 80%);
}

.route-card-portrait-stage.is-duo {
  height: 136px;
  gap: 12px;
}

.route-card-sprite {
  height: 118%;
  max-width: 86%;
  object-fit: contain;
  object-position: top center;
  transform: translateY(10%);
  transition: filter 320ms ease, opacity 320ms ease, transform 320ms ease;
}

.route-card-portrait-stage.is-duo .route-card-sprite {
  max-width: 44%;
}

.route-card-sprite.is-unlocked {
  filter: drop-shadow(0 2px 12px rgba(6, 5, 4, 0.72));
  opacity: 1;
}

.route-card:hover .route-card-sprite.is-unlocked {
  transform: translateY(7%) scale(1.03);
}

.route-card-sprite.is-silhouette {
  filter: brightness(0) contrast(1.3) drop-shadow(0 0 7px rgba(217, 167, 74, 0.58));
  opacity: 0.78;
}

.route-portrait-status-pill {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 7px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  border: 1px solid rgba(217, 167, 74, 0.55);
  background: rgba(16, 13, 12, 0.85);
  color: #F5D076;
  pointer-events: none;
}

.route-portrait-status-pill.is-shadow {
  border-color: rgba(255, 94, 126, 0.45);
  background: rgba(42, 18, 28, 0.88);
  color: #FFEBF0;
}

.route-card.is-locked {
  border-color: rgba(159, 117, 45, 0.45);
  background: rgba(22, 16, 26, 0.88);
}

.route-card.is-tier2 {
  border-color: var(--dh-cinnabar);
}

.route-card.is-tier3 {
  border-color: var(--dh-serpent-glow);
  background: linear-gradient(155deg, rgba(28, 18, 38, 0.94), rgba(16, 13, 18, 0.96));
}

.route-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--dh-gold-bright);
  letter-spacing: 0.08em;
}

.route-card-sub {
  font-size: var(--text-label-min);
  color: var(--dh-mist-celadon);
}

.route-card-desc {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(242, 234, 217, 0.85);
}

.route-lock-overlay {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #FFEBF0;
  padding: 4px 8px;
  background: rgba(92, 16, 30, 0.55);
  border: 1px solid rgba(255, 94, 126, 0.45);
}

.route-card.is-tier3 .route-lock-overlay {
  background: rgba(42, 27, 56, 0.78);
  border-color: rgba(217, 167, 74, 0.55);
}

/* 四仪星芒堪舆图 */
.atlas-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  height: 100%;
}

.atlas-map-wrap {
  position: relative;
  border: 1px solid var(--dh-gold-leaf);
  background: radial-gradient(circle at 46% 50%, #1d3c47 0%, #10242e 60%, #0b161d 100%);
  overflow: hidden;
}

.atlas-detail-panel {
  border: 1px solid rgba(217, 167, 74, 0.55);
  background: rgba(16, 18, 22, 0.88);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.atlas-landmark-node {
  cursor: pointer;
}

.atlas-landmark-node:hover .landmark-ring {
  stroke: var(--dh-gold-bright);
  stroke-width: 2.5;
}

/* B-Side 伏羲三魂切片暗卷 */
.bside-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.bside-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.bside-card {
  padding: 14px;
  background: rgba(16, 14, 22, 0.92);
  border: 1px solid rgba(217, 167, 74, 0.52);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bside-card.is-locked {
  opacity: 0.6;
  border-style: dashed;
}

/* 存档与历史记录列表 */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.save-slot-card {
  padding: 12px 14px;
  background: rgba(22, 26, 30, 0.88);
  border: 1px solid rgba(217, 167, 74, 0.55);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  padding: 10px 14px;
  background: rgba(22, 24, 28, 0.82);
  border-left: 3px solid var(--dh-gold-leaf);
}

/* 矮屏（手机横持）：锦边按钮多于柱高时可上下滑动，按钮收紧（设置钮加入后左柱 8 枚） */
@media (max-height: 520px) {
  .hud-pillar {
    justify-content: flex-start;
    gap: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding-top: 6px;
    padding-bottom: 8px;
  }
  .hud-pillar::-webkit-scrollbar { display: none; }
  .hud-pillar .pillar-group { gap: 5px; }
  .hud-pillar .jade-plaque-btn { min-height: 32px; flex-shrink: 0; }
}
