:root {
  --bg-deep: #e5f7f4;
  --panel-dark: #f3fbf8;
  --panel-mid: #e4f6f3;
  --panel-card: #fff8e8;
  --gold-bright: #ff8a76;
  --gold-main: #27afbc;
  --gold-dim: #72c9bb;
  --border-gold: rgba(62, 177, 185, 0.66);
  --border-iron: rgba(103, 164, 177, 0.48);
  --text-main: #29475b;
  --text-muted: #668494;
  --red-dark: #df8d82;
  --red-bright: #e86f68;
  --green-bright: #42b982;
  --blue-bright: #49a9df;
  --purple-bright: #9f83df;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, #ffffff 0%, #d7f3ef 100%);
  color: var(--text-main);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* ==================== 手机竖屏 720×1280 舞台容器 ==================== */
.phone-viewport {
  position: relative;
  width: min(100vw, 56.25dvh);
  height: min(100dvh, 177.7778vw);
  margin: auto;
  background: #080a0e;
  box-shadow: 0 0 60px #000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}



.full-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==================== 1. 角色大厅 (warrior-selected.png 1:1) ==================== */
.lobby-screen {
  background:
    linear-gradient(180deg, rgba(8, 6, 5, 0.25) 0%, rgba(8, 6, 5, 0.1) 60%, rgba(8, 6, 5, 0.85) 100%),
    url("/q-art/frames/UI/character_lobby_six_background.webp") center top / 100% 100% no-repeat;
  padding: 1.5vh 3% 1.6vh;
  justify-content: space-between;
}

.select-job-screen {
  background:
    radial-gradient(circle at 50% 20%, rgba(72, 48, 24, 0.35), rgba(10, 8, 7, 0.95)),
    url("/q-art/frames/UI/character_lobby_six_background.webp") center top / cover no-repeat;
  padding: 1.5vh 3.5% 1.8vh;
  justify-content: space-between;
}

.lobby-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.lobby-title-banner {
  padding: 6px 34px;
  background: linear-gradient(180deg, rgba(46, 34, 22, 0.92), rgba(23, 17, 11, 0.96));
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  color: var(--gold-bright);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
}

.lobby-top-right-btn,
.lobby-top-left-btn {
  position: absolute;
  top: 4px;
  padding: 5px 12px;
  background: rgba(28, 21, 16, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.78rem;
  cursor: pointer;
}

.lobby-top-right-btn {
  right: 0;
}

.lobby-top-left-btn {
  left: 0;
}

.lobby-points-line {
  text-align: center;
  font-size: 0.78rem;
  color: var(--gold-bright);
  margin-top: 2px;
  text-shadow: 0 1px 3px #000;
}

/* 6石台网格 (2行×3列) */
.lobby-pedestal-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1.2vh 2%;
  margin: 0.8vh 0;
  align-items: end;
}

.pedestal-slot {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10%;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.15s ease;
}

.pedestal-slot:hover {
  transform: translateY(-2px);
}

.pedestal-spotlight {
  position: absolute;
  inset: 4% 8% 14%;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 215, 128, 0.26) 0%, rgba(255, 215, 128, 0.06) 55%, transparent 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pedestal-slot.selected .pedestal-spotlight {
  opacity: 1;
}

.pedestal-star-ring {
  position: absolute;
  bottom: 14%;
  width: 78%;
  height: 26px;
  background: url("/q-art/frames/UI/character_spotlight_star.webp") center / contain no-repeat;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pedestal-slot.selected .pedestal-star-ring {
  opacity: 1;
  transform: scale(1.08);
  filter: drop-shadow(0 0 8px rgba(255, 215, 110, 0.8));
}

.pedestal-Plus {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 15, 12, 0.78);
  border: 1px dashed rgba(214, 175, 96, 0.65);
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin-bottom: 24%;
}

.pedestal-slot.selected .pedestal-Plus {
  border-style: solid;
  box-shadow: 0 0 14px rgba(244, 210, 132, 0.55);
}

.pedestal-sprite-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  z-index: 2;
  margin-bottom: 8%;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.85));
}

