/* ============================================================================
   天堂 3.81C · Windows 原版玩家介面完整還原樣式表（Mac 友善熱鍵版）
   所有原版 .img / .tbt 均由後端從 天堂3.81c/Sprite*.pak 唯讀即時解碼
   ============================================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

:root {
  --hud-s: 1.58px;
  --win-s: 1.48px;
  --l1-bg-deep: #0b0907;
  --l1-panel: #16120e;
  --l1-panel-2: #1f1914;
  --l1-slot: #0c0a08;
  --l1-border-outer: #4c3e2e;
  --l1-border-hi: #8a7356;
  --l1-border-dark: #070504;
  --l1-gold: #e7c982;
  --l1-gold-hi: #fff1b8;
  --l1-text: #dfd4be;
  --l1-muted: #9e8f77;
  --l1-blue: #7ac8ff;
  --l1-green: #69e89c;
  --l1-red: #ff6961;
  --l1-font: "PingFang TC", "PMingLiU", "MingLiU", "Hiragino Sans CNS", "Microsoft JhengHei", sans-serif;
  --l1-mono: "Menlo", "SF Mono", "Consolas", monospace;
}

@media (min-width: 1680px) {
  :root {
    --hud-s: 1.88px;
    --win-s: 1.70px;
  }
}

@media (min-width: 2150px) {
  :root {
    --hud-s: 2.04px;
    --win-s: 1.84px;
  }
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--l1-text);
  font-family: var(--l1-font);
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hidden {
  display: none !important;
}

#game-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: url('/cursors/normal.png') 2 2, default;
}

#game-canvas.cur-normal {
  cursor: url('/cursors/normal.png') 2 2, default;
}

#game-canvas.cur-attack {
  cursor: url('/cursors/sword.png') 2 2, pointer;
}

#game-canvas.cur-attack-hit {
  cursor: url('/cursors/sword_hit.png') 2 2, pointer;
}

#game-canvas.cur-npc {
  cursor: url('/cursors/npc.png') 4 4, pointer;
}

#game-canvas.cur-loot {
  cursor: url('/cursors/loot.png') 10 6, pointer;
}

/* 原版「滑鼠游標大小：放大」模式 (46x46 清晰像素游標) */
body.l1-cursor-large #game-canvas,
body.l1-cursor-large #game-canvas.cur-normal {
  cursor: url('/cursors/normal_lg.png') 3 3, default;
}
body.l1-cursor-large #game-canvas.cur-attack {
  cursor: url('/cursors/sword_lg.png') 3 3, pointer;
}
body.l1-cursor-large #game-canvas.cur-attack-hit {
  cursor: url('/cursors/sword_hit_lg.png') 3 3, pointer;
}
body.l1-cursor-large #game-canvas.cur-npc {
  cursor: url('/cursors/npc_lg.png') 6 6, pointer;
}
body.l1-cursor-large #game-canvas.cur-loot {
  cursor: url('/cursors/loot_lg.png') 14 9, pointer;
}

/* 原版「夜視功能（妖精／地監畫面提亮）」與「移動式體力／魔力列」開關 */
body.l1-infravision #game-canvas {
  filter: brightness(1.22) contrast(1.05);
}
body.l1-hide-float-hpmp .l1-hud-hpbar-row,
body.l1-hide-float-hpmp .l1-gauge-orb {
  display: none;
}

/* 魔法效果結束通知：剩餘 ≤ 15 秒脈衝閃爍 */
.l1-buff-icon.expiring {
  animation: l1BuffExpire 0.75s infinite alternate;
  border-color: #ff7a6b !important;
}
@keyframes l1BuffExpire {
  from { opacity: 1; box-shadow: 0 0 8px rgba(255, 96, 82, 0.85); }
  to   { opacity: 0.38; box-shadow: 0 0 2px rgba(255, 96, 82, 0.25); }
}

/* ============================================================================
   左上角：目標怪物血條框
   右上角（小地圖左側）：Windows 原版天堂 3.81C 正統 Buff 狀態圖示列
   ============================================================================ */
#top-left-hud {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.l1-top-right-buffs {
  position: absolute;
  top: 10px;
  right: 256px;
  z-index: 26;
  max-width: min(620px, calc(100vw - 320px));
  pointer-events: none;
  transition: right 0.16s ease;
}

.l1-top-right-buffs.minimap-collapsed {
  right: 92px;
}

.l1-buff-bar {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
  pointer-events: auto;
}

.l1-buff-icon {
  position: relative;
  width: 36px;
  height: 36px;
  background: #0b0908;
  border: 1px solid #6c5941;
  box-shadow: inset 0 0 0 1px #1f1912, 0 2px 5px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.l1-buff-icon.haste {
  border-color: #62e38f;
  box-shadow: inset 0 0 0 1px #184a2a, 0 0 7px rgba(98, 227, 143, 0.55);
}

.l1-buff-icon.brave {
  border-color: #f4be52;
  box-shadow: inset 0 0 0 1px #573d10, 0 0 7px rgba(244, 190, 82, 0.6);
}

.l1-buff-icon.bluepot {
  border-color: #69b8ff;
  box-shadow: inset 0 0 0 1px #173b63, 0 0 7px rgba(105, 184, 255, 0.5);
}

.l1-buff-icon.gold {
  border-color: #d6b25e;
  box-shadow: inset 0 0 0 1px #4c3b15, 0 0 6px rgba(231, 201, 130, 0.45);
}

.l1-buff-icon.debuff {
  border-color: #d94b4b;
  background: #230909;
  box-shadow: inset 0 0 0 1px #6a1818, 0 0 7px rgba(220, 62, 62, 0.65);
}
.l1-buff-icon.debuff img {
  filter: sepia(0.35) hue-rotate(-35deg) saturate(1.4);
}

.l1-buff-icon.god {
  border-color: #ff9f43;
  box-shadow: 0 0 8px rgba(255, 160, 60, 0.65);
}

.l1-buff-icon.expiring {
  animation: l1BuffBlink 0.65s infinite alternate;
}

@keyframes l1BuffBlink {
  from { opacity: 1; }
  to   { opacity: 0.35; }
}

.l1-buff-icon img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.l1-buff-sec {
  position: absolute;
  right: 1px;
  bottom: 0;
  padding: 0 3px;
  font-size: 10px;
  line-height: 12px;
  font-family: var(--l1-mono);
  color: #fff3c4;
  background: rgba(0, 0, 0, 0.84);
  text-shadow: 0 1px 1px #000;
}

.l1-target-box {
  width: 242px;
  padding: 6px 10px;
  background: rgba(16, 13, 10, 0.92);
  border: 1px solid #7d6445;
  box-shadow: inset 0 0 0 1px #241c13, 0 4px 12px rgba(0, 0, 0, 0.85);
}

.l1-target-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #ffd788;
  text-shadow: 0 1px 2px #000;
}

.l1-target-head #target-lv {
  font-size: 11px;
  color: #f4a48a;
  font-weight: 600;
}

.l1-target-hp-track {
  height: 11px;
  background: #140808;
  border: 1px solid #594432;
  overflow: hidden;
}

.l1-target-hp-fill {
  height: 100%;
  background: linear-gradient(180deg, #ff564e 0%, #c81b15 55%, #7a0d09 100%);
  transition: width 0.12s linear;
}

.l1-target-hp-text {
  margin-top: 3px;
  text-align: right;
  font-size: 11px;
  font-family: var(--l1-mono);
  color: #e2d2b5;
}

/* ============================================================================
   中央上方系統公告跑馬
   ============================================================================ */
.center-banner {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  padding: 7px 18px;
  background: rgba(14, 10, 7, 0.92);
  border: 1px solid #c4a35d;
  box-shadow: inset 0 0 0 1px #362815, 0 6px 20px rgba(0, 0, 0, 0.85);
  color: #ffe9a3;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  white-space: nowrap;
}

.center-banner.enchant_ok {
  border-color: #7ccaff;
  color: #c2ebff;
}

.center-banner.enchant_break {
  border-color: #ff6b6b;
  color: #ffb8b8;
}

.center-banner.levelup {
  border-color: #ffd966;
  color: #fff3b0;
}

/* ============================================================================
   右上角：原版 3.81C 黑鐵雕花小地圖停駐框
   ============================================================================ */
.l1-minimap-dock {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 26;
  width: 238px;
}

.l1-minimap-frame {
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(31, 17, 20, 0.96) 0%, rgba(14, 8, 10, 0.98) 100%);
  border: 1px solid rgba(206, 162, 82, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 228, 158, 0.22), 0 8px 22px rgba(0, 0, 0, 0.88);
  padding: 6px;
}

.l1-minimap-head {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 5px;
  border-bottom: 1px solid #3c3023;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--l1-gold);
}

.l1-minimap-head #minimap-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.l1-zone {
  padding: 0 5px;
  font-size: 10.5px;
  border: 1px solid currentColor;
  line-height: 16px;
}

