:root {
  --bg-deep: #160d08;
  --bg-board: #20140c;
  --cell-bg-grad: linear-gradient(145deg, #8a5f39, #6f4728);
  --cell-border: #4a2f1a;
  --dungeon-border: #881337;
  --topbar-h: 56px;
  --sidebar-w: 320px;
  --gold: #eab308;
  --gold-glow: rgba(234, 179, 8, 0.4);
  --text-main: #f5eedb;
  --text-dim: #b8ad96;
  --text-mute: #7d725d;
  --zoom-inv: 1;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  user-select: none;
}

button, input {
  font-family: inherit;
  color: inherit;
}

/* ---------------- 顶部导航栏 ---------------- */
.topbar {
  height: var(--topbar-h);
  background: linear-gradient(180deg, #1c110a, #140c07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  position: relative;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #241710;
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-toggle:hover {
  color: var(--gold);
  background: #332015;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.logo-title em {
  font-style: normal;
  color: var(--gold);
  margin-left: 4px;
}

.logo-sub {
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.4px;
}

/* 时代切换 */
.era-seg {
  display: flex;
  background: #110905;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px;
}

.era-btn {
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-dim);
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.era-btn:hover {
  color: #fff;
}

.era-btn.on {
  background: linear-gradient(180deg, #4d331c, #362211);
  color: var(--gold);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* 全收集进度 */
.progress-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.prog-txt {
  color: var(--text-mute);
}

.prog-num {
  font-weight: 700;
  color: var(--gold);
}

.prog-pct {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 10px;
}

.progress-bar-bg {
  width: 100%;
  height: 5px;
  background: #110905;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ca8a04, #facc15);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-done-lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}

.toggle-done-lbl input {
  accent-color: var(--gold);
  cursor: pointer;
}

.btn-edit-mode {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(234, 179, 8, 0.4);
  background: #241710;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-edit-mode:hover {
  background: #3d2618;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.btn-edit-mode.on {
  background: linear-gradient(180deg, #ca8a04, #a16207);
  color: #fff;
  border-color: #facc15;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.6);
}

.btn-guide {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(234, 179, 8, 0.55);
  background: linear-gradient(180deg, #3a2a12, #241710);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-guide:hover {
  background: #3d2618;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.35);
}

.btn-lang {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #241710;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-lang:hover {
  color: var(--gold);
}

/* ---------------- 页面主体 ---------------- */
.main-wrap {
  display: flex;
  height: calc(100% - var(--topbar-h));
  position: relative;
}

/* ---------------- 左侧分类面板 (GamerGuides) ---------------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #18100a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.6);
}

.sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-w));
}

.search-box {
  padding: 12px 14px 8px;
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 24px;
  top: 22px;
  color: var(--text-mute);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f0a06;
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus {
  border-color: var(--gold);
}

.search-results {
  position: absolute;
  top: 54px;
  left: 14px;
  right: 14px;
  background: #241710;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  z-index: 100;
}

.search-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-item:hover {
  background: #332015;
}

.search-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-area {
  font-size: 10.5px;
  color: var(--gold);
}

.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.action-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.action-btns button {
  font-size: 11px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.action-btns button:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.cat-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.cat-item:hover {
  background: #2a1a11;
  color: #fff;
}

.cat-item.active {
  color: #fff;
}

.cat-item input[type="checkbox"] {
  accent-color: var(--gold);
  cursor: pointer;
}

.cat-icon-slot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
}

.cat-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #110905;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gold);
  font-weight: 600;
}

.jump-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  background: #140c07;
}

.jump-header {
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.jump-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 110px;
  overflow-y: auto;
}

.jump-chip {
  padding: 3px 8px;
  border-radius: 12px;
  background: #22150d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.12s;
}

.jump-chip:hover {
  color: var(--gold);
  background: #332015;
}

/* ---------------- 地图画板与思维导图拓扑网络 ---------------- */
.map-stage {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: var(--bg-board);
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  cursor: grab;
}

.map-stage:active {
  cursor: grabbing;
}

.map-viewport {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* 拓扑导图大画布 */
.mindmap-board {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
  transform-style: flat;
  backface-visibility: hidden;
}

/* SVG 连线层 */
.topology-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: visible;
}

.edge-path {
  fill: none;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.2s, stroke-width 0.2s, filter 0.2s;
  pointer-events: stroke;
  cursor: pointer;
}

.edge-hitarea {
  fill: none;
  stroke: transparent;
  stroke-width: 28px;
  vector-effect: non-scaling-stroke;
  pointer-events: stroke;
  cursor: pointer;
}

.edge-path.main {
  stroke: #d99a4e;
  stroke-width: 4px;
  stroke-linecap: round;
}

.edge-path.dungeon {
  stroke: #f43f5e;
  stroke-width: 4px;
  stroke-dasharray: 8 5;
  stroke-linecap: round;
}

.edge-path.shortcut {
  stroke: #06b6d4;
  stroke-width: 3.5px;
  stroke-dasharray: 8 6;
  animation: shortcutFlow 2s linear infinite;
}

@keyframes shortcutFlow {
  from { stroke-dashoffset: 28; }
  to { stroke-dashoffset: 0; }
}

.edge-path:hover,
.edge-path.highlight {
  stroke: var(--gold) !important;
  stroke-width: 7px !important;
  filter: drop-shadow(0 0 16px var(--gold)) !important;
}

/* 连线路标小标签 (出入口名称高亮徽章) */
.edge-label-group {
  pointer-events: all;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.edge-label-group:hover {
  filter: drop-shadow(0 0 12px var(--gold));
}

.edge-label-group:hover .edge-label-bg {
  stroke: var(--gold);
  stroke-width: 2px;
}

.edge-label {
  font-size: 12.5px;
  font-weight: 700;
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: central;
  letter-spacing: 0.5px;
}

.edge-label-bg {
  fill: rgba(14, 9, 5, 0.94);
  stroke: rgba(234, 179, 8, 0.45);
  stroke-width: 1.2px;
  rx: 8;
}

/* 出入口与近道悬浮说明框 (双向跳转) */
.edge-tooltip {
  position: absolute;
  z-index: 85;
  background: rgba(18, 11, 7, 0.96);
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.85), 0 0 18px var(--gold-glow);
  pointer-events: none;
  max-width: 320px;
  transform: translate(-50%, -120%);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.edge-tt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.edge-tt-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.edge-tt-badge.main {
  background: rgba(234, 179, 8, 0.2);
  color: var(--gold);
  border-color: rgba(234, 179, 8, 0.4);
}

.edge-tt-badge.dungeon {
  background: rgba(244, 63, 94, 0.25);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.4);
}

.edge-tt-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.edge-tt-route {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}

.edge-tt-desc {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 8px;
}

.edge-tt-hint {
  font-size: 10.5px;
  color: #38bdf8;
  font-weight: 600;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
}

/* 点位校准模式工具条 */
.calibration-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 12, 8, 0.96);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9), 0 0 20px var(--gold-glow);
  z-index: 100;
  animation: slideDown 0.25s ease;
}

.cal-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.cal-desc {
  font-size: 11.5px;
  color: var(--text-dim);
}

.cal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.cal-actions button {
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #332015;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.cal-actions button:hover {
  background: var(--gold);
  color: #1a0f07;
}

/* 处于校准模式时的 pin 交互样式 */
body.cal-mode .map-pin {
  cursor: grab !important;
  filter: drop-shadow(0 0 8px #f59e0b) !important;
}

body.cal-mode .map-pin:active {
  cursor: grabbing !important;
  transform: translate(-50%, -50%) scale(1.35) !important;
}

/* 节点层 */
.nodes-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* 单个区域与迷宫节点卡片 */
.node-card {
  position: absolute;
  pointer-events: auto;
  background: var(--cell-bg-grad);
  border: 2px solid var(--cell-border);
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  overflow: visible;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.node-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--gold);
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.8), 0 0 12px var(--gold-glow);
  z-index: 35;
}

/* 中心海拉鲁平原突出加粗金边 */
.node-card.type-hub {
  border-color: #ca8a04;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(202, 138, 4, 0.3);
}

/* 地下城神殿节点特别标识 (红宝石神殿边框与典雅羊皮纸底色) */
.node-card.type-dungeon {
  border-color: #e11d48;
  background: linear-gradient(145deg, #6c422a, #4e2919);
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 16px rgba(225, 29, 72, 0.35);
}

/* 节点顶部胶囊标签 (自适应缩放保真，保证导图文字恒久清晰) */
.node-header {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%) scale(clamp(1, calc(var(--zoom-inv) * 0.72), 2.2));
  transform-origin: center bottom;
  background: rgba(14, 9, 5, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 14px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.node-card.type-dungeon .node-header {
  border-color: #f43f5e;
  color: #fecdd3;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}

.node-badge-type {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(234, 179, 8, 0.25);
  color: var(--gold);
  font-weight: 700;
}

.node-card.type-dungeon .node-badge-type {
  background: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

/* 神殿地下城楼层切换标签栏 (GamerGuides 风格) */
.floor-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) scale(clamp(0.8, calc(var(--zoom-inv) * 0.6), 1.6));
  transform-origin: center bottom;
  display: flex;
  background: rgba(14, 9, 5, 0.94);
  border: 1.5px solid rgba(225, 29, 72, 0.5);
  border-radius: 12px;
  padding: 2px 4px;
  gap: 3px;
  z-index: 32;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85);
  pointer-events: auto;
}

.floor-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.floor-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.floor-btn.active {
  background: linear-gradient(180deg, #e11d48, #9f1239);
  color: #fff;
  box-shadow: 0 1px 6px rgba(225, 29, 72, 0.6);
}

/* 区域地图原画 */
.node-map-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* 节点内部点位层 */
.node-pins {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
}

/* Pin 点位标记 (合理限制最小与最大倍率，防止过大遮盖或过小看不清) */
.map-pin {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(clamp(0.65, calc(var(--zoom-inv) * 0.45), 1.6));
  transform-origin: 50% 50%;
  transition: filter 0.15s ease, opacity 0.2s ease;
  z-index: 30;
}

.map-pin:hover {
  z-index: 45;
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.95)) brightness(1.2);
}

.map-pin.selected {
  z-index: 50;
  filter: drop-shadow(0 0 14px #38bdf8) brightness(1.3);
  animation: pinPulse 1.5s infinite;
}

.map-pin.done {
  opacity: 0.35;
  filter: grayscale(0.85);
}

.map-pin.done:hover {
  opacity: 0.85;
  filter: grayscale(0.2);
}

@keyframes pinPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(calc(clamp(0.65, calc(var(--zoom-inv) * 0.45), 1.6) * 1.15)); }
  50% { transform: translate(-50%, -50%) scale(calc(clamp(0.65, calc(var(--zoom-inv) * 0.45), 1.6) * 1.35)); }
}

/* ---------------- 缩放控件 ---------------- */
.zoom-controls {
  position: absolute;
  right: 18px;
  bottom: 24px;
  background: #1c110a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  z-index: 40;
}

.zoom-controls button {
  width: 38px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.12s;
}

.zoom-controls button:hover {
  background: #2a1a11;
  color: var(--gold);
}

#zoomPercent {
  font-size: 10px;
  color: var(--text-mute);
  text-align: center;
  padding: 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: monospace;
}

/* ---------------- 详情卡片 ---------------- */
.detail-card {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 360px;
  max-width: calc(100% - 40px);
  background: rgba(28, 17, 11, 0.94);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  z-index: 50;
  animation: slideInCard 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

@keyframes slideInCard {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.12s;
}

.card-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-right: 24px;
}

.card-icon-wrap {
  flex: 0 0 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.card-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.tag-cat {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(234, 179, 8, 0.18);
  color: var(--gold);
}

.tag-era, .tag-time {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.card-area {
  font-size: 11.5px;
  color: var(--text-mute);
}

.card-body {
  margin: 12px 0 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
}

.card-req-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(234, 179, 8, 0.1);
  border-left: 3px solid var(--gold);
  padding: 6px 8px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 10px;
  font-size: 12px;
}

.req-label {
  color: var(--gold);
  font-weight: 600;
}

.req-val {
  color: #fff;
  font-weight: 500;
}

.card-desc {
  color: var(--text-dim);
  font-size: 12.5px;
  white-space: pre-line;
}

.card-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.card-collect-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.2);
  transition: all 0.15s;
}

.card-collect-btn:hover {
  background: rgba(234, 179, 8, 0.2);
}

.card-collect-btn input {
  accent-color: var(--gold);
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* -------------------------------------------------------------
   出入口与传送门标记 (Gateways / Portals)
   ------------------------------------------------------------- */
.node-gateways {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 26;
}

.map-gateway {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(clamp(0.7, calc(var(--zoom-inv) * 0.5), 1.3));
  transform-origin: 50% 50%;
  z-index: 32;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid #d99a4e;
  border-radius: 14px;
  box-shadow: 0 0 10px rgba(217, 154, 78, 0.45), 0 2px 6px rgba(0, 0, 0, 0.6);
  color: #fef08a;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-gateway .gateway-icon {
  font-size: 12px;
  display: inline-block;
  filter: drop-shadow(0 0 4px #eab308);
}

.map-gateway .gateway-label {
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.map-gateway:hover {
  z-index: 48;
  background: rgba(30, 41, 59, 0.96);
  border-color: #fde047;
  color: #fff;
  transform: translate(-50%, -50%) scale(calc(clamp(0.7, calc(var(--zoom-inv) * 0.5), 1.3) * 1.18));
  box-shadow: 0 0 16px rgba(253, 224, 71, 0.85), 0 4px 12px rgba(0, 0, 0, 0.8);
}

.map-gateway.highlight {
  border-color: #38bdf8;
  color: #e0f2fe;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.9);
  animation: gatewayPulse 1.2s infinite;
}

@keyframes gatewayPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(calc(clamp(0.7, calc(var(--zoom-inv) * 0.5), 1.3) * 1.05)); }
  50% { transform: translate(-50%, -50%) scale(calc(clamp(0.7, calc(var(--zoom-inv) * 0.5), 1.3) * 1.25)); }
}


/* ==========================================================================
   全局兜底：hidden 属性必须真正隐藏（曾因 .calibration-toast 的 display:flex
   覆盖 [hidden]，导致校准提示条在首页常显）
   ========================================================================== */
[hidden] { display: none !important; }

/* 页脚版本徽章（版本号由 app.js 的 APP_VERSION 单一真源渲染） */
.ver-badge {
  position: absolute;
  left: 12px;
  bottom: 8px;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--text-mute);
  background: rgba(20, 12, 8, .72);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  padding: 3px 8px;
  z-index: 35;
  pointer-events: none;
}

/* ==========================================================================
   移动端第一版（≤900 抽屉侧栏 / 底部详情卡；≤600 精简顶栏）
   ========================================================================== */
@media (max-width: 900px) {
  .main-wrap { height: calc(100% - var(--topbar-h)); }

  .topbar {
    gap: 8px;
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .topbar::-webkit-scrollbar { display: none; }
  .topbar-left { flex: 0 0 auto; }
  .logo-text .logo-sub { display: none; }
  .progress-box { flex: 0 0 auto; min-width: 104px; }
  .topbar-right { margin-left: auto; flex: 0 0 auto; }

  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    flex: 0 0 auto;
    margin-left: 0;
    transform: translateX(0);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    z-index: 60;
  }
  .sidebar.collapsed {
    margin-left: 0;
    transform: translateX(-100%);
  }

  .map-stage { width: 100%; }

  .detail-card {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    max-width: none;
    max-height: 46vh;
    overflow-y: auto;
    padding: 14px;
  }

  .zoom-controls { right: 10px; bottom: 44px; }
  .zoom-controls button { width: 44px; height: 42px; }

  .calibration-toast {
    left: 8px;
    right: 8px;
    top: 8px;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
  }
  .cal-actions { flex-wrap: wrap; justify-content: center; }

  .edge-tooltip { left: 8px !important; right: 8px; max-width: none; }
  .ver-badge { left: 8px; bottom: 8px; }
}

@media (max-width: 600px) {
  .logo-sub { display: none; }
  .progress-info .prog-txt { display: none; }
  .btn-guide, .btn-edit-mode, .btn-lang, .toggle-done-lbl {
    font-size: 11px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .jump-chips { flex-wrap: nowrap; overflow-x: auto; }
  .detail-card { max-height: 52vh; }
}

/* 移动端顶栏收口（防止时代按钮被挤成竖排） */
@media (max-width: 900px) {
  .logo-title { white-space: nowrap; font-size: 12px; }
  .logo-title em { display: none; }
  .era-seg { flex: 0 0 auto; }
  .era-btn { white-space: nowrap; }
  .progress-box { flex: 0 0 auto; }
  .topbar-right { flex: 0 0 auto; }
}

/* 详情卡窄屏收口：防止长坐标/英文实例名把卡片撑出屏幕 */
@media (max-width: 900px) {
  .detail-card { max-width: calc(100vw - 16px); }
  .card-desc, .card-req-row { overflow-wrap: anywhere; word-break: break-word; }
}

/* 双模式补充：区域模式下详情卡必须让出楼层条与缩放控件 */
@media (max-width: 900px) {
  body[data-view="region"] .detail-card {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    max-height: 48vh;
  }
  body[data-view="region"] .zoom-controls {
    bottom: 96px;
    right: 12px;
  }
  body[data-view="region"] .ver-badge {
    left: 12px;
    bottom: 6px;
    font-size: 9px;
  }
}

/* ===== 区域单图模式（双模式 V0.2） ===== */
/* ==========================================================================
   区域单图模式（V0.2 双模式）
   ========================================================================== */
.view-seg {
  display: flex;
  background: #110905;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px;
  flex: 0 0 auto;
}
.view-seg button {
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-dim);
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}
.view-seg button.on {
  background: linear-gradient(180deg, #4d331c, #362211);
  color: var(--gold);
  font-weight: 700;
}

.region-panel {
  padding: 6px 12px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 2px 6px;
}
.panel-head .action-title { margin: 0; }
.panel-head .action-title em {
  font-style: normal;
  color: var(--gold);
  font-size: 11px;
}
.panel-toggle,
.cat-toggle {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #241710;
  color: var(--text-dim);
  border-radius: 6px;
  font-size: 10px;
  padding: 3px 7px;
  cursor: pointer;
}
.panel-toggle:hover,
.cat-toggle:hover { color: var(--gold); border-color: rgba(234, 179, 8, 0.4); }
.region-group-title {
  display: flex;
  justify-content: space-between;
  color: var(--text-mute);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 7px 4px 4px;
}
.region-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
}
#regionDungeonList { grid-template-columns: 1fr; max-height: 265px; }
.region-list::-webkit-scrollbar { width: 5px; }
.region-list::-webkit-scrollbar-thumb { background: #3a2616; border-radius: 99px; }
.region-item {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #cfc4ad;
  font-size: 11px;
  line-height: 1.35;
  cursor: pointer;
  overflow: hidden;
}
.region-item span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.region-item:hover { background: #241710; }
.region-item.on {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.17), rgba(234, 179, 8, 0.02));
  border-color: rgba(234, 179, 8, 0.22);
  color: var(--gold);
}
.region-item em {
  margin-left: auto;
  font-style: normal;
  font-size: 9px;
  color: var(--text-mute);
}
.region-item.on em { color: var(--gold); }
.region-item .region-floors {
  font-size: 8px;
  color: var(--text-mute);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0 3px;
  flex: 0 0 auto;
}
.region-note {
  font-size: 10px;
  line-height: 1.6;
  color: var(--text-mute);
  padding: 8px 4px 4px;
}

.region-board {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  background:
    radial-gradient(900px 600px at 55% 30%, rgba(234, 179, 8, 0.045), transparent 65%),
    #120b07;
}
.region-board.dragging { cursor: grabbing; }
.region-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}
.region-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.region-world img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 4px;
  filter: saturate(0.95) contrast(1.02);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.region-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}
