/* ============================
   单词勇者 - 全部样式
   ============================ */

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
:root {
  --primary: #ff6b6b;
  --secondary: #4ecdc4;
  --accent: #ffe66d;
  --dark: #2c3e50;
  --light: #ecf0f1;
  --shadow: 0 4px 12px rgba(0,0,0,0.15);
}

html, body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, Arial, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  user-select: none;
  color: var(--dark);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font-family: inherit; cursor: pointer; border:none; }

/* ============= 角色卡（顶部常驻） ============= */
.hero-card {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #fff 0%, #fff8e7 100%);
  border-bottom: 3px solid var(--primary);
  box-shadow: var(--shadow);
}
.hero-avatar {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  background: radial-gradient(circle, #ffe66d 0%, #ff9f43 100%);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255,159,67,0.6);
}
.hero-info { flex: 1; min-width: 0; }
.hero-name { display:flex; align-items:center; gap:8px; font-weight:bold; font-size:16px; }
.hero-title {
  font-size: 12px;
  padding: 2px 8px;
  background: var(--accent);
  border-radius: 10px;
  color: var(--dark);
}
.hero-level {
  font-size: 12px;
  color: var(--primary);
  font-weight: bold;
  margin-top: 2px;
}
.exp-bar {
  position: relative;
  height: 10px;
  background: #ddd;
  border-radius: 5px;
  overflow: hidden;
  margin-top: 4px;
}
.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4 0%, #44a3aa 100%);
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.exp-bar-text {
  position: absolute; left:0; right:0; top:50%;
  transform: translateY(-50%);
  font-size: 9px;
  text-align: center;
  color: #2c3e50;
  font-weight: bold;
  text-shadow: 0 0 2px #fff;
}
.hero-stats { display:flex; gap:12px; font-size:14px; font-weight:bold; }
.stat-item { padding: 6px 12px; border-radius: 12px; background: #f0f0f0; }
.stat-gem { background: linear-gradient(135deg, #ffe66d 0%, #ff9f43 100%); color:#fff; }
.stat-power { background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%); color:#fff; }

/* ============= 主舞台 ============= */
.stage {
  max-width: 1100px;
  margin: 16px auto;
  padding: 16px;
}
.page-title {
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  margin: 16px 0 8px;
  text-shadow: 2px 2px 0 #fff;
}
.page-subtitle { text-align:center; color:#555; margin-bottom: 20px; }

/* ============= 大地图 ============= */
.world-map {
  background: linear-gradient(180deg, #87ceeb 0%, #98d8a8 100%);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  min-height: 400px;
}
.map-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.world-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}
.world-tab {
  padding: 8px 16px;
  background: #fff;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid transparent;
}
.world-tab.active { background: var(--primary); color: #fff; border-color: var(--accent); }
.world-tab.locked { opacity: 0.4; cursor:not-allowed; }

.theme-zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.zone-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
}
.zone-card:hover { transform: translateY(-4px); }
.zone-card.unlocked { border-color: var(--secondary); }
.zone-card.locked { opacity: 0.5; cursor: not-allowed; }
.zone-icon { font-size: 44px; text-align: center; }
.zone-name { font-size: 18px; font-weight: bold; text-align: center; margin: 6px 0; }
.zone-desc { font-size: 12px; color: #888; text-align: center; margin-bottom: 6px; }
.zone-progress {
  height: 8px; background: #eee; border-radius: 4px; overflow:hidden;
}
.zone-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4 0%, #44a3aa 100%);
}

/* 怪入口（练习入口） */
.monster-list { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:10px; }
.monster-chip {
  font-size: 22px;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  background: #f7f7f7;
  transition: transform 0.15s;
}
.monster-chip:hover { transform: scale(1.2); }
.monster-chip.mastered { opacity: 0.4; }
.monster-chip.elite { box-shadow: 0 0 6px #ff9f43; }

/* ============= 主页快捷入口 ============= */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.quick-btn {
  background: #fff;
  padding: 16px;
  border-radius: 14px;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.quick-btn:hover { transform: translateY(-3px); }
.quick-btn .quick-icon { font-size: 32px; display:block; margin-bottom: 6px; }
.quick-btn.flame { background: linear-gradient(135deg, #ff6b6b 0%, #c0392b 100%); color: #fff; }
.quick-btn.tower { background: linear-gradient(135deg, #6c5ce7 0%, #4834d4 100%); color: #fff; }
.quick-btn.final  { background: linear-gradient(135deg, #ff9f43 0%, #ee5a24 100%); color: #fff; }
.quick-btn.thunder { background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%); color: #fff; }

/* ============= 模态通用 ============= */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display:flex; align-items:center; justify-content:center;
  z-index: 200;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal > * {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
}
.close-btn {
  background: #eee;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 12px;
  width: 100%;
}
.close-btn.close-top {
  position: absolute; top: 10px; right: 10px;
  width: auto; padding: 4px 10px;
  margin: 0; font-size: 18px;
}
.primary-btn {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a3aa 100%);
  color: #fff;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
}

/* ============= 战斗模态 ============= */
.battle-panel {
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%) !important;
  color: #fff;
  padding: 20px !important;
}
.battle-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.battle-enemy, .battle-player { text-align:center; }
.enemy-portrait, .player-portrait {
  font-size: 64px;
  display: inline-block;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}
.enemy-portrait { animation: enemyIdle 1.5s ease-in-out infinite; }
@keyframes enemyIdle {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.enemy-name, .player-name { font-weight:bold; margin-top: 4px; }
.enemy-hp-bar, .player-hp-bar {
  height: 12px;
  background: #555;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 6px;
}
.enemy-hp-fill { height:100%; background: linear-gradient(90deg, #ff6b6b 0%, #c0392b 100%); transition: width 0.3s; }
.player-hp-fill { height:100%; background: linear-gradient(90deg, #4ecdc4 0%, #16a085 100%); transition: width 0.3s; }
.enemy-hp-text, .player-hp-text { font-size: 11px; margin-top: 2px; color: #ecf0f1; }

.battle-vs { font-size: 36px; }
.battle-question {
  text-align: center;
  background: rgba(255,255,255,0.1);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.qtype-icon { font-size: 44px; }
.qtype-prompt { margin: 6px 0; font-size: 14px; color: #ffe66d; }
.qtype-target {
  font-size: 28px;
  font-weight: bold;
  margin: 8px 0;
  min-height: 36px;
}
.qtype-listen {
  background: var(--accent);
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--dark);
  font-size: 14px;
  font-weight: bold;
}

.battle-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.battle-options button {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.95);
  color: var(--dark);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}
.battle-options button:hover:not(:disabled) {
  transform: scale(1.05);
  background: #ffe66d;
}
.battle-options button.correct {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  color: #fff;
}
.battle-options button.wrong {
  background: linear-gradient(135deg, #d63031 0%, #e17055 100%);
  color: #fff;
}
.battle-options button:disabled { cursor: not-allowed; opacity: 0.7; }

.battle-spell {
  display: flex; gap: 8px; align-items: center;
}
.battle-spell input {
  flex: 1;
  padding: 14px;
  font-size: 18px;
  border-radius: 10px;
  border: 2px solid #fff;
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.battle-spell input::placeholder { color: rgba(255,255,255,0.5); }
.battle-spell button {
  padding: 14px 18px;
  background: var(--accent);
  color: var(--dark);
  font-weight: bold;
  border-radius: 10px;
  font-size: 16px;
}

.battle-judge {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.battle-judge button {
  padding: 16px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
}
#judge-yes { background: linear-gradient(135deg, #00b894 0%, #00cec9 100%); color: #fff; }
#judge-no { background: linear-gradient(135deg, #d63031 0%, #e17055 100%); color: #fff; }

.battle-feedback {
  text-align: center;
  margin-top: 12px;
  min-height: 24px;
  font-weight: bold;
  font-size: 16px;
}
.battle-feedback.dmg-enemy { color: #ff6b6b; }
.battle-feedback.dmg-player { color: #e17055; }
.battle-feedback.heal { color: #4ecdc4; }
.battle-feedback.gem { color: #ffe66d; }

.battle-combo {
  position: absolute;
  top: 20%; left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  font-weight: bold;
  color: #ffe66d;
  text-shadow: 2px 2px 0 #d63031;
  animation: comboPop 0.6s ease-out forwards;
}
@keyframes comboPop {
  0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
  50% { transform: translateX(-50%) scale(1.4); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 0; }
}

/* ============= 副本大厅 ============= */
.dungeon-panel h2 { text-align:center; margin-bottom: 6px; }
.dungeon-subtitle { text-align:center; color:#888; font-size:13px; margin-bottom: 16px; }
.dungeon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dungeon-card {
  padding: 16px;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s;
}
.dungeon-card:hover { transform: translateY(-3px); }
.dungeon-card .dun-icon { font-size: 36px; }
.dungeon-card .dun-name { font-weight: bold; margin: 6px 0; font-size: 16px; }
.dungeon-card .dun-desc { font-size: 12px; opacity: 0.9; }
.dungeon-card.dun-flame { background: linear-gradient(135deg, #ff6b6b 0%, #c0392b 100%); }
.dungeon-card.dun-month { background: linear-gradient(135deg, #00b894 0%, #00cec9 100%); }
.dungeon-card.dun-thunder { background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%); }
.dungeon-card.dun-precision { background: linear-gradient(135deg, #6c5ce7 0%, #4834d4 100%); }
.dungeon-card.dun-final { background: linear-gradient(135deg, #ff9f43 0%, #ee5a24 100%); }
.dungeon-card.dun-grade { background: linear-gradient(135deg, #00cec9 0%, #0984e3 100%); }

/* ============= 角色详情 ============= */
.profile-avatar-big {
  font-size: 88px;
  text-align: center;
  margin: 10px 0;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}
.profile-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f9f9f9;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}
.profile-info div span:first-child { color: #888; margin-right: 4px; }

.equip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.equip-slot {
  background: #f7f7f7;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
}
.equip-slot.empty { color: #aaa; }
.equip-slot .eq-icon { font-size: 28px; }
.equip-slot .eq-name { font-size: 12px; font-weight: bold; }
.equip-slot .eq-rarity { font-size: 10px; padding: 1px 6px; border-radius: 6px; display:inline-block; margin-top: 2px; }
.rarity-white { color: #aaa; }
.rarity-green { color: #27ae60; }
.rarity-blue { color: #2980b9; }
.rarity-purple { color: #8e44ad; }
.rarity-orange { color: #e67e22; }
.equip-slot.equipped { border: 2px solid var(--accent); }

.shop-tip { font-size: 12px; color:#888; text-align:center; margin-bottom: 10px; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.shop-item {
  background: #fff8e7;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
}
.shop-item:hover { background: #ffe66d; }
.shop-item .eq-icon { font-size: 30px; }

/* ============= 单词详情卡 ============= */
.word-big {
  font-size: 44px;
  font-weight: bold;
  color: var(--primary);
  text-align: center;
  margin-top: 6px;
}
.word-phonetic { text-align:center; color:#888; font-size: 18px; margin: 6px 0; }
.big-listen {
  display: block; margin: 10px auto;
  padding: 8px 20px;
  background: var(--accent);
  border-radius: 20px;
  font-size: 16px;
  font-weight: bold;
}
.word-zh { text-align:center; font-size: 22px; margin: 10px 0; }
.word-meta {
  display: flex; justify-content: space-around;
  background: #f9f9f9;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}
.word-actions { margin-top: 14px; }
.word-actions button {
  width: 100%;
  padding: 10px;
  background: #ffe66d;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
}

/* ============= 结算 ============= */
.result-panel { text-align: center; }
.result-panel h2 { font-size: 32px; margin-bottom: 14px; }
.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  text-align: left;
}
.result-stats .stat {
  background: #f7f7f7;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}
.result-stats .stat .label { color: #888; font-size: 12px; }
.result-stats .stat .val { font-size: 20px; font-weight: bold; }

/* ============= 浮动通知 ============= */
.toast {
  position: fixed; top: 80px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-weight: bold;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  font-size: 14px;
  max-width: 90%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============= 庆祝动画 ============= */
.celebrate {
  position: fixed; inset: 0;
  display:flex; align-items:center; justify-content:center;
  background: rgba(255,230,109,0.3);
  z-index: 250;
  pointer-events: none;
  animation: celebrateFlash 0.6s;
}
@keyframes celebrateFlash {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* ============= 横屏强制 + 触摸放大 ============= */
/* 竖屏时给提示，全屏 game 强制横屏。手机访问时建议旋转。 */
@media (orientation: portrait) and (max-width: 900px) {
  #portrait-tip {
    display: flex !important;
  }
  .stage, .hero-card, .toast { display: none !important; }
}

#portrait-tip {
  display: none;
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #ff6b6b 0%, #ffe66d 100%);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 20px;
}
#portrait-tip .rotate-icon {
  font-size: 80px;
  animation: rotateIcon 2s ease-in-out infinite;
}
@keyframes rotateIcon {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(90deg); }
}
#portrait-tip h2 { font-size: 22px; margin: 16px 0 8px; }
#portrait-tip p { font-size: 14px; opacity: 0.9; }

/* iPhone 安全区 */
.hero-card { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* 防止 iOS 输入框被缩放 */
input { font-size: 16px !important; }

/* 防止双击缩放和长按选择 */
* { touch-action: manipulation; }
img, button { -webkit-user-drag: none; }

@media (max-width: 900px) and (orientation: landscape) {
  /* 横屏手机：紧凑布局，按钮要大 */
  :root { font-size: 14px; }
  .hero-card { padding: 6px 12px; gap: 8px; }
  .hero-avatar { width: 44px; height: 44px; font-size: 32px; }
  .hero-name { font-size: 14px; }
  .hero-title { font-size: 11px; }
  .hero-level { font-size: 11px; }
  .hero-stats { font-size: 12px; gap: 6px; }
  .stat-item { padding: 4px 8px; }
  .page-title { font-size: 20px; margin: 8px 0 4px; }
  .page-subtitle { font-size: 12px; margin-bottom: 8px; }
  .stage { padding: 8px; margin: 8px auto; }

  .world-map { padding: 12px; min-height: auto; }
  .world-tabs { gap: 4px; margin-bottom: 10px; }
  .world-tab { padding: 6px 10px; font-size: 12px; }

  .theme-zones {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
  }
  .zone-card { padding: 8px; }
  .zone-icon { font-size: 28px; }
  .zone-name { font-size: 14px; margin: 2px 0; }
  .zone-desc { font-size: 11px; }
  .monster-list { gap: 4px; }
  .monster-chip { font-size: 18px; padding: 2px; }

  .quick-actions {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 8px;
  }
  .quick-btn { padding: 10px 8px; font-size: 13px; }
  .quick-btn .quick-icon { font-size: 24px; margin-bottom: 2px; }

  /* 战斗 */
  .battle-panel { padding: 12px !important; }
  .battle-header { gap: 8px; margin-bottom: 8px; }
  .enemy-portrait, .player-portrait { font-size: 44px; }
  .battle-vs { font-size: 24px; }
  .battle-question { padding: 10px; margin-bottom: 8px; }
  .qtype-icon { font-size: 28px; }
  .qtype-prompt { font-size: 12px; }
  .qtype-target { font-size: 18px; min-height: 24px; }
  .qtype-listen { padding: 4px 10px; font-size: 12px; }

  .battle-options {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .battle-options button {
    padding: 14px 8px;
    font-size: 18px;
    min-height: 48px;  /* 触控够大 */
  }

  .battle-spell input {
    padding: 14px;
    font-size: 18px;
    min-height: 48px;
  }
  .battle-spell button {
    padding: 14px;
    min-height: 48px;
  }
  .battle-judge button { padding: 16px; font-size: 16px; min-height: 52px; }

  /* 模态 */
  .modal { padding: 8px; }
  .modal > * { padding: 14px; max-height: 95vh; }

  /* 大地图按钮 */
  .map-title-row { flex-wrap: wrap; gap: 8px; }
  .map-title-row button { font-size: 13px; padding: 6px 12px !important; }

  h3 { font-size: 14px; margin-top: 12px !important; }

  /* 装备 / 商店 */
  .equip-grid { gap: 6px; }
  .equip-slot { padding: 6px; }
  .equip-slot .eq-icon { font-size: 22px; }
  .shop-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .shop-item { padding: 6px; }
}

@media (max-width: 700px) and (orientation: landscape) {
  /* 小屏横屏：更紧凑 */
  .theme-zones { grid-template-columns: repeat(3, 1fr); }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .battle-options { grid-template-columns: 1fr 1fr; }
}

/* iPad 平板横屏：宽松些 */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
  .theme-zones { grid-template-columns: repeat(3, 1fr); }
  .battle-options button { font-size: 22px; padding: 20px; }
}

/* === 深色主题（角色界面 / 战略板）覆盖原有粉橙背景 === */
body.theme-dark {
  background: #0a1018 !important;
  background-image: none !important;
}
body.theme-dark #stage {
  background: transparent !important;
}
body.theme-dark .toast {
  background: rgba(20,30,40,0.95);
  color: #ffe66d;
  border: 1px solid #4ecdc4;
}
/* 让 bot-nav 在最底部，不被遮挡 */
body.theme-dark .char-page,
body.theme-dark .board-page {
  padding-bottom: 80px !important;
}

/* ============================================================
   世界地图（worldmap.js）· 羊皮纸魔兽风
   ============================================================ */
.world-container {
  position: relative;
  margin: 16px auto;
  max-width: 1280px;
  background: #f4e4bc;
  border-radius: 4px;
  padding: 20px;
  border: 6px solid #8a6a2a;
  box-shadow: 0 8px 32px rgba(80, 50, 0, 0.4),
              inset 0 0 60px rgba(120, 80, 30, 0.2);
}
.parchment-bg {
  position: absolute;
  inset: 6px;
  background:
    radial-gradient(ellipse at top left, rgba(120, 80, 30, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(120, 80, 30, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at center, rgba(120, 80, 30, 0.08) 0%, transparent 70%),
    repeating-linear-gradient(45deg, transparent, transparent 80px, rgba(120, 80, 30, 0.04) 80px, rgba(120, 80, 30, 0.04) 82px),
    linear-gradient(180deg, #f8e8c0 0%, #e8d49a 100%);
  border-radius: 2px;
  pointer-events: none;
}
.parchment-edge {
  position: absolute;
  left: 6px; right: 6px;
  height: 30px;
  background:
    radial-gradient(ellipse, rgba(120, 80, 30, 0.3) 0%, transparent 70%);
  pointer-events: none;
}
.parchment-edge.top { top: 6px; }
.parchment-edge.bottom { bottom: 6px; transform: scaleY(-1); }

#world-svg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  position: relative;
  z-index: 1;
}
.place-clickable { cursor: pointer; transition: opacity 0.2s; }
.place-clickable:hover { opacity: 0.85; filter: brightness(1.1); }

/* 大陆信息卡 */
.land-info-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 320px;
  background: #f4e4bc;
  border: 3px solid #8a6a2a;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(60, 40, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 10;
}
.land-info-panel.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.land-info-close {
  position: absolute; top: 8px; right: 8px;
  background: #8a6a2a; color: #f4e4bc;
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-weight: bold;
}
.li-band {
  display: inline-block;
  background: #8a6a2a;
  color: #f4e4bc;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.land-info-panel h2 { font-size: 22px; color: #3a2818; margin: 4px 0; }
.li-place { font-size: 14px; color: #5a3a1a; font-style: italic; margin-bottom: 8px; }
.li-desc { font-size: 13px; color: #3a2818; opacity: 0.85; line-height: 1.5; margin-bottom: 10px; }
.li-badge {
  display: inline-block;
  background: #aa2a2a;
  color: #f4e4bc;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 10px;
}
.li-progress { margin: 12px 0; }
.li-progress-bar {
  height: 6px;
  background: rgba(58, 40, 24, 0.3);
  border-radius: 3px;
  overflow: hidden;
}
.li-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #8a6a2a 0%, #d4a83a 100%);
}
.li-progress-text { font-size: 11px; color: #5a3a1a; margin-top: 4px; }
.li-actions { display: flex; gap: 6px; margin-top: 12px; }
.li-btn {
  flex: 1;
  padding: 8px;
  border-radius: 4px;
  background: rgba(138, 106, 42, 0.15);
  border: 1px solid #8a6a2a;
  color: #3a2818;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
}
.li-btn.primary {
  background: linear-gradient(135deg, #d4a83a 0%, #8a6a2a 100%);
  color: #fff;
  border: none;
}

/* ============================================================
   卫星图风格世界地图
   ============================================================ */
.map-container {
  position: relative;
  margin: 12px 0;
  background: #0a2030;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #2a4a6a;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.map-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}
.map-scroll::-webkit-scrollbar { height: 8px; }
.map-scroll::-webkit-scrollbar-track { background: #1a2a3a; }
.map-scroll::-webkit-scrollbar-thumb { background: #5a4a3a; border-radius: 4px; }

#world-svg {
  display: block;
  min-width: 100%;
  user-select: none;
}
.land-clickable { cursor: pointer; transition: transform 0.2s; transform-origin: center; transform-box: fill-box; }
.land-clickable:hover { filter: brightness(1.2); }

/* HUD 左上 */
.map-hud-tl {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 20, 30, 0.85);
  color: #ffe66d;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #4a5a6a;
  font-family: "Courier New", monospace;
  pointer-events: none;
  max-width: 240px;
}
.hud-title {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.hud-coord {
  font-size: 10px;
  opacity: 0.6;
  margin-bottom: 8px;
}
.hud-status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.hud-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ecdc4;
  box-shadow: 0 0 6px #4ecdc4;
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{ opacity:1 } 50%{ opacity:0.3 } }
.hud-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
}
.hud-stats > div {
  background: rgba(255,255,255,0.08);
  padding: 4px 2px;
  border-radius: 4px;
}
.hs-num { display: block; font-size: 14px; font-weight: bold; color: #ffe66d; }
.hs-lbl { display: block; font-size: 9px; opacity: 0.6; }

/* 缩略图右下 */
.map-minimap {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 180px;
  background: rgba(10, 20, 30, 0.9);
  border: 1px solid #4a5a6a;
  border-radius: 8px;
  padding: 6px;
  cursor: crosshair;
  pointer-events: auto;
}
.minimap-label {
  font-size: 9px;
  color: #ffe66d;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 4px;
  font-family: "Courier New", monospace;
}
.map-minimap svg { width: 100%; height: 60px; display: block; }

/* 大陆信息卡 */
.land-info-panel {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%) translateX(120%);
  width: 280px;
  background: rgba(10, 20, 30, 0.95);
  color: #fff;
  border: 2px solid #ffe66d;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transition: transform 0.3s;
  z-index: 5;
}
.land-info-panel.show { transform: translateY(-50%) translateX(0); }
.land-info-close {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
}
.li-header { margin-bottom: 12px; }
.li-band {
  display: inline-block;
  background: rgba(255,230,109,0.2);
  color: #ffe66d;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  margin-bottom: 6px;
}
.li-header h2 { margin: 4px 0; font-size: 22px; color: #ffe66d; }
.li-place { font-size: 13px; color: rgba(255,255,255,0.7); }

.li-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
}
.li-stats > div {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.06);
  padding: 6px;
  border-radius: 4px;
}
.li-lbl { font-size: 10px; opacity: 0.6; }
.li-val { font-weight: bold; color: #ffe66d; }

.li-progress-bar {
  height: 6px;
  background: rgba(0,0,0,0.5);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.li-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4 0%, #ffe66d 100%);
  transition: width 0.4s;
}

.li-actions {
  display: flex;
  gap: 6px;
}
.li-btn {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
}
.li-btn.primary { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); }
.li-btn:hover { background: rgba(255,255,255,0.2); }
.li-btn.primary:hover { background: linear-gradient(135deg, #ee5a24 0%, #d65a3a 100%); }

/* 横屏适配 */
@media (max-width: 900px) and (orientation: landscape) {
  .map-hud-tl { max-width: 200px; padding: 6px 10px; }
  .hud-title { font-size: 11px; }
  .hud-coord, .hud-status { font-size: 10px; }
  .hs-num { font-size: 12px; }
  .hs-lbl { font-size: 8px; }
  .map-minimap { width: 140px; }
  .map-minimap svg { height: 48px; }
  .land-info-panel { width: 240px; right: 8px; }
}

/* ============================================================
   角色界面（character.js）· 战略板地图（board.js）通用色调
   配色变量：黑蓝紫 + 绿色高亮 + 红色警告
   ============================================================ */
:root {
  --bg-darkest: #0a1018;
  --bg-dark: #0f1820;
  --bg-mid: #1a2530;
  --bg-card: #2a3540;
  --line: #3a4855;
  --green-main: #4ecdc4;
  --green-bright: #ffe66d;
  --red-warn: #ff6b6b;
  --purple-main: #a29bfe;
  --text-main: #e0e6ed;
  --text-dim: #8a9aaa;
}

/* ======= 顶部 / 底部 nav（三角洲风）======= */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex;
  z-index: 300;
  background: linear-gradient(135deg, rgba(20,30,40,0.98) 0%, rgba(30,40,60,0.98) 100%);
  border-bottom: 2px solid var(--green-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  padding: 6px 10px;
  gap: 4px;
  align-items: center;
}
.top-nav-left {
  display: flex; align-items: center; gap: 10px;
  margin-right: 14px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}
.tn-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: var(--green-bright);
  cursor: pointer;
  font-size: 16px;
}
.tn-title {
  font-size: 14px;
  color: var(--green-bright);
  font-weight: bold;
  letter-spacing: 2px;
}
.tn-sub { font-size: 11px; color: var(--text-dim); }

.top-nav-right {
  display: flex; gap: 2px;
}
.tn-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  min-width: 56px;
  color: var(--text-dim);
  transition: background 0.2s;
}
.tn-item:hover { background: rgba(78,205,196,0.15); color: var(--green-main); }
.tn-item.active {
  background: linear-gradient(180deg, rgba(78,205,196,0.2) 0%, transparent 100%);
  color: var(--green-bright);
  border-bottom: 2px solid var(--green-main);
}
.tn-icon { font-size: 18px; }
.tn-label { font-size: 10px; margin-top: 2px; }
.tn-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  font-size: 10px;
  text-align: center;
  line-height: 16px;
  font-weight: bold;
}
.badge-num { background: var(--red-warn); color: #fff; }
.badge-new { background: var(--green-bright); color: #000; }

.bot-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  background: linear-gradient(180deg, rgba(20,30,40,0.95) 0%, rgba(10,15,25,0.98) 100%);
  border-top: 2px solid var(--green-main);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.4);
  padding: 6px;
  z-index: 300;
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--text-dim);
  border-radius: 6px;
  transition: background 0.2s;
}
.bn-item:hover { background: rgba(78,205,196,0.15); }
.bn-item.active {
  color: var(--green-bright);
  background: linear-gradient(0deg, rgba(78,205,196,0.2) 0%, transparent 100%);
  border-top: 2px solid var(--green-main);
}
.bn-icon { font-size: 22px; }
.bn-label { font-size: 10px; margin-top: 2px; }

/* ======= 角色界面 — 极简 + 全身立绘 ======= */
.char-page {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0;
  padding: 56px 16px 64px;
  background: linear-gradient(180deg, #0a1018 0%, #0f1820 100%);
  min-height: calc(100vh - 130px);
}

/* 中央 */
.char-stage {
  position: relative;
  background:
    radial-gradient(ellipse at center 70%, rgba(78,205,196,0.12) 0%, transparent 70%),
    linear-gradient(180deg, #0a1525 0%, #0a1018 100%);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}
.char-stage-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(78,205,196,0.05) 50%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, rgba(78,205,196,0.05) 50%, transparent 50.5%);
  background-size: 50px 50px;
  pointer-events: none;
}

/* 名字 + Lv + 经验 */
.char-header {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}
.char-name-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.char-name {
  font-size: 28px;
  font-weight: bold;
  color: var(--green-bright);
  text-shadow: 0 0 14px rgba(255,230,109,0.4);
  letter-spacing: 2px;
}
.char-lv {
  font-size: 14px;
  color: var(--green-main);
}
.char-lv b {
  font-size: 18px;
  color: var(--green-bright);
}
.char-rank {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.char-exp {
  width: 240px;
  height: 4px;
  background: rgba(0,0,0,0.6);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}
.ce-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4 0%, #ffe66d 100%);
  transition: width 0.4s;
}

/* 桃桃全身立绘 */
.char-figure-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}
.char-glow {
  position: absolute;
  width: 220px; height: 80px;
  background: radial-gradient(ellipse, rgba(78,205,196,0.25) 0%, transparent 70%);
  bottom: 30px;
  pointer-events: none;
  animation: charGlow 2.5s ease-in-out infinite;
}
@keyframes charGlow {
  0%,100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.1); opacity: 0.5; }
}
.char-figure {
  width: 180px;
  height: 280px;
  animation: charIdle 3.5s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.5));
}
@keyframes charIdle {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 行前备战按钮 */
.char-deploy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 280px;
  padding: 16px 24px;
  margin: 0 auto;
  background: linear-gradient(135deg, #4ecdc4 0%, #2a8a7a 100%);
  color: #000;
  font-size: 18px;
  font-weight: bold;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 6px;
  box-shadow: 0 8px 20px rgba(78,205,196,0.5);
  transition: transform 0.2s;
}
.char-deploy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(78,205,196,0.6);
}

/* 右侧极简信息 */
.char-mini-info {
  background: rgba(20,30,40,0.6);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 12px;
}
.cmi-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  padding: 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
}
.cmi-icon { font-size: 18px; }
.cmi-val { color: var(--green-bright); }

.cmi-btn {
  padding: 8px;
  border-radius: 6px;
  background: rgba(78,205,196,0.15);
  border: 1px solid var(--green-main);
  color: var(--green-bright);
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
}

/* === 横屏适配 === */
@media (max-width: 900px) and (orientation: landscape) {
  .char-page { grid-template-columns: 1fr 140px; padding: 50px 8px 60px; }
  .char-figure { width: 140px; height: 220px; }
  .char-name { font-size: 22px; }
  .char-deploy-btn { width: 200px; font-size: 16px; letter-spacing: 4px; padding: 12px; }
  .char-mini-info { padding: 10px; margin-left: 8px; }
  .cmi-row { padding: 6px; font-size: 12px; }
}

/* === 旧的 board-page 保留 === */

/* === 深色主题（角色界面 / 战略板）覆盖原有粉橙背景 === */
body.theme-dark {
  background: #0a1018 !important;
  background-image: none !important;
}
body.theme-dark #stage {
  background: transparent !important;
}
body.theme-dark .toast {
  background: rgba(20,30,40,0.95);
  color: #ffe66d;
  border: 1px solid #4ecdc4;
}
/* 让 bot-nav 在最底部，不被遮挡 */
body.theme-dark .char-page,
body.theme-dark .board-page {
  padding-bottom: 80px !important;
}

/* ============================================================
   世界地图（worldmap.js）专属样式
   ============================================================ */
.world-header {
  text-align: center;
  margin-bottom: 20px;
}
.world-header .page-title {
  font-size: 32px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #f39c12 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  text-shadow: none;
}

.world-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 600px;
  margin: 12px auto;
}
.ws-item {
  background: rgba(255,255,255,0.95);
  padding: 10px 6px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ws-num {
  display: block;
  font-size: 22px;
  font-weight: bold;
  color: #e67e22;
  line-height: 1;
}
.ws-label {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.lands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 8px;
}

.land-card {
  position: relative;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 4px solid transparent;
  background: var(--land-color, #ccc);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.land-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}
.land-card.locked {
  opacity: 0.6;
  filter: grayscale(80%);
}
.land-card.current {
  border-color: #ffe66d;
  animation: pulseBorder 2s ease-in-out infinite;
}
@keyframes pulseBorder {
  0%,100% { box-shadow: 0 6px 18px rgba(0,0,0,0.15), 0 0 0 0 #ffe66d; }
  50%     { box-shadow: 0 6px 18px rgba(0,0,0,0.15), 0 0 0 8px rgba(255,230,109,0.3); }
}
.land-card.completed::after {
  content: '👑';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.land-band {
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 11px;
  padding: 4px 0;
  text-align: center;
  font-weight: bold;
  letter-spacing: 2px;
}
.land-icon {
  font-size: 48px;
  text-align: center;
  padding: 14px 0 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.land-name {
  text-align: center;
  font-weight: bold;
  color: #fff;
  font-size: 18px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  padding: 0 6px;
}
.land-place {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  padding: 2px 6px 10px;
}

.land-snap {
  background: rgba(255,255,255,0.95);
  margin: 0 6px;
  border-radius: 10px;
  padding: 8px;
  font-size: 12px;
}
.snap-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.snap-row span { color: #888; }
.snap-row b { color: var(--land-dark, #333); }

.land-progress {
  height: 8px;
  background: rgba(255,255,255,0.3);
  margin: 10px 10px 4px;
  border-radius: 4px;
  overflow: hidden;
}
.land-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffe66d 0%, #f39c12 100%);
  transition: width 0.4s;
}
.land-progress-text {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.95);
  padding-bottom: 4px;
}

.land-go-btn {
  display: block;
  width: calc(100% - 20px);
  margin: 8px 10px 12px;
  padding: 10px;
  background: rgba(255,255,255,0.95);
  color: var(--land-dark, #333);
  border-radius: 10px;
  font-weight: bold;
  font-size: 14px;
  border: 2px solid rgba(0,0,0,0.1);
}
.land-go-btn:hover { background: #ffe66d; }

.land-badge {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.95);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  color: #27ae60;
  font-weight: bold;
}

.land-lock-cover {
  text-align: center;
  color: rgba(255,255,255,0.85);
  padding: 20px 10px;
}
.lock-icon { font-size: 36px; opacity: 0.6; }
.lock-text { font-size: 11px; margin-top: 6px; }

.world-legend {
  text-align: center;
  margin-top: 20px;
  color: rgba(0,0,0,0.6);
  font-size: 13px;
}
.legend-tip {
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.7;
}

/* 横屏适配（iPhone 安卓） */
@media (max-width: 900px) and (orientation: landscape) {
  .world-header .page-title { font-size: 22px; }
  .world-stats { max-width: 400px; }
  .ws-num { font-size: 16px; }
  .ws-label { font-size: 10px; }
  .lands-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .land-icon { font-size: 32px; padding: 8px 0 4px; }
  .land-name { font-size: 14px; }
  .land-place { font-size: 11px; }
  .land-snap { padding: 4px 6px; font-size: 10px; }
  .land-go-btn { padding: 6px; font-size: 12px; }
}

/* ============================================================
   卫星图风格世界地图
   ============================================================ */
.map-container {
  position: relative;
  margin: 12px 0;
  background: #0a2030;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #2a4a6a;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.map-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}
.map-scroll::-webkit-scrollbar { height: 8px; }
.map-scroll::-webkit-scrollbar-track { background: #1a2a3a; }
.map-scroll::-webkit-scrollbar-thumb { background: #5a4a3a; border-radius: 4px; }

#world-svg {
  display: block;
  min-width: 100%;
  user-select: none;
}
.land-clickable { cursor: pointer; transition: transform 0.2s; transform-origin: center; transform-box: fill-box; }
.land-clickable:hover { filter: brightness(1.2); }

/* HUD 左上 */
.map-hud-tl {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 20, 30, 0.85);
  color: #ffe66d;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #4a5a6a;
  font-family: "Courier New", monospace;
  pointer-events: none;
  max-width: 240px;
}
.hud-title {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.hud-coord {
  font-size: 10px;
  opacity: 0.6;
  margin-bottom: 8px;
}
.hud-status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.hud-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ecdc4;
  box-shadow: 0 0 6px #4ecdc4;
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{ opacity:1 } 50%{ opacity:0.3 } }
.hud-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
}
.hud-stats > div {
  background: rgba(255,255,255,0.08);
  padding: 4px 2px;
  border-radius: 4px;
}
.hs-num { display: block; font-size: 14px; font-weight: bold; color: #ffe66d; }
.hs-lbl { display: block; font-size: 9px; opacity: 0.6; }

/* 缩略图右下 */
.map-minimap {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 180px;
  background: rgba(10, 20, 30, 0.9);
  border: 1px solid #4a5a6a;
  border-radius: 8px;
  padding: 6px;
  cursor: crosshair;
  pointer-events: auto;
}
.minimap-label {
  font-size: 9px;
  color: #ffe66d;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 4px;
  font-family: "Courier New", monospace;
}
.map-minimap svg { width: 100%; height: 60px; display: block; }

/* 大陆信息卡 */
.land-info-panel {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%) translateX(120%);
  width: 280px;
  background: rgba(10, 20, 30, 0.95);
  color: #fff;
  border: 2px solid #ffe66d;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transition: transform 0.3s;
  z-index: 5;
}
.land-info-panel.show { transform: translateY(-50%) translateX(0); }
.land-info-close {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
}
.li-header { margin-bottom: 12px; }
.li-band {
  display: inline-block;
  background: rgba(255,230,109,0.2);
  color: #ffe66d;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  margin-bottom: 6px;
}
.li-header h2 { margin: 4px 0; font-size: 22px; color: #ffe66d; }
.li-place { font-size: 13px; color: rgba(255,255,255,0.7); }

.li-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
}
.li-stats > div {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.06);
  padding: 6px;
  border-radius: 4px;
}
.li-lbl { font-size: 10px; opacity: 0.6; }
.li-val { font-weight: bold; color: #ffe66d; }

.li-progress-bar {
  height: 6px;
  background: rgba(0,0,0,0.5);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.li-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4 0%, #ffe66d 100%);
  transition: width 0.4s;
}

.li-actions {
  display: flex;
  gap: 6px;
}
.li-btn {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
}
.li-btn.primary { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); }
.li-btn:hover { background: rgba(255,255,255,0.2); }
.li-btn.primary:hover { background: linear-gradient(135deg, #ee5a24 0%, #d65a3a 100%); }

/* 横屏适配 */
@media (max-width: 900px) and (orientation: landscape) {
  .map-hud-tl { max-width: 200px; padding: 6px 10px; }
  .hud-title { font-size: 11px; }
  .hud-coord, .hud-status { font-size: 10px; }
  .hs-num { font-size: 12px; }
  .hs-lbl { font-size: 8px; }
  .map-minimap { width: 140px; }
  .map-minimap svg { height: 48px; }
  .land-info-panel { width: 240px; right: 8px; }
}

/* ============================================================
   角色界面（character.js）· 战略板地图（board.js）通用色调
   配色变量：黑蓝紫 + 绿色高亮 + 红色警告
   ============================================================ */
:root {
  --bg-darkest: #0a1018;
  --bg-dark: #0f1820;
  --bg-mid: #1a2530;
  --bg-card: #2a3540;
  --line: #3a4855;
  --green-main: #4ecdc4;
  --green-bright: #ffe66d;
  --red-warn: #ff6b6b;
  --purple-main: #a29bfe;
  --text-main: #e0e6ed;
  --text-dim: #8a9aaa;
}

/* ======= 顶部 / 底部 nav（三角洲风）======= */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex;
  z-index: 300;
  background: linear-gradient(135deg, rgba(20,30,40,0.98) 0%, rgba(30,40,60,0.98) 100%);
  border-bottom: 2px solid var(--green-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  padding: 6px 10px;
  gap: 4px;
  align-items: center;
}
.top-nav-left {
  display: flex; align-items: center; gap: 10px;
  margin-right: 14px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}
.tn-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: var(--green-bright);
  cursor: pointer;
  font-size: 16px;
}
.tn-title {
  font-size: 14px;
  color: var(--green-bright);
  font-weight: bold;
  letter-spacing: 2px;
}
.tn-sub { font-size: 11px; color: var(--text-dim); }

.top-nav-right {
  display: flex; gap: 2px;
}
.tn-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  min-width: 56px;
  color: var(--text-dim);
  transition: background 0.2s;
}
.tn-item:hover { background: rgba(78,205,196,0.15); color: var(--green-main); }
.tn-item.active {
  background: linear-gradient(180deg, rgba(78,205,196,0.2) 0%, transparent 100%);
  color: var(--green-bright);
  border-bottom: 2px solid var(--green-main);
}
.tn-icon { font-size: 18px; }
.tn-label { font-size: 10px; margin-top: 2px; }
.tn-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  font-size: 10px;
  text-align: center;
  line-height: 16px;
  font-weight: bold;
}
.badge-num { background: var(--red-warn); color: #fff; }
.badge-new { background: var(--green-bright); color: #000; }

.bot-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  background: linear-gradient(180deg, rgba(20,30,40,0.95) 0%, rgba(10,15,25,0.98) 100%);
  border-top: 2px solid var(--green-main);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.4);
  padding: 6px;
  z-index: 300;
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--text-dim);
  border-radius: 6px;
  transition: background 0.2s;
}
.bn-item:hover { background: rgba(78,205,196,0.15); }
.bn-item.active {
  color: var(--green-bright);
  background: linear-gradient(0deg, rgba(78,205,196,0.2) 0%, transparent 100%);
  border-top: 2px solid var(--green-main);
}
.bn-icon { font-size: 22px; }
.bn-label { font-size: 10px; margin-top: 2px; }

/* ======= 角色界面 — 极简 + 全身立绘 ======= */
.char-page {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0;
  padding: 56px 16px 64px;
  background: linear-gradient(180deg, #0a1018 0%, #0f1820 100%);
  min-height: calc(100vh - 130px);
}
.char-stage {
  position: relative;
  background:
    radial-gradient(ellipse at center 70%, rgba(78,205,196,0.12) 0%, transparent 70%),
    linear-gradient(180deg, #0a1525 0%, #0a1018 100%);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}
.char-stage-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(78,205,196,0.05) 50%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, rgba(78,205,196,0.05) 50%, transparent 50.5%);
  background-size: 50px 50px;
  pointer-events: none;
}
.char-header { position: relative; z-index: 1; width: 100%; text-align: center; margin-bottom: 8px; }
.char-name-row { display: flex; justify-content: center; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.char-name { font-size: 28px; font-weight: bold; color: var(--green-bright); text-shadow: 0 0 14px rgba(255,230,109,0.4); letter-spacing: 2px; }
.char-lv { font-size: 14px; color: var(--green-main); }
.char-lv b { font-size: 18px; color: var(--green-bright); }
.char-rank { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; margin-bottom: 6px; }
.char-exp { width: 240px; height: 4px; background: rgba(0,0,0,0.6); border-radius: 2px; overflow: hidden; margin: 0 auto; }
.ce-fill { height: 100%; background: linear-gradient(90deg, #4ecdc4 0%, #ffe66d 100%); transition: width 0.4s; }
.char-figure-wrap { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 0; }
.char-glow {
  position: absolute;
  width: 220px; height: 80px;
  background: radial-gradient(ellipse, rgba(78,205,196,0.25) 0%, transparent 70%);
  bottom: 30px;
  pointer-events: none;
  animation: charGlow 2.5s ease-in-out infinite;
}
@keyframes charGlow {
  0%,100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.1); opacity: 0.5; }
}
.char-figure { width: 180px; height: 280px; animation: charIdle 3.5s ease-in-out infinite; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.5)); }
@keyframes charIdle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.char-deploy-btn {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 280px; padding: 16px 24px; margin: 0 auto;
  background: linear-gradient(135deg, #4ecdc4 0%, #2a8a7a 100%);
  color: #000; font-size: 18px; font-weight: bold; border-radius: 12px;
  cursor: pointer; letter-spacing: 6px;
  box-shadow: 0 8px 20px rgba(78,205,196,0.5);
  transition: transform 0.2s;
}
.char-deploy-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(78,205,196,0.6); }
.char-mini-info {
  background: rgba(20,30,40,0.6); border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; margin-left: 12px;
}
.cmi-row { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.3); padding: 8px; border-radius: 6px; font-size: 14px; font-weight: bold; }
.cmi-icon { font-size: 18px; }
.cmi-val { color: var(--green-bright); }
.cmi-btn {
  padding: 8px; border-radius: 6px;
  background: rgba(78,205,196,0.15); border: 1px solid var(--green-main);
  color: var(--green-bright); cursor: pointer; font-size: 12px; font-weight: bold;
}
@media (max-width: 900px) and (orientation: landscape) {
  .char-page { grid-template-columns: 1fr 140px; padding: 50px 8px 60px; }
  .char-figure { width: 140px; height: 220px; }
  .char-name { font-size: 22px; }
  .char-deploy-btn { width: 200px; font-size: 16px; letter-spacing: 4px; padding: 12px; }
  .char-mini-info { padding: 10px; margin-left: 8px; }
  .cmi-row { padding: 6px; font-size: 12px; }
}

/* ======= 战略板 (board page) ======= */
.board-page {
  background: linear-gradient(180deg, #0a1018 0%, #0a1525 100%);
  min-height: 100vh;
  padding: 60px 14px 80px;
  color: var(--text-main);
}

.board-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(20,30,40,0.7);
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.board-back {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.06);
  color: var(--green-bright);
  border-radius: 6px;
  cursor: pointer;
}
.board-titles { flex: 1; }
.board-title { color: var(--green-bright); font-size: 22px; }
.board-subtitle { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.board-meta { display: flex; gap: 12px; font-size: 12px; }
.board-meta-item { color: var(--text-dim); }
.board-meta-item b { color: var(--green-bright); }

.board-grid {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  gap: 14px;
}

.board-side {
  background: rgba(20,30,40,0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

/* 左侧：模式列表 */
.mode-card {
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.mode-card:hover {
  background: rgba(78,205,196,0.1);
  border-left-color: var(--green-main);
}
.mode-card.active {
  background: rgba(78,205,196,0.18);
  border-left-color: var(--green-main);
}
.mode-card.locked { opacity: 0.4; cursor: not-allowed; }
.mode-card.header .mode-content { padding: 0; }

.mode-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mode-icon { font-size: 18px; }
.mode-name { font-size: 13px; color: var(--text-main); font-weight: bold; }
.mode-desc { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.mode-header {
  font-size: 11px;
  color: var(--green-bright);
  letter-spacing: 2px;
  font-weight: bold;
}

/* 中央：12 张小地图 */
.board-main {
  position: relative;
  background:
    radial-gradient(ellipse at center, rgba(78,205,196,0.08) 0%, transparent 70%),
    linear-gradient(180deg, #0a1525 0%, #0a1018 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  min-height: 480px;
}
.board-main-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, transparent 49.5%, rgba(78,205,196,0.06) 50%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, rgba(78,205,196,0.06) 50%, transparent 50.5%);
  background-size: 40px 40px;
  pointer-events: none;
  border-radius: 10px;
}

.board-coords {
  display: flex;
  gap: 14px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: var(--green-bright);
  margin-bottom: 14px;
}
.bc-tag { color: var(--green-bright); }
.bc-grid { color: var(--text-dim); }
.bc-time { color: var(--red-warn); margin-left: auto; }

.board-maps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.mini-map {
  background: rgba(0,0,0,0.4);
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.mini-map:hover {
  transform: translateY(-3px);
  border-color: var(--accent, var(--green-main));
}
.mini-map.locked { opacity: 0.5; cursor: not-allowed; }
.mini-map.current {
  border-color: var(--green-bright);
  box-shadow: 0 0 12px rgba(255,230,109,0.4);
}

.mini-map-svg {
  display: block;
  width: 100%;
  height: 90px;
  background: #1a2530;
}

.mm-info {
  padding: 6px 8px;
}
.mm-name { font-size: 12px; font-weight: bold; color: var(--green-bright); }
.mm-sub { font-size: 10px; color: var(--text-dim); }
.mm-bar {
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.mm-bar-fill { height: 100%; background: var(--accent, var(--green-main)); }
.mm-prog { font-size: 9px; color: var(--text-dim); margin-top: 2px; }
.mm-lock { font-size: 10px; color: var(--red-warn); margin-top: 4px; }
.mm-pin {
  position: absolute;
  top: -8px; right: 6px;
  background: var(--red-warn);
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
}

/* 状态栏 */
.board-status {
  position: absolute;
  bottom: 12px; left: 12px; right: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.bs-signal {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bs-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green-main);
  box-shadow: 0 0 6px var(--green-main);
  animation: blink 2s infinite;
}
.bs-waveform {
  display: flex;
  gap: 2px;
  align-items: center;
}
.bs-waveform span {
  width: 3px;
  background: var(--green-main);
  border-radius: 2px;
  animation: wave 1.4s ease-in-out infinite;
}
.bs-waveform span:nth-child(1) { height: 6px; animation-delay: 0s; }
.bs-waveform span:nth-child(2) { height: 10px; animation-delay: 0.2s; }
.bs-waveform span:nth-child(3) { height: 14px; animation-delay: 0.4s; }
.bs-waveform span:nth-child(4) { height: 10px; animation-delay: 0.6s; }
.bs-waveform span:nth-child(5) { height: 6px; animation-delay: 0.8s; }
@keyframes wave {
  0%,100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.2); }
}

.bs-ping { font-family: "Courier New", monospace; }

.board-deploy {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--green-main) 0%, #2a8a7a 100%);
  color: #000;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(78,205,196,0.3);
  transition: transform 0.2s;
}
.board-deploy:hover { transform: translateY(-2px); }

/* 右侧：等待解锁 */
.bs-locked-list, .bs-tip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.locked-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: rgba(255,107,107,0.06);
  border-radius: 4px;
}
.li-icon { font-size: 20px; }
.li-name { font-size: 12px; font-weight: bold; }
.li-desc { font-size: 10px; color: var(--text-dim); }

.bs-tip {
  background: rgba(0,0,0,0.3);
  padding: 8px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.6;
}

/* 边角装饰 */
.board-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.bo-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--green-main);
  opacity: 0.6;
}
.bo-corner.tl { top: 4px; left: 4px; border-right: none; border-bottom: none; }
.bo-corner.tr { top: 4px; right: 4px; border-left: none; border-bottom: none; }
.bo-corner.bl { bottom: 4px; left: 4px; border-right: none; border-top: none; }
.bo-corner.br { bottom: 4px; right: 4px; border-left: none; border-top: none; }

/* 横屏适配 */
@media (max-width: 900px) and (orientation: landscape) {
  .char-page { grid-template-columns: 160px 1fr 160px; padding: 55px 8px 70px; gap: 8px; }
  .char-side { padding: 8px; }
  .char-name { font-size: 20px; }
  .char-figure { font-size: 100px; bottom: 30px; }
  .char-portrait { width: 140px; height: 200px; }
  .char-deploy-btn { width: 200px; padding: 10px; font-size: 16px; }
  .char-stats { grid-template-columns: repeat(2, 1fr); }
  .top-nav { padding: 4px 8px; }
  .tn-item { padding: 4px 6px; min-width: 44px; }
  .tn-icon { font-size: 14px; }
  .tn-label { font-size: 9px; }
  .bot-nav { padding: 4px; }
  .bn-item { padding: 4px; }
  .bn-icon { font-size: 18px; }
  .board-grid { grid-template-columns: 140px 1fr 140px; }
  .board-side { padding: 8px; }
  .board-maps { grid-template-columns: repeat(4, 1fr); }
  .mini-map-svg { height: 70px; }
  .board-meta { flex-direction: column; gap: 4px; }
  .board-title { font-size: 16px; }
}
@media (max-width: 700px) and (orientation: landscape) {
  .board-maps { grid-template-columns: repeat(3, 1fr); }
  .char-page { grid-template-columns: 1fr; }
}
