:root {
  --bg-void: #050507;
  --text-main: #f3efe6;
  --text-muted: rgba(243, 239, 230, 0.68);
  --text-dim: rgba(243, 239, 230, 0.42);

  /* 动态异火主题变量 */
  --c-primary: #d4a638;
  --c-secondary: #6e4e12;
  --c-core: #fff0b3;
  --c-glow: rgba(212, 166, 56, 0.38);

  /* 卷宗同色墨韵变量 */
  --c-ink-bright: #ffeeb3;
  --c-ink-body: #ebd38d;
  --c-ink-dim: rgba(212, 166, 56, 0.72);
  --c-ink-line: rgba(212, 166, 56, 0.28);

  /* 实时由 JS 帧同步火焰呼吸明暗系数 (0.76 ~ 1.24) */
  --flame-pulse: 1;

  --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'Kaiti SC', 'PingFang SC', serif;
  --font-calli: 'Ma Shan Zheng', 'Kaiti SC', 'STKaiti', 'Noto Serif SC', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.04;
  background-image: radial-gradient(rgba(255, 255, 255, 0.45) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

/* 三层全屏画布舞台 */
#shader-flame-canvas,
#fx-canvas,
#transition-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
}

#shader-flame-canvas {
  z-index: 1;
}

#fx-canvas {
  z-index: 2;
  pointer-events: none;
}

#transition-canvas {
  z-index: 6;
  pointer-events: none;
}

/* 顶部极简古风控制栏 */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0.85) 0%, rgba(5, 5, 7, 0) 100%);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
}

.brand-seal {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--font-calli);
  font-size: 18px;
  color: var(--c-core);
  background: radial-gradient(circle at 35% 35%, var(--c-primary), var(--c-secondary));
  border: 1px solid var(--c-ink-line);
  box-shadow: 0 0 16px var(--c-glow);
  transition: box-shadow 0.6s ease, background 0.6s ease;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--c-ink-bright);
  transition: color 0.6s ease;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--c-ink-dim);
  transition: color 0.6s ease;
}

.top-center {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--c-ink-line);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--c-ink-dim);
  transition: border-color 0.6s ease, color 0.6s ease;
}

.vol-step {
  color: var(--c-ink-bright);
  font-weight: 600;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 8, 12, 0.55);
  backdrop-filter: blur(8px);
  color: var(--c-ink-body);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
}

.ctrl-btn:hover {
  border-color: var(--c-primary);
  color: var(--c-ink-bright);
  box-shadow: 0 0 14px var(--c-glow);
}

.ctrl-btn.is-active {
  border-color: var(--c-primary);
  color: var(--c-core);
  box-shadow: 0 0 16px var(--c-glow);
}

.btn-icon {
  color: var(--c-primary);
}

/* 纯净观火模式 */
.zen-exit-btn {
  position: fixed;
  top: 18px;
  right: 28px;
  z-index: 15;
  padding: 7px 15px;
  border-radius: 4px;
  border: 1px solid var(--c-ink-line);
  background: rgba(8, 8, 12, 0.58);
  backdrop-filter: blur(8px);
  color: var(--c-ink-bright);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, border-color 0.25s ease;
}

body.zen-mode .top-bar,
body.zen-mode .scroll-dossier,
body.zen-mode .flame-rail,
body.zen-mode .controls-hint {
  opacity: 0;
  pointer-events: none;
}

body.zen-mode .zen-exit-btn {
  opacity: 0.85;
  pointer-events: auto;
}

/* =========================================================
   刺绣鎏金铭文（与火焰错位排布 + 金线闪耀 + 轻柔飘荡）
   ========================================================= */