.region-pins .map-pin {
  transform: translate(-50%, -50%) scale(var(--region-inv, 1));
}
.region-pins .map-pin.selected {
  animation: none;
  transform: translate(-50%, -50%) scale(calc(var(--region-inv, 1) * 1.18));
}
.region-head {
  position: absolute;
  left: 24px;
  top: 18px;
  z-index: 9;
  pointer-events: none;
}
.region-kicker {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
}
.region-head h2 {
  margin: 2px 0 2px;
  font-size: 22px;
  letter-spacing: 1px;
  text-shadow: 0 2px 14px #000;
}
.region-sub {
  font-size: 11px;
  color: var(--text-dim);
  text-shadow: 0 1px 8px #000;
}
.region-floor-bar {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  max-width: 60%;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(20, 12, 7, 0.9);
  backdrop-filter: blur(8px);
  z-index: 10;
  scrollbar-width: none;
}
.region-floor-bar::-webkit-scrollbar { display: none; }
.region-floor-btn {
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
}
.region-floor-btn:hover { color: #fff; }
.region-floor-btn.on {
  background: rgba(234, 179, 8, 0.16);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.3);
}
.region-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 14px 20px;
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 10px;
  background: rgba(20, 12, 7, 0.92);
  color: var(--gold);
  font-size: 13px;
  z-index: 15;
}
.region-list-empty {
  padding: 10px 8px;
  font-size: 11px;
  color: var(--text-mute);
}

