/* ==========================================================================
   《残明狂刀》全屏主视觉、3D 画轴点将台、演武堂、兵书图鉴样式
   ========================================================================== */

.screen-layer {
  z-index: var(--z-screens);
  pointer-events: auto;
}

/* ======================== 1. 原画预加载水墨卷轴 ======================== */
.preloader-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-preloader);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(127, 29, 29, 0.24) 0%, transparent 58%),
    radial-gradient(circle at 50% 50%, #120e15 0%, #060508 100%);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.preloader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  width: min(460px, 88vw);
  text-align: center;
  padding: 36px 28px;
}

.preloader-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  background: linear-gradient(145deg, #b91c1c, #7f1d1d);
  border: 2px solid var(--gold-300);
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff5ea;
  letter-spacing: 0.08em;
  box-shadow: 0 0 24px rgba(220, 38, 38, 0.55);
  transform: rotate(-4deg);
}

.preloader-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  background: var(--grad-blade-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.9));
}

.preloader-sub {
  margin-top: 6px;
  margin-bottom: 28px;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-size: 0.92rem;
  letter-spacing: 0.24em;
}

.preloader-bar-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(212, 175, 55, 0.42);
  border-radius: 2px;
  overflow: hidden;
}

.preloader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #991b1b 0%, #ef4444 45%, #f59e0b 82%, #fef08a 100%);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.8);
  transition: width 0.16s ease-out;
}

.preloader-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

#preloader-pct {
  color: var(--gold-300);
  font-family: var(--font-num);
  font-weight: 700;
}

.preloader-disclaimer {
  margin-top: 26px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: rgba(202, 186, 161, 0.48);
}

/* ======================== 2. 标题大片主视觉 (title) ======================== */
.title-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    calc(18px + var(--safe-top))
    calc(32px + var(--safe-right))
    calc(22px + var(--safe-bottom))
    calc(38px + var(--safe-left));
  overflow: hidden;
}

.screen-bg-wrap {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #08070b;
}

.screen-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  animation: kenBurnsBreath 20s ease-in-out infinite;
  will-change: transform;
}

.title-vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 5, 9, 0.91) 0%, rgba(9, 7, 12, 0.68) 42%, rgba(9, 7, 12, 0.28) 72%, rgba(6, 5, 9, 0.76) 100%),
    linear-gradient(180deg, rgba(6, 5, 9, 0.68) 0%, transparent 28%, transparent 68%, rgba(5, 4, 8, 0.92) 100%),
    radial-gradient(circle at 24% 48%, rgba(185, 28, 28, 0.18) 0%, transparent 55%);
  pointer-events: none;
}

/* 顶部声明与音频栏 */
.title-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 2;
}

.history-solemn-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(10, 8, 13, 0.76);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-left: 3px solid var(--crimson-600);
  color: var(--text-secondary);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  backdrop-filter: blur(6px);
}

.top-utility-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: rgba(12, 10, 16, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.42);
  border-radius: 3px;
  color: var(--gold-200);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.btn-icon-pill:hover {
  background: rgba(34, 24, 20, 0.92);
  border-color: var(--gold-300);
  transform: translateY(-1px);
}

/* 中左主标题与刀纹菜单区 */
.title-hero-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: 650px;
  margin: auto 0;
  z-index: 2;
  animation: fadeSlideUp 0.65s var(--ease-out-expo);
}

.title-era-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--gold-300);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  letter-spacing: 0.28em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.title-era-kicker::before {
  content: "";
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--crimson-500), var(--gold-400));
}

.title-logo-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.title-calligraphy {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(3.3rem, 7.6vw, 5.6rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, #fffdf5 0%, #f7dc88 38%, #ef4444 76%, #881313 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: bladeTitleShine 5s ease-in-out infinite;
}

/* 凌厉刀锋横斩金红光痕 */
.title-blade-slash {
  width: min(460px, 78vw);
  height: 3px;
  margin: 8px 0 12px;
  background: linear-gradient(90deg, #ef4444 0%, #fde047 38%, rgba(245, 212, 122, 0.35) 78%, transparent 100%);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
  position: relative;
}

.title-blade-slash::after {
  content: "◆";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #fef08a;
  font-size: 0.7rem;
  text-shadow: 0 0 10px #ef4444;
}

.title-subtitle-cn {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.28rem);
  letter-spacing: 0.3em;
  color: var(--text-ivory);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
}

.title-subtitle-en {
  margin-top: 3px;
  font-size: 0.72rem;
  letter-spacing: 0.36em;
  color: rgba(241, 207, 117, 0.65);
  text-transform: uppercase;
}

/* 乌木鎏金猩红刀纹菜单栈 */
.title-menu-stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: min(350px, 84vw);
  margin-top: 28px;
}