.scroll-dossier {
  position: fixed;
  z-index: 8;
  max-width: min(460px, 41vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 22px;
  pointer-events: none;

  /* 极柔和的深墨羽化衬底，确保任何背景下铭文高对比清晰且无硬边框 */
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(5, 5, 8, 0.68) 0%,
    rgba(5, 5, 8, 0.36) 64%,
    rgba(5, 5, 8, 0) 100%
  );
  animation: silkFloatMain 7.2s ease-in-out infinite;
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 四种灵动版位：不再全部固定左下/左侧 */
.scroll-dossier[data-layout='left'] {
  left: 34px;
  right: auto;
  top: 84px;
  bottom: 62px;
}

.scroll-dossier[data-layout='right'] {
  left: auto;
  right: 92px;
  top: 84px;
  bottom: 62px;
}

.scroll-dossier[data-layout='top-left'] {
  left: 34px;
  right: auto;
  top: 76px;
  bottom: auto;
  justify-content: flex-start;
}

.scroll-dossier[data-layout='top-right'] {
  left: auto;
  right: 92px;
  top: 76px;
  bottom: auto;
  justify-content: flex-start;
}

.scroll-dossier[data-layout='top-left'] .dossier-columns,
.scroll-dossier[data-layout='top-right'] .dossier-columns {
  max-height: min(600px, 74vh);
}

.scroll-dossier.is-swapping .dossier-col {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(3px);
}

/* 锦帛轻柔飘荡动效（极低幅度，确保阅读稳健舒适） */
@keyframes silkFloatMain {
  0%, 100% {
    transform: translate3d(0px, 0px, 0) rotate(0deg);
  }
  33% {
    transform: translate3d(1.5px, -3.5px, 0) rotate(0.22deg);
  }
  66% {
    transform: translate3d(-1.2px, 2.5px, 0) rotate(-0.18deg);
  }
}

/* 上下双线刺绣织金边纹 */
.dossier-ornament {
  position: relative;
  height: 3px;
  width: 100%;
  border-top: 1px solid rgba(244, 208, 122, 0.48);
  border-bottom: 1px dashed rgba(244, 208, 122, 0.28);
  opacity: calc(0.62 + 0.34 * (var(--flame-pulse) - 0.8));
  box-shadow: 0 0 calc(10px * var(--flame-pulse)) rgba(244, 208, 122, 0.25);
}

.dossier-ornament-top {
  margin-bottom: 14px;
}

.dossier-ornament-bottom {
  margin-top: 14px;
}

/* 竖排主体容器：自右向左阅读 */
.dossier-columns {
  display: flex;
  flex-direction: row-reverse;
  align-items: stretch;
  gap: 16px;
  max-height: calc(100vh - 200px);
  max-height: calc(100dvh - 200px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dossier-columns::-webkit-scrollbar {
  display: none;
}

.dossier-col {
  writing-mode: vertical-rl;
  text-orientation: upright;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-left: 14px;
  /* 刺绣金线虚实针脚界格 */
  border-left: 1px dashed rgba(245, 212, 132, 0.34);
  transition:
    opacity 0.36s ease var(--col-delay, 0ms),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1) var(--col-delay, 0ms),
    filter 0.36s ease var(--col-delay, 0ms);
}

.dossier-col:last-child {
  border-left: none;
  padding-left: 4px;
}

/* 卷首列：印章 + 织金刺绣书法竖排火名 */
.dossier-col-head {
  padding-left: 18px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
  animation: colFloatA 5.8s ease-in-out infinite;
}

.dossier-seal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 5px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(245, 212, 132, 0.72);
  box-shadow:
    inset 0 0 10px var(--c-glow),
    0 0 calc(12px * var(--flame-pulse)) rgba(245, 212, 132, 0.32);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #fff6db;
  background: rgba(10, 8, 6, 0.52);
}

.seal-prefix {
  opacity: 0.78;
}

.seal-num {
  font-weight: 700;
}

/* 刺绣金线火名：金属织线闪耀扫掠 + 实时火光反射闪烁 */
.dossier-title {
  font-family: var(--font-calli);
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.12em;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(
    165deg,
    #fffdf2 0%,
    #f8dc88 22%,
    #c68a28 42%,
    #fff7d1 56%,
    #ecc25c 76%,
    #fffdf2 100%
  );
  background-size: 100% 260%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.92))
          drop-shadow(0 0 calc(12px * var(--flame-pulse)) rgba(248, 212, 120, 0.48))
          brightness(calc(0.94 + 0.18 * var(--flame-pulse)));
  animation: goldThreadGlint 4.2s ease-in-out infinite;
}