@media (max-width: 1100px) {
  .view-seg button { padding: 5px 8px; font-size: 11px; }
  .logo-text { display: none; }
}

@media (max-width: 900px) {
  .view-seg { display: none; }
  .sidebar .region-panel { padding-top: 2px; }
  .region-list { max-height: 150px; }
  .region-head { left: 14px; top: 12px; }
  .region-head h2 { font-size: 17px; }
  .region-floor-bar { top: 78px; left: 14px; right: 14px; transform: none; max-width: none; }
}

@media (max-width: 600px) {
  .region-head h2 { font-size: 15px; }
  .region-sub { font-size: 10px; }
  .zip-bar { max-width: 100%; }
}

/* 页脚版本徽章（内容由 app.js 的 APP_VERSION 渲染） */
.ver-badge {
  position: absolute;
  left: 18px;
  bottom: 10px;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--text-mute);
  z-index: 35;
}
.ver-badge b { color: var(--gold); }

@media (max-width: 900px) {
  .ver-badge { left: 12px; bottom: 6px; font-size: 9px; }
}

/* 移动端：详情卡改为底部面板（不遮挡楼层条） */
@media (max-width: 900px) {
  .detail-card {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    max-height: 52%;
  }
  .zoom-controls { bottom: 84px; right: 12px; }
}