.title-menu-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(90deg, rgba(24, 17, 16, 0.95) 0%, rgba(14, 11, 15, 0.9) 100%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-left: 4px solid var(--gold-500);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.78);
  transition: transform 0.2s var(--ease-out-expo), border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-align: left;
}

.title-menu-btn:hover {
  transform: translateX(8px);
  border-color: var(--gold-200);
  background: linear-gradient(90deg, rgba(65, 16, 16, 0.94) 0%, rgba(24, 16, 18, 0.94) 100%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 22px rgba(220, 38, 38, 0.35);
}

.title-menu-btn.is-primary {
  padding: 17px 26px;
  background: linear-gradient(95deg, #7f1d1d 0%, #b91c1c 48%, #450a0a 100%);
  border: 1px solid var(--gold-300);
  border-left: 5px solid #fef08a;
  box-shadow: 0 12px 34px rgba(185, 28, 28, 0.58), inset 0 1px 0 rgba(255, 240, 185, 0.38);
}

.title-menu-btn.is-primary:hover {
  background: linear-gradient(95deg, #991b1b 0%, #dc2626 52%, #5c0d0d 100%);
  box-shadow: 0 14px 40px rgba(239, 68, 68, 0.75), 0 0 24px rgba(245, 212, 122, 0.48);
}

.menu-btn-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-btn-label {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-ivory);
}

.title-menu-btn.is-primary .menu-btn-label {
  font-size: 1.56rem;
  color: #fffbeb;
}

.menu-btn-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.title-menu-btn.is-primary .menu-btn-desc {
  color: #fde68a;
}

.menu-btn-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  color: var(--gold-300);
  font-size: 1.1rem;
}

.menu-notif-badge {
  padding: 2px 7px;
  background: var(--crimson-600);
  border: 1px solid var(--gold-200);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}

/* 底部功名战绩徽章横栏 */
.title-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  z-index: 2;
}

.war-record-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.record-medal {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(11, 9, 14, 0.84);
  border: 1px solid rgba(212, 175, 55, 0.36);
  border-radius: 3px;
  backdrop-filter: blur(6px);
}

.record-medal.is-merit {
  border-color: rgba(245, 212, 122, 0.72);
  background: linear-gradient(90deg, rgba(58, 38, 8, 0.75), rgba(16, 12, 14, 0.88));
}

.record-medal-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.record-medal-val {
  font-family: var(--font-num);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-200);
}

.title-controls-hint {
  font-size: 0.78rem;
  color: rgba(202, 186, 161, 0.72);
  letter-spacing: 0.06em;
}

/* ======================== 3. 3D 画轴感点将台 (hero_select) ======================== */
.hero-select-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding:
    calc(14px + var(--safe-top))
    calc(26px + var(--safe-right))
    calc(16px + var(--safe-bottom))
    calc(26px + var(--safe-left));
  background:
    radial-gradient(circle at 28% 45%, rgba(185, 28, 28, 0.16) 0%, transparent 55%),
    radial-gradient(circle at 78% 30%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, rgba(7, 6, 10, 0.9) 0%, rgba(11, 9, 14, 0.94) 100%);
  overflow: hidden;
}

.hero-select-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.24;
  filter: blur(5px) saturate(0.85);
  pointer-events: none;
}

.hero-select-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 点将台顶栏 */
.screen-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  flex-shrink: 0;
}

.screen-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.screen-header-title h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  letter-spacing: 0.18em;
  color: var(--gold-200);
}

.screen-header-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* 左右双栏主舞台 */
.hero-stage-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 24px;
  padding-top: 14px;
  align-items: stretch;
}

/* 左侧：三大名将竖版生成原画画轴卡陈列 */
.hero-scroll-deck {
  display: grid;
  /* 5将点将台：桌面端一行5列，自适应宽度，不换行不溢出 */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  perspective: 1100px;
  min-height: 0;
  padding: 6px 2px;
}

