@font-face {
  font-family: 'Zpix';
  src: url('/zpix.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

:root {
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0f172a;
  background-image: url('/bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #f8fafc;
  line-height: 1.5;
}

* {
  cursor: none !important;
}

#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  pointer-events: none;
  z-index: 999999;
  background-repeat: no-repeat;
  background-position: left top;
  filter: drop-shadow(1px 1px 1.5px rgba(0,0,0,0.5));
  will-change: transform;
  display: none;
}

button {
  font: inherit;
}

code {
  word-break: break-all;
}

.marquee-container {
  width: 100%;
  background: rgba(0, 0, 0, .5);
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
  position: relative;
  z-index: 1001;
  flex-shrink: 0;
}

.marquee-text {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 15s linear infinite;
  color: #FFFF22;
  font-size: 14px;
  font-weight: 500;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Sidebar Removed */

.toolbar p,
.muted {
  margin: 0;
  color: #93a4bd;
}

.panel,
.preview-box,
.detail-box {
  border-radius: 0;
}

.form-select {
  width: 100%;
  background: #172033;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  outline: none;
}

.form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
}

.custom-select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 80px;
}

.maple-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  background-image: 
    url('/api/uiwindow/basic?path=ComboBox/normal/0'),
    url('/api/uiwindow/basic?path=ComboBox/normal/2'),
    url('/api/uiwindow/basic?path=ComboBox/normal/1');
  background-position: left top, right top, 5px top;
  background-repeat: no-repeat, no-repeat, repeat-x;
  background-size: 5px 17px, 18px 17px, calc(100% - 23px) 17px;
  height: 17px;
  border: none;
  padding: 0 20px 0 6px;
  color: #333;
  font-size: 12px;
  font-family: 'Zpix', "SimSun", "宋体", Tahoma, sans-serif;
  -webkit-font-smoothing: none;
  font-smooth: never;
  line-height: 17px;
  outline: none;
  cursor: none;
  width: 100%;
  display: block;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 80px;
}

.maple-select:hover {
  background-image: 
    url('/api/uiwindow/basic?path=ComboBox/mouseOver/0'),
    url('/api/uiwindow/basic?path=ComboBox/mouseOver/2'),
    url('/api/uiwindow/basic?path=ComboBox/mouseOver/1');
  background-position: left top, right top, 5px top;
  background-repeat: no-repeat, no-repeat, repeat-x;
  background-size: 5px 17px, 18px 17px, calc(100% - 23px) 17px;
}

.maple-select:active,
.maple-select:focus,
.custom-select-wrapper.open .maple-select {
  background-image: 
    url('/api/uiwindow/basic?path=ComboBox/pressed/0'),
    url('/api/uiwindow/basic?path=ComboBox/pressed/2'),
    url('/api/uiwindow/basic?path=ComboBox/pressed/1');
  background-position: left top, right top, 5px top;
  background-repeat: no-repeat, no-repeat, repeat-x;
  background-size: 5px 17px, 18px 17px, calc(100% - 23px) 17px;
}

.maple-select:disabled {
  background-image: 
    url('/api/uiwindow/basic?path=ComboBox/disabled/0'),
    url('/api/uiwindow/basic?path=ComboBox/disabled/2'),
    url('/api/uiwindow/basic?path=ComboBox/disabled/1');
  color: #999;
  pointer-events: none;
}

.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #999;
  border-top: none;
  z-index: 10001;
  display: none;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.custom-select-wrapper.open .custom-select-options {
  display: block;
}

.custom-select-option {
  padding: 6px 10px;
  font-size: 12px;
  color: #333;
  font-family: 'Zpix', "SimSun", "宋体", Tahoma, sans-serif;
  -webkit-font-smoothing: none;
  font-smooth: never;
  cursor: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-option:hover,
.custom-select-option.selected {
  background: #0066cc;
  color: #fff;
}

.panel-header h3,
.detail-box h4 {
  margin: 0;
}

.action-button:hover,
.mini-button:hover {
  background: #1f2c45;
}

.content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.toolbar {
  display: none;
}

.panel {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.toolbar h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.action-button,
#reloadBtn,
.mini-button {
  border: 1px solid #3b82f6;
  background: #1d4ed8;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
}

#reloadBtn {
  padding: 10px 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  background: #111827;
  border: 1px solid #243041;
  border-radius: 12px;
  padding: 14px;
}

.summary-card .label {
  color: #93a4bd;
  font-size: 13px;
}

.summary-card .value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}