.mode-fab {
  position: absolute;
  left: 18px;
  bottom: 38px;
  z-index: 40;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid rgba(234, 179, 8, 0.38);
  background: rgba(24, 16, 10, 0.92);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.5px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}
.mode-fab:hover {
  background: rgba(234, 179, 8, 0.15);
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.3);
}

@media (max-width: 900px) {
  .mode-fab { left: 12px; bottom: 30px; padding: 7px 11px; font-size: 10px; }
}

/* ==========================================================================
   P1 界面骨架：无顶栏 / 左侧视图 tabs / 左下设置 / 全图预览
   ========================================================================== */
.main-wrap {
  height: 100%;
  height: 100dvh;
}

@keyframes boardIn { from { opacity: .55; } to { opacity: 1; } }
.region-board,
.mindmap-board,
.world-board { animation: boardIn .18s ease-out both; }

.sidebar {
  height: 100%;
  overflow: hidden;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}
.side-brand .logo { flex: 1; min-width: 0; }
.side-brand .logo-text { display: flex; }
.side-brand .logo-title { font-size: 14px; }
.side-brand .logo-title em { display: inline; }
.side-brand .logo-sub { font-size: 9px; letter-spacing: 1.4px; }
.side-brand .icon-toggle {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  flex: 0 0 auto;
}