/* 兜底：若将数 < 5（开发测试），回退3列 */
.hero-scroll-deck[data-hero-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 6px 4px;
}

.hero-scroll-card {
  position: relative;
  height: min(100%, 560px);
  max-height: 100%;
  aspect-ratio: 3 / 4.15;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transform: scale(0.94) translateZ(0);
  filter: brightness(0.56) saturate(0.75);
  transition:
    transform 0.32s var(--ease-out-expo),
    filter 0.32s ease,
    box-shadow 0.32s ease;
}

.hero-scroll-card:hover:not(.is-selected) {
  transform: translateY(-4px) scale(0.975);
  filter: brightness(0.82) saturate(0.92);
}

.hero-scroll-card.is-selected {
  transform: translateY(-8px) scale(1.03);
  filter: brightness(1.04) saturate(1.08);
  z-index: 4;
}

/* 画轴天地乌木鎏金轴杆 */
.scroll-rod {
  height: 11px;
  width: calc(100% + 12px);
  margin-left: -6px;
  background: linear-gradient(180deg, #573d1c 0%, #26190d 55%, #120b06 100%);
  border: 1px solid var(--gold-500);
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.85);
  flex-shrink: 0;
  position: relative;
}

.scroll-rod::before,
.scroll-rod::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 8px;
  height: 13px;
  background: var(--grad-gold-metal);
  border-radius: 2px;
}

.scroll-rod::before {
  left: -4px;
}

.scroll-rod::after {
  right: -4px;
}

.scroll-art-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #120d10;
  border-left: 2px solid rgba(212, 175, 55, 0.45);
  border-right: 2px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.85);
}

.hero-scroll-card.is-selected .scroll-art-body {
  border-left-color: #fde047;
  border-right-color: #fde047;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.92),
    0 0 28px rgba(245, 158, 11, 0.52),
    0 0 54px rgba(220, 38, 38, 0.38),
    inset 0 0 22px rgba(253, 224, 71, 0.25);
}

.scroll-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.01);
  transition: transform 0.5s var(--ease-out-expo);
}

.hero-scroll-card.is-selected .scroll-card-img {
  transform: scale(1.045);
}

/* 画轴底部暗金遮罩与竖排/横排将帅名牌 */
.scroll-art-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, transparent 28%, rgba(8, 6, 10, 0.42) 64%, rgba(6, 5, 9, 0.95) 100%);
  pointer-events: none;
}

.scroll-selected-ribbon {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  border: 1px solid var(--gold-200);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 0.76rem;
  color: #fffbeb;
  letter-spacing: 0.1em;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s, transform 0.25s;
}

.hero-scroll-card.is-selected .scroll-selected-ribbon {
  opacity: 1;
  transform: translateY(0);
}

/* 竖版将名铭牌 */
.scroll-vertical-tag {
  position: absolute;
  top: 12px;
  left: 10px;
  writing-mode: vertical-rl;
  padding: 8px 5px;
  background: rgba(8, 7, 11, 0.78);
  border: 1px solid rgba(212, 175, 55, 0.55);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: var(--gold-200);
}

.scroll-bottom-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 12px 10px;
  text-align: center;
}

.scroll-hero-name {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-ivory);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}

.hero-scroll-card.is-selected .scroll-hero-name {
  color: #fef08a;
}

.scroll-hero-role {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--gold-300);
  letter-spacing: 0.08em;
}

/* 右侧：黑金雕花武库面板 */
.hero-armory-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  padding: 13px 18px;
  background: linear-gradient(180deg, rgba(17, 14, 20, 0.94) 0%, rgba(10, 8, 13, 0.97) 100%);
  border: 1px solid rgba(212, 175, 55, 0.48);
  box-shadow: var(--shadow-deep), inset 0 0 28px rgba(212, 175, 55, 0.06);
}

.armory-scroll-content {
  flex: 1;
  min-height: 0;
  padding-right: 4px;
}

.armory-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.24);
}

.armory-name-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.armory-hero-name {
  font-family: var(--font-display);
  font-size: 1.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-200);
  line-height: 1.1;
}

.armory-hero-courtesy {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 1px 7px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 2px;
}

.armory-weapon-tag {
  margin-top: 3px;
  font-size: 0.8rem;
  color: #fca5a5;
  letter-spacing: 0.06em;
}