@keyframes goldThreadGlint {
  0%, 100% {
    background-position: 50% 0%;
  }
  50% {
    background-position: 50% 100%;
  }
}

.dossier-color-note {
  font-size: 11px;
  letter-spacing: 0.18em;
  white-space: nowrap;
  flex-shrink: 0;
  color: rgba(246, 224, 166, 0.82);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* 副题与判词列：亮鎏金刺绣字 + 轻柔飘动 */
.dossier-col-epithet {
  justify-content: space-between;
  flex-wrap: nowrap;
  animation: colFloatB 6.4s ease-in-out infinite;
}

.dossier-epithet {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  white-space: nowrap;
  color: #fce5a6;
  text-shadow:
    0 1px 6px rgba(0, 0, 0, 0.95),
    0 0 calc(11px * var(--flame-pulse)) rgba(248, 208, 112, 0.42);
}

.dossier-quote {
  font-size: 12.5px;
  line-height: 1.65;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: #f4cc6c;
  text-shadow:
    0 1px 6px rgba(0, 0, 0, 0.95),
    0 0 calc(10px * var(--flame-pulse)) rgba(244, 204, 108, 0.38);
}

/* 源起与神通正文列：高对比暖象牙宣白，刺绣金标题点缀 */
.dossier-col-body {
  animation: colFloatA 6.9s ease-in-out infinite;
  animation-delay: 0.6s;
}

.dossier-section-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  white-space: nowrap;
  flex-shrink: 0;
  color: #f8da8c;
  text-shadow: 0 0 calc(8px * var(--flame-pulse)) rgba(248, 218, 140, 0.45);
}

.dossier-text {
  font-size: 13.5px;
  line-height: 1.72;
  letter-spacing: 0.11em;
  color: #f6f1e6;
  text-shadow:
    0 1px 6px rgba(0, 0, 0, 0.96),
    0 0 calc(7px * var(--flame-pulse)) rgba(255, 240, 200, 0.18);
}

/* 传承列 */
.dossier-col-holders {
  animation: colFloatB 7.4s ease-in-out infinite;
  animation-delay: 1.1s;
}

.dossier-holders-text {
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: 0.14em;
  color: rgba(246, 234, 206, 0.88);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.94);
}

@keyframes colFloatA {
  0%, 100% {
    transform: translateY(0px);
    filter: brightness(0.96);
  }
  50% {
    transform: translateY(-3px);
    filter: brightness(1.08);
  }
}

@keyframes colFloatB {
  0%, 100% {
    transform: translateY(-2px);
    filter: brightness(1.06);
  }
  50% {
    transform: translateY(2.5px);
    filter: brightness(0.95);
  }
}

/* 右侧 23 枚火纹刻度导航尺 */
.flame-rail {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  padding: 10px 6px;
  transition: opacity 0.45s ease;
}

.rail-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 28px;
  height: 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.rail-pip {
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.rail-item:hover .rail-pip {
  width: 18px;
  background: var(--c-ink-bright);
}

.rail-item.is-active .rail-pip {
  width: 24px;
  height: 4px;
  background: var(--c-core);
  box-shadow: 0 0 10px var(--c-primary), 0 0 18px var(--c-glow);
}

.rail-tooltip {
  position: absolute;
  right: 34px;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(10, 10, 14, 0.92);
  border: 1px solid var(--c-ink-line);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--c-ink-bright);
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.rail-item:hover .rail-tooltip,
.rail-item.is-active:hover .rail-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* 底部操作提示与翻页按钮 */
.controls-hint {
  position: fixed;
  bottom: 14px;
  left: 32px;
  right: 32px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-dim);
  transition: opacity 0.45s ease;
}