.side-open {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 70;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid rgba(234, 179, 8, 0.35);
  background: rgba(24, 16, 10, 0.94);
  color: var(--gold);
  display: none;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}
body.side-collapsed .side-open { display: grid; }

.view-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}
.view-tab {
  width: 100%;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 9px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.view-tab:hover { background: #241710; color: #fff; }
.view-tab.on {
  background: linear-gradient(90deg, rgba(234, 179, 8, .16), rgba(234, 179, 8, .025));
  border-color: rgba(234, 179, 8, .18);
  border-left-color: var(--gold);
  color: var(--gold);
}
.vt-ico { display: grid; place-items: center; color: currentColor; }
.vt-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vt-copy b { font-size: 12.5px; font-weight: 700; letter-spacing: .4px; }
.vt-copy small { font-size: 9.5px; color: var(--text-mute); letter-spacing: .2px; }
.view-tab.on .vt-copy small { color: rgba(234, 179, 8, .75); }
.vt-meta { font-size: 9.5px; color: var(--text-mute); white-space: nowrap; }
.view-tab.on .vt-meta { color: var(--gold); }

.side-era {
  margin: 8px 12px 6px;
  flex: 0 0 auto;
}
.side-era .era-btn { flex: 1 1 0; padding: 6px 0; }

/* 区域列表限高，给分类列表留出可读空间 */
.region-panel {
  max-height: 330px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.region-list { max-height: none; }
#regionDungeonList { max-height: none; }

.side-foot {
  margin-top: auto;
  padding: 9px 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #140c07;
  flex: 0 0 auto;
}
.side-foot .progress-box { min-width: 0; }

.world-board {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(900px 600px at 50% 50%, rgba(234, 179, 8, .06), transparent 72%),
    #0d0805;
}
.world-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}
.world-canvas {
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
}
.world-canvas > img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
}
.world-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 16px;
  border: 1px solid rgba(234, 179, 8, .35);
  border-radius: 8px;
  background: rgba(16, 10, 6, .9);
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 1px;
  z-index: 6;
  animation: worldPulse 1.2s ease-in-out infinite;
}
@keyframes worldPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.world-pins { position: absolute; inset: 0; }