/* 三姿态透明动作原画预览微缩窗 */
.armory-pose-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.pose-thumb-box {
  width: 42px;
  height: 42px;
  padding: 3px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.16) 0%, rgba(8, 7, 11, 0.9) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pose-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.armory-quote {
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 0.81rem;
  font-style: italic;
  color: var(--gold-100);
  opacity: 0.92;
}

/* 五维战力条矩阵 */
.armory-radar-section {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(6, 5, 9, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 3px;
}

.armory-stats-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 7px;
}

.stat-mini-pill {
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.18);
  text-align: center;
  border-radius: 2px;
}

.stat-mini-pill span {
  display: block;
  font-size: 0.66rem;
  color: var(--text-muted);
}

.stat-mini-pill strong {
  font-family: var(--font-num);
  font-size: 0.88rem;
  color: var(--gold-200);
}

.five-dim-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
}

.dim-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dim-bar-label {
  width: 56px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.dim-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 2px;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #b91c1c 0%, #f59e0b 68%, #fef08a 100%);
  transition: width 0.35s var(--ease-out-expo);
}

/* 普攻/重技/无双招式详情列表 */
.armory-moves-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.move-card-item {
  padding: 6px 10px;
  background: rgba(20, 16, 22, 0.78);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-left: 3px solid var(--gold-500);
  border-radius: 2px;
}

.move-card-item.is-musou {
  border-left-color: var(--crimson-500);
  background: linear-gradient(90deg, rgba(69, 10, 10, 0.42) 0%, rgba(20, 16, 22, 0.78) 100%);
}

.move-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.move-card-name {
  font-family: var(--font-display);
  font-size: 0.93rem;
  color: var(--gold-200);
  letter-spacing: 0.06em;
}

.move-card-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.36;
}

/* 底部难度选择与披甲出征大印 */
.armory-deploy-footer {
  margin-top: 7px;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 175, 55, 0.26);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.armory-deploy-footer .btn-imperial-seal {
  padding: 10px 26px;
  font-size: 1.26rem;
  flex-shrink: 0;
}

.difficulty-selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.difficulty-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.diff-tier-tag {
  font-size: 0.68rem;
  color: var(--gold-300);
  padding: 2px 6px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 2px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.difficulty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  background: rgba(8, 7, 11, 0.92);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 3px;
  flex-shrink: 0;
}

.diff-step-btn {
  width: 22px;
  height: 22px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.42);
  border-radius: 2px;
  color: var(--gold-200);
  font-weight: 700;
  line-height: 1;
}

.diff-step-btn:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.32);
}

.diff-current-text {
  min-width: 118px;
  padding: 0 3px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--gold-200);
  white-space: nowrap;
}

.diff-current-text.is-asura {
  color: #fde047;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.55);
}

.diff-current-text.is-asura-extreme {
  color: #fca5a5;
  text-shadow: 0 0 12px rgba(220, 38, 38, 0.85);
}

.difficulty-mods-line {
  font-size: 0.71rem;
  line-height: 1.25;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.difficulty-mods-line.is-asura {
  color: #fde68a;
}

/* 战场顶栏难度品阶徽章（与 hud.js 联动，兼容桌面与手机横竖屏零换行挤压） */
.stage-diff-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  background: rgba(20, 16, 22, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.48);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--gold-200);
  white-space: nowrap;
  flex-shrink: 0;
}

.stage-diff-badge.is-asura {
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.88), rgba(120, 53, 15, 0.86));
  border-color: rgba(253, 224, 71, 0.78);
  color: #fef08a;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.42);
}

.stage-diff-badge.is-asura-extreme {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.94), rgba(88, 28, 135, 0.88));
  border-color: #fde047;
  color: #fffbeb;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.65);
}

/* ======================== 4. 《演武堂》8 项永久天赋晋升殿 ======================== */
.subscreen-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding:
    calc(16px + var(--safe-top))
    calc(28px + var(--safe-right))
    calc(18px + var(--safe-bottom))
    calc(28px + var(--safe-left));
  background: rgba(7, 6, 10, 0.92);
  overflow: hidden;
}

.subscreen-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.subscreen-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.32) saturate(0.9);
}

.subscreen-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(245, 158, 11, 0.12), rgba(6, 5, 9, 0.88));
}