.pedestal-tag {
  z-index: 3;
  background: rgba(14, 11, 8, 0.88);
  border: 1px solid rgba(212, 169, 83, 0.45);
  border-radius: 4px;
  padding: 2px 8px;
  text-align: center;
  min-width: 84%;
}

.pedestal-slot.selected .pedestal-tag {
  border-color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(244, 210, 132, 0.4);
}

.pedestal-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pedestal-meta {
  font-size: 0.66rem;
  color: var(--text-muted);
}

.lobby-footer {
  background: linear-gradient(180deg, rgba(25, 19, 14, 0.94), rgba(14, 10, 8, 0.98));
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 10px 14px;
  text-align: center;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.75);
}

.lobby-slot-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.lobby-slot-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.lobby-slot-info-box {
  margin: 6px auto;
  padding: 5px 10px;
  background: rgba(10, 8, 6, 0.75);
  border: 1px solid rgba(212, 169, 83, 0.25);
  border-radius: 4px;
  font-size: 0.73rem;
  color: #dfd0b6;
  line-height: 1.45;
}

.lobby-btn-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.lobby-gold-btn {
  min-width: 156px;
  height: 40px;
  padding: 0 22px;
  background:
    url("/q-art/frames/UI/character_lobby_controls/enter_game_button.webp") center / 100% 100% no-repeat,
    linear-gradient(180deg, #6e4e23, #3c2911);
  border: 1px solid var(--gold-bright);
  border-radius: 4px;
  color: #fff3d1;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 3px #000;
  cursor: pointer;
}

.lobby-red-btn {
  height: 40px;
  padding: 0 16px;
  background:
    url("/q-art/frames/UI/character_lobby_controls/delete_character_button.webp") center / 100% 100% no-repeat,
    linear-gradient(180deg, #691d1a, #3b0f0d);
  border: 1px solid #c95b52;
  border-radius: 4px;
  color: #ffd7d4;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.lobby-bottom-tip {
  margin-top: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ==================== 2. 选择职业 3×3 九宫格 (create-character.png 1:1) ==================== */
.job-card-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.job-card {
  position: relative;
  background:
    url("/q-art/frames/UI/character_job_card.webp") center / 100% 100% no-repeat,
    linear-gradient(180deg, #241c15, #140f0b);
  border: 1px solid rgba(212, 169, 83, 0.42);
  border-radius: 6px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.job-card.selected {
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(244, 210, 132, 0.55), inset 0 0 12px rgba(244, 210, 132, 0.22);
  transform: translateY(-2px);
}

.job-card.locked {
  opacity: 0.55;
  filter: grayscale(0.45);
}

.job-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.job-card-sprite {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.85));
}

.job-card-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
}

.job-footer {
  text-align: center;
  padding: 6px 0;
}

.nickname-dialog-box {
  width: 86%;
  max-width: 340px;
  background: linear-gradient(180deg, #241c15, #130e0a);
  border: 1px solid var(--gold-bright);
  border-radius: 6px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
}

.nickname-dialog-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.nickname-job-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 6px 0 12px;
}

.nickname-input {
  width: 100%;
  padding: 9px 12px;
  background: #0d0a08;
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 14px;
}

/* 角色大厅按背景里的六个石台定位；保持 Q 版角色。 */
.lobby-screen { padding: 1.5% 3%; justify-content: flex-start; }
.lobby-pedestal-grid { position: absolute; left: 3%; right: 3%; top: 23%; height: 48%; margin: 0; gap: 0 2%; }
.pedestal-slot { padding: 0; }
.pedestal-sprite-img { position: absolute; bottom: -8%; width: 112px; height: 112px; margin: 0; }
.pedestal-Plus { position: absolute; bottom: 19%; margin: 0; width: 34px; height: 34px; background: none; border: 0; }
.pedestal-star-ring { bottom: 0; }
.pedestal-tag { position: absolute; top: 0; min-width: 0; width: 100%; padding: 0 2px; background: none; border: 0; text-shadow: 1px 1px 3px #000; }
.pedestal-slot.selected .pedestal-tag { border: 0; box-shadow: none; }
.pedestal-name { font-weight: 400; }
.lobby-footer { position: absolute; left: 8%; right: 8%; bottom: 2%; background: none; border: 0; box-shadow: none; padding: 0; }
.lobby-gold-btn:disabled { opacity: .55; cursor: not-allowed; }

/* 职业卡显示原版的基础属性和解锁状态。 */
.job-card { min-height: 0; overflow: hidden; background: linear-gradient(#182337, #0a101c); border: 1px solid #806e49; border-radius: 1px; padding: 4px; }
.job-card.selected { transform: none; }
.job-card.locked { opacity: .8; filter: none; }
.job-card-sprite { width: min(68px, 100%); height: 42%; flex-shrink: 1; }
.job-card-sub { width: 100%; border: 1px solid #645738; font-size: .64rem; line-height: 1.25; color: #dedbd1; }
.job-card-lock { position: absolute; top: 38%; left: 50%; transform: translateX(-50%); font-size: 18px; }
.job-available { color: #67df9a; }
.job-unavailable { color: #ec7772; }

.nickname-btn-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* ==================== 3. 游戏主界面 (ingame.png 1:1) ==================== */
.game-screen {
  background: #080a0e;
  container-type: inline-size;
  --u: calc(100cqw / 720);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

/* 顶部地图信息栏 */
.top-map-bar {
  height: calc(var(--u) * 64);
  flex-shrink: 0;
  background: url("/assets/ui-q/hud/top-status-frame.png") center / 100% 100% no-repeat, #0b0d11;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(var(--u) * 14);
  font-size: calc(var(--u) * 21);
  color: #eee;
  z-index: 15;
  white-space: nowrap;
}

.top-map-name span,
.top-map-count span {
  color: var(--gold-bright);
  font-weight: 700;
}

.top-line-btn {
  padding: calc(var(--u) * 3) calc(var(--u) * 7);
  background: url("/q-art/frames/UI/bot_button_on_bl.webp") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  font-size: calc(var(--u) * 20);
  color: #eee;
  cursor: pointer;
}

.top-line-btn span {
  color: #eee;
  font-weight: 400;
}

/* 地图视口容器 */
.map-viewport-container {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: #0b0907;
}

#battle-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

/* 天气横幅 */
.hud-weather-banner {
  position: absolute;
  top: calc(var(--u) * 20);
  left: 50%;
  transform: translateX(-50%);
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: calc(var(--u) * 20);
  color: #35e8ec;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  white-space: nowrap;
  z-index: 6;
}

/* 入城区域提示 */
.city-entry-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78%;
  max-width: 360px;
  pointer-events: none;
  z-index: 20;
  animation: bannerFadeInOut 2.4s ease forwards;
}

.city-entry-banner img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.9));
}

@keyframes bannerFadeInOut {
  0% { opacity: 0; transform: translate(-50%, -60%) scale(0.9); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -45%) scale(1.03); }
}

/* 左侧可折叠栏：任务引导 & 战斗统计 */
.left-sidebar {
  position: absolute;
  left: 0;
  display: flex;
  align-items: stretch;
  z-index: 10;
  transition: transform 0.2s ease;
}

.task-sidebar {
  top: calc(var(--u) * 42);
}

.stats-sidebar {
  bottom: calc(var(--u) * 320);
}

.left-sidebar.collapsed .sidebar-body {
  display: none;
}

.sidebar-body {
  width: calc(var(--u) * 200);
  background: rgba(6, 10, 16, 0.38);
  border: 0;
  border-radius: 0;
  padding: calc(var(--u) * 4) calc(var(--u) * 7);
  text-shadow: 1px 1px 2px #000;
}

.sidebar-title {
  font-size: calc(var(--u) * 21);
  font-weight: 400;
  color: #e6e0cc;
  border: 0;
  padding: 0;
  margin-bottom: calc(var(--u) * 3);
}

.task-stage-line {
  font-size: calc(var(--u) * 17);
  color: #ccc;
}

.task-name-line {
  font-size: calc(var(--u) * 19);
  font-weight: 400;
  color: #fff;
  margin: calc(var(--u) * 2) 0;
}

.task-desc-line {
  font-size: calc(var(--u) * 17);
  color: #ddd;
  line-height: 1.25;
}

.task-nav-link {
  margin-top: calc(var(--u) * 3);
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: #72ed55;
  font-size: calc(var(--u) * 18);
  cursor: pointer;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  gap: calc(var(--u) * 7);
  font-size: calc(var(--u) * 17);
  line-height: 1.45;
  color: #ddd;
}

.stat-line strong {
  color: #eee;
  font-weight: 400;
}

.sidebar-collapse-btn {
  width: calc(var(--u) * 22);
  background: rgba(8, 12, 17, 0.5);
  border: 0;
  color: #ddd;
  font-size: calc(var(--u) * 18);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

/* 右上三颗暗红哥特按钮 (Boss狩猎 / 传送 / 附近玩家) */
.right-top-buttons {
  position: absolute;
  top: calc(var(--u) * 42);
  right: calc(var(--u) * 12);
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 8);
  z-index: 10;
}

.red-gothic-btn {
  width: calc(var(--u) * 144);
  min-width: 0;
  height: calc(var(--u) * 42);
  padding: 0 calc(var(--u) * 8);
  background: url("/q-art/frames/UI/boss_hunt_button/button.webp") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  color: #fff;
  font-size: calc(var(--u) * 21);
  font-weight: 400;
  text-shadow: 1px 1px 2px #000;
  cursor: pointer;
}

.red-gothic-btn:active {
  transform: scale(0.97);
}

/* 飘字提示 */
.battle-toast {
  position: absolute;
  bottom: calc(var(--u) * 170);
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  background: rgba(8, 12, 18, 0.92);
  border: 1px solid #857858;
  padding: calc(var(--u) * 6) calc(var(--u) * 16);
  font-size: calc(var(--u) * 21);
  color: #ead8a1;
  z-index: 25;
  pointer-events: none;
}

/* ==================== 底部哥特操控台 (bottom-hud-deck) ==================== */
.bottom-hud-deck {
  flex-shrink: 0;
  background: #080a0d;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 15;
}

/* 第一层：左红球 + 中间切号/和平 + 右蓝球 */
.orb-control-row {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(var(--u) * 160);
  z-index: 15;
  pointer-events: none;
}

.orb-wrapper {
  position: absolute;
  bottom: 0;
  width: calc(var(--u) * 360);
  height: calc(var(--u) * 178);
  cursor: pointer;
  pointer-events: none;
}

.orb-sphere {
  position: absolute;
  left: calc(var(--u) * 26);
  bottom: calc(var(--u) * 26);
  width: calc(var(--u) * 148);
  height: calc(var(--u) * 148);
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #160b0d;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 5;
}

.orb-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  clip-path: inset(calc(100% - var(--orb-level, 100%)) 0 0);
  transition: clip-path 0.25s ease;
}

.hp-fill {
  background:
    url("/q-art/frames/UI/hongqiu.webp") center bottom / cover no-repeat,
    radial-gradient(circle at 38% 35%, #ff5e55, #9e1510 70%, #4d0705 100%);
}

.mp-fill {
  background:
    url("/q-art/frames/UI/lanqiu.webp") center bottom / cover no-repeat,
    radial-gradient(circle at 38% 35%, #5eb8ff, #114d9c 70%, #071f47 100%);
}

.orb-value-text {
  position: relative;
  z-index: 3;
  font-size: calc(var(--u) * 18);
  font-weight: 400;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
}

.orb-frame-wing {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.left-wing {
  background: url("/q-art/frames/UI/xuekuang2.webp") center / 100% 100% no-repeat;
}

.right-wing {
  background: url("/q-art/frames/UI/xuekuang1.webp") center / 100% 100% no-repeat;
}

.orb-center-controls {
  position: absolute;
  left: calc(var(--u) * 210);
  right: calc(var(--u) * 210);
  bottom: calc(var(--u) * 12);
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 5);
  z-index: 5;
  pointer-events: auto;
}

.orb-center-btns {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 4);
}

.stone-mini-btn {
  flex: 1;
  height: calc(var(--u) * 40);
  padding: 0;
  background: url("/q-art/frames/UI/bot_button_on_bl.webp") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  font-size: calc(var(--u) * 19);
  font-weight: 400;
  color: #eee;
  cursor: pointer;
}

.stone-mini-btn.peace-text {
  color: #67e683;
}

.stone-mini-btn.pk-text {
  color: #ff6b63;
}

.stone-mini-btn.active-gold {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}

.orb-sub-bars {
  display: flex;
  flex-direction: row;
  gap: calc(var(--u) * 5);
}

.mini-status-bar {
  flex: 1;
  min-width: 0;
  height: calc(var(--u) * 11);
  background: #080a11;
  border: 1px solid #665b47;
  border-radius: 0;
  overflow: hidden;
}

.purple-bar .mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7b3fe4, #c57bff);
}

.yellow-bar .mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #b8821e, #f7d168);
}

.hud-hero-summary {
  text-align: center;
  font-size: calc(var(--u) * 15);
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px #000;
}

/* ==================== 第二层：原版十字方向地图走位盘 (#map-travel-box) ==================== */
.map-travel-box {
  position: relative;
  height: calc(var(--u) * 220);
  min-height: 0;
  background: url("/assets/ui-q/hud/bottom-map-frame.png") center / 100% 100% no-repeat, #080a0d;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 5节点十字布局 (北门 / 西门 / 主城 / 东门 / 南门) */
.cross-map-grid {
  position: relative;
  width: 100%;
  height: 100%;
}

.cross-node-btn {
  height: calc(var(--u) * 54);
  background: url("/q-art/frames/UI/bot_button_on_bl.webp") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  color: #eee;
  font-size: calc(var(--u) * 21);
  font-weight: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: calc(var(--u) * 3);
  cursor: pointer;
  position: relative;
  z-index: 1;
  text-shadow: 1px 1px #000;
}

.cross-node-btn .lv-bracket {
  font-size: calc(var(--u) * 18);
  color: #e1bd5f;
  font-weight: 400;
}

.cross-node-btn.active-node {
  background: linear-gradient(180deg, #523b1c 0%, #2c1e0d 100%);
  border-color: var(--gold-bright);
  color: #fff4d2;
  box-shadow: 0 0 10px rgba(244, 210, 132, 0.45);
}

.cross-node-btn.boss-node {
  background: linear-gradient(180deg, #631b18 0%, #360d0b 100%);
  border-color: #e06a5f;
  color: #ffd8d4;
}

.cross-arrow-cell {
  font-size: 0.74rem;
  color: rgba(212, 169, 83, 0.65);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* 门区子地图展开布局 (如：东门门口 / 东门台阶 / 东门巢穴 / Boss区 / 主城 / 查看掉落 / 返回) */
.submap-travel-layout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(var(--u) * 8);
  padding: calc(var(--u) * 14);
  height: 100%;
}

.submap-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--u) * 8);
}

.submap-region-title {
  font-size: calc(var(--u) * 19);
  font-weight: 400;
  color: #e1bd5f;
}

.submap-top-actions {
  display: flex;
  gap: calc(var(--u) * 6);
  flex-shrink: 0;
}

.submap-util-btn {
  padding: calc(var(--u) * 4) calc(var(--u) * 10);
  background: url("/q-art/frames/UI/bot_button_on_bl.webp") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  font-size: calc(var(--u) * 18);
  color: #eee;
  cursor: pointer;
}

.submap-util-btn.drop-btn {
  color: #79e88c;
}

.submap-chain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--u) * 5);
}