.world-seal {
  position: absolute;
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  --pct: 0;
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), rgba(234, 179, 8, .2) 0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .75);
  transform: translate(-50%, -50%) scale(var(--world-inv, 1));
  transform-origin: 50% 50%;
  transition: transform .15s;
}
.world-seal::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #1a110a;
  border: 1px solid rgba(234, 179, 8, .45);
}
.world-seal .ws-mark {
  position: relative;
  z-index: 1;
  font: 700 10px/1 var(--font-ui, "Noto Sans SC", sans-serif);
  color: var(--gold);
}
.world-seal:hover { transform: translate(-50%, -50%) scale(calc(var(--world-inv, 1) * 1.14)); }
.ws-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(234, 179, 8, .45);
  border-radius: 5px;
  background: rgba(16, 10, 6, .95);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 5;
}
.ws-label b { font-size: 8px; color: var(--text-mute); font-weight: 600; }
.ws-label em { font-style: normal; }
.world-seal:hover .ws-label,
.world-seal:focus-visible .ws-label { opacity: 1; }

.world-entry {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(var(--world-inv, 1));
  transform-origin: 50% 50%;
  transition: transform .15s;
  z-index: 2;
}
.world-entry::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(192, 132, 252, .9);
  background: rgba(45, 20, 60, .94);
  transform: rotate(45deg);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .8);
}
.world-entry:hover { transform: translate(-50%, -50%) scale(calc(var(--world-inv, 1) * 1.16)); }
.world-entry .we-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #e9d5ff;
  font-size: 9px;
  line-height: 1;
}
.world-entry .ws-label {
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
}
.world-entry:hover .ws-label { opacity: 1; }