.merit-bank-plaque {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  background: linear-gradient(90deg, rgba(68, 44, 10, 0.82), rgba(20, 14, 14, 0.92));
  border: 1px solid var(--gold-400);
  border-radius: 3px;
  box-shadow: var(--glow-gold);
}

.merit-bank-plaque strong {
  font-family: var(--font-num);
  font-size: 1.3rem;
  color: #fef08a;
}

.yanwu-grid {
  flex: 1;
  min-height: 0;
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
  padding-bottom: 10px;
}

.talent-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px 16px;
  background: linear-gradient(180deg, rgba(24, 19, 22, 0.94) 0%, rgba(12, 10, 15, 0.96) 100%);
  border: 1px solid rgba(212, 175, 55, 0.36);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, border-color 0.2s;
}

.talent-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-300);
}

.talent-card.is-maxed {
  border-color: rgba(250, 204, 21, 0.78);
  background: linear-gradient(180deg, rgba(46, 33, 12, 0.9) 0%, rgba(15, 12, 14, 0.96) 100%);
}

.talent-card.is-keystone {
  border-color: rgba(239, 68, 68, 0.68);
}

.talent-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.talent-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  color: var(--gold-200);
}

.talent-lv-badge {
  font-family: var(--font-num);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--amber-300);
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
}

.talent-pips {
  display: flex;
  gap: 5px;
  margin: 9px 0;
}

.talent-pip {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.talent-pip.is-lit {
  background: linear-gradient(90deg, #f59e0b, #fef08a);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.talent-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.48;
  min-height: 44px;
}

.talent-next-bonus {
  margin-top: 6px;
  font-size: 0.76rem;
  color: #86efac;
}

.talent-upgrade-btn {
  margin-top: 12px;
  width: 100%;
  padding: 9px 12px;
  background: linear-gradient(135deg, #7f1d1d, #b91c1c);
  border: 1px solid var(--gold-300);
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: #fffbeb;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.talent-upgrade-btn:hover:not(:disabled) {
  filter: brightness(1.14);
}

.talent-upgrade-btn.is-max {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.45);
  color: var(--gold-200);
}

.yanwu-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* ======================== 5. 《兵书图鉴》与操作指南 ======================== */
.codex-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  flex-shrink: 0;
}

.codex-tab-btn {
  padding: 8px 18px;
  background: rgba(16, 13, 20, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.34);
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
}

.codex-tab-btn.is-active {
  background: linear-gradient(135deg, #7f1d1d, #450a0a);
  border-color: var(--gold-300);
  color: #fef08a;
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.4);
}

.codex-body {
  flex: 1;
  min-height: 0;
  margin-top: 14px;
  padding-right: 6px;
}

.controls-showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.control-guide-card {
  padding: 14px 16px;
  background: rgba(16, 13, 20, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 4px;
}

.control-guide-card h4 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  color: var(--gold-200);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.control-guide-card h4 > span {
  white-space: nowrap;
}

.control-guide-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.codex-sect-section {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: rgba(14, 11, 17, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 4px;
}

.codex-sect-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.codex-sect-header img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.codex-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.codex-entry-card {
  padding: 10px 12px;
  background: rgba(24, 19, 25, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 3px;
}

.codex-entry-card .entry-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  color: var(--gold-200);
  margin-bottom: 4px;
}

.codex-entry-card .entry-desc {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.codex-enemy-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(18, 14, 20, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 4px;
}

.codex-enemy-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.18), rgba(6, 5, 9, 0.9));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 4px;
  padding: 4px;
  object-fit: contain;
}

/* ======================== 响应式适配：移动横屏 & 竖屏 ======================== */
@media (max-width: 1080px) {
  .hero-stage-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .yanwu-grid,
  .controls-showcase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .controls-showcase-grid {
    grid-template-columns: 1fr;
  }
}

/* 移动端竖屏 (如 390×844) */
@media (max-width: 760px) and (orientation: portrait) {
  .title-screen {
    padding: calc(14px + var(--safe-top)) 18px calc(16px + var(--safe-bottom));
  }
  .title-menu-stack {
    width: 100%;
  }
  .hero-select-screen {
    padding: calc(10px + var(--safe-top)) 14px calc(12px + var(--safe-bottom));
    overflow-y: auto;
  }
  /* v3.1：竖屏顶栏改为两行网格（返回 | 演武堂 / 标题+提示），杜绝标题与药丸逐字断行 */
  .hero-select-screen .screen-header-bar {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
      'back util'
      'title title';
    justify-content: space-between;
    align-items: center;
    row-gap: 8px;
  }
  .hero-select-screen .screen-header-bar > [data-action='back-to-title'] {
    grid-area: back;
  }
  .hero-select-screen .screen-header-bar > .top-utility-group {
    grid-area: util;
    justify-self: end;
  }
  .hero-select-screen .screen-header-title {
    grid-area: title;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
  }
  .hero-select-screen .screen-header-title h2 {
    font-size: clamp(1.15rem, 5.4vw, 1.45rem);
    letter-spacing: 0.12em;
    white-space: nowrap;
    word-break: keep-all;
  }
  .hero-select-screen .screen-header-sub {
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    word-break: keep-all;
  }
  .hero-select-screen .btn-icon-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .hero-stage-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    overflow-y: auto;
  }
  .hero-scroll-deck {
    /* 移动端竖屏：5将横滑，每张卡固定宽度，overflow横向可滑动 */
    grid-template-columns: repeat(5, min(44vw, 180px));
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    /* 隐藏滚动条但保留滑动能力 */
    scrollbar-width: none;
  }
  .hero-scroll-deck::-webkit-scrollbar {
    display: none;
  }
  .hero-scroll-card {
    aspect-ratio: 3 / 3.9;
    max-height: 220px;
    scroll-snap-align: center;
    min-width: 0;
  }
  .scroll-vertical-tag {
    display: none;
  }
  .armory-deploy-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-imperial-seal {
    width: 100%;
    padding: 12px 20px;
    font-size: 1.25rem;
  }
  .yanwu-grid {
    grid-template-columns: 1fr;
  }
}