.panel + .panel {
  margin-top: 16px;
}

.panel-header {
  margin-bottom: 14px;
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  gap: 16px;
}

.overlay-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 0px;
  gap: 16px;
}

@media (max-width: 768px) {
  .overlay-panel {
    gap: 0px !important;
  }
  #worldMapFrameWrapper {
    margin-bottom: -72px !important;
    max-width: 95vw;
  }
  .controls-group {
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 12px !important;
  }
  #versionSelectContainer,
  #fileSelectContainer {
    flex: 1;
    min-width: 80px !important;
  }
  .custom-select-wrapper {
    width: 100%;
  }
}

.overlay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #243041;
  border-radius: 12px;
  background: #0f172a;
}

.overlay-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  color: #cbd5e1;
  font-size: 13px;
}

.overlay-controls select,
.overlay-controls input[type="number"] {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
}

.overlay-controls .checkbox-label {
  flex-direction: row;
  align-items: center;
  min-width: auto;
  padding-top: 22px;
}

.worldmap-frame.new-style {
  position: relative;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: left top;
  background-size: 100% 100%;
  padding: 23px 11px 20px 11px; /* 让新版边框紧紧包裹地图，并且支持动态拉伸 */
}

.worldmap-frame.old-style {
  position: relative;
  display: inline-block;
  background: none;
  z-index: 1000;
  /* 统一的基础间距（响应式） */
  margin-bottom: 12px;
}
@media (max-width: 768px) {
  /* 移动端统一调整所有框的间距 */
  .worldmap-frame.old-style {
    margin-bottom: 12px !important;
  }
  
  /* 移动端主地图框，不留白由 JS 动态计算 scale 负边距控制 */
  #worldMapFrame.worldmap-frame.old-style {
    /* 移除 !important 的 0 边距，允许 JS 动态设置负边距 */
  }
  
  /* 移动端历史版本框等其他框，确保底部不留白 */
  #historyFrame.worldmap-frame.old-style,
  #avatarFrame.worldmap-frame.old-style,
  #donateFrame.worldmap-frame.old-style {
    margin-bottom: 0 !important;
  }
  
  /* 移动端底部选择控件组的边距调整 */
  .controls-group {
    bottom: 10px !important;
  }
}

/* 顶部导航框的特定内边距 */
#topMenuFrame.worldmap-frame.old-style {
  padding: 33px 7px 20px 7px;
}

/* 历史版本、纸娃娃、赞助 等非地图框的特定内边距 */
#historyFrame.worldmap-frame.old-style,
#avatarFrame.worldmap-frame.old-style,
#donateFrame.worldmap-frame.old-style {
  padding: 33px 7px 20px 7px;
}

/* 主世界地图框的特定内边距 */
#worldMapFrame.worldmap-frame.old-style {
  padding: 33px 7px 40px 7px;
  margin-bottom: 0; /* 主地图作为最后一个元素不需要底部 margin */
}

.worldmap-frame.old-style.has-back-btn {
  /* 废弃：统一由 .old-style 控制底部间距 */
}

.worldmap-frame.old-style #worldMapContent {
  background-color: #ffffff; /* 填补主图九宫格中间的透明空洞 */
}

.worldmap-frame.old-style.has-back-btn #worldMapContent {
  /* box-shadow 方法废弃，改用 ::before 伪元素补白 */
}

#worldMapContent {
  position: relative;
  display: block;
  line-height: 0px;
  font-size: 0;
  margin: 0 auto;
}

#worldMapFrame.worldmap-frame.old-style::before,
#avatarFrame.worldmap-frame.old-style::before,
#donateFrame.worldmap-frame.old-style::before {
  content: '';
  position: absolute;
  top: 30px;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background-color: #ffffff;
  z-index: 1;
}

#topMenuFrame.worldmap-frame.old-style::before {
  content: '';
  position: absolute;
  top: 30px;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background-color: #ffffff;
  z-index: 1;
}