.world-caption {
  position: absolute;
  left: 70px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(16, 10, 6, .84);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .55);
  backdrop-filter: blur(5px);
  pointer-events: none;
  z-index: 5;
}
.world-caption span { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.world-caption small { font-size: 10px; color: var(--text-mute); }

.settings-btn {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 40;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(234, 179, 8, .35);
  background: rgba(24, 16, 10, .94);
  color: var(--gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .65);
  backdrop-filter: blur(6px);
}
.settings-btn:hover { background: rgba(234, 179, 8, .14); }

.settings-panel {
  position: absolute;
  left: 16px;
  bottom: 62px;
  z-index: 90;
  width: 248px;
  border: 1px solid rgba(234, 179, 8, .35);
  border-radius: 10px;
  background: rgba(20, 12, 8, .97);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .8);
  backdrop-filter: blur(10px);
  padding: 8px;
}
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
}
.settings-head button {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
}
.setting-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.setting-row:hover { background: #2a1a11; color: #fff; }
.setting-row em { font-style: normal; font-size: 10px; color: var(--text-mute); }
.setting-row input { accent-color: var(--gold); cursor: pointer; }
.settings-version {
  margin: 6px 4px 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--text-mute);
}

body[data-view="world"] #filterActions,
body[data-view="world"] #catList { display: none; }
body.side-collapsed .region-head { left: 64px; }
body.side-collapsed .world-caption { left: 64px; }