/* 移动端紧凑横屏 (如 844×390) */
@media (max-height: 480px) {
  .title-screen {
    padding: 8px 22px 10px;
  }
  .title-calligraphy {
    font-size: 2.55rem;
  }
  .title-blade-slash {
    margin: 4px 0 6px;
  }
  .title-subtitle-cn {
    font-size: 0.88rem;
  }
  .title-subtitle-en {
    display: none;
  }
  .title-menu-stack {
    flex-direction: row;
    width: auto;
    max-width: 100%;
    margin-top: 10px;
    gap: 10px;
  }
  .title-menu-btn,
  .title-menu-btn.is-primary {
    padding: 9px 14px;
    width: auto;
    min-width: 155px;
  }
  .menu-btn-label,
  .title-menu-btn.is-primary .menu-btn-label {
    font-size: 1.08rem;
  }
  .menu-btn-desc {
    font-size: 0.66rem;
  }
  .record-medal {
    padding: 4px 9px;
  }
  .hero-select-screen {
    padding: 6px 16px 8px;
  }
  .screen-header-bar {
    padding-bottom: 6px;
  }
  .hero-stage-grid {
    padding-top: 6px;
    gap: 12px;
  }
  .hero-armory-panel {
    padding: 10px 14px;
  }
  .armory-hero-name {
    font-size: 1.35rem;
  }
  .pose-thumb-box {
    width: 34px;
    height: 34px;
  }
  .btn-imperial-seal {
    padding: 8px 18px;
    font-size: 1.08rem;
  }
  .diff-tier-tag {
    display: none;
  }
  .diff-current-text {
    min-width: 104px;
    font-size: 0.82rem;
  }
  .difficulty-mods-line {
    font-size: 0.65rem;
  }
  .yanwu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }
}

@media (max-width: 860px), (max-height: 460px) {
  .hud-stage-plaque {
    max-width: 100%;
  }
  .stage-diff-badge {
    padding: 1px 6px;
    font-size: 0.68rem;
  }
}

@media (max-width: 520px) and (orientation: portrait) {
  .hud-stage-plaque {
    padding: 3px 8px;
    gap: 5px;
    max-width: 96vw;
  }
  .hud-stage-plaque .stage-sep {
    display: none;
  }
  .hud-stage-plaque .stage-act-title {
    font-size: 0.76rem;
    letter-spacing: 0.04em;
  }
  .hud-stage-plaque .stage-room-info {
    font-size: 0.7rem;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hud-stage-plaque .stage-wave-badge,
  .hud-stage-plaque .stage-diff-badge {
    padding: 1px 5px;
    font-size: 0.66rem;
  }
}