#historyFrame.worldmap-frame.old-style::before {
  content: '';
  position: absolute;
  top: 30px;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background-color: #ffffff; /* 之前改为了 transparent，现在恢复白色以修补空洞 */
  z-index: 1;
}

/* 历史版本滚动条样式（冒险岛 VScr4 风格） */
#historyContent {
  /* 隐藏系统默认滚动条 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

#historyContent::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Webkit */
}

/* 轨道背景 */
.mxd-scrollbar-track {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 15px; /* VScr4.img 默认宽度 */
  background-image: url('/api/uiwindow/basic?path=VScr4/enabled/base');
  background-repeat: repeat-y;
  background-position: top center;
  z-index: 3;
}

/* 上下箭头按钮 */
.mxd-scrollbar-btn-up,
.mxd-scrollbar-btn-down {
  position: absolute;
  left: 0;
  width: 15px;
  height: 14px;
  cursor: pointer;
  z-index: 4;
}

.mxd-scrollbar-btn-up {
  top: 0;
  background-image: url('/api/uiwindow/basic?path=VScr4/enabled/prev0');
}
.mxd-scrollbar-btn-up:hover {
  background-image: url('/api/uiwindow/basic?path=VScr4/enabled/prev1');
}
.mxd-scrollbar-btn-up:active {
  background-image: url('/api/uiwindow/basic?path=VScr4/enabled/prev2');
}

.mxd-scrollbar-btn-down {
  bottom: 0;
  background-image: url('/api/uiwindow/basic?path=VScr4/enabled/next0');
}
.mxd-scrollbar-btn-down:hover {
  background-image: url('/api/uiwindow/basic?path=VScr4/enabled/next1');
}
.mxd-scrollbar-btn-down:active {
  background-image: url('/api/uiwindow/basic?path=VScr4/enabled/next2');
}

/* 历史版本、纸娃娃、赞助 等通用内容区包裹 */
.common-panel-wrapper {
  position: relative;
  width: 650px;
  height: 400px;
  background: transparent;
  border-radius: 0;
  box-sizing: border-box;
}

.common-panel-content {
  position: relative;
  padding: 20px;
  color: #333;
  font-size: 12px;
  font-family: 'Zpix', 'SimSun', Tahoma, sans-serif;
  -webkit-font-smoothing: none;
  font-smooth: never;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .common-panel-wrapper {
    width: 88vw;
    height: 400px;
  }
}

/* 历史版本滚动条外层 */
.history-wrapper {
  position: relative;
  width: 650px;
  height: 400px;
  background: transparent;
  border-radius: 0;
  z-index: 2;
  box-sizing: border-box; /* 确保宽高包含 padding，防止溢出撑大外框 */
}

.history-content {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 20px;
  padding-right: 35px;
  color: #333;
  font-size: 12px;
  font-family: 'Zpix', 'SimSun', Tahoma, sans-serif;
  -webkit-font-smoothing: none;
  font-smooth: never;
  overflow-y: scroll;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  box-sizing: border-box;
}
.history-content::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

@media (max-width: 768px) {
  .history-wrapper {
    width: 88vw; /* 移动端自适应宽度 */
    height: 400px; /* 移动端固定高度，防止因为 vh 计算过大顶住导航 */
  }
  
  .history-content {
    padding: 10px;
    padding-right: 25px; /* 给滚动条留点空间 */
  }
  
  .history-row {
    flex-direction: column !important; /* 移动端垂直排列 */
    border-bottom: 1px dashed #eee;
    padding-bottom: 8px;
  }
  
  .history-date {
    width: auto !important;
    margin-bottom: 4px;
    color: #999 !important;
  }
  
  .history-dash {
    display: none !important; /* 移动端隐藏横杠 */
  }
}