.nav-arrow-btn {
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid var(--c-ink-line);
  background: rgba(8, 8, 12, 0.6);
  color: var(--c-ink-body);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.nav-arrow-btn:hover {
  border-color: var(--c-primary);
  color: var(--c-core);
  box-shadow: 0 0 12px var(--c-glow);
}

.mobile-step-indicator {
  display: none;
}

/* 序章古卷封面 */
.hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 45%, rgba(28, 20, 12, 0.72) 0%, rgba(5, 5, 8, 0.95) 68%, #040406 100%);
  backdrop-filter: blur(8px);
  transition: opacity 0.75s ease, transform 0.75s ease, visibility 0.75s ease;
}

.hero-overlay.is-hidden {
  opacity: 0;
  transform: scale(1.04);
  visibility: hidden;
  pointer-events: none;
}

.hero-emblem {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}

.emblem-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(226, 180, 92, 0.48);
}

.emblem-ring-1 {
  animation: spinSlow 24s linear infinite;
}

.emblem-ring-2 {
  inset: 10px;
  border-style: solid;
  border-color: rgba(226, 180, 92, 0.28);
  animation: spinReverse 16s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.emblem-core {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-calli);
  font-size: 32px;
  color: #fff6d1;
  background: radial-gradient(circle, #e8a838 0%, #8c4110 75%, transparent 100%);
  box-shadow: 0 0 36px rgba(232, 168, 56, 0.55);
}

.hero-kicker {
  font-size: 13px;
  letter-spacing: 0.36em;
  color: rgba(236, 198, 120, 0.82);
  margin-bottom: 10px;
}

.hero-title {
  font-family: var(--font-calli);
  font-size: clamp(46px, 6vw, 76px);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: #fffaf0;
  text-shadow: 0 0 36px rgba(235, 164, 52, 0.45);
  margin-bottom: 16px;
}

.hero-subtitle {
  max-width: 580px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.85;
  color: rgba(243, 239, 230, 0.78);
  margin-bottom: 30px;
}

.hero-subtitle strong {
  color: #ffe094;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.hero-btn:hover {
  transform: translateY(-2px);
}

.hero-btn-primary {
  border: 1px solid rgba(255, 224, 148, 0.65);
  background: linear-gradient(135deg, #d8952e 0%, #8e4110 100%);
  color: #fffaf0;
  box-shadow: 0 8px 30px rgba(216, 149, 46, 0.35);
}

.hero-btn-primary small {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.88;
}

.hero-btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 20, 26, 0.65);
  color: var(--text-main);
}

.hero-footnote {
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

/* 23火图鉴弹窗 */
.codex-modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.codex-modal[hidden] {
  display: none;
}

.codex-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 7, 0.84);
  backdrop-filter: blur(10px);
}

.codex-panel {
  position: relative;
  width: min(1100px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--c-ink-line);
  background: rgba(10, 10, 14, 0.94);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.82);
  overflow: hidden;
}

.codex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.codex-header h3 {
  font-size: 19px;
  letter-spacing: 0.14em;
  color: var(--c-ink-bright);
}

.codex-subtitle {
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-dim);
}

.codex-grid {
  padding: 20px 24px 26px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.codex-card {
  position: relative;
  text-align: left;
  padding: 14px 15px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.25s ease, background 0.25s ease;
}

.codex-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-color, #d4a638);
  background: rgba(255, 255, 255, 0.06);
}

.codex-card.is-current {
  border-color: var(--card-color, #d4a638);
  box-shadow: 0 0 18px -4px var(--card-color, #d4a638);
}

.codex-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-dim);
}

.codex-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card-color, #fff);
  box-shadow: 0 0 10px var(--card-color, #fff);
}