.submap-chain-arrow {
  color: #eee;
  font-size: calc(var(--u) * 22);
  flex-shrink: 0;
}

.submap-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--u) * 10);
}

/* ==================== 第三层：最底排 6 个固定主菜单按钮 ==================== */
.bottom-main-nav {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: calc(var(--u) * 3);
  height: calc(var(--u) * 58);
  padding: calc(var(--u) * 4) calc(var(--u) * 5);
  background: url("/q-art/frames/UI/shangditu.webp") center / 100% 175% no-repeat, #090b0e;
}

.main-nav-btn {
  height: 100%;
  padding: 0 calc(var(--u) * 2);
  background: url("/q-art/frames/UI/bot_button_on_bl.webp") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  color: #eee;
  font-size: calc(var(--u) * 22);
  font-weight: 400;
  text-shadow: 1px 1px #000;
  cursor: pointer;
  white-space: nowrap;
}

.main-nav-btn:active,
.main-nav-btn.active {
  background: linear-gradient(180deg, #59401f 0%, #2e200f 100%);
  border-color: var(--gold-bright);
  color: #fff6db;
}


.orb-left { left: calc(var(--u) * -20); }
.orb-right { right: calc(var(--u) * -20); }
.orb-right .orb-sphere { left: auto; right: calc(var(--u) * 29); }
.orb-control-row::before { content: ""; position: absolute; inset: 0; background: url("/q-art/frames/UI/jingyankuang.webp") center bottom / 100% auto no-repeat; pointer-events: none; }
.cross-map-links { position: absolute; inset: 0; width: 100%; height: 100%; color: #f0eee6; pointer-events: none; }
.cross-map-grid > .cross-node-btn { position: absolute; width: 19%; }
.cross-north { left: 40.5%; top: 5%; }
.cross-west { left: 1.5%; top: 38%; }
.cross-hub { left: 40.5%; top: 38%; color: #69ed42; font-size: calc(var(--u) * 28); }
.cross-hub.active-node { color: #69ed42; }
.cross-east { right: 1.5%; top: 38%; }
.cross-south { left: 40.5%; bottom: 4%; }
.cross-drops, .cross-continent { position: absolute; bottom: 5%; font-size: calc(var(--u) * 16); background: none; }
.cross-drops { left: 2%; }
.cross-continent { right: 2%; max-width: 28%; }
.submap-chain-row .cross-node-btn, .submap-bottom-row .cross-node-btn { flex: 1; min-width: 0; font-size: calc(var(--u) * 18); }
.more-features-window .gothic-window-header { justify-content: center; position: relative; padding: calc(var(--u) * 6); background: none; border: 0; }
.more-features-window .gothic-window-title { font-size: calc(var(--u) * 26); font-weight: 400; }
.more-features-window .gothic-close-btn { position: absolute; right: 0; top: 0; width: calc(var(--u) * 28); height: calc(var(--u) * 28); font-size: calc(var(--u) * 18); background: none; border: 0; }

/* ==================== 弹窗通用样式 ==================== */
.gothic-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 4, 3, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 40;
}

.gothic-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(180deg, #2c2117, #19120c);
  border-bottom: 1px solid var(--border-gold);
}

.gothic-window-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
}

.gothic-close-btn {
  width: 26px;
  height: 26px;
  background: rgba(65, 22, 18, 0.85);
  border: 1px solid rgba(212, 169, 83, 0.55);
  border-radius: 4px;
  color: #f5dfb8;
  font-size: 0.8rem;
  cursor: pointer;
}

/* 「更多功能」12宫格窗口 (tutorial-more.png 1:1) */
.more-features-window {
  width: calc(var(--u) * 520);
  max-width: 90%;
  background: url("/assets/ui-q/controls/more-features-frame.png") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  padding: calc(var(--u) * 25) calc(var(--u) * 26) calc(var(--u) * 32);
  overflow: hidden;
}

.more-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--u) * 15) calc(var(--u) * 13);
  padding: calc(var(--u) * 12) calc(var(--u) * 6);
}