/* 滚动滑块 (Thumb) 包含上中下三部分 */
.mxd-scrollbar-thumb {
  position: absolute;
  left: 0;
  width: 15px;
  min-height: 25px; /* thumb高度 */
  cursor: pointer;
  z-index: 4;
  background-image: url('/api/uiwindow/basic?path=VScr4/enabled/thumb0');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

/* 滑块悬停状态 */
.mxd-scrollbar-thumb:hover { background-image: url('/api/uiwindow/basic?path=VScr4/enabled/thumb1'); }

/* 滑块按下状态 */
.mxd-scrollbar-thumb:active { background-image: url('/api/uiwindow/basic?path=VScr4/enabled/thumb2'); }


.border-old {
  position: absolute;
  background-repeat: no-repeat;
  z-index: 1;
}
.border-old.t-l { left: 0; top: 0; width: 7px; height: 33px; }
.border-old.t-c { left: 6px; top: 0; right: 6px; height: 33px; background-repeat: repeat-x; }
.border-old.t-r { right: 0; top: 0; width: 7px; height: 33px; background-position: right top; }
.border-old.m-l { left: 0; top: 32px; bottom: 17px; width: 7px; background-repeat: repeat-y; }
.border-old.m-r { right: 0; top: 32px; bottom: 17px; width: 7px; background-repeat: repeat-y; background-position: right top; }
.border-old.b-l { left: 0; bottom: 0; width: 7px; height: 18px; }
.border-old.b-c { left: 6px; bottom: 0; right: 6px; height: 18px; background-repeat: repeat-x; }
.border-old.b-r { right: 0; bottom: 0; width: 7px; height: 18px; background-position: right top; }
.border-old.title { left: 10px; right: 0; top: 5px; height: 26px; background-position: left top; z-index: 2; }

.menu-item {
  color: #333;
  font-size: 12px;
  font-weight: normal;
  font-family: 'Zpix', "SimSun", "宋体", Tahoma, sans-serif;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-decoration: none;
  cursor: none;
}

.menu-item:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.native-back-btn {
  position: absolute;
  bottom: 16px;
  right: 15px;
  width: 70px;
  height: 19px;
  background-image: url('/api/uiwindow/old?path=Maplebutton/BtReturn/normal/0');
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  z-index: 1000;
  /* display: block; 删除硬编码，让 JS 控制 */
}

.native-back-btn:hover {
  background-image: url('/api/uiwindow/old?path=Maplebutton/BtReturn/mouseOver/0');
}

.native-back-btn:active {
  background-image: url('/api/uiwindow/old?path=Maplebutton/BtReturn/pressed/0');
}

.native-back-btn.disabled {
  background-image: url('/api/uiwindow/old?path=Maplebutton/BtReturn/disabled/0');
}

.overlay-stage {
  position: relative;
  z-index: 2;
  display: inline-block;
  line-height: 0;
  margin: 0;
}

.overlay-stage > img {
  display: block;
  max-width: none;
  border: none;
  background: transparent;
}

.map-marker {
  position: absolute;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  /* 取消这里的 translate(-50%, -50%) 偏移，交给图片本身或内部控制 */
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 50 !important;
}

.cur-pos-anim {
  position: absolute;
  /* 移除相对父级容器的偏移，因为 img 已经基于 origin 进行了绝对定位 */
  top: 0;
  left: 0;
  pointer-events: none;
  display: none;
  z-index: 200 !important;
}

.map-marker.active .cur-pos-anim {
  display: block;
}

.cur-pos-anim img.anim-frame {
  position: absolute;
  display: none;
  /* 确保图片能按原始大小显示，不要限制宽高 */
  max-width: none;
  max-height: none;
}

.cur-pos-anim img.anim-frame.show {
  display: block;
}

.map-icon-img {
  display: block;
}

.map-path-overlay {
  position: absolute;
  display: block;
  padding: 0;
  border: 0 !important;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  box-shadow: none !important;
  opacity: 0;
  z-index: 20 !important;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.map-path-overlay.active,
.map-path-overlay.show-all,
.map-path-overlay:hover {
  opacity: 1;
  pointer-events: auto;
}

.map-path-overlay.active {
}

.map-path-overlay img {
  display: block;
  max-width: none;
  max-height: none;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.map-link-overlay {
  position: absolute;
  cursor: pointer;
  line-height: 0;
  z-index: 30 !important;
}

.map-link-overlay img {
  display: block;
  max-width: none;
  max-height: none;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

.map-link-overlay:hover img {
  opacity: 1;
}

.bgm-status {
  color: #93a4bd;
  font-size: 14px;
  background: #111827;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #243041;
  z-index: 10;
  line-height: 1.5;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

.map-marker:hover,
.map-marker.active,
.map-path-overlay:hover,
.map-path-overlay.active,
.map-link-overlay:hover,
.map-link-overlay.active {
  z-index: 100 !important;
}

.map-marker:hover .map-icon-img,
.map-marker.active .map-icon-img {
  /* Use a brightness/contrast filter or scale for hover effect instead of changing background color */
  transform: scale(1.1);
  transition: all 0.1s ease;
}

.global-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%);
  margin-top: -16px;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  white-space: nowrap;
  text-align: center;
}

.global-tooltip .tooltip-mapid {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.global-tooltip.show {
  opacity: 1;
  visibility: visible;
}

.global-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(17, 24, 39, 0.95) transparent transparent transparent;
}

#screen-transition {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 999;
  pointer-events: none;
  visibility: hidden;
}

.overlay-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: #93a4bd;
  font-size: 13px;
}

.overlay-legend-debug {
  margin-top: -4px;
}

.overlay-empty {
  padding: 16px;
  border: 1px dashed #334155;
  border-radius: 12px;
  color: #93a4bd;
}

.preview-box,
.detail-box {
  padding: 16px;
  min-height: 240px;
}

.preview-box {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
}

.preview-box img {
  max-width: 100%;
  height: auto;
  display: none;
  border: 1px solid #334155;
  background: #0b1220;
}

.detail-meta {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.meta-pill {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #172033;
  border: 1px solid #334155;
}

.field-table,
.map-table {
  width: 100%;
  border-collapse: collapse;
}

.field-table th,
.field-table td,
.map-table th,
.map-table td {
  border-bottom: 1px solid #243041;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.field-table td:last-child,
.map-table td:last-child {
  word-break: break-word;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.card-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.item-card {
  border: 1px solid #243041;
  border-radius: 12px;
  background: #0f172a;
  padding: 12px;
}

.item-card h4 {
  margin: 0 0 8px;
}

.item-card.is-active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

.item-card img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  margin: 10px 0;
  border: 1px solid #334155;
  background: #111827;
}

.mini-button {
  margin-top: 8px;
  padding: 8px 10px;
}

.map-table tr.is-active td {
  background: rgba(29, 78, 216, 0.18);
}

.tree-root details {
  border-left: 1px solid #243041;
  margin-left: 10px;
  padding-left: 10px;
}

.tree-root summary {
  cursor: pointer;
  padding: 4px 0;
}

.tree-leaf {
  padding: 4px 0 4px 20px;
}

.tree-path {
  color: #93a4bd;
  font-size: 12px;
  margin-left: 8px;
}

.empty,
.error-box {
  padding: 16px;
  border-radius: 12px;
  background: #0f172a;
  border: 1px dashed #334155;
  color: #93a4bd;
}

.error-box {
  color: #fecaca;
  border-color: #7f1d1d;
  background: #2a1212;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .toolbar .controls-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
    /* 去除强制的行内样式干扰 */
    align-items: stretch !important;
  }
  
  .toolbar .controls-group span.muted {
    display: none; /* 在手机上隐藏标签以节省空间 */
  }
  
  .toolbar select,
  .toolbar button {
    flex: 1;
    min-width: 80px;
    height: 36px !important; /* 加大触控区域 */
    font-size: 14px !important;
  }
  
  .overlay-panel {
    /* 不依靠滑动，而是让内容在面板内部居中或从顶部开始，并且隐藏多余的滚动条（因为我们要用 scale 缩放） */
    overflow: hidden;
    align-items: center;
    justify-content: center;
  }
  
  /* 允许外框自然排布，我们将在 JS 里根据屏幕宽度和外框实际宽度动态计算缩放比例 */
  .worldmap-frame {
    transform-origin: center center;
    margin: 0; 
  }
  
  /* 针对移动端，可以把小箭头加回来或者保持隐藏，因为现在是跟随点击位置了，为了美观我们恢复它 */
  .global-tooltip::after {
    display: block;
  }
}
