/* 造梦三国 · 古风 UI 皮肤（复刻造梦三国竖屏界面）
   仅视觉层：所有按钮复用既有 data-nav / data-action / data-command 事件。 */

/* ---------- 全局 ---------- */
body.jm-mode .topbar { display: none !important; }
body.jm-mode .main {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.jm-mode .ambient { display: none; }
body.jm-mode .app { background: #0c0e10; }
body.jm-mode #bottom-nav { display: none !important; }
html.embedded body.jm-mode .app { width: 100%; max-width: none; }
html.embedded .game-screen.jm-game { max-width: none; }

.game-screen.jm-game {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  height: 100dvh;
  max-height: 880px;
  min-height: 0;
  margin: 0 auto;
  padding: 0 !important;
  gap: 0;
  overflow: hidden;
}

/* ---------- 顶部城池横幅 + 云纹标题栏 ---------- */
.jm-scene {
  position: relative;
  z-index: 3;
  flex: 0 0 44px;
  height: 44px;
  background: url('../assets/ui/main-bg.png') center 58% / cover no-repeat, #191410;
  border-bottom: 1px solid #2b2016;
}
.jm-scene:after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 6, .25), rgba(10, 8, 6, .68));
  pointer-events: none;
}
.jm-topbar {
  position: relative;
  z-index: 4;
  flex: 0 0 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('../assets/ui/top-cloud.png') center / 100% 100% no-repeat, #16283a;
  color: #fff2cc;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 3px #000, 0 0 8px #000;
}
.jm-topbar:after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .35));
  pointer-events: none;
}
.jm-net {
  position: absolute;
  right: 12px;
  top: 13px;
  z-index: 2;
  font-family: system-ui, sans-serif;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  color: #ff9a86;
  text-shadow: none;
}
.jm-net.online { color: #a8e39a; }
.jm-net.ready { color: #ffe08a; }

/* ---------- 上部主区：左人物 / 右面板 ---------- */
.jm-stage {
  flex: 1 1 auto;
  min-height: 290px;
  max-height: 384px;
  display: flex;
  gap: 3px;
  padding: 3px 4px 0;
  overflow: hidden;
  isolation: isolate;
  background: url('../assets/ui/cloud-bg.png') center / cover no-repeat, #10172a;
}

/* 左侧人物状态卡 */
.jm-left {
  flex: 0 0 41%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.jm-hero {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.jm-map-slot { flex: 0 0 auto; }
.jm-map-slot .jm-map-card { width: 100%; }
.jm-map-slot .jm-map-card img { height: 88px; }
.jm-avatarline {
  position: relative;
  flex: 0 0 46px;
  height: 46px;
  background: url('../assets/ui/avatar-frame.png') center / 100% 100% no-repeat;
}
.jm-avatar {
  position: absolute;
  left: 4px;
  top: 5px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #d9b25c;
  background: radial-gradient(circle at 40% 30%, #6c5a3c, #241d14);
}
.jm-avatar-fallback {
  position: absolute;
  left: 4px;
  top: 5px;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #d9b25c;
  background: radial-gradient(circle at 40% 30%, #6c5a3c, #241d14);
  color: #ffe6a8;
  font-family: serif;
  font-size: 19px;
}
.jm-avatar-text {
  position: absolute;
  left: 42px;
  right: 5px;
  top: 5px;
  color: #f5e6c6;
  font-size: 11px;
  line-height: 1.45;
  text-shadow: 0 1px 2px #000;
}
.jm-avatar-text b { font-size: 12px; }
.jm-avatar-text small { display: block; color: #c3b28a; font-size: 9px; }

.jm-power {
  flex: 0 0 23px;
  height: 23px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid #c9a24d;
  border-radius: 2px;
  background: linear-gradient(90deg, #4b1d70, #8d3fb9 48%, #4b1d70);
  box-shadow: inset 0 0 6px #0008, 0 1px 3px #0009;
  color: #f0d8ff;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
}
.jm-power i {
  color: #ffe9a0;
  font-style: normal;
  font-family: serif;
}

.jm-deputy {
  position: relative;
  flex: 0 0 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 12px;
  background: url('../assets/ui/deputy-slots.png') center / 100% 100% no-repeat;
}
.jm-deputy-slot { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.jm-deputy img {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  object-fit: contain;
  background: #211a12;
  border: 1px solid #b98b3e;
}
.jm-deputy-slot small { max-width: 38px; color: #f5e6c2; font-size: 8px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jm-deputy .empty-slot {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: radial-gradient(circle, #3a2f20, #1a140d);
  border: 1px dashed #8a6b38;
}

.jm-stats {
  flex: 1;
  min-height: 0;
  padding: 9px 11px;
  overflow: hidden;
  background: url('../assets/ui/panel-paper.png') center / 100% 100% no-repeat;
  color: #382a17;
  font-size: 11px;
  line-height: 1.75;
}
.jm-stats .jm-stat-line { display: flex; justify-content: space-between; gap: 4px; }
.jm-stats .jm-stat-line span { color: #5b4525; }
.jm-stats .jm-stat-line b { font-weight: 700; }
.jm-exp {
  height: 8px;
  margin: 4px 0 6px;
  border: 1px solid #a88750;
  border-radius: 5px;
  background: #e5d5ac;
  overflow: hidden;
}
.jm-exp i { display: block; height: 100%; background: linear-gradient(90deg, #a67b2e, #e8c76a); }
.jm-money { display: flex; flex-direction: column; gap: 1px; }
.jm-money span { display: flex; align-items: center; gap: 4px; }
.jm-money img { width: 14px; height: 14px; object-fit: contain; }

/* 右侧红木主面板 */
.jm-panel {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 8px 8px 34px;
  background: url('../assets/ui/panel-red.png') center / 100% 100% no-repeat;
}
.jm-panel-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 3px;
  color: #f2e3c2;
  scrollbar-width: thin;
  scrollbar-color: #a38043 transparent;
}
.jm-panel-inner::-webkit-scrollbar { width: 4px; }
.jm-panel-inner::-webkit-scrollbar-thumb { background: #a38043; border-radius: 3px; }
.jm-panel-title {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #f2dda2;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 6px;
  text-indent: 6px;
  text-shadow: 0 2px 4px #000, 0 0 8px #000;
  pointer-events: none;
}

/* 面板内容：在红木底色上重排 */
.jm-panel .panel-head { margin: 0 0 8px; }
.jm-panel .panel-head h2 { color: #ffe6a8; font-size: 18px; text-shadow: 0 1px 3px #000; }
.jm-panel .panel-head p { color: #d7c49c; font-size: 10px; }
.jm-panel .chapter-no { color: #d6b56844; }
.jm-panel .hero-card {
  min-height: 0;
  margin-bottom: 8px;
  padding: 10px;
  border-color: #c9a24d66;
  background: linear-gradient(105deg, #3a2018e8, #241611e8);
}
.jm-panel .hero-card h3 { font-size: 21px; color: #ffe6a8; }
.jm-panel .hero-card p { font-size: 10px; line-height: 1.65; color: #ddc9a2; }
.jm-panel .hero-actions { margin-top: 10px; gap: 6px; }
.jm-panel .grid { gap: 6px; }
.jm-panel .card {
  padding: 9px;
  border-color: #a7804466;
  background: linear-gradient(160deg, #43251be8, #2a1810e8);
}
.jm-panel .card strong { font-size: 12px; color: #ffe9b8; }
.jm-panel .card small,
.jm-panel .row small { color: #cbb489; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jm-panel .row {
  padding: 8px;
  border-color: #a7804455;
  background: #2b1a13c9;
}
.jm-panel .row strong { color: #f6e3bb; font-size: 11px; }
.jm-panel .section-title { margin: 12px 1px 6px; }
.jm-panel .section-title h3 { color: #ffe6a8; font-size: 14px; }
.jm-panel .section-title span { color: #cbb489; font-size: 9px; }
.jm-panel .muted,
.jm-panel .notice { color: #d5c098; font-size: 10px; }
.jm-panel .notice { border-left-color: #c9a24d; background: #d6b56812; }
.jm-panel .tabs { margin-bottom: 8px; padding: 3px; background: #1b120d; border-color: #8a6b38; }
.jm-panel .tab { font-size: 10px; color: #cbb489; }
.jm-panel .tab.active { background: #6d4a22; color: #ffe6a8; }
.jm-panel .btn { font-size: 11px; padding: 8px 11px; border-radius: 3px; }
.jm-panel .btn.gold { background: linear-gradient(180deg, #c79a3f, #8a6524); border-color: #e6c26a; color: #fff4d6; }
.jm-panel .btn.primary { background: linear-gradient(180deg, #a4472d, #6d2a1d); border-color: #d89068; }
.jm-panel .btn.ghost { background: #2a1a12; color: #d5c098; border-color: #8a6b38; }
.jm-panel .empty { color: #cbb489; border-color: #8a6b38; background: #2b1a1388; font-size: 11px; padding: 20px 10px; }
.jm-panel .stat-grid div { background: #2b1a13aa; border-color: #a7804455; }
.jm-panel .stat-grid span { color: #cbb489; }
.jm-panel .list { gap: 6px; }

/* ---------- 四大页签按钮 ---------- */
.jm-bigtabs {
  flex: 0 0 62px;
  height: 62px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 2px 4px 2px;
  background: linear-gradient(180deg, #0d1014, #171d24);
  border-top: 1px solid #3d4a58;
}
.jm-bigtab {
  position: relative;
  height: 58px;
  border: 0;
  padding: 0;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 100% 300%;
  /* 素材 nav-*.png 已自带「人物/设施/移动/功能」字样，隐藏 HTML 文字避免重影 */
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-shadow: none;
  filter: brightness(.9) saturate(.98);
  transition: filter .12s, transform .12s;
}
.jm-bigtab.active { filter: brightness(1.12) drop-shadow(0 0 5px rgba(255, 214, 120, .85)); }
.jm-bigtab:active { transform: translateY(1px); }
.jm-bigtab[data-jmtab="person"] { background-image: url('../assets/ui/nav-person.png'); }
.jm-bigtab[data-jmtab="facility"] { background-image: url('../assets/ui/nav-facility.png'); }
.jm-bigtab[data-jmtab="move"] { background-image: url('../assets/ui/nav-move.png'); }
.jm-bigtab[data-jmtab="function"] { background-image: url('../assets/ui/nav-function.png'); }

/* ---------- 人物面板内容 ---------- */
.jm-npc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid #a7804444;
  font-family: serif;
  font-size: 14px;
  color: #f5e6c2;
}
.jm-npc-row .jm-npc-name { flex: 1; }
.jm-npc-row .jm-npc-name em { color: #ff8f6b; font-style: normal; font-size: 10px; }
.jm-dialog {
  flex: 0 0 54px;
  width: 54px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: linear-gradient(135deg, #5aa4e6, #1b4b86 62%, #123764);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  color: #fff;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 12px;
  text-shadow: 0 1px 2px #000;
}
.jm-dialog span { display: block; transform: translateY(-1px); }
.jm-dialog.urgent { background: linear-gradient(135deg, #f09a45, #a94424 62%, #7b2d18); }
.jm-dialog:disabled { filter: grayscale(.7); }
.jm-panel .jm-gold-btn { margin-top: auto; }
.jm-gold-btn {
  width: 100%;
  margin-top: 12px;
  flex: 0 0 auto;
  padding: 9px;
  border: 1px solid #f0d27a;
  border-radius: 4px;
  background: linear-gradient(180deg, #e5bc56, #a97a22);
  color: #3b2a10;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 0 #ffe9ae;
}

/* ---------- 设施面板 ---------- */
.jm-fac-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px 6px; padding-top: 5px; }
.jm-fac {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  color: #f6e5bd;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 15px;
  text-shadow: 0 1px 3px #000;
}
.jm-fac .jm-fac-icon {
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #d9b25c;
  background: radial-gradient(circle at 40% 30%, #b98b3e, #5d3f18);
  font-size: 15px;
}

/* ---------- 移动面板 ---------- */
.jm-map-card {
  border: 1px solid #c9a24d;
  border-radius: 3px;
  padding: 3px;
  background: #1d150e;
}
.jm-map-card img { display: block; width: 100%; height: 74px; object-fit: cover; border-radius: 2px; }
.jm-map-card b { display: block; margin-top: 3px; text-align: center; color: #ffe6a8; font-size: 11px; }
.jm-move-list { width: 100%; }
.jm-move-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 9px 3px;
  border: 0;
  border-bottom: 1px solid #a7804444;
  background: none;
  color: #f5e6c2;
  font-family: serif;
  font-size: 15px;
  text-align: left;
}
.jm-move-row .arrow { color: #e8b64e; font-size: 20px; }
.jm-move-row .thumb { width: 32px; height: 32px; object-fit: contain; border-radius: 3px; }

/* ---------- 功能面板 ---------- */
.jm-func-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 2px; padding-top: 4px; }
.jm-func {
  position: relative;
  padding: 5px 2px;
  border: 0;
  background: none;
  color: #f4e3b8;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 14px;
  text-shadow: 0 1px 3px #000;
}
/* 每格一个金色云纹图标在文字前（素材风格），不再左右各一个 */
.jm-func:before {
  content: '❧';
  color: #d8ae5c;
  font-size: 12px;
  margin-right: 4px;
  text-shadow: 0 1px 2px #000;
}
.jm-func:after { content: none; }
.jm-func-more { margin-top: 6px; border-top: 1px solid #a7804444; padding-top: 4px; }
.jm-func-more summary { color: #9fd8e6; font-size: 10px; text-align: center; cursor: pointer; list-style: none; }
.jm-func-more summary::-webkit-details-marker { display: none; }
.jm-func-more[open] summary { color: #ffe0a0; }

/* ---------- 头像快捷栏 ---------- */
.jm-quick {
  flex: 0 0 44px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 5px;
  overflow-x: auto;
  background: linear-gradient(180deg, #0b0e12, #1a2027);
  border-top: 1px solid #3d4a58;
  scrollbar-width: none;
}
.jm-quick::-webkit-scrollbar { display: none; }
.jm-quick img, .jm-quick .jm-quick-fallback {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #c9a24d;
  object-fit: contain;
  background: radial-gradient(circle at 40% 30%, #6c5a3c, #241d14);
}
.jm-quick .jm-quick-fallback { display: grid; place-items: center; color: #ffe6a8; font-family: serif; font-size: 16px; }
.jm-quick-more { flex: 0 0 auto; color: #67b6e6; font-size: 11px; white-space: nowrap; padding-left: 3px; }

/* ---------- 快捷键条 ---------- */
.jm-hotkeys {
  flex: 0 0 30px;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  background: linear-gradient(180deg, #1b2b3c, #101a26);
  border-top: 1px solid #3c4b5a;
}
.jm-hotkeys-label { flex: 0 0 60px; color: #ffe0a0; font-family: "STKaiti", "KaiTi", serif; font-size: 11px; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.jm-hotkey {
  flex: 0 0 26px;
  width: 26px;
  height: 24px;
  border: 1px solid #7c94a8;
  border-radius: 3px;
  background: linear-gradient(180deg, #324860, #1a293b);
  color: #dceaf7;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 13px;
  line-height: 1;
}
.jm-hotkey.active { border-color: #f05b3a; background: linear-gradient(180deg, #b34527, #6e2413); color: #fff2d6; box-shadow: 0 0 5px #f05b3a88; }

/* ---------- 常驻聊天区 ---------- */
.jm-chat {
  flex: 1 1 auto;
  min-height: 130px;
  max-height: 268px;
  display: flex;
  flex-direction: column;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .3) 0 1px, transparent 1px 46px),
    linear-gradient(180deg, #22303f, #121b25);
  border-top: 2px solid #3c4b5a;
}
.jm-chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px; scrollbar-width: thin; }
.jm-chat-line { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 7px; }
.jm-chat-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 3px;
  border: 1px solid #6b7d8c;
  object-fit: contain;
  background: #20262e;
}
.jm-chat-avatar.jm-fallback { display: grid; place-items: center; color: #d9c9a0; font-family: serif; font-size: 15px; }
.jm-chat-bubble {
  max-width: calc(100% - 40px);
  padding: 6px 10px;
  border-radius: 13px;
  background: linear-gradient(180deg, #2b3c4f, #1e2d3d);
  border: 1px solid #4a6179;
  color: #e2ecf4;
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  box-shadow: inset 0 1px 0 #ffffff12, 0 1px 3px #0006;
}
.jm-chat-time { color: #9fd8a2; font-size: 10px; margin-right: 5px; }
.jm-chat-bubble b { color: #f0cf72; margin-right: 6px; font-weight: 500; }
.jm-chat-form {
  flex: 0 0 46px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: url('../assets/ui/chat-bar.png') center / 100% 100% no-repeat, #14203a;
}
.jm-chat-icon {
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border: 1px solid #9ab6d0;
  border-radius: 50%;
  background: linear-gradient(180deg, #36506e, #1b2a3d);
  color: #e8f2ff;
  font-size: 17px;
  line-height: 1;
}
.jm-chat-face { background: linear-gradient(180deg, #f0d68a, #b98b3e); color: #2a1d0d; font-size: 15px; border-color: #f0d68a; }
.jm-chat-form input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #48617a;
  border-radius: 16px;
  background: #0b1420e6;
  color: #eaf2fa;
  font-size: 12px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.jm-chat-form input:focus { border-color: #8fc4ea; }
.jm-send {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 13px;
  border: 1px solid #a6cf82;
  border-radius: 17px;
  background: linear-gradient(180deg, #83bb60, #3f7c2e);
  color: #fff;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
}
.jm-send:disabled { opacity: .5; }

/* 小屏适配 */
@media (max-height: 720px) {
  .jm-stage { min-height: 238px; max-height: 340px; }
  .jm-bigtabs { flex-basis: 56px; height: 56px; }
  .jm-bigtab { height: 52px; }
  .jm-quick { flex-basis: 38px; height: 38px; }
  .jm-quick img, .jm-quick .jm-quick-fallback { width: 29px; height: 29px; flex-basis: 29px; }
  .jm-hotkeys { flex-basis: 26px; height: 26px; }
  .jm-chat-form { flex-basis: 40px; height: 40px; }
}
@media (max-height: 500px) {
  .jm-scene { flex-basis: 24px; height: 24px; }
  .jm-topbar { flex-basis: 32px; height: 32px; }
  .jm-topbar:after { background: none; }
  .jm-net { top: 9px; font-size: 8px; }
  .jm-stage { min-height: 0; max-height: none; padding-top: 2px; }
  .jm-left { min-height: 0; overflow: hidden; }
  .jm-hero { overflow-y: auto; scrollbar-width: none; }
  .jm-hero::-webkit-scrollbar { display: none; }
  .jm-panel { padding: 4px 5px 24px; }
  .jm-panel-title { bottom: 1px; height: 22px; font-size: 16px; line-height: 22px; }
  .jm-bigtabs { flex-basis: 44px; height: 44px; }
  .jm-bigtab { height: 42px; }
  .jm-quick, .jm-hotkeys { display: none; }
  .jm-chat { min-height: 0; max-height: none; }
  .jm-chat-list { padding: 2px 5px; }
  .jm-chat-line { margin-bottom: 2px; }
  .jm-chat-bubble { padding: 2px 5px; font-size: 10px; }
  .jm-chat-form { flex-basis: 32px; height: 32px; padding: 2px 5px; }
  .jm-chat-form input { height: 26px; }
  .jm-send { height: 26px; font-size: 12px; }
}
@media (max-width: 360px) {
  .jm-avatar-text { font-size: 10px; }
  .jm-power { font-size: 11px; }
  .jm-bigtab { height: 48px; }
  .jm-func { font-size: 12px; }
  .jm-fac { font-size: 13px; }
}

/* 古风皮肤下的提示条：贴近聊天输入条上方，不遮挡聊天内容 */
body.jm-mode .toast {
  top: calc(max(0px, (100dvh - 880px) / 2) + 92px);
  bottom: auto;
}
/* 选中页签保持参考图的蓝色晶体，用亮度与金色光晕区分 */
.jm-bigtab.active { background-position: 0 0; filter: brightness(1.16) drop-shadow(0 0 4px #ffd271); }

/* 战斗态：左侧人物卡收起，右侧面板占满宽度，避免战斗画面被挤压 */
.jm-stage.jm-battle-stage .jm-left { display: none; }
.jm-stage.jm-battle-stage .jm-hero { display: none; }
.jm-stage.jm-battle-stage .jm-panel { padding: 5px 6px 30px; }
.jm-stage.jm-battle-stage .jm-panel-inner { padding: 0 2px; }
.jm-stage.jm-battle-stage .panel-head { margin-bottom: 5px; }
.jm-stage.jm-battle-stage .panel-head h2 { font-size: 17px; letter-spacing: 1px; }
.jm-stage.jm-battle-stage .battle { padding: 8px; }
.jm-stage.jm-battle-stage .battlefield { height: 152px; margin: -8px -8px 8px; }
.jm-stage.jm-battle-stage .battle-log { height: 48px; font-size: 9px; }
.jm-stage.jm-battle-stage .battle-actions { gap: 4px; margin-top: 6px; }
.jm-stage.jm-battle-stage .battle-actions .btn { padding: 7px 3px; font-size: 11px; }
.jm-stage.jm-battle-stage .enemy-intent { font-size: 9px; }

/* 战斗单位保持绝对定位，不被皮肤层覆盖 */
.jm-battlefield .unit { position: absolute; z-index: 2; }
.jm-battlefield .battle-round { position: absolute; z-index: 3; }

/* ---------- 皮肤脚本加载失败时的干净回退（避免原版 JS + 古风 CSS 错位） ---------- */
body.jm-fallback .jm-topbar,
body.jm-fallback .jm-bigtabs,
body.jm-fallback .jm-quick,
body.jm-fallback .jm-hotkeys,
body.jm-fallback .jm-chat,
body.jm-fallback .jm-panel-title,
body.jm-fallback .ambient { display: none !important; }
body.jm-fallback .jm-stage { display: block; height: auto; max-height: none; min-height: 0; padding: 0; background: none; }
body.jm-fallback .jm-left { display: none; }
body.jm-fallback .jm-panel { display: block; padding: 0; background: none; }
body.jm-fallback .jm-panel-inner { display: block; height: auto; overflow: visible; padding: 0; }
body.jm-fallback #bottom-nav { display: flex !important; }