.codex-card-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.codex-card-epithet {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* 响应式适配（桌面微缩 + 移动端 H5 横排古卷交互） */
@media (max-width: 900px) {
  .top-bar {
    padding: calc(10px + env(safe-area-inset-top)) 12px 8px;
    gap: 6px;
  }
  .brand-mark {
    gap: 7px;
    margin-right: 2px;
  }
  .brand-seal {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }
  .brand-title {
    font-size: 13px;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
  .brand-sub,
  .top-center,
  .hint-text {
    display: none;
  }
  .top-left,
  .top-right {
    gap: 6px;
  }
  .ctrl-btn {
    padding: 6px 9px;
    font-size: 11.5px;
    white-space: nowrap;
  }
  .zen-exit-btn {
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
  }

  .scroll-dossier,
  .scroll-dossier[data-layout] {
    left: 12px;
    right: 40px;
    top: auto;
    bottom: calc(56px + env(safe-area-inset-bottom));
    max-width: none;
    height: auto;
    max-height: 42dvh;
    padding: 11px 14px;
    justify-content: flex-start;
    pointer-events: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: none;
    -ms-overflow-style: none;
    animation: none;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(8, 8, 13, 0.78) 0%, rgba(5, 5, 8, 0.92) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(244, 208, 122, 0.24);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  }
  .scroll-dossier::-webkit-scrollbar {
    display: none;
  }

  .dossier-ornament-top {
    margin-bottom: 8px;
  }
  .dossier-ornament-bottom {
    margin-top: 8px;
  }

  .dossier-columns {
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    max-height: none;
    overflow: visible;
  }
  .dossier-col {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    padding-left: 0;
    border-left: none;
    border-bottom: 1px dashed rgba(245, 212, 132, 0.22);
    padding-bottom: 7px;
    animation: none;
  }
  .dossier-col:last-child {
    border-bottom: none;
    padding-bottom: 0;
    padding-left: 0;
  }

  .dossier-col-head {
    padding-left: 0;
    align-items: center;
    gap: 6px 10px;
    flex-wrap: wrap;
  }
  .dossier-seal {
    padding: 3px 8px;
    font-size: 11px;
    letter-spacing: 0.12em;
  }
  .dossier-title {
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
  .dossier-color-note {
    font-size: 11px;
    letter-spacing: 0.08em;
    white-space: normal;
    width: 100%;
    margin-top: 1px;
  }

  .dossier-col-epithet {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .dossier-epithet {
    font-size: 13px;
    letter-spacing: 0.08em;
    white-space: normal;
  }
  .dossier-quote {
    font-size: 12.5px;
    line-height: 1.5;
    letter-spacing: 0.05em;
    white-space: normal;
  }

  .dossier-col-body,
  .dossier-col-holders {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 4px;
  }
  .dossier-section-tag {
    font-size: 12px;
    letter-spacing: 0.06em;
    line-height: 1.6;
  }
  .dossier-text,
  .dossier-holders-text {
    font-size: 12.5px;
    line-height: 1.6;
    letter-spacing: 0.04em;
    white-space: normal;
    word-break: break-word;
    flex: 1;
    min-width: 0;
  }

  .flame-rail {
    right: 8px;
  }

  .controls-hint {
    justify-content: space-between;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .mobile-step-indicator {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-serif);
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--c-ink-bright);
  }
  .nav-arrow-btn {
    padding: 7px 14px;
    font-size: 12.5px;
  }

  .hero-overlay {
    padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .hero-emblem {
    width: 76px;
    height: 76px;
    margin-bottom: 16px;
  }
  .hero-title {
    font-size: clamp(36px, 11vw, 52px);
    margin-bottom: 12px;
  }
  .hero-subtitle {
    font-size: 13px;
    line-height: 1.75;
    margin-bottom: 22px;
  }
  .hero-btn {
    padding: 11px 20px;
    font-size: 14px;
  }

  .codex-modal {
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  }
  .codex-panel {
    width: 100%;
    max-height: 86dvh;
  }
  .codex-header {
    padding: 12px 14px;
  }
  .codex-header h3 {
    font-size: 16px;
  }
  .codex-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .codex-card {
    padding: 10px 11px;
  }
  .codex-card-name {
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  .flame-rail {
    display: none;
  }
  .scroll-dossier,
  .scroll-dossier[data-layout] {
    right: 12px;
  }
}

@media (max-width: 560px) {
  .top-right .btn-label {
    display: none;
  }
  .top-right .ctrl-btn {
    min-width: 32px;
    height: 30px;
    padding: 0;
    justify-content: center;
    font-size: 13px;
  }
  #btn-codex {
    padding: 5px 8px;
    font-size: 11.5px;
  }
}