.feature-cell-btn {
  height: calc(var(--u) * 31);
  padding: 0;
  background: url("/assets/ui-q/controls/feature-button.png") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  color: #e2c778;
  font-size: calc(var(--u) * 19);
  font-weight: 400;
  cursor: pointer;
}

.feature-cell-btn:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

/* 通用功能大窗口 (角色/背包/技能/战盟/铁匠铺/传送/Boss狩猎等) */
.feature-window-frame {
  width: 95%;
  max-height: 86vh;
  background:
    linear-gradient(180deg, rgba(26, 20, 15, 0.97) 0%, rgba(14, 11, 8, 0.99) 100%);
  border: 1px solid var(--gold-bright);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
}

.feature-window-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #817357 #15191e;
}

.feature-window-body::-webkit-scrollbar { width: 6px; }
.feature-window-body::-webkit-scrollbar-track { background: #15191e; }
.feature-window-body::-webkit-scrollbar-thumb { background: #817357; border-radius: 3px; }

/* 窗口内通用选项卡与卡片 */
.window-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.window-tab-btn {
  flex: 1;
  min-width: 68px;
  padding: 6px 8px;
  background: #1a140e;
  border: 1px solid rgba(212, 169, 83, 0.42);
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.window-tab-btn.active {
  background: linear-gradient(180deg, #4f391b, #291c0d);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.gothic-section-card {
  background: rgba(15, 11, 8, 0.85);
  border: 1px solid rgba(212, 169, 83, 0.35);
  border-radius: 5px;
  padding: 8px 10px;
}

.gothic-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-bright);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gothic-btn {
  padding: 5px 11px;
  background: linear-gradient(180deg, #33261a, #1b140d);
  border: 1px solid rgba(212, 169, 83, 0.6);
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #f3e3c3;
  cursor: pointer;
}

.gothic-btn.gold {
  background: linear-gradient(180deg, #6b4c21, #3b2810);
  border-color: var(--gold-bright);
  color: #fff4d4;
}

.gothic-btn.red {
  background: linear-gradient(180deg, #6e1f1c, #3b0f0d);
  border-color: #d6655c;
  color: #ffd9d6;
}

.gothic-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 角色面板 12 槽位纸娃娃 (beibao_slots_pixel/*) */
.paperdoll-stage {
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  gap: 8px;
  align-items: center;
  background:
    url("/q-art/frames/UI/juese_panel_pixel.webp") center / cover no-repeat,
    rgba(12, 9, 7, 0.9);
  border: 1px solid rgba(212, 169, 83, 0.42);
  border-radius: 6px;
  padding: 10px 8px;
}

.paperdoll-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.equip-slot-box {
  position: relative;
  height: 52px;
  background: rgba(18, 14, 10, 0.92);
  border: 1px solid rgba(212, 169, 83, 0.48);
  border-radius: 4px;
  padding: 3px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-align: center;
}

.equip-slot-box.has-item {
  border-color: var(--gold-bright);
  box-shadow: inset 0 0 8px rgba(244, 210, 132, 0.2);
}

.equip-slot-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.equip-slot-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.equip-slot-box.has-item .equip-slot-label {
  color: var(--gold-bright);
}

.paperdoll-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
}

.paperdoll-hero-img {
  width: 136px;
  height: 136px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.9));
}

.attr-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
  font-size: 0.73rem;
}

.attr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
  background: rgba(24, 18, 13, 0.8);
  border: 1px solid rgba(212, 169, 83, 0.22);
  border-radius: 3px;
}

.attr-row strong {
  color: var(--gold-bright);
}

/* 背包道具格子 */
.bag-item-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.bag-item-cell {
  background: rgba(22, 17, 12, 0.94);
  border: 1px solid rgba(212, 169, 83, 0.42);
  border-radius: 4px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  text-align: center;
  position: relative;
}

.bag-item-cell.selected {
  border-color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(244, 210, 132, 0.45);
}

.bag-item-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.bag-item-name {
  font-size: 0.66rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.bag-item-power {
  font-size: 0.6rem;
  color: var(--gold-main);
}

/* 离线战报窗 */
.offline-reward-window {
  width: 88%;
  max-width: 340px;
  background:
    url("/q-art/frames/UI/offline_rewards_frame.webp") center / cover no-repeat,
    linear-gradient(180deg, #241b14, #120d09);
  border: 1px solid var(--gold-bright);
  border-radius: 6px;
  padding-bottom: 14px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.92);
}

.offline-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 8px 14px 4px;
  margin: 0;
}

.offline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 14px 12px;
}

/* 昆顿宝箱、昆顿印记、失落地图：各级共用一张图，+2 起按等级换颜色（图标地址带 ?lv=N）。 */
img[src*="?lv=2"] { filter: hue-rotate(50deg); }
img[src*="?lv=3"] { filter: hue-rotate(110deg); }
img[src*="?lv=4"] { filter: hue-rotate(170deg); }
img[src*="?lv=5"] { filter: hue-rotate(220deg); }
img[src*="?lv=6"] { filter: hue-rotate(280deg); }
img[src*="?lv=7"] { filter: hue-rotate(330deg); }