.l1-zone.safe { color: #7ac8ff; }
.l1-zone.normal { color: #dfd4be; }
.l1-zone.combat { color: #ff7066; }

.l1-mini-icon-btn {
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid #6b5841;
  background: #221b14;
  color: #dfd4be;
  font-size: 11px;
  line-height: 19px;
  cursor: pointer;
}

.l1-mini-icon-btn:hover {
  border-color: var(--l1-gold);
  color: #fff;
}

.l1-minimap-body {
  position: relative;
  width: 100%;
  aspect-ratio: 10 / 9;
  background: #060504;
  border: 1px solid #4a3d2d;
  overflow: hidden;
}

#minimap-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.l1-minimap-parchment {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.l1-minimap-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 3px 3px;
  font-size: 11.5px;
  font-family: var(--l1-mono);
  color: #d7c7a5;
}

.l1-rate-tag {
  padding: 0 4px;
  background: #40260d;
  border: 1px solid #c9973b;
  color: #ffe399;
  font-size: 10px;
}

.l1-minimap-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.l1-small-btn {
  padding: 4px 3px;
  background: linear-gradient(180deg, #2d241b 0%, #19140f 100%);
  border: 1px solid #64513c;
  color: #e4d7bd;
  font-family: var(--l1-font);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}

.l1-small-btn:hover {
  border-color: var(--l1-gold);
  color: #fff6d2;
}

.l1-small-btn.active {
  border-color: #d6b25e;
  background: linear-gradient(180deg, #42331f 0%, #241b10 100%);
  color: #ffe8a1;
}

.l1-small-btn.danger {
  border-color: #7d362d;
  color: #ffbeb3;
}

.l1-minimap-extra {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid #3c3023;
}

.l1-bgm-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  font-size: 10.5px;
  color: var(--l1-gold);
}

.l1-select {
  flex: 1;
  min-width: 0;
  padding: 2px 4px;
  background: #0d0a08;
  border: 1px solid #594835;
  color: #e3d6be;
  font-size: 10.5px;
}

.l1-landmark-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--l1-muted);
  margin-bottom: 3px;
}

.l1-landmark-list {
  max-height: 155px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.landmark-btn {
  text-align: left;
  padding: 4px 6px;
  background: #14100c;
  border: 1px solid #453728;
  color: #e4d7bd;
  cursor: pointer;
  font-family: var(--l1-font);
  font-size: 11px;
}

.landmark-btn:hover {
  border-color: var(--l1-gold);
  background: #241c13;
}

.landmark-btn .lm-name {
  font-weight: 700;
  color: #f3dba0;
}

.landmark-btn .lm-desc {
  font-size: 10px;
  color: #9e8f77;
}

.l1-minimap-restore {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 26;
  padding: 4px 10px;
  background: #1a1510;
  border: 1px solid #7c6548;
  color: var(--l1-gold);
  font-family: var(--l1-font);
  font-size: 11.5px;
  cursor: pointer;
}

/* ============================================================================
   底部中央：100% Windows 原版《天堂 3.81C》三件式雕花主操作控制列
   ============================================================================ */
.l1-hud-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.l1-hud-stage {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 10px 6px;
  pointer-events: auto;
}

/* --- 左塊：Mac天堂 高解析度黑曜鍛金血魔條 ＋ 人物數值狀態盤（徹底取代低解析馬賽克底圖） --- */
.l1-hud-left-col {
  --s: var(--hud-s);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: calc(4 * var(--s));
  width: calc(158 * var(--s));
  flex-shrink: 0;
}

/* 上方浮動體力／魔力列（Retina 高清黑曜暗紅鍛金質感，左側《Mac天堂》紅寶石雙劍盾徽） */
.l1-gauge-orb {
  --s: var(--hud-s);
  position: relative;
  width: 100%;
  height: calc(32 * var(--s));
  padding: calc(3.2 * var(--s)) calc(4.5 * var(--s)) calc(3.2 * var(--s)) calc(3.8 * var(--s));
  display: flex;
  align-items: center;
  gap: calc(4.5 * var(--s));
  border-radius: calc(5 * var(--s));
  background: linear-gradient(180deg, rgba(36, 15, 19, 0.96) 0%, rgba(18, 8, 10, 0.98) 58%, rgba(12, 5, 7, 0.98) 100%);
  border: 1px solid rgba(206, 162, 82, 0.68);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 228, 158, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(10, 4, 5, 0.9);
}

.l1-gauge-orb::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 16%;
  right: 16%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #f5d47e, transparent);
  pointer-events: none;
}

.l1-gauge-crest {
  width: calc(24.5 * var(--s));
  height: calc(24.5 * var(--s));
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
}

.l1-gauge-bars {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(2.4 * var(--s));
}

.l1-gauge-row {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(4.5 * var(--s));
  border-radius: calc(2.8 * var(--s));
  background: linear-gradient(180deg, #0b0506 0%, #170b0d 100%);
  border: 1px solid rgba(164, 128, 68, 0.36);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.92);
  overflow: hidden;
}

.l1-gauge-row.mp {
  background: linear-gradient(180deg, #060b16 0%, #0d172c 100%);
}

.l1-gauge-hp-clip,
.l1-gauge-mp-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.l1-gauge-hp-bar {
  height: 100%;
  background: linear-gradient(180deg, #ff5e54 0%, #d4211c 48%, #981012 85%, #750a0d 100%);
  box-shadow: inset 0 1px 0 rgba(255, 212, 200, 0.45), 0 0 8px rgba(236, 48, 42, 0.42);
  transition: width 0.14s ease-out;
}

.l1-gauge-mp-bar {
  height: 100%;
  background: linear-gradient(180deg, #52c0ff 0%, #1d74e8 48%, #12489e 85%, #0c3170 100%);
  box-shadow: inset 0 1px 0 rgba(206, 240, 255, 0.45), 0 0 8px rgba(48, 138, 255, 0.42);
  transition: width 0.14s ease-out;
}

.l1-gauge-tag {
  position: relative;
  z-index: 2;
  font-family: var(--l1-mono);
  font-size: calc(5.8 * var(--s));
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

.l1-gauge-tag.hp { color: #ffd9d2; }
.l1-gauge-tag.mp { color: #cceaff; }

.l1-gauge-hp-txt,
.l1-gauge-mp-txt {
  position: relative;
  z-index: 2;
  font-size: calc(6.5 * var(--s));
  line-height: 1;
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #fffdf7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  white-space: nowrap;
}

/* 下方人物數值狀態盤（與聊天欄、快捷欄同高 calc(110 * var(--s))，純 Flex/Grid 零跑版） */
.l1-status-plate {
  --s: var(--hud-s);
  position: relative;
  width: 100%;
  height: calc(110 * var(--s));
  padding: calc(4.8 * var(--s)) calc(5.2 * var(--s)) calc(5 * var(--s));
  display: flex;
  flex-direction: column;
  gap: calc(3.6 * var(--s));
  border-radius: calc(5 * var(--s));
  background: linear-gradient(180deg, rgba(30, 18, 20, 0.97) 0%, rgba(17, 10, 12, 0.98) 54%, rgba(11, 7, 8, 0.99) 100%);
  border: 1px solid rgba(202, 158, 82, 0.64);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.88),
    inset 0 1px 0 rgba(255, 228, 158, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(9, 5, 6, 0.92);
  overflow: hidden;
}

.l1-status-plate::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18%;
  right: 18%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #f4d27c, transparent);
  pointer-events: none;
}

/* 第 1 層：角色名稱 ＋ 正義／邪惡數值 ＋ 獨立天平滑軌（絕不重疊） */
.l1-sp-identity {
  display: flex;
  flex-direction: column;
  gap: calc(2.4 * var(--s));
  flex-shrink: 0;
}

.l1-sp-mid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(4 * var(--s));
  min-width: 0;
  height: calc(11.5 * var(--s));
}

.l1-sp-name {
  flex: 1;
  min-width: 0;
  font-size: calc(7.1 * var(--s));
  font-weight: 800;
  line-height: 1.1;
  color: #f8e5b4;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.92);
}

.l1-sp-lawful-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: calc(2.4 * var(--s));
  padding: calc(1 * var(--s)) calc(3.8 * var(--s));
  border-radius: calc(2.5 * var(--s));
  background: rgba(9, 5, 7, 0.78);
  border: 1px solid rgba(168, 132, 72, 0.34);
}

.l1-sp-lawful-lbl {
  font-size: calc(5.2 * var(--s));
  font-weight: 700;
  line-height: 1;
  color: #c8b89a;
}

.l1-sp-lawful-num {
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  font-size: calc(6.2 * var(--s));
  font-weight: 700;
  line-height: 1;
  color: #8ad6ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.l1-sp-align {
  display: none;
}

/* 獨立正義／邪惡天平滑軌（左藍金正義 · 中立 · 右紫紅邪惡） */
.l1-sp-align-rail {
  position: relative;
  height: calc(3.2 * var(--s));
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(66, 174, 255, 0.78) 0%,
    rgba(96, 152, 206, 0.34) 30%,
    rgba(58, 48, 42, 0.55) 50%,
    rgba(164, 62, 118, 0.36) 70%,
    rgba(232, 54, 54, 0.82) 100%
  );
  border: 1px solid rgba(178, 140, 78, 0.3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.85);
}

.l1-sp-align-center-tick {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 240, 200, 0.35);
  transform: translateX(-50%);
}

.l1-sp-align-needle {
  position: absolute;
  top: 50%;
  width: calc(4.2 * var(--s));
  height: calc(4.2 * var(--s));
  border-radius: 1px;
  background: linear-gradient(135deg, #fff8d6 0%, #f2c45a 55%, #b57718 100%);
  border: 1px solid #301a05;
  box-shadow: 0 0 6px rgba(255, 224, 128, 0.92);
  transform: translate(-50%, -50%) rotate(45deg);
  pointer-events: none;
  transition: left 0.2s ease;
}

/* 第 2 層：等級徽章與經驗進度條 */
.l1-sp-lv-box {
  position: relative;
  flex-shrink: 0;
  height: calc(14 * var(--s));
  padding: 0 calc(5 * var(--s));
  border-radius: calc(3 * var(--s));
  background: linear-gradient(180deg, #0d0809 0%, #191112 100%);
  border: 1px solid rgba(182, 142, 74, 0.44);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.88);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.l1-sp-exp-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(146, 98, 22, 0.72) 0%, rgba(214, 162, 54, 0.82) 70%, rgba(246, 212, 108, 0.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 244, 198, 0.4);
  pointer-events: none;
  z-index: 0;
  transition: width 0.2s ease;
}

.l1-sp-lv-wrap {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: calc(1.5 * var(--s));
  white-space: nowrap;
}

.l1-sp-lv-prefix {
  font-family: var(--l1-mono);
  font-size: calc(5.8 * var(--s));
  font-weight: 700;
  color: #e2be6c;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}

.l1-sp-lv-txt,
.l1-sp-exp-txt {
  position: relative;
  z-index: 1;
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  font-size: calc(6.8 * var(--s));
  line-height: 1;
  font-weight: 800;
  color: #fff8de;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}

.l1-sp-exp-txt {
  font-size: calc(6.2 * var(--s));
  font-weight: 700;
  color: #f6e7c2;
}

/* 第 3 層：2×3 六大核心能力格（寬裕防溢位、圓角內槽進度條絕不爆框） */
.l1-sp-stats-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: calc(3.2 * var(--s));
}

.l1-sp-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: calc(2.4 * var(--s));
  padding: 0 calc(4 * var(--s)) 0 calc(3.2 * var(--s));
  border-radius: calc(3 * var(--s));
  background: linear-gradient(180deg, rgba(15, 10, 12, 0.92) 0%, rgba(24, 16, 18, 0.92) 100%);
  border: 1px solid rgba(164, 128, 70, 0.3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  white-space: nowrap;
}

.l1-sp-ico {
  position: relative;
  z-index: 2;
  width: calc(9.6 * var(--s));
  height: calc(9.6 * var(--s));
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}

.l1-sp-ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

.l1-sp-lbl {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  font-size: calc(5.2 * var(--s));
  font-weight: 700;
  line-height: 1;
  color: rgba(214, 194, 158, 0.78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}

.l1-sp-val {
  position: relative;
  z-index: 2;
  margin-left: auto;
  min-width: 0;
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  font-size: calc(6.5 * var(--s));
  font-weight: 800;
  line-height: 1;
  text-align: right;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.96);
  overflow: hidden;
  text-overflow: ellipsis;
}

.l1-sp-gauge-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: calc(2.2 * var(--s)) 0 0 calc(2.2 * var(--s));
  transition: width 0.16s ease;
}

.l1-sp-gauge-fill.wt {
  background: linear-gradient(90deg, rgba(28, 92, 46, 0.72) 0%, rgba(62, 158, 78, 0.84) 100%);
  box-shadow: inset 0 1px 0 rgba(176, 255, 192, 0.25);
}
.l1-sp-gauge-fill.wt.warn {
  background: linear-gradient(90deg, rgba(146, 94, 16, 0.78) 0%, rgba(220, 158, 38, 0.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 232, 164, 0.3);
}
.l1-sp-gauge-fill.wt.over {
  background: linear-gradient(90deg, rgba(138, 22, 18, 0.84) 0%, rgba(218, 52, 44, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 186, 180, 0.3);
}
.l1-sp-gauge-fill.food {
  background: linear-gradient(90deg, rgba(124, 70, 18, 0.72) 0%, rgba(196, 128, 38, 0.84) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 224, 154, 0.26);
}

.l1-sp-cell.c-ac .l1-sp-val     { color: #9cd6ff; }
.l1-sp-cell.c-sp .l1-sp-val     { color: #7ee4ff; }
.l1-sp-cell.c-adena .l1-sp-val  { color: #ffd978; font-size: calc(6.2 * var(--s)); letter-spacing: -0.25px; }
.l1-sp-cell.c-mr .l1-sp-val     { color: #d8b8ff; }
.l1-sp-cell.c-weight .l1-sp-val { color: #eaffdc; }
.l1-sp-cell.c-food .l1-sp-val   { color: #ffebc2; }

/* --- 中塊：原版 2271.img 黑石聊天室 + 2273.img 底部輸入條 --- */
.l1-hud-chat-col {
  --s: var(--hud-s);
  position: relative;
  width: calc(330 * var(--s));
  height: calc(110 * var(--s));
  background: url('/api/ui/img/2271.png') no-repeat left top / 100% 100%;
  image-rendering: pixelated;
  display: flex;
  flex-direction: column;
  padding: calc(14.5 * var(--s)) calc(7.5 * var(--s)) calc(5.5 * var(--s)) calc(7.5 * var(--s));
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.92));
  transition: height 0.16s ease;
}

.l1-hud-chat-col.expanded {
  height: calc(190 * var(--s));
}

.l1-chat-top-ctrl {
  position: absolute;
  top: calc(1.5 * var(--s));
  left: calc(11 * var(--s));
  right: calc(11 * var(--s));
  height: calc(12 * var(--s));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.l1-chat-map-label {
  font-size: calc(7.4 * var(--s));
  font-weight: 700;
  color: #f3d796;
  text-shadow: 0 1px 2px #000;
}

.l1-chat-channels {
  display: flex;
  gap: 3px;
}

.l1-ch-btn {
  width: calc(14 * var(--s));
  height: calc(11 * var(--s));
  padding: 0;
  border: 1px solid #6b5740;
  background: rgba(20, 15, 11, 0.92);
  color: #cbba9d;
  font-family: var(--l1-font);
  font-size: calc(6.8 * var(--s));
  line-height: 1;
  cursor: pointer;
}

.l1-ch-btn.active,
.l1-ch-btn:hover {
  border-color: #e6c675;
  color: #fff3c0;
  background: #3a2d1b;
}

.l1-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 4px 7px;
  background: rgba(6, 5, 4, 0.74);
  border: 1px solid rgba(90, 74, 54, 0.52);
  font-size: calc(7.8 * var(--s));
  line-height: 1.46;
  color: #e2d8c5;
  user-select: text;
  -webkit-user-select: text;
}

.l1-chat-log .log-line {
  margin-bottom: 1px;
  text-shadow: 0 1px 1px #000;
}

.l1-chat-log .log-line.gold { color: #ffe07d; }
.l1-chat-log .log-line.danger { color: #ff8278; }
.l1-chat-log .log-line.loot { color: #7ef2a6; }
.l1-chat-log .log-line.magic { color: #8ad6ff; }
.l1-chat-log .log-line.chat { color: #ffffff; }

.l1-chat-input-wrap {
  margin-top: 4px;
  height: calc(16 * var(--s));
  background: url('/api/ui/img/2273.png') no-repeat left center / 100% 100%;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  padding: 0 9px;
}

.l1-chat-input {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #fff7df;
  font-family: var(--l1-font);
  font-size: calc(7.6 * var(--s));
  user-select: text;
  -webkit-user-select: text;
}

.l1-chat-input::placeholder {
  color: rgba(196, 178, 146, 0.56);
  font-size: calc(7 * var(--s));
}

/* --- 右塊：原版系統功能列 + 2300.img (155x110) 八格快捷欄 (Mac 1~8) --- */
.l1-hud-right-col {
  --s: var(--hud-s);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.l1-sys-btn-strip {
  display: flex;
  gap: 3px;
  padding: 4px 5px;
  background: linear-gradient(180deg, #271f17 0%, #140f0b 100%);
  border: 1px solid #6e5a42;
  box-shadow: inset 0 0 0 1px #1d1610, 0 2px 6px rgba(0, 0, 0, 0.85);
}

.l1-sys-btn {
  position: relative;
  width: calc(19.2 * var(--s));
  height: calc(24 * var(--s));
  padding: 2px 0 1px;
  background: linear-gradient(180deg, #241c14 0%, #110d09 100%);
  border: 1px solid #594835;
  color: #dfd0b1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  font-family: var(--l1-font);
  font-size: calc(6 * var(--s));
  line-height: 1;
}

.l1-sys-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5ef29b;
  box-shadow: 0 0 6px #5ef29b;
  pointer-events: none;
}

.l1-sys-dot.hidden {
  display: none;
}

.l1-sys-btn img {
  width: calc(12 * var(--s));
  height: calc(11.5 * var(--s));
  object-fit: contain;
}

.l1-sys-btn:hover {
  border-color: var(--l1-gold);
  background: linear-gradient(180deg, #3c2e1f 0%, #1e160e 100%);
  color: #fff3c0;
}

.l1-sys-btn.has-reward {
  border-color: #f3c859;
  box-shadow: 0 0 7px rgba(243, 200, 89, 0.7);
}

/* 原版 2300.img (155x110) 隨 --hud-s 等比縮放，內部 2×4 八格精準貼齊 */
.l1-quickbar-frame {
  --s: var(--hud-s);
  position: relative;
  width: calc(155 * var(--s));
  height: calc(110 * var(--s));
  background: url('/api/ui/img/2300.png') no-repeat left top / 100% 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.92));
}

.l1-hotbar-grid {
  position: absolute;
  left: calc(16 * var(--s));
  top: calc(21 * var(--s));
  width: calc(134 * var(--s));
  height: calc(67 * var(--s));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: calc(2 * var(--s));
}

.hot-slot {
  position: relative;
  padding: 0;
  border: 1px solid #3c3124;
  background: rgba(9, 7, 5, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.1s ease, background 0.1s ease, box-shadow 0.1s ease, transform 0.08s ease;
}

.hot-slot[draggable="true"] {
  cursor: grab;
}

.hot-slot.empty {
  background: rgba(8, 6, 4, 0.56);
  border-color: rgba(84, 68, 48, 0.55);
}

.hot-slot.empty:hover {
  border-color: #d6b66c;
  background: rgba(231, 201, 130, 0.14);
}

.hot-empty-plus {
  font-size: calc(11 * var(--s));
  color: rgba(215, 190, 136, 0.24);
  font-weight: 700;
  pointer-events: none;
  transition: color 0.12s ease;
}

.hot-slot.empty:hover .hot-empty-plus {
  color: rgba(255, 227, 136, 0.78);
}

.hot-slot:hover {
  border-color: #e7c982;
  background: rgba(231, 201, 130, 0.16);
}

.hot-slot.active {
  border-color: #69e89c;
  box-shadow: inset 0 0 8px rgba(105, 232, 156, 0.52);
}

.hot-slot.equipped {
  border-color: #79b3e0;
  box-shadow: inset 0 0 6px rgba(121, 179, 224, 0.42);
}

.hot-slot.depleted .hot-img,
.hot-slot.depleted .hot-icon {
  opacity: 0.34;
  filter: grayscale(0.8);
}

.hot-slot.depleted .hot-qty {
  color: #ff8a80;
}

.hot-slot.drag-over {
  border-color: #82e4ff !important;
  background: rgba(96, 200, 255, 0.24) !important;
  box-shadow: inset 0 0 10px rgba(130, 228, 255, 0.72), 0 0 8px rgba(130, 228, 255, 0.5) !important;
}

.hot-slot.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.hot-slot.pressed {
  transform: scale(0.93);
  border-color: #fff3b0;
}

.hot-img {
  width: calc(23 * var(--s));
  height: calc(23 * var(--s));
  object-fit: contain;
  -webkit-user-drag: none;
  pointer-events: none;
}

.hot-icon {
  font-size: calc(14 * var(--s));
  line-height: 1;
  pointer-events: none;
}

.hot-key {
  position: absolute;
  left: 1px;
  top: 0;
  padding: 1px 4px;
  background: rgba(0, 0, 0, 0.86);
  color: #ffe388;
  font-family: var(--l1-mono);
  font-size: calc(6.5 * var(--s));
  font-weight: 700;
  line-height: 1.1;
  border-right: 1px solid rgba(231, 201, 130, 0.4);
  border-bottom: 1px solid rgba(231, 201, 130, 0.4);
  pointer-events: none;
}

.hot-win {
  position: absolute;
  right: 2px;
  top: 1px;
  font-size: calc(4.9 * var(--s));
  color: rgba(210, 195, 165, 0.42);
  font-family: var(--l1-mono);
  pointer-events: none;
}

.hot-ench {
  position: absolute;
  left: 1px;
  bottom: 0;
  padding: 0 2px;
  background: rgba(0, 0, 0, 0.82);
  color: #82d4ff;
  font-family: var(--l1-mono);
  font-size: calc(5.8 * var(--s));
  font-weight: 700;
  line-height: 1.15;
  pointer-events: none;
}

.hot-ench.blessed {
  color: #fff07a;
}

.hot-ench.cursed {
  color: #ff6e6e;
}

.hot-eq {
  position: absolute;
  right: 1px;
  bottom: 0;
  padding: 0 3px;
  background: rgba(152, 102, 14, 0.92);
  color: #fff6c2;
  font-family: var(--l1-mono);
  font-size: calc(6 * var(--s));
  font-weight: 700;
  line-height: 1.15;
  pointer-events: none;
}

.hot-mp {
  position: absolute;
  right: 1px;
  bottom: 0;
  padding: 0 3px;
  background: rgba(10, 26, 48, 0.88);
  color: #8ce0ff;
  font-family: var(--l1-mono);
  font-size: calc(6 * var(--s));
  font-weight: 700;
  line-height: 1.15;
  pointer-events: none;
}

.hot-qty {
  position: absolute;
  right: 1px;
  bottom: 0;
  padding: 0 3px;
  background: rgba(0, 0, 0, 0.84);
  color: #ffffff;
  font-family: var(--l1-mono);
  font-size: calc(6.2 * var(--s));
  font-weight: 700;
  line-height: 1.15;
  pointer-events: none;
  z-index: 2;
}

.hot-cd-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: rgba(6, 12, 24, 0.72);
  border-top: 1px solid rgba(130, 212, 255, 0.75);
  pointer-events: none;
  z-index: 1;
}

.l1-quickbar-hint {
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(4.5 * var(--s));
  text-align: center;
  font-size: calc(6.2 * var(--s));
  color: #e6cf9b;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.l1-quickbar-foot {
  position: absolute;
  left: calc(16 * var(--s));
  top: calc(91 * var(--s));
  width: calc(134 * var(--s));
  height: calc(13 * var(--s));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(2 * var(--s));
}

.l1-quickbar-foot-tip {
  font-size: calc(5.8 * var(--s));
  color: #b7a480;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  pointer-events: none;
}

.l1-quickbar-mini-btn {
  padding: 1px calc(5 * var(--s));
  height: calc(11.5 * var(--s));
  border: 1px solid #6e593e;
  background: linear-gradient(180deg, #322619 0%, #17110b 100%);
  color: #f4d88c;
  font-family: var(--l1-font);
  font-size: calc(5.8 * var(--s));
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.l1-quickbar-mini-btn:hover {
  border-color: #f1ce78;
  background: linear-gradient(180deg, #4b3822 0%, #241b10 100%);
  color: #fff6cf;
}

.l1-inv-cell img,
.l1-spell-cell img {
  -webkit-user-drag: none;
  pointer-events: none;
}

.l1-inv-cell[draggable="true"],
.l1-spell-cell[draggable="true"] {
  cursor: grab;
}

/* 原版黑金右鍵選單與熱鍵自訂快選器 */
.l1-ctx-menu {
  position: fixed;
  z-index: 130;
  min-width: 244px;
  max-width: 300px;
  background: linear-gradient(180deg, rgba(24, 19, 14, 0.98) 0%, rgba(12, 9, 7, 0.99) 100%);
  border: 1px solid #c9a659;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.92), inset 0 0 0 1px rgba(255, 224, 140, 0.16);
  color: #efe2c6;
  font-family: var(--l1-font);
  font-size: 12px;
  padding: 6px;
  user-select: none;
}

.l1-ctx-menu.hidden {
  display: none;
}

.l1-ctx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 4px 6px;
  margin-bottom: 5px;
  border-bottom: 1px solid #4e3f2d;
  color: #ffe38c;
  font-weight: 700;
  font-size: 12px;
}

.l1-ctx-head-sub {
  font-size: 10.5px;
  font-weight: 400;
  color: #b7a483;
}

.l1-ctx-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: 1px solid #594734;
  background: linear-gradient(180deg, #271f17 0%, #16110c 100%);
  color: #f3e4c3;
  font-family: var(--l1-font);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.l1-ctx-action-btn:hover {
  border-color: #e9c97a;
  background: linear-gradient(180deg, #403220 0%, #241b11 100%);
  color: #fff8dc;
}

.l1-ctx-action-btn.danger {
  border-color: #8a3a30;
  background: linear-gradient(180deg, #4a1c17 0%, #280e0c 100%);
  color: #ffd3cd;
}

.l1-ctx-action-btn.danger:hover {
  border-color: #ff8578;
  background: linear-gradient(180deg, #69261f 0%, #3a1410 100%);
}

.l1-ctx-action-btn.gold {
  border-color: #b69244;
  background: linear-gradient(180deg, #4b3918 0%, #271d0c 100%);
  color: #fff2be;
}

.l1-ctx-tabs {
  display: flex;
  gap: 3px;
  margin: 4px 0 5px;
}

.l1-ctx-tab {
  flex: 1;
  padding: 4px 4px;
  border: 1px solid #4e3f2d;
  background: #17120d;
  color: #bda988;
  font-family: var(--l1-font);
  font-size: 11px;
  cursor: pointer;
}

.l1-ctx-tab.active,
.l1-ctx-tab:hover {
  border-color: #dfbe72;
  background: #362a1b;
  color: #fff3c2;
}

.l1-ctx-list {
  max-height: min(210px, calc(100vh - 220px));
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
  margin-bottom: 5px;
}

.l1-ctx-pick {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border: 1px solid #3c3024;
  background: #130f0b;
  color: #eee0c2;
  font-family: var(--l1-font);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
}

.l1-ctx-pick:hover {
  border-color: #e4c273;
  background: #271e14;
  color: #fff8de;
}

.l1-ctx-pick.current {
  border-color: #69e89c;
  background: rgba(34, 86, 52, 0.38);
}

.l1-ctx-pick-ico {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: #090705;
  border: 1px solid #4d3d2c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.l1-ctx-pick-ico img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.l1-ctx-pick-info {
  flex: 1;
  min-width: 0;
}

.l1-ctx-pick-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.l1-ctx-pick-meta {
  font-size: 10px;
  color: #a89578;
}

.l1-ctx-pick-badge {
  flex-shrink: 0;
  padding: 1px 4px;
  border: 1px solid #6b583e;
  background: #211910;
  color: #ffe08a;
  font-family: var(--l1-mono);
  font-size: 10px;
}

.l1-ctx-empty {
  padding: 12px 8px;
  text-align: center;
  color: #9e8c70;
  font-size: 11px;
}

.l1-ctx-foot {
  display: flex;
  gap: 4px;
  padding-top: 5px;
  border-top: 1px solid #443728;
}

.l1-ctx-foot button {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid #5e4b36;
  background: #1f1811;
  color: #e8d5ae;
  font-family: var(--l1-font);
  font-size: 11px;
  cursor: pointer;
}

.l1-ctx-foot button:hover {
  border-color: #e6c675;
  background: #362a1b;
  color: #fff4c6;
}

.l1-ctx-slot-label {
  font-size: 11px;
  color: #cbb896;
  margin: 4px 2px 4px;
}

.l1-ctx-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.l1-ctx-slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 5px 2px;
  border: 1px solid #594735;
  background: #17120d;
  color: #f3dc99;
  font-family: var(--l1-font);
  cursor: pointer;
}

.l1-ctx-slot-btn:hover {
  border-color: #f2cf78;
  background: #372a1b;
  color: #fff;
}

.l1-ctx-slot-btn.occupied {
  border-color: #69e89c;
  background: rgba(34, 88, 52, 0.45);
}

.l1-ctx-slot-num {
  font-family: var(--l1-mono);
  font-size: 12px;
  font-weight: 700;
}

.l1-ctx-slot-cur {
  max-width: 56px;
  font-size: 9.5px;
  color: #b5a384;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   Mac天堂 統一視覺設計系統（黑曜暗紅 × 鍛造古金 Retina HD）
   全面統一角色狀態、裝備欄、背包、魔法書、倉庫、冒險錄、設定、變身與交易視窗
   ============================================================================ */
.l1-classic-win {
  position: absolute;
  z-index: 36;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 180px);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 17, 20, 0.975) 0%, rgba(16, 9, 11, 0.985) 54%, rgba(11, 6, 8, 0.992) 100%);
  border: 1px solid rgba(206, 162, 82, 0.62);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.88),
    inset 0 1px 0 rgba(255, 228, 158, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(10, 4, 5, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: var(--win-alpha, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.l1-classic-win::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16%;
  right: 16%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #f5d47e, transparent);
  pointer-events: none;
  z-index: 3;
}

.l1-cwin-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(58, 22, 27, 0.94) 0%, rgba(28, 11, 14, 0.96) 100%);
  border-bottom: 1px solid rgba(206, 162, 82, 0.36);
  color: #f6dc96;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  cursor: move;
  flex-shrink: 0;
}

.l1-cwin-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.l1-cwin-close {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 5px;
  background: rgba(18, 6, 8, 0.82);
  border: 1px solid rgba(186, 142, 72, 0.48);
  color: #ebd6ae;
  font-size: 11.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.l1-cwin-close:hover {
  background: rgba(124, 26, 26, 0.9);
  border-color: #f2c96f;
  color: #fff;
}

.l1-cwin-body {
  flex: 1;
  min-height: 0;
  padding: 11px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* --- 統一 NPC／倉庫對話盒（取代突兀米白羊皮紙，與黑曜暗紅系統融為一體） --- */
.npc-dialog-box {
  position: relative;
  padding: 11px 14px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(44, 21, 22, 0.88) 0%, rgba(24, 12, 14, 0.94) 100%);
  border: 1px solid rgba(202, 158, 82, 0.42);
  border-left: 3px solid #e4bc62;
  box-shadow: inset 0 1px 0 rgba(255, 228, 158, 0.12);
  color: #f2e5cb;
}

.npc-dialog-text {
  font-size: 12.5px;
  line-height: 1.62;
  font-weight: 500;
  white-space: pre-wrap;
  color: #f4e8d1;
}

.npc-dialog-src {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(206, 162, 82, 0.28);
  font-size: 12px;
  color: #d6bf95;
}

.npc-dialog-src strong {
  color: #ffd978;
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
}

/* --- 統一單排頁籤系統（全站絕不斷行） --- */
.inv-filter-tabs,
.adv-tabs {
  display: flex;
  align-items: stretch;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.adv-tabs::-webkit-scrollbar,
.inv-filter-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 1 0 auto;
  padding: 6px 10px;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(30, 14, 17, 0.92) 0%, rgba(16, 8, 10, 0.96) 100%);
  border: 1px solid rgba(168, 128, 66, 0.36);
  color: #cbb898;
  font-family: var(--l1-font);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s ease;
}

.tab-btn:hover {
  border-color: rgba(226, 186, 102, 0.72);
  color: #f6e4bc;
  background: linear-gradient(180deg, rgba(58, 26, 24, 0.92) 0%, rgba(30, 14, 15, 0.96) 100%);
}

.tab-btn.active {
  background: linear-gradient(180deg, rgba(122, 80, 22, 0.82) 0%, rgba(58, 28, 12, 0.92) 100%);
  border-color: #ebc468;
  color: #fff6d4;
  box-shadow: inset 0 1px 0 rgba(255, 236, 178, 0.32), 0 0 10px rgba(232, 188, 92, 0.18);
}

/* ============================================================================
   視窗 1：高解析度角色狀態視窗 (C) — 頂部常駐切換列，徹底根治狀態獎勵卡死
   ============================================================================ */
.l1-stats-body {
  padding: 10px 11px 11px;
  gap: 8px;
}

.l1-st-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 5px;
  flex-shrink: 0;
}

.l1-st-tabs .tab-btn {
  padding: 5px 6px;
  font-size: 11.5px;
  text-align: center;
}

.l1-st-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.l1-st-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(44, 18, 22, 0.82) 0%, rgba(22, 10, 12, 0.92) 100%);
  border: 1px solid rgba(196, 154, 78, 0.38);
}

.l1-st-hero-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.l1-st-hero-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #fae6b6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.l1-st-hero-cls {
  font-size: 11px;
  color: #c8b596;
}

.l1-st-hero-law {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(10, 5, 6, 0.78);
  border: 1px solid rgba(176, 138, 74, 0.34);
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.l1-st-bars-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.l1-st-meter {
  position: relative;
  height: 22px;
  padding: 0 9px;
  border-radius: 5px;
  background: linear-gradient(180deg, #0b0607 0%, #160c0e 100%);
  border: 1px solid rgba(172, 134, 72, 0.36);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.l1-st-meter-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  transition: width 0.16s ease;
}

.l1-st-meter-fill.exp {
  background: linear-gradient(90deg, rgba(146, 98, 22, 0.72), rgba(232, 186, 76, 0.86));
}
.l1-st-meter-fill.hp {
  background: linear-gradient(180deg, #ff584f 0%, #c81e1a 55%, #840e10 100%);
}
.l1-st-meter-fill.mp {
  background: linear-gradient(180deg, #4dbaff 0%, #1c6fe0 55%, #0e3d8a 100%);
}
.l1-st-meter-fill.wt {
  background: linear-gradient(90deg, rgba(32, 102, 50, 0.76), rgba(74, 174, 86, 0.86));
}
.l1-st-meter-fill.wt.warn {
  background: linear-gradient(90deg, rgba(154, 102, 18, 0.8), rgba(226, 166, 44, 0.9));
}
.l1-st-meter-fill.wt.over {
  background: linear-gradient(90deg, rgba(148, 22, 18, 0.85), rgba(224, 54, 46, 0.92));
}

.l1-st-meter-lbl,
.l1-st-meter-val {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
}

.l1-st-meter-lbl { color: #e8d8b8; }
.l1-st-meter-val {
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  color: #fffaf0;
}

.l1-st-pts-banner {
  padding: 5px 9px;
  border-radius: 5px;
  background: rgba(110, 74, 18, 0.34);
  border: 1px solid #e6be62;
  color: #ffe89a;
  font-size: 11.5px;
  text-align: center;
}

.l1-st-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #d6b676;
  letter-spacing: 0.6px;
  padding-left: 7px;
  border-left: 2.5px solid #e0b556;
  line-height: 1.2;
}

.l1-st-attr-grid,
.l1-st-combat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.l1-st-attr-cell,
.l1-st-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 5px;
  background: rgba(15, 9, 11, 0.88);
  border: 1px solid rgba(164, 128, 70, 0.28);
  font-size: 12px;
}

.l1-st-attr-lbl,
.l1-st-kv span {
  color: #cab898;
  font-size: 11.5px;
  white-space: nowrap;
}

.l1-st-attr-val,
.l1-st-kv strong {
  margin-left: auto;
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 800;
  color: #f8ecd2;
  white-space: nowrap;
}

.l1-st-attr-val.bonus { color: #7ef2a6; }
.l1-st-attr-val small {
  margin-left: 3px;
  font-size: 10px;
  color: #8df5b2;
}

.l1-st-kv.accent-sp strong { color: #7ee4ff; }
.l1-st-kv.accent-ac strong { color: #9cd6ff; }

.l1-st-plus-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #f0cb72;
  background: linear-gradient(180deg, #b8842a 0%, #6e460d 100%);
  color: #fff8dc;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.l1-st-plus-btn:hover {
  filter: brightness(1.18);
}

.l1-st-elem-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.l1-st-elem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 4px;
  border-radius: 5px;
  background: rgba(15, 9, 11, 0.88);
  border: 1px solid rgba(164, 128, 70, 0.28);
}

.l1-st-elem span { font-size: 10.5px; font-weight: 700; }
.l1-st-elem strong {
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #f6ead0;
}
.l1-st-elem.earth span { color: #c7a66b; }
.l1-st-elem.fire span  { color: #ff8a70; }
.l1-st-elem.water span { color: #76ccff; }
.l1-st-elem.wind span  { color: #8ff0b8; }

/* 狀態獎勵頁面板 */
.l1-st-bonus-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(14, 8, 10, 0.86);
  border: 1px solid rgba(176, 138, 74, 0.34);
}

.l1-st-bonus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(164, 128, 70, 0.14);
  font-size: 12px;
}

.l1-st-bonus-row:last-child {
  border-bottom: none;
}

.l1-st-bonus-row span {
  color: #c2b090;
  white-space: nowrap;
}

.l1-st-bonus-row strong {
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  color: #f8ecd2;
  text-align: right;
}

.l1-st-bonus-row strong.c-blue   { color: #9cd6ff; }
.l1-st-bonus-row strong.c-purple { color: #d8b8ff; }
.l1-st-bonus-row strong.c-cyan   { color: #7ee4ff; }
.l1-st-bonus-row strong.c-gold   { color: #ffd978; }
.l1-st-bonus-row strong.c-green  { color: #84f2a8; }

.l1-st-set-pill {
  margin-top: 4px;
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(24, 78, 46, 0.35);
  border: 1px solid rgba(102, 224, 146, 0.52);
  color: #8ef5b4;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}

/* ============================================================================
   視窗 2：高解析度 18 槽角色裝備欄視窗 (U) — 精準 3×6 Grid，零偏移雙框
   ============================================================================ */
.l1-equip-body {
  padding: 10px 11px 11px;
  gap: 9px;
}

.l1-eq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.l1-eq-slot {
  position: relative;
  height: 60px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(16, 10, 12, 0.94) 0%, rgba(26, 16, 19, 0.94) 100%);
  border: 1px solid rgba(158, 122, 68, 0.32);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.l1-eq-slot:hover {
  border-color: #ebc66e;
  box-shadow: inset 0 0 12px rgba(235, 198, 110, 0.16);
}

.l1-eq-slot.filled {
  background: linear-gradient(180deg, rgba(28, 36, 52, 0.88) 0%, rgba(16, 20, 32, 0.95) 100%);
  border-color: rgba(128, 188, 245, 0.62);
  box-shadow: inset 0 0 12px rgba(96, 174, 248, 0.16);
}

.l1-eq-slot.filled.blessed {
  border-color: rgba(242, 204, 96, 0.78);
  box-shadow: inset 0 0 12px rgba(242, 204, 96, 0.18);
}

.l1-eq-slot.filled.cursed {
  border-color: rgba(235, 86, 80, 0.75);
}

.l1-eq-slot img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  margin-top: 8px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
}

.l1-eq-empty-lbl {
  font-size: 11px;
  font-weight: 600;
  color: rgba(186, 164, 130, 0.44);
  letter-spacing: 0.4px;
}

.l1-eq-slot-lbl {
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 9.5px;
  color: rgba(218, 202, 172, 0.65);
  pointer-events: none;
}

.l1-eq-ench {
  position: absolute;
  top: 2px;
  left: 5px;
  font-family: var(--l1-mono);
  font-size: 11px;
  font-weight: 800;
  color: #8ce0ff;
  text-shadow: 0 1px 2px #000;
}

.l1-eq-ench.blessed { color: #ffe678; }
.l1-eq-ench.cursed  { color: #ff7a72; }

.l1-eq-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(14, 8, 10, 0.9);
  border: 1px solid rgba(176, 138, 74, 0.36);
}

.l1-eq-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.l1-eq-stat {
  color: #cbb898;
  white-space: nowrap;
}

.l1-eq-stat.ac strong { color: #9cd6ff; font-family: var(--l1-mono); }
.l1-eq-stat.mr strong { color: #d8b8ff; font-family: var(--l1-mono); }

/* ============================================================================
   視窗 3：高解析度格狀背包道具欄 (I / Tab)
   ============================================================================ */
.l1-inv-body {
  padding: 10px 11px 11px;
  gap: 8px;
}

.l1-inv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

.l1-inv-tabs,
.l1-inv-shortcuts {
  display: flex;
  align-items: center;
  gap: 4px;
}

.l1-inv-tabs {
  flex: 1;
}

.l1-inv-tab {
  padding: 5px 8px;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(30, 14, 17, 0.92) 0%, rgba(16, 8, 10, 0.96) 100%);
  border: 1px solid rgba(168, 128, 66, 0.36);
  color: #cbb898;
  font-family: var(--l1-font);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s ease;
}

.l1-inv-tabs .l1-inv-tab {
  flex: 1;
  text-align: center;
}

.l1-inv-tab:hover {
  border-color: rgba(226, 186, 102, 0.72);
  color: #f6e4bc;
}

.l1-inv-tab.active {
  background: linear-gradient(180deg, rgba(122, 80, 22, 0.82) 0%, rgba(58, 28, 12, 0.92) 100%);
  border-color: #ebc468;
  color: #fff6d4;
}

.l1-inv-tab.eq-link {
  border-color: rgba(98, 168, 224, 0.55);
  color: #a8dcff;
  background: linear-gradient(180deg, rgba(22, 46, 72, 0.85) 0%, rgba(12, 24, 40, 0.94) 100%);
}

.l1-inv-tab.wh-link {
  border-color: rgba(212, 166, 76, 0.55);
  color: #ffe29a;
  background: linear-gradient(180deg, rgba(72, 48, 18, 0.85) 0%, rgba(36, 22, 10, 0.94) 100%);
}

.l1-inv-tab.wh-link.wh-active {
  border-color: #5ce696;
  color: #aefad0;
}

.l1-enchant-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(122, 74, 16, 0.82), rgba(74, 34, 14, 0.88));
  border: 1px solid #f0c96c;
  color: #fff4cc;
  font-size: 11.5px;
  font-weight: 700;
}

.l1-inv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 66px;
  gap: 6px;
  max-height: min(46vh, 360px);
  overflow-y: auto;
  padding: 4px 3px 4px 2px;
  overscroll-behavior: contain;
}

.l1-inv-cell {
  position: relative;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(16, 10, 12, 0.94) 0%, rgba(25, 16, 18, 0.94) 100%);
  border: 1px solid rgba(158, 122, 68, 0.28);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.l1-inv-cell:hover {
  border-color: #ebc66e;
  box-shadow: inset 0 0 10px rgba(235, 198, 110, 0.18);
}

.l1-inv-cell.equipped {
  background: linear-gradient(180deg, rgba(26, 40, 62, 0.88) 0%, rgba(14, 22, 36, 0.95) 100%);
  border-color: rgba(120, 188, 250, 0.68);
  box-shadow: inset 0 0 12px rgba(96, 174, 248, 0.18);
}

.l1-inv-cell.blessed { border-color: rgba(242, 204, 96, 0.74); }
.l1-inv-cell.cursed  { border-color: rgba(235, 86, 80, 0.72); }

.l1-inv-cell.enchant-target {
  border-color: #ffde6b;
  box-shadow: 0 0 10px rgba(255, 218, 92, 0.55), inset 0 0 12px rgba(255, 218, 92, 0.25);
}

.l1-inv-cell img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
}

.l1-inv-cell .cell-plus {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: var(--l1-mono);
  font-size: 11px;
  font-weight: 800;
  color: #8ce0ff;
  text-shadow: 0 1px 2px #000;
}

.l1-inv-cell .cell-plus.blessed { color: #ffe678; }
.l1-inv-cell .cell-plus.cursed  { color: #ff7a72; }

.l1-inv-cell .cell-e {
  position: absolute;
  top: 3px;
  right: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, #d8a644 0%, #8f6218 100%);
  color: #fff9e0;
  font-family: var(--l1-mono);
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.l1-inv-cell .cell-qty {
  position: absolute;
  bottom: 2px;
  right: 4px;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(10, 5, 6, 0.78);
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 700;
  color: #fff3d4;
}

.l1-inv-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(14, 8, 10, 0.9);
  border: 1px solid rgba(176, 138, 74, 0.36);
  font-size: 12px;
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
}

.l1-adena-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ffd978;
}

.l1-mini-svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.l1-apple-line { color: #ffad9c; }
.l1-ac-line    { color: #9cd6ff; }

/* ============================================================================
   視窗 4：高解析度經典魔法書 (K)
   ============================================================================ */
.l1-skills-body {
  padding: 10px 11px 11px;
  gap: 8px;
}

.l1-spell-tabs {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 5px;
  flex-shrink: 0;
}

.l1-spell-tabs .l1-inv-tab {
  text-align: center;
}

.l1-spell-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 66px;
  gap: 6px;
  max-height: min(46vh, 360px);
  overflow-y: auto;
  padding: 4px 3px 4px 2px;
  overscroll-behavior: contain;
}

.l1-spell-cell {
  position: relative;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(16, 10, 12, 0.94) 0%, rgba(25, 16, 18, 0.94) 100%);
  border: 1px solid rgba(158, 122, 68, 0.28);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.l1-spell-cell:hover {
  border-color: #ebc66e;
  box-shadow: inset 0 0 10px rgba(235, 198, 110, 0.2);
}

.l1-spell-cell.primary {
  background: linear-gradient(180deg, rgba(22, 42, 68, 0.9) 0%, rgba(12, 24, 42, 0.95) 100%);
  border-color: #6bc8ff;
  box-shadow: inset 0 0 12px rgba(96, 194, 255, 0.26);
}

.l1-spell-cell img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
}

.l1-spell-tag {
  position: absolute;
  top: 3px;
  left: 3px;
  padding: 1px 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #3da8f5 0%, #165ea8 100%);
  color: #fff;
  font-family: var(--l1-mono);
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1.1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.l1-spell-mp {
  position: absolute;
  bottom: 2px;
  right: 4px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(8, 14, 28, 0.84);
  font-family: var(--l1-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 700;
  color: #8ed6ff;
}

.l1-spell-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 6px;
  background: rgba(14, 8, 10, 0.9);
  border: 1px solid rgba(176, 138, 74, 0.36);
  font-size: 12px;
}

.l1-spell-stat {
  color: #cbb898;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.l1-spell-stat.sp strong { color: #7ee4ff; font-family: var(--l1-mono); font-size: 13px; }
.l1-spell-stat.mr strong { color: #d8b8ff; font-family: var(--l1-mono); font-size: 13px; }
.inv-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(48vh, 380px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.inv-row,
.poly-row,
.adv-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #14100c;
  border: 1px solid #443729;
}

.inv-row:hover,
.poly-row:hover,
.adv-card:hover {
  border-color: #8f7758;
  background: #1d1711;
}

.poly-row.active-poly,
.adv-card.active-hi {
  border-color: #d6b25e;
  background: #281f13;
}

.poly-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.poly-tabs,
.poly-style-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.poly-tabs .tab-btn {
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.poly-style-pill {
  padding: 2px 8px;
  font-size: 11px;
  background: #17120d;
  border: 1px solid #4a3b2a;
  color: #bba98c;
  cursor: pointer;
}

.poly-style-pill:hover,
.poly-style-pill.active {
  background: #2f2418;
  border-color: #cfa95a;
  color: #fff0bf;
}

.poly-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: min(56vh, 450px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.poly-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  margin-top: 4px;
  background: linear-gradient(90deg, #2a2015 0%, #17120c 100%);
  border-left: 3px solid #d4af5e;
  border-bottom: 1px solid #3f3224;
  font-size: 12px;
  font-weight: 700;
  color: #f3d792;
}

.poly-tier-header.locked {
  border-left-color: #8a3a35;
  background: linear-gradient(90deg, #221413 0%, #15100f 100%);
  color: #c58882;
}

.poly-tier-status {
  font-size: 11px;
  font-weight: 400;
  color: #96d88b;
}

.poly-tier-header.locked .poly-tier-status {
  color: #e07b72;
}

.poly-icon {
  width: 48px;
  height: 64px;
  flex-shrink: 0;
  background: #0a0806;
  border: 1px solid #4d3e2d;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 2px;
}

.poly-icon img {
  width: 48px;
  height: 64px;
  image-rendering: pixelated;
  object-fit: contain;
  display: block;
}

.poly-row.locked-poly {
  opacity: 0.62;
  background: #120e0c;
  border-color: #362925;
}

.poly-row.locked-poly:hover {
  border-color: #5c3a35;
  background: #181110;
}

.poly-row.locked-poly .poly-icon img {
  filter: grayscale(75%) brightness(0.75);
}

.poly-lv-badge {
  display: inline-block;
  padding: 0 5px;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 2px;
  background: #1d2d1d;
  border: 1px solid #4f854d;
  color: #9be897;
  vertical-align: middle;
}

.poly-lv-badge.locked {
  background: #2f1716;
  border-color: #8b3b36;
  color: #f09088;
}

.poly-style-tag {
  display: inline-block;
  padding: 0 5px;
  margin-left: 4px;
  font-size: 10px;
  border-radius: 2px;
  background: #241c13;
  border: 1px solid #665239;
  color: #dec38c;
  vertical-align: middle;
}

.poly-warn-tag {
  display: inline-block;
  padding: 0 5px;
  margin-left: 4px;
  font-size: 10px;
  border-radius: 2px;
  background: #301a12;
  border: 1px solid #965236;
  color: #ffb18a;
  vertical-align: middle;
}

.poly-btn-locked {
  background: #231918 !important;
  border-color: #5d3633 !important;
  color: #a97671 !important;
  cursor: not-allowed !important;
  min-width: 66px;
}

/* 旅館休息狀態橫幅 */
.inn-rest-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 42;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  background: linear-gradient(180deg, rgba(44, 32, 18, 0.95) 0%, rgba(22, 16, 10, 0.95) 100%);
  border: 1px solid #d6b25e;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
  color: #ffe8a6;
  font-size: 13px;
  font-weight: 600;
}

/* 記憶座標與祝福瞬移視窗 */
.bm-add-box {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.bm-add-box input {
  flex: 1;
  background: #100c08;
  border: 1px solid #6b563c;
  color: #f5e6c8;
  padding: 5px 8px;
  font-size: 12px;
}

.bm-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: min(46vh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.bm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: #14100c;
  border: 1px solid #443729;
}

.bm-row:hover {
  border-color: #9e8259;
  background: #1d1711;
}

.bm-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #3c2f21;
  font-size: 11px;
  color: #bba98c;
}

/* 旅館櫃檯面板 */
.inn-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: #16110c;
  border: 1px solid #594630;
}

.inn-status-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #211910;
  border: 1px solid #755b3c;
  font-size: 12px;
  color: #f2dfb7;
}

.inn-bonus-note {
  padding: 8px 10px;
  background: #111c14;
  border: 1px solid #3d6b47;
  color: #a9e6b2;
  font-size: 12px;
  line-height: 1.5;
}

.inn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adv-card.boss-card {
  border-color: #7c372d;
  background: #1c100e;
}

.adv-card.quest-done {
  border-color: #69d693;
  background: #122116;
}

.inv-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: #080605;
  border: 1px solid #4f402e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.inv-info {
  flex: 1;
  min-width: 0;
}

.inv-name {
  font-size: 12px;
  font-weight: 700;
  color: #f0e3c6;
}

.inv-name.enchanted { color: #8ad6ff; }
.inv-name.blessed,
.l1-ctx-pick-name.blessed {
  color: #ffe866;
  text-shadow: 0 0 6px rgba(255, 214, 52, 0.45), 0 1px 2px #000;
}
.inv-name.cursed,
.l1-ctx-pick-name.cursed {
  color: #e64c4c;
  text-shadow: 0 0 6px rgba(190, 22, 22, 0.48), 0 1px 2px #000;
}

/* 祝福物品（黃光／黃色外框）與詛咒物品（暗紅色外框與色調）全介面統一辨識 */
.l1-inv-cell.bless-0,
.l1-eq-slot.bless-0,
.hot-slot.bless-0,
.inv-icon.bless-0,
.l1-ctx-pick-ico.bless-0 {
  border-color: #ffde3b;
  background: radial-gradient(circle at center, rgba(255, 224, 88, 0.32) 0%, rgba(138, 98, 12, 0.42) 72%, rgba(30, 22, 6, 0.84) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 152, 0.78), inset 0 0 9px rgba(255, 214, 48, 0.52), 0 0 6px rgba(255, 210, 42, 0.55);
}

.l1-inv-cell.bless-0:hover,
.l1-eq-slot.bless-0:hover,
.hot-slot.bless-0:hover {
  border-color: #fff28a;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 185, 0.92), inset 0 0 12px rgba(255, 224, 72, 0.68), 0 0 9px rgba(255, 220, 62, 0.78);
}

.l1-inv-cell.bless-0 img,
.l1-eq-slot.bless-0 img,
.hot-slot.bless-0 .hot-img,
.inv-icon.bless-0 img,
.l1-ctx-pick-ico.bless-0 img {
  filter: drop-shadow(0 0 3px rgba(255, 224, 78, 0.9)) brightness(1.06);
}

.l1-inv-cell.bless-2,
.l1-eq-slot.bless-2,
.hot-slot.bless-2,
.inv-icon.bless-2,
.l1-ctx-pick-ico.bless-2 {
  border-color: #ba2626;
  background: radial-gradient(circle at center, rgba(158, 22, 22, 0.52) 0%, rgba(78, 10, 10, 0.76) 74%, rgba(28, 4, 4, 0.92) 100%);
  box-shadow: inset 0 0 0 1px rgba(232, 62, 62, 0.65), inset 0 0 10px rgba(168, 16, 16, 0.78), 0 0 6px rgba(175, 22, 22, 0.55);
}

.l1-inv-cell.bless-2:hover,
.l1-eq-slot.bless-2:hover,
.hot-slot.bless-2:hover {
  border-color: #e64545;
  box-shadow: inset 0 0 0 1px rgba(255, 96, 96, 0.85), inset 0 0 12px rgba(196, 24, 24, 0.85), 0 0 9px rgba(205, 32, 32, 0.72);
}

.l1-inv-cell.bless-2 img,
.l1-eq-slot.bless-2 img,
.hot-slot.bless-2 .hot-img,
.inv-icon.bless-2 img,
.l1-ctx-pick-ico.bless-2 img {
  filter: sepia(0.58) hue-rotate(-48deg) saturate(2.5) brightness(0.84) drop-shadow(0 0 3px rgba(205, 24, 24, 0.88));
}

.hot-slot.depleted.bless-0 .hot-img,
.hot-slot.depleted.bless-2 .hot-img {
  opacity: 0.34;
  filter: grayscale(0.8);
}

.inv-meta {
  font-size: 11px;
  color: #a5947a;
  margin-top: 2px;
}

.inv-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.mini-btn,
.gold-btn,
.danger-btn,
.l1-btn-wood,
.l1-btn-danger {
  padding: 4px 9px;
  font-family: var(--l1-font);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #6b5842;
  background: linear-gradient(180deg, #33281d 0%, #1c1610 100%);
  color: #eee0c2;
}

.mini-btn:hover,
.l1-btn-wood:hover {
  border-color: #e6c675;
  color: #fff7d6;
}

.mini-btn.blue {
  border-color: #4f88b8;
  background: linear-gradient(180deg, #21405e 0%, #122538 100%);
  color: #d6f0ff;
}

.mini-btn.blue:hover {
  border-color: #8ad6ff;
}

.gold-btn {
  border-color: #c9a44f;
  background: linear-gradient(180deg, #5e471c 0%, #33250d 100%);
  color: #fff2be;
}

.gold-btn:hover {
  border-color: #ffe388;
  color: #fff;
}

.danger-btn,
.l1-btn-danger {
  border-color: #9e3d33;
  background: linear-gradient(180deg, #5c201a 0%, #30100d 100%);
  color: #ffd0c9;
}

.danger-btn:hover,
.l1-btn-danger:hover {
  border-color: #ff7e70;
}

.equip-summary {
  padding: 6px 8px;
  background: #120e0a;
  border: 1px solid #4c3d2d;
  font-size: 11.5px;
  color: #e2d3b5;
}

.section-label {
  margin-top: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid #443728;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--l1-gold);
}

.wh-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wh-col-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--l1-gold);
  margin-bottom: 4px;
}

.l1-classic-win.tp-wide {
  width: 660px !important;
}

.tp-top-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tp-search-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.tp-search-input {
  width: 100%;
  padding: 6px 28px 6px 10px;
  background: #0d0a07;
  border: 1px solid #6b563a;
  color: #fff2cc;
  font-family: var(--l1-font);
  font-size: 12px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.tp-search-input:focus {
  border-color: #f0cf78;
  box-shadow: 0 0 6px rgba(240, 207, 120, 0.32);
}

.tp-search-input::placeholder {
  color: #8a7a62;
}

.tp-search-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: #bfa985;
  font-size: 12px;
  cursor: pointer;
}

.tp-search-clear:hover {
  color: #fff2b8;
}

.tp-search-count {
  font-size: 11px;
  color: #b7a382;
  white-space: nowrap;
}

.tp-recent-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px 7px;
  background: rgba(18, 14, 10, 0.9);
  border: 1px solid #3f3325;
}

.tp-recent-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #d8bc7e;
  margin-right: 2px;
  white-space: nowrap;
}

.tp-recent-pill {
  padding: 2px 8px;
  border: 1px solid #624f35;
  background: linear-gradient(180deg, #2a2116 0%, #17120c 100%);
  color: #f4dfaa;
  font-family: var(--l1-font);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.tp-recent-pill:hover {
  border-color: #f2cf78;
  background: linear-gradient(180deg, #43331e 0%, #241b10 100%);
  color: #fff8dc;
}

.tp-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}

.tp-cat-tabs .tab-btn {
  flex: 1 1 auto;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tp-dest-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

#wm-dest-scroll {
  max-height: 220px;
  margin-top: 6px;
}

.tp-group-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tp-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  background: linear-gradient(90deg, rgba(168, 128, 52, 0.24) 0%, rgba(28, 22, 14, 0.4) 100%);
  border-left: 3px solid #e6c166;
  color: #f7de94;
  font-size: 11.5px;
  font-weight: 700;
}

.tp-group-cnt {
  font-size: 10.5px;
  font-weight: 400;
  color: #b5a180;
}

.dest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.dest-cat-badge {
  display: inline-block;
  margin-right: 5px;
  padding: 0 4px;
  border: 1px solid #5d4b34;
  background: #221a11;
  color: #d4bc89;
  font-size: 9.5px;
  font-weight: 600;
  vertical-align: middle;
}

.dest-cat-badge.cat-dungeon_entry {
  border-color: #7c5c34;
  background: #2b1e10;
  color: #ffc875;
}

.dest-cat-badge.cat-dungeon_floor {
  border-color: #7e3d3d;
  background: #291313;
  color: #ff9c94;
}

.dest-cat-badge.cat-toi {
  border-color: #8252a6;
  background: #241630;
  color: #ddb0ff;
}

.dest-cat-badge.cat-hunting {
  border-color: #3e6b4f;
  background: #122419;
  color: #8df0b0;
}

.dest-card {
  text-align: left;
  padding: 6px 8px;
  background: #15110d;
  border: 1px solid #4c3e2c;
  color: #e4d6ba;
  cursor: pointer;
  font-family: var(--l1-font);
  transition: border-color 0.12s, background 0.12s;
}

.dest-card:hover {
  border-color: #f0cf78;
  background: #261e14;
}

.dest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #f6dc96;
  font-size: 12px;
}

.dest-head-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.dest-cost {
  font-size: 10.5px;
  font-weight: 700;
  color: #f6d371;
  font-family: var(--l1-mono);
}

.dest-empty {
  padding: 22px 10px;
  text-align: center;
  color: #a89678;
  font-size: 12px;
}

.boss-filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.boss-filter-tabs .tab-btn {
  flex: 1;
  padding: 4px 6px;
  font-size: 11px;
}

.boss-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(50vh, 410px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.dest-tag {
  font-size: 10.5px;
  color: #8ad6ff;
}

.dest-meta {
  font-size: 10.5px;
  color: #bba98b;
  margin-top: 2px;
}

.dest-desc {
  font-size: 10.5px;
  color: #8f8069;
  margin-top: 2px;
}

.gm-section {
  padding: 7px 8px;
  background: #130f0b;
  border: 1px solid #443728;
}

.gm-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.gm-cmd-bar {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.gm-cmd-bar input {
  flex: 1;
  padding: 5px 8px;
  background: #0a0806;
  border: 1px solid #5e4d38;
  color: #fff3cf;
  font-family: var(--l1-mono);
  font-size: 11.5px;
  user-select: text;
  -webkit-user-select: text;
}

.quest-bar-track {
  height: 6px;
  margin-top: 4px;
  background: #0b0907;
  border: 1px solid #4a3b2a;
}

.quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #b88b2e, #f7d674);
}

/* --- 原版 1294c.img 亞丁全大陸手繪古地圖視窗 --- */
.l1-worldmap-body {
  padding: 8px;
}

.l1-worldmap-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1478 / 825;
  background: #140f0a;
  border: 2px solid #5e4b34;
  overflow: hidden;
}

.l1-worldmap-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: auto;
}

.l1-map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 3px 8px;
  background: rgba(18, 12, 7, 0.88);
  border: 1px solid #e7c982;
  color: #fff1b8;
  font-family: var(--l1-font);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.l1-map-pin:hover {
  background: #523b16;
  border-color: #fff4c2;
  color: #fff;
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 4;
}

/* ============================================================================
   全域原版 3.81C 黑底黃字懸停 Tooltip
   ============================================================================ */
.l1-tooltip {
  position: fixed;
  z-index: 95;
  max-width: 248px;
  padding: 7px 9px;
  background: rgba(6, 5, 4, 0.94);
  border: 1px solid #9e835c;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  font-size: 11.5px;
  line-height: 1.48;
  color: #ece0c7;
}

.l1-tooltip .tt-title {
  font-weight: 700;
  color: #ffe388;
  margin-bottom: 3px;
}

.l1-tooltip .tt-title.enchanted { color: #8ad6ff; }
.l1-tooltip .tt-title.blessed {
  color: #ffe866;
  text-shadow: 0 0 6px rgba(255, 214, 52, 0.5);
}
.l1-tooltip .tt-title.cursed {
  color: #ea4d4d;
  text-shadow: 0 0 6px rgba(195, 24, 24, 0.5);
}
.l1-tooltip .tt-line { color: #d8ccb4; }
.l1-tooltip .tt-line.tt-bless { color: #ffe866; font-weight: 700; }
.l1-tooltip .tt-line.tt-curse { color: #ea5656; font-weight: 700; }
.l1-tooltip .tt-sub { color: #9c8d74; font-size: 10.5px; margin-top: 3px; }

/* ============================================================================
   原版 5483.img 確認對話框彈窗
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
}

.l1-dialog-box {
  position: relative;
  width: 360px;
  min-height: 170px;
  padding: 18px 22px 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 17, 20, 0.98) 0%, rgba(16, 9, 11, 0.99) 100%);
  border: 1px solid rgba(208, 164, 84, 0.68);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.92),
    inset 0 1px 0 rgba(255, 228, 158, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  text-align: center;
}

.l1-dialog-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #f5d47e, transparent);
  pointer-events: none;
}

.l1-dialog-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffe08a;
  text-shadow: 0 1px 2px #000;
}

.l1-dialog-msg {
  font-size: 12px;
  line-height: 1.55;
  color: #efe2c8;
  text-shadow: 0 1px 2px #000;
}

.l1-dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.l1-img-action-btn {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.l1-img-action-btn:hover {
  filter: brightness(1.2);
}

/* ============================================================================
   原版 3.81C 登入／選角（2106c.img）／創角（2196c.img）大廳
   640x480 精確原圖座標，等比縮放居中顯示！
   ============================================================================ */
.l1-lobby-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: radial-gradient(circle at center, #120e0a 0%, #040302 72%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.l1-lobby-stage {
  --lobby-scale: min(1.68, calc(96vw / 640px), calc(95vh / 480px));
  width: 640px;
  height: 480px;
  transform: scale(var(--lobby-scale));
  transform-origin: center center;
  box-shadow: 0 0 0 2px #3b2f21, 0 24px 70px rgba(0, 0, 0, 0.96);
}

.l1-screen-640 {
  position: relative;
  width: 640px;
  height: 480px;
  image-rendering: pixelated;
  overflow: hidden;
}

/* --- 選角畫面：原版 2106c.img --- */
.l1-select-screen {
  background: url('/api/ui/img/2106c.png') no-repeat left top / 640px 480px;
}

.l1-lobby-status-strip {
  position: absolute;
  top: 4px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(242, 217, 152, 0.85);
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
  z-index: 4;
}

.l1-arch-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 640px;
  height: 274px;
}

.l1-arch-slot {
  position: absolute;
  top: 42px;
  width: 116px;
  height: 218px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10px;
  transition: background 0.15s ease;
}

.l1-arch-slot:hover {
  background: radial-gradient(ellipse at 50% 62%, rgba(255, 224, 130, 0.16) 0%, transparent 72%);
}

.l1-arch-slot.selected {
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 214, 112, 0.34) 0%, rgba(255, 168, 64, 0.08) 54%, transparent 78%);
}

.l1-arch-slot.selected::after {
  content: "";
  position: absolute;
  bottom: 12px;
  width: 72px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 225, 130, 0.55) 0%, transparent 75%);
  pointer-events: none;
}

.l1-arch-canvas {
  width: 112px;
  height: 170px;
  pointer-events: none;
  image-rendering: pixelated;
}

.l1-arch-portrait {
  height: 174px;
  width: auto;
  max-width: 114px;
  object-fit: contain;
  pointer-events: none;
  image-rendering: auto;
  mix-blend-mode: lighten;
  filter: brightness(0.84) contrast(1.06);
  transition: filter 0.16s ease, transform 0.16s ease;
}

.l1-arch-slot.selected .l1-arch-portrait {
  filter: brightness(1.08) contrast(1.08) drop-shadow(0 0 8px rgba(255, 224, 130, 0.32));
  transform: scale(1.03);
}

.l1-arch-name {
  position: relative;
  z-index: 2;
  padding: 1px 6px;
  background: rgba(8, 6, 4, 0.82);
  border: 1px solid rgba(154, 127, 82, 0.65);
  color: #f4dfaa;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 106px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.l1-arch-slot.selected .l1-arch-name {
  border-color: #ffe388;
  color: #fff8d6;
  background: rgba(54, 38, 14, 0.92);
}

.l1-arch-empty {
  color: rgba(206, 188, 152, 0.45);
  font-size: 10.5px;
  margin-bottom: 64px;
  text-shadow: 0 1px 2px #000;
}

.l1-arch-slot:hover .l1-arch-empty {
  color: #ffe388;
}

/* 下方 15 個原版繁中屬性欄位（實測 2106c.img 黑框高 16px，垂直正中） */
.l1-sel-val {
  position: absolute;
  width: 92px;
  height: 16px;
  display: flex;
  align-items: center;
  padding: 0 5px;
  font-size: 10.5px;
  line-height: 1;
  font-family: var(--l1-font);
  color: #f7ebd0;
  text-shadow: 0 1px 1px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.l1-sel-val.birth {
  width: 76px;
  justify-content: center;
  font-family: var(--l1-mono);
  font-size: 9.5px;
}

.l1-sel-actions {
  position: absolute;
  left: 516px;
  top: 382px;
  width: 88px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.l1-lobby-btn {
  width: 100%;
  height: 18px;
  padding: 0 4px;
  background: linear-gradient(180deg, #352a1e 0%, #19130d 100%);
  border: 1px solid #7c6548;
  color: #efe1c4;
  font-family: var(--l1-font);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.l1-lobby-btn:hover {
  border-color: #ffe388;
  color: #fff;
}

.l1-lobby-btn.gold {
  border-color: #d6b25e;
  background: linear-gradient(180deg, #694e1c 0%, #38270c 100%);
  color: #fff4c2;
}

.l1-lobby-btn.danger {
  border-color: #8f3b31;
  color: #ffc5bd;
}

.l1-lobby-btn.sub {
  border-color: #536f8c;
  color: #bde2ff;
}

/* --- 創角畫面：原版 2196c.img（實測精確像素對位 + 原版高解析 3D 立繪） --- */
.l1-create-screen {
  background: url('/api/ui/img/2196c.png') no-repeat left top / 640px 480px;
}

.l1-create-preview-box {
  position: absolute;
  left: 48px;
  top: 45px;
  width: 216px;
  height: 195px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding-bottom: 4px;
}

.l1-hd-portrait {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  height: 184px;
  width: auto;
  max-width: 196px;
  object-fit: contain;
  image-rendering: auto;
  mix-blend-mode: lighten;
  filter: contrast(1.06) brightness(1.08);
  pointer-events: none;
}

#create-preview-canvas {
  width: 180px;
  height: 164px;
  image-rendering: pixelated;
}

.l1-create-preview-cap {
  position: relative;
  z-index: 2;
  padding: 2px 10px;
  background: rgba(10, 8, 6, 0.88);
  border: 1px solid #8a7252;
  color: #ffe391;
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
}

.l1-create-class-panel {
  position: absolute;
  left: 300px;
  top: 42px;
  width: 312px;
  height: 222px;
  padding: 8px 10px;
  background: rgba(12, 10, 8, 0.78);
  border: 1px solid #594835;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.l1-create-gender-row {
  display: flex;
  gap: 6px;
}

.gender-btn {
  flex: 1;
  height: 24px;
  background: #1c1610;
  border: 1px solid #63503a;
  color: #d6c7ab;
  font-family: var(--l1-font);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.gender-btn.active,
.gender-btn:hover {
  border-color: #e7c982;
  background: #3d2f1c;
  color: #fff3c0;
}

.l1-create-class-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.cls-card {
  padding: 4px 5px;
  background: #18130e;
  border: 1px solid #594835;
  color: #dfd0b1;
  font-family: var(--l1-font);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.cls-card-emblem {
  width: 24px;
  height: 20px;
  object-fit: contain;
  image-rendering: auto;
  flex-shrink: 0;
}

.cls-card-txt {
  text-align: left;
  line-height: 1.2;
}

.cls-card.active,
.cls-card:hover {
  border-color: #f0cf7b;
  background: #42321b;
  color: #fff5c8;
}

.l1-create-class-desc {
  flex: 1;
  padding: 6px 8px;
  background: rgba(8, 6, 4, 0.8);
  border: 1px solid #443728;
  font-size: 10.5px;
  line-height: 1.5;
  color: #d7c7a7;
}

/* 左下「基本點數加成」：實測原圖 8 列每列精確 16px (y=312..440)、直線 x=19,118,157,162,261,300 */
.l1-create-bonus-table {
  position: absolute;
  left: 19px;
  top: 312px;
  width: 281px;
  height: 128px;
  display: grid;
  grid-template-columns: 138px 138px;
  column-gap: 5px;
  grid-template-rows: repeat(8, 16px);
  font-size: 9.2px;
  color: #efe1c4;
}

.l1-cb-row {
  display: grid;
  grid-template-columns: 99px 39px;
  height: 16px;
  align-items: center;
  padding: 0;
}

.l1-cb-row span {
  padding-left: 7px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px #000;
}

.l1-cb-row strong {
  text-align: center;
  color: #ffe388;
  font-family: var(--l1-mono);
  font-size: 9.2px;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 1px #000;
}

/* 右下「屬性分配點數」中框：實測原圖黑框 x=468..492, y=327..349 */
.l1-create-remain {
  position: absolute;
  left: 468px;
  top: 327px;
  width: 24px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--l1-mono);
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  color: #7ef2a6;
  text-shadow: 0 1px 2px #000;
}

.l1-create-stats-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 640px;
  height: 480px;
  pointer-events: none;
}

.l1-cs-item {
  position: absolute;
  height: 13px;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
}

.l1-cs-val {
  width: 22px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--l1-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #fff2c2;
  background: rgba(10, 8, 6, 0.9);
  border: 1px solid #594835;
}

.l1-cs-btn {
  width: 14px;
  height: 13px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2b2116;
  border: 1px solid #7a6449;
  color: #f3dba0;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.l1-cs-btn:hover {
  border-color: #ffe388;
  background: #4f3c24;
  color: #fff;
}

/* 精準不透明覆蓋原圖「自動配點」(x=339..393, y=385..397) 徹底消除重影 */
.l1-auto-alloc-btn {
  position: absolute;
  left: 334px;
  top: 381px;
  width: 66px;
  height: 20px;
  background: linear-gradient(180deg, #332619 0%, #1a130c 100%);
  border: 1px solid #8a7252;
  box-shadow: inset 0 0 0 1px #140f09, 0 2px 5px rgba(0, 0, 0, 0.8);
  color: #ffe8a1;
  font-family: var(--l1-font);
  font-size: 10.5px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}

.l1-auto-alloc-btn:hover {
  border-color: #ffe388;
  background: linear-gradient(180deg, #523e21 0%, #2a1e0e 100%);
  color: #fff;
}

/* 精準內嵌原圖「角色命名」黑框 (x=426..534, y=426..444) */
.l1-create-name-input {
  position: absolute;
  left: 428px;
  top: 427px;
  width: 104px;
  height: 16px;
  line-height: 16px;
  padding: 0 5px;
  background: rgba(8, 6, 4, 0.92);
  border: none;
  outline: none;
  color: #fff7d6;
  font-family: var(--l1-font);
  font-size: 10.5px;
  user-select: text;
  -webkit-user-select: text;
}

.l1-create-error {
  position: absolute;
  left: 332px;
  top: 406px;
  width: 280px;
  font-size: 10px;
  color: #ff8c82;
  text-shadow: 0 1px 2px #000;
}

.l1-create-actions {
  position: absolute;
  left: 540px;
  top: 404px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

/* ============================================================================
   Mac天堂 專屬品牌載入遮罩（全面替換原版 329.img 第三方載入圖）
   ============================================================================ */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background:
    linear-gradient(to top, rgba(20, 1, 3, 0.92) 0%, rgba(20, 1, 3, 0.45) 36%, rgba(20, 1, 3, 0.08) 65%, rgba(20, 1, 3, 0.28) 100%),
    #1c0103 url('/images/brand-login.webp') no-repeat center 36% / cover;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: clamp(46px, 9vh, 108px);
}

#loading-overlay.done {
  display: none;
}

.l1-loading-box {
  width: min(420px, 88vw);
  padding: 14px 20px;
  background: rgba(20, 4, 7, 0.84);
  border: 1px solid rgba(212, 168, 86, 0.62);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 224, 150, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 6px;
  text-align: center;
}

.l1-loading-box h1 {
  font-size: 15px;
  color: #f3d78f;
  letter-spacing: 1px;
  margin-bottom: 5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.l1-loading-box p {
  font-size: 11.5px;
  color: #dbc7a6;
  margin-bottom: 10px;
}

.l1-loading-bar {
  height: 7px;
  background: rgba(12, 2, 4, 0.92);
  border: 1px solid rgba(182, 138, 66, 0.48);
  border-radius: 999px;
  overflow: hidden;
}

.l1-loading-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8b5b16, #e8bf62, #fff0b8);
  box-shadow: 0 0 12px rgba(238, 194, 92, 0.65);
  transition: width 0.22s ease;
}

/* 復古深色捲軸 */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #0c0907; }
::-webkit-scrollbar-thumb { background: #4d3e2d; border: 1px solid #756047; }
::-webkit-scrollbar-thumb:hover { background: #756047; }

/* ============================================================================
   大桌機／2K／4K 高解析度螢幕自動舒展放大（不擁擠、視野開闊又清晰好點）
   ============================================================================ */
@media (min-width: 1680px) {
  .l1-hud-stage { gap: 10px; padding: 0 14px 8px; }
  .l1-minimap-dock { width: 280px; top: 12px; right: 12px; }
  .l1-top-right-buffs { top: 12px; right: 300px; }
  .l1-top-right-buffs.minimap-collapsed { right: 98px; }
  .l1-minimap-head { font-size: 13.5px; }
  .l1-minimap-foot { font-size: 12.5px; }
  .l1-small-btn { font-size: 12.5px; padding: 5px 4px; }
  .l1-buff-icon { width: 42px; height: 42px; }
  .l1-buff-icon img { width: 36px; height: 36px; }
  .l1-buff-sec { font-size: 10.5px; line-height: 13px; }
  .l1-target-box { width: 274px; padding: 8px 12px; }
  .l1-target-head { font-size: 14px; }
  .l1-target-hp-track { height: 12px; }
  .l1-eq-slot img { width: 44px; height: 44px; }
  .l1-inv-cell img { width: 40px; height: 40px; }
  .l1-spell-cell img { width: 42px; height: 42px; }
}

@media (min-width: 2150px) {
  .l1-hud-stage { gap: 14px; padding: 0 18px 10px; }
  .l1-minimap-dock { width: 312px; }
  .l1-top-right-buffs { right: 334px; }
  .l1-top-right-buffs.minimap-collapsed { right: 104px; }
  .l1-buff-icon { width: 46px; height: 46px; }
  .l1-buff-icon img { width: 40px; height: 40px; }
}

/* ============================================================================
   原版 3.81C 功能選項（環境設定／音效音樂／自動喝水／社群指令／操作熱鍵）
   ============================================================================ */
.l1-classic-win {
  opacity: var(--win-alpha, 1);
}

.l1-win-settings {
  max-height: min(82vh, 690px);
}

.opt-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  background: linear-gradient(180deg, #221a12 0%, #140f0a 100%);
  border: 1px solid #6b563c;
  font-size: 11.5px;
  color: #e6d6b5;
}

.opt-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid #594735;
  background: #17120d;
  font-size: 11px;
  color: #bba98b;
}

.opt-status-pill.on {
  border-color: #55d68a;
  background: rgba(24, 78, 46, 0.45);
  color: #9ff7c2;
}

.opt-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.opt-tabs::-webkit-scrollbar { display: none; }

.opt-tab {
  flex: 1 0 auto;
  padding: 6px 10px;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(30, 14, 17, 0.92) 0%, rgba(16, 8, 10, 0.96) 100%);
  border: 1px solid rgba(168, 128, 66, 0.36);
  color: #cbb898;
  font-family: var(--l1-font);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s ease;
}

.opt-tab:hover,
.opt-tab.active {
  background: linear-gradient(180deg, rgba(122, 80, 22, 0.82) 0%, rgba(58, 28, 12, 0.92) 100%);
  border-color: #ebc468;
  color: #fff6d4;
}

.opt-tab.pot-on {
  border-color: #55d68a;
  color: #9ff7c2;
}

.opt-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(54vh, 450px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.opt-group {
  background: #130f0b;
  border: 1px solid #483a2a;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opt-group-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #f3d584;
  padding-bottom: 4px;
  border-bottom: 1px solid #3c3023;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.opt-group-tag {
  font-size: 10px;
  font-weight: 400;
  color: #9c8a6e;
}

.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  font-size: 12px;
  color: #e8dac0;
}

.opt-row-info {
  flex: 1;
  min-width: 0;
}

.opt-row-label {
  font-weight: 600;
  color: #f2e5cb;
}

.opt-row-desc {
  font-size: 10.5px;
  color: #9e8d73;
  margin-top: 1px;
}

.opt-toggle {
  min-width: 58px;
  padding: 3px 10px;
  border: 1px solid #634f39;
  background: linear-gradient(180deg, #271f17 0%, #16110c 100%);
  color: #a9987d;
  font-family: var(--l1-font);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.opt-toggle.on {
  border-color: #62e396;
  background: linear-gradient(180deg, #235937 0%, #12311e 100%);
  color: #b8ffd2;
  box-shadow: 0 0 6px rgba(98, 227, 150, 0.3);
}

.opt-toggle:hover {
  border-color: #e8c775;
}

.opt-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 196px;
}

.opt-slider {
  flex: 1;
  accent-color: #e6c166;
  cursor: pointer;
}

.opt-slider-val {
  min-width: 40px;
  text-align: right;
  font-family: var(--l1-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #ffe28c;
}

.opt-seg {
  display: inline-flex;
  gap: 3px;
  flex-shrink: 0;
}

.opt-seg-btn {
  padding: 3px 8px;
  border: 1px solid #574634;
  background: #1a140e;
  color: #bda988;
  font-family: var(--l1-font);
  font-size: 11px;
  cursor: pointer;
}

.opt-seg-btn.active,
.opt-seg-btn:hover {
  border-color: #e6c675;
  background: #3d2f1d;
  color: #fff4c6;
}

.opt-pot-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.opt-pot-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  background: #17120d;
  border: 1px solid #4d3d2c;
  color: #e6d7b9;
  font-size: 11px;
}

.opt-pot-card img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.opt-pot-card strong {
  color: #ffe288;
  font-family: var(--l1-mono);
}

.opt-select {
  padding: 4px 7px;
  background: #16110c;
  border: 1px solid #6b563c;
  color: #f3e4c3;
  font-family: var(--l1-font);
  font-size: 11.5px;
}

.opt-key-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.opt-key-table th,
.opt-key-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #30261b;
  text-align: left;
}

.opt-key-table th {
  color: #f0d082;
  background: #1a140e;
}

.opt-key-table td:first-child {
  font-family: var(--l1-mono);
  color: #8ce0ff;
  white-space: nowrap;
}

.opt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #4a3c2c;
}

/* 原版黑金倉庫／道具數量選擇視窗 */
.l1-qty-box {
  width: 340px;
  text-align: left;
}

.l1-qty-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  margin-bottom: 8px;
  background: #120e0a;
  border: 1px solid #524230;
}

.l1-qty-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.l1-qty-input {
  flex: 1;
  height: 30px;
  padding: 0 10px;
  background: #0b0806;
  border: 1px solid #967a50;
  color: #ffe89e;
  font-family: var(--l1-mono);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.l1-qty-input:focus {
  border-color: #ffe07d;
  box-shadow: 0 0 6px rgba(255, 224, 125, 0.35);
}

.l1-qty-quick-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.l1-qty-quick-row .mini-btn {
  padding: 4px 2px;
  text-align: center;
  font-size: 11px;
}

/* ============================================================================
   金蘋果良心商城 × 第二階段多人連線介面（原版 3.81C 暗古銅黑金視覺）
   ============================================================================ */

.l1-chat-online-pill,
.l1-chat-apple-pill,
.l1-chat-vip-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  font-size: 10.5px;
  border-radius: 2px;
  border: 1px solid #594731;
  background: rgba(16, 12, 8, 0.9);
  color: #dcd0b4;
  white-space: nowrap;
}

.l1-chat-online-pill {
  border-color: #3b6f50;
  color: #8bf2b0;
}

.l1-chat-apple-pill {
  border-color: #8f6b29;
  color: #ffe280;
}

.l1-chat-vip-pill {
  border-color: #d6a83e;
  background: linear-gradient(180deg, #4b3511 0%, #261907 100%);
  color: #fff0a8;
  font-weight: 700;
}

.l1-apple-line {
  color: #ffe07d;
  font-size: 11px;
  margin-left: 6px;
}

/* 點選同地圖其他線上玩家互動工具列 */
.l1-other-player-bar {
  margin-top: 6px;
  padding: 7px 9px;
  min-width: 248px;
  background: linear-gradient(180deg, rgba(28, 22, 16, 0.96) 0%, rgba(15, 11, 8, 0.96) 100%);
  border: 1px solid #9e8152;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
  pointer-events: auto;
}

.l1-op-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

#op-meta {
  font-size: 10.5px;
  font-weight: 400;
  color: #bba98b;
  margin-left: auto;
}

.l1-op-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.l1-op-actions .mini-btn {
  flex: 1 1 auto;
  padding: 3px 6px;
  font-size: 11px;
}

.mini-btn.danger {
  border-color: #9e3d33;
  background: linear-gradient(180deg, #5c201a 0%, #30100d 100%);
  color: #ffd0c9;
}

.mini-btn.danger:hover {
  border-color: #ff7e70;
}

/* 多人組隊邀請通知橫幅 */
.party-inv-bar {
  top: 56px;
  border-color: #62b3ff;
  background: linear-gradient(180deg, rgba(20, 38, 56, 0.96) 0%, rgba(10, 20, 32, 0.96) 100%);
  color: #d8f1ff;
}

/* 大廳帳號登入／註冊控制列與彈窗 */
.l1-lobby-auth-bar {
  position: absolute;
  top: 26px;
  left: 16px;
  right: 16px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(12, 9, 6, 0.82);
  border: 1px solid #5c4932;
  font-size: 11px;
  color: #e6d4b0;
}

.l1-auth-mini-btn {
  padding: 2px 8px;
  font-family: var(--l1-font);
  font-size: 11px;
  border: 1px solid #8a6d3e;
  background: linear-gradient(180deg, #3c2d19 0%, #1f170d 100%);
  color: #ffebad;
  cursor: pointer;
}

.l1-auth-mini-btn:hover {
  border-color: #f6d573;
  color: #fff;
}

.l1-auth-mini-btn.danger {
  border-color: #8f3932;
  background: linear-gradient(180deg, #4f1d18 0%, #2a0f0c 100%);
  color: #ffcac4;
}

.l1-auth-dialog {
  width: 360px;
}

.l1-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.l1-auth-tab {
  padding: 6px 8px;
  border: 1px solid #594732;
  background: #17120c;
  color: #b8a586;
  font-family: var(--l1-font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.l1-auth-tab.active {
  border-color: #e2be67;
  background: linear-gradient(180deg, #433219 0%, #241a0d 100%);
  color: #fff0b8;
}

.l1-auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  text-align: left;
}

.l1-auth-field label {
  font-size: 11.5px;
  color: #d6c39f;
}

.l1-auth-field input {
  padding: 6px 9px;
  background: #0b0806;
  border: 1px solid #725c3e;
  color: #fff2cf;
  font-size: 13px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.l1-auth-field input:focus {
  border-color: #f0cf78;
}

/* 金蘋果良心商城 NPC 專屬樣式 */
.mall-head-box {
  border-color: #a68238 !important;
  background: linear-gradient(180deg, #21180d 0%, #140f09 100%) !important;
  color: #f5ebd2 !important;
}

.mall-head-box .npc-dialog-text {
  color: #f7ecd2 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.tr-wait-box {
  text-align: center;
  padding: 18px 14px;
  background: linear-gradient(180deg, #211910 0%, #140f0a 100%);
  border: 1px solid #967746;
}

.mall-balance-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #4d3d24;
  font-size: 12px;
  color: #f2dfb7;
}

.mall-vip-status {
  font-size: 11px;
  color: #9be8a8;
}

.mall-promise-banner {
  margin-top: 8px;
  padding: 7px 9px;
  background: rgba(18, 34, 22, 0.85);
  border: 1px solid #3f754d;
  color: #b7efc2;
  font-size: 11.5px;
  line-height: 1.45;
}

.mall-tag {
  display: inline-block;
  margin-right: 5px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 2px;
  border: 1px solid #96722d;
  background: #2e220e;
  color: #ffdf7c;
  vertical-align: middle;
}

.mall-dur-tag {
  display: inline-block;
  margin-right: 5px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 2px;
  border: 1px solid #457c9c;
  background: #122634;
  color: #8ee0ff;
  vertical-align: middle;
}

.mall-pass-board {
  margin-top: 8px;
  padding: 7px 9px;
  background: rgba(24, 19, 10, 0.92);
  border: 1px solid #8c6e34;
}

.mall-pass-board-title {
  font-size: 11px;
  font-weight: 700;
  color: #ffe285;
  margin-bottom: 6px;
}

.mall-pass-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mall-pass-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  background: #141c15;
  border: 1px solid #447a51;
  font-size: 10.5px;
  color: #dff7e5;
}

.mall-pass-chip .mpc-name {
  font-weight: 700;
  color: #ffe694;
}

.mall-pass-chip .mpc-rem {
  color: #8df5a8;
  font-weight: 700;
}

.mall-pass-chip .mpc-exp {
  color: #b7c4ba;
  font-family: var(--l1-mono);
  font-size: 10px;
}

.mall-pass-live-line {
  margin-top: 3px;
  font-size: 11px;
  color: #8ef5a8;
}

.l1-remote-wh-btn.wh-active,
.l1-inv-tab.wh-link.wh-active {
  border-color: #e6be5c !important;
  background: linear-gradient(180deg, #4b3714 0%, #271b08 100%) !important;
  color: #fff0a8 !important;
  box-shadow: 0 0 6px rgba(240, 198, 88, 0.35);
}

.mall-class-change-box {
  margin: 8px 0;
  padding: 8px 10px;
  background: #1d1526;
  border: 1px solid #7d59a8;
}

.mall-cc-title {
  font-size: 12px;
  font-weight: 700;
  color: #e4c6ff;
  margin-bottom: 6px;
}

.mall-cc-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 第二階段多人安全面對面交易視窗 */
.tr-safe-tip {
  padding: 6px 8px;
  margin-bottom: 8px;
  background: #122117;
  border: 1px solid #3c6e4b;
  color: #a8e8b8;
  font-size: 11px;
  line-height: 1.45;
}

.tr-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tr-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #14100b;
  border: 1px solid #594732;
}

.tr-col.locked {
  border-color: #d6b25e;
  background: #1b150c;
}

.tr-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #f4dfaa;
  border-bottom: 1px solid #3c2f21;
  padding-bottom: 4px;
}

.tr-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border: 1px solid #594732;
  color: #b7a486;
}

.tr-badge.lock {
  border-color: #d6b25e;
  color: #ffe388;
  background: #2f230e;
}

.tr-badge.ok {
  border-color: #4f9e62;
  color: #9ff5b3;
  background: #142c1a;
}

.tr-items-box {
  min-height: 92px;
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  background: #0c0907;
  border: 1px solid #3b2f22;
}

.tr-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #efe2c6;
}

.tr-item-row img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.tr-empty {
  padding: 12px 6px;
  text-align: center;
  font-size: 11px;
  color: #88775e;
}

.tr-currency-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #e6d4b0;
}

.tr-currency-form label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tr-currency-form input {
  width: 78px;
  padding: 3px 5px;
  background: #0b0806;
  border: 1px solid #6b563c;
  color: #ffe89e;
  font-family: var(--l1-mono);
  font-size: 11.5px;
  user-select: text;
  -webkit-user-select: text;
}

.tr-partner-cur {
  display: flex;
  justify-content: space-between;
  padding: 5px 6px;
  background: #0d0a07;
  border: 1px solid #3c2f21;
  font-size: 11.5px;
  color: #f0dfb8;
}

.tr-bag-section {
  margin-top: 8px;
}

.tr-bag-title {
  font-size: 11px;
  color: #c7b494;
  margin-bottom: 4px;
}

.tr-bag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 92px;
  overflow-y: auto;
  padding: 5px;
  background: #0e0b08;
  border: 1px solid #443728;
}

.tr-bag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: #1c150e;
  border: 1px solid #614e36;
  color: #f0e2c4;
  font-family: var(--l1-font);
  font-size: 11px;
  cursor: pointer;
}

.tr-bag-chip:hover {
  border-color: #f0cf78;
  background: #2b2014;
}

.tr-bag-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tr-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* ============================================================================
   第三階段：奇岩城單城攻城戰即時橫幅與冒險錄分頁樣式
   ============================================================================ */
.siege-live-bar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 42;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: linear-gradient(180deg, rgba(48, 16, 12, 0.94), rgba(22, 10, 8, 0.96));
  border: 1px solid #d49b4b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.72), inset 0 0 0 1px rgba(255, 208, 120, 0.2);
  color: #ffe8b5;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.siege-live-actions {
  display: flex;
  gap: 6px;
}

.siege-hero-card {
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(36, 25, 14, 0.95), rgba(18, 13, 9, 0.98));
  border: 1px solid #8a6b3e;
  margin-bottom: 8px;
}

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

.siege-hero-title {
  font-size: 15px;
  font-weight: 700;
  color: #f6d573;
}

.siege-status-pill {
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #6b5638;
  background: #231a11;
  color: #d7c39c;
}

.siege-status-pill.live {
  border-color: #ff6e5a;
  background: rgba(130, 22, 16, 0.9);
  color: #ffd8b5;
}

.siege-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  font-size: 12px;
  color: #dfd1b6;
}

.siege-kv-item strong {
  color: #f5d888;
}

.siege-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.siege-tax-panel {
  padding: 8px 11px;
  margin-bottom: 8px;
  background: rgba(24, 19, 13, 0.92);
  border: 1px solid #6d5837;
}

.siege-clan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.siege-clan-chip {
  padding: 2px 8px;
  background: #261b12;
  border: 1px solid #7f5f37;
  color: #f4d694;
  font-size: 11.5px;
}

.siege-rules-box {
  padding: 8px 11px;
  background: rgba(15, 12, 9, 0.9);
  border: 1px solid #483b29;
  font-size: 11px;
  line-height: 1.56;
  color: #c8b899;
}

/* ============================================================================
   第四階段：多人血盟大廳／血盟倉庫與全服離線交易所（拍賣場）樣式
   ============================================================================ */
.clan-invite-bar {
  top: 52px;
  border-color: #e6b85c;
  background: linear-gradient(180deg, rgba(44, 31, 14, 0.96), rgba(20, 15, 8, 0.98));
}

.cm-subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.cm-subtab {
  flex: 1;
  padding: 5px 8px;
  background: #1b150e;
  border: 1px solid #5e4b34;
  color: #cdbda0;
  font-family: var(--l1-font);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.cm-subtab.active,
.cm-subtab:hover {
  background: #362816;
  border-color: #e8c26b;
  color: #fff0c2;
}

.cm-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 5px;
  background: rgba(20, 16, 11, 0.92);
  border: 1px solid #4c3d2b;
  font-size: 11.5px;
}

.cm-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  background: #676258;
}

.cm-dot.on {
  background: #5df094;
  box-shadow: 0 0 6px rgba(93, 240, 148, 0.7);
}

.cm-rank-badge {
  padding: 1px 6px;
  font-size: 10.5px;
  border: 1px solid #755b35;
  background: #281e12;
  color: #f3d280;
  margin-left: 5px;
}

.cm-rank-badge.leader {
  border-color: #f2be4c;
  background: #422c10;
  color: #ffe89c;
}

.cm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
  align-items: center;
}

.cm-filter-bar input[type="text"],
.cm-filter-bar input[type="number"],
.cm-filter-bar select {
  background: #120e0a;
  border: 1px solid #634f36;
  color: #f3e4c3;
  padding: 4px 7px;
  font-family: var(--l1-font);
  font-size: 11.5px;
}

.cm-market-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  margin-bottom: 6px;
  background: rgba(22, 17, 12, 0.94);
  border: 1px solid #57452e;
}

.cm-market-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cm-market-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: #0d0a07;
  border: 1px solid #4f402e;
  flex-shrink: 0;
}

.cm-price-tag {
  font-size: 12.5px;
  font-weight: 700;
  color: #f6d573;
  white-space: nowrap;
}

.cm-price-tag.apple {
  color: #ff9a7b;
}

.cm-sell-form {
  padding: 9px 11px;
  margin-bottom: 8px;
  background: rgba(28, 21, 13, 0.95);
  border: 1px solid #8a6c3f;
}

.cm-log-row {
  padding: 4px 7px;
  border-bottom: 1px solid rgba(90, 72, 48, 0.35);
  font-size: 11px;
  color: #cbbba0;
}

/* ============================================================================
   Mac天堂 專屬純品牌開場商標畫面（Splash）與專屬品牌登入畫面（Login）
   嚴格對齊 1920x1080 品牌圖底部安全區，全程零第三方商標
   ============================================================================ */
.brand-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: radial-gradient(circle at 50% 44%, #280408 0%, #140103 68%, #0d0002 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.62s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.62s ease;
}

.brand-splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.brand-splash-screen.hidden {
  display: none;
}

.brand-splash-artwork {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

@media (max-aspect-ratio: 4 / 3) {
  .brand-splash-artwork {
    object-fit: contain;
  }
}

.brand-splash-dock {
  position: absolute;
  left: 50%;
  bottom: clamp(42px, 9.2vh, 108px);
  transform: translateX(-50%);
  width: min(420px, 78vw);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand-splash-bar-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(12, 1, 3, 0.78);
  border: 1px solid rgba(206, 162, 78, 0.38);
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

.brand-splash-bar-fill {
  width: 14%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5a14 0%, #e5bc5f 60%, #fff2be 100%);
  box-shadow: 0 0 14px rgba(240, 198, 96, 0.78);
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-splash-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.4px;
  color: rgba(239, 222, 186, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.brand-splash-skip {
  font-size: 11px;
  color: rgba(208, 178, 126, 0.56);
  white-space: nowrap;
}

/* --- Mac天堂 專屬品牌登入主畫面 --- */
.brand-login-screen {
  position: fixed;
  inset: 0;
  z-index: 75;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(64, 12, 12, 0.08) 0%, rgba(16, 1, 3, 0.25) 68%, rgba(12, 0, 2, 0.66) 100%),
    linear-gradient(to top, rgba(22, 1, 3, 0.96) 0%, rgba(24, 2, 4, 0.72) 25%, rgba(24, 2, 4, 0.14) 44%, rgba(20, 2, 4, 0) 60%),
    #1c0103 url('/images/brand-login.webp') no-repeat center 34% / cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  animation: brandFadeIn 0.45s ease-out;
}

.brand-login-screen.hidden {
  display: none;
}

@keyframes brandFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.brand-login-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 0;
  pointer-events: none;
}

.brand-server-pill,
.brand-top-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(22, 4, 6, 0.72);
  border: 1px solid rgba(206, 162, 78, 0.42);
  color: #f2dfb7;
  font-family: var(--l1-font);
  font-size: 12px;
  letter-spacing: 0.3px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.brand-top-btn {
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.brand-top-btn:hover {
  border-color: #f0cc74;
  background: rgba(58, 16, 18, 0.85);
  color: #fff6d8;
}

.brand-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5ce696;
  box-shadow: 0 0 8px rgba(92, 230, 150, 0.85);
}

/* 底部 35% 酒紅山霧安全區：精準定錨不遮城堡、石橋與 Mac天堂 字標 */
.brand-login-dock {
  position: absolute;
  left: 50%;
  bottom: clamp(44px, 6.2vh, 72px);
  transform: translateX(-50%);
  width: min(468px, 90vw);
  z-index: 3;
}

.brand-login-card {
  position: relative;
  padding: 16px 22px 15px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(34, 7, 10, 0.86) 0%, rgba(18, 3, 5, 0.92) 100%);
  border: 1px solid rgba(212, 166, 82, 0.56);
  box-shadow:
    0 22px 58px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(92, 22, 26, 0.55) inset,
    0 1px 0 rgba(255, 226, 154, 0.24) inset;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand-login-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18%;
  right: 18%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f5d47e, transparent);
  pointer-events: none;
}

.brand-login-card.hidden {
  display: none;
}

.brand-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.brand-auth-tab {
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(162, 118, 56, 0.42);
  background: rgba(16, 3, 5, 0.7);
  color: #bfa988;
  font-family: var(--l1-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.brand-auth-tab:hover {
  border-color: rgba(226, 186, 102, 0.75);
  color: #f6e4bc;
}

.brand-auth-tab.active {
  border-color: #e4bc62;
  background: linear-gradient(180deg, rgba(114, 76, 22, 0.72) 0%, rgba(58, 28, 12, 0.85) 100%);
  color: #fff3c7;
  box-shadow: 0 0 14px rgba(228, 188, 98, 0.2);
}

.brand-auth-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 560px) {
  .brand-auth-inputs {
    grid-template-columns: 1fr;
  }
}

.brand-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-input-group span {
  font-size: 11.5px;
  font-weight: 600;
  color: #dfcaa1;
  letter-spacing: 0.4px;
}

.brand-input-group input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: 6px;
  border: 1px solid rgba(176, 134, 68, 0.52);
  background: rgba(12, 2, 4, 0.86);
  color: #fff4d8;
  font-family: var(--l1-font);
  font-size: 13px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.brand-input-group input::placeholder {
  color: rgba(190, 165, 132, 0.48);
  font-size: 12px;
}

.brand-input-group input:focus {
  border-color: #f0ca72;
  box-shadow: 0 0 0 1px rgba(240, 202, 114, 0.45), 0 0 16px rgba(240, 202, 114, 0.22);
}

.brand-auth-error {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: #ff8e84;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.brand-auth-actions {
  margin-top: 4px;
}

.brand-gold-btn {
  width: 100%;
  height: 40px;
  border-radius: 7px;
  border: 1px solid #f0cb72;
  background: linear-gradient(180deg, #c6963d 0%, #8e5f1a 52%, #68420e 100%);
  color: #fff8de;
  font-family: var(--l1-font);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-shadow: 0 1px 3px rgba(34, 14, 4, 0.9);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 241, 196, 0.48);
  cursor: pointer;
  transition: filter 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}

.brand-gold-btn:hover {
  filter: brightness(1.1);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.65),
    0 0 18px rgba(240, 202, 114, 0.34),
    inset 0 1px 0 rgba(255, 244, 204, 0.65);
}

.brand-gold-btn:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

.brand-guest-row {
  margin-top: 9px;
  text-align: center;
}

.brand-guest-row.hidden {
  display: none;
}

.brand-link-btn {
  background: transparent;
  border: none;
  padding: 2px 6px;
  color: rgba(232, 204, 152, 0.78);
  font-family: var(--l1-font);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.brand-link-btn:hover {
  color: #ffebad;
}

/* 已登入狀態歡迎卡 */
.brand-logged-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  padding: 18px 24px 16px;
}

.brand-logged-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.brand-logged-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(226, 184, 96, 0.45);
  background: rgba(114, 72, 22, 0.32);
  color: #f3d484;
  font-size: 11px;
  letter-spacing: 0.8px;
}

.brand-logged-welcome strong {
  font-size: 19px;
  color: #fff3cf;
  letter-spacing: 0.8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

.brand-logged-hint {
  font-size: 12px;
  color: #cfb996;
}

.brand-logged-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.brand-logged-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.brand-subtle-btn {
  height: 31px;
  border-radius: 6px;
  border: 1px solid rgba(176, 134, 68, 0.45);
  background: rgba(24, 6, 8, 0.76);
  color: #e4cfab;
  font-family: var(--l1-font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.brand-subtle-btn:hover {
  border-color: #ecc770;
  background: rgba(62, 22, 18, 0.85);
  color: #fff6d8;
}

.brand-subtle-btn.danger {
  border-color: rgba(176, 68, 60, 0.55);
  color: #ffc8c2;
}

.brand-subtle-btn.danger:hover {
  border-color: #ff867c;
  background: rgba(98, 20, 20, 0.85);
  color: #fff;
}

.brand-login-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px 14px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: rgba(214, 188, 146, 0.62);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.brand-footer-sep {
  opacity: 0.5;
}