/* P1.1 视图 tabs 改为一行三枚；侧栏改为覆盖层，收起/展开不再挤压地图 */
.view-tabs {
  flex-direction: row;
  gap: 5px;
  padding: 8px 10px 7px;
}
.view-tab {
  flex: 1 1 0;
  width: auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px 2px;
  border: 1px solid transparent;
  border-left: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 7px;
  text-align: center;
}
.view-tab:hover { background: #241710; }
.view-tab.on {
  border-color: rgba(234, 179, 8, .18);
  border-left-color: rgba(234, 179, 8, .18);
  border-bottom-color: var(--gold);
}
.view-tab .vt-ico svg { width: 14px; height: 14px; }
.view-tab .vt-copy { display: block; }
.view-tab .vt-copy b { font-size: 11.5px; letter-spacing: .2px; white-space: nowrap; }
.view-tab .vt-copy small,
.view-tab .vt-meta { display: none; }

@media (min-width: 901px) {
  .main-wrap { display: block; }
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    margin-left: 0;
    transform: translateX(0);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    z-index: 40;
  }
  .sidebar.collapsed {
    margin-left: 0;
    transform: translateX(-100%);
    box-shadow: none;
  }
  .map-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .region-head { left: calc(var(--sidebar-w) + 22px); }
  .world-caption { left: calc(var(--sidebar-w) + 22px); }
  .settings-btn { left: calc(var(--sidebar-w) + 16px); }
  .settings-panel { left: calc(var(--sidebar-w) + 16px); }
  body.side-collapsed .region-head { left: 70px; }
  body.side-collapsed .world-caption { left: 70px; }
  body.side-collapsed .settings-btn { left: 16px; }
  body.side-collapsed .settings-panel { left: 16px; }
}

@media (max-width: 900px) {
  .main-wrap { height: 100%; height: 100dvh; }
  .side-brand { padding-top: 14px; }
  .view-tabs { padding: 7px 8px; }
  .view-tab { padding: 8px 1px; gap: 3px; }
  .view-tab .vt-ico svg { width: 13px; height: 13px; }
  .view-tab .vt-copy b { font-size: 11px; }
  .side-era { margin: 7px 10px 4px; }
  .side-foot { padding: 8px 12px 10px; }
  .region-panel { max-height: 270px; }
  .settings-btn { left: 12px; bottom: 12px; width: 40px; height: 40px; }
  .settings-panel { left: 12px; bottom: 58px; width: min(76vw, 260px); }
  .side-open { left: 12px; top: 12px; }
  body.side-collapsed .region-head { left: 60px; top: 14px; }
  body.side-collapsed .world-caption { left: 60px; bottom: 16px; }
  .world-seal { width: 24px; height: 24px; margin: 0; }
  .world-seal::before { inset: 3px; }
  .world-seal .ws-mark { font-size: 8px; }
  .world-entry { width: 17px; height: 17px; margin: 0; }
  .world-entry .we-mark { font-size: 7px; }
  .world-caption { max-width: calc(100vw - 84px); padding: 7px 10px; }
  .world-caption span { font-size: 13px; }
  .world-caption small { font-size: 9px; }
}




