/* ========== 咖喱小镇 全局样式 ==========
 * 作用范围：游戏侧所有页面共用的基础样式——设计令牌(CSS 变量)、顶部状态栏、
 *   导航栏、主内容区、弹窗体系、按钮/表单/卡片、物品图标与品质配色、Toast、
 *   词条卡、背包(含格子/扩容/灵卡槽)与全局浮动信息层。
 * 层级约定：弹窗 .modal-overlay 基线 z-index:2000，与 JS 中 showModal/showToast
 *   的叠加规则(每多一个弹窗 +500)一一对应；.toast 用 3000，背包浮动信息层最高 10000。
 */
:root {
  --color-primary: #E8A04F;
  --color-primary-dark: #D8943F;
  --color-secondary: #5BA89A;
  --color-danger: #C75B5B;
  --color-bg: #F5EEDC;
  --color-card: #EFE3CB;
  --color-card-alt: #F9F4E8;
  --color-text: #4A3B2A;
  --color-text-light: #8B7C6A;
  --color-border: #DCC9A0;
  --color-white: #FFFFFF;
  --season-spring: #A8D5A2;
  --season-summer: #7EC8E3;
  --season-autumn: #E8A04F;
  --season-winter: #D6E4E8;
  --quality-1: #FFFFFF;
  --quality-2: #5BA85B;
  --quality-3: #4A90D9;
  --quality-4: #9B59B6;
  --quality-5: #E8A04F;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

/* ========== 顶部状态栏 ========== */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(74, 59, 42, 0.95);
  color: var(--color-white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.top-bar-left { display: flex; align-items: center; gap: 24px; }
.top-bar-center { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; z-index: 2; }
.afk-stop-notice { align-items:center; gap:8px; max-width:min(520px, calc(100vw - 32px)); padding:3px 6px 3px 10px; border:1px solid rgba(255, 214, 150, .7); border-radius:7px; background:rgba(137, 61, 31, .96); color:#fff4dd; box-shadow:0 3px 10px rgba(0,0,0,.28); font-size:12px; font-weight:700; line-height:1.45; white-space:nowrap; }
.afk-stop-notice span { overflow:hidden; text-overflow:ellipsis; }
.afk-stop-notice-close { width:19px; height:19px; flex:0 0 19px; padding:0; border:0; border-radius:50%; background:transparent; color:#fff; cursor:pointer; font-size:18px; line-height:17px; }
.afk-stop-notice-close:hover { background:rgba(255,255,255,.2); }
@media (max-width: 680px) { .afk-stop-notice { max-width:calc(100vw - 22px); font-size:11px; } }

/* 挂机每周期产出通知：顶部居中栏正下方单独图层（2秒淡出，由 JS 定位） */
.afk-tick-notify {
  position: fixed;
  z-index: 1500;
  min-width: 168px;
  max-width: 340px;
  padding: 8px 16px;
  background: rgba(38, 26, 14, 0.94);
  color: #fff;
  border: 1px solid rgba(255, 214, 150, 0.45);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.afk-tick-notify.show { opacity: 1; }
.afk-tick-notify .afk-notify-line { white-space: nowrap; }
.afk-tick-notify b { color: #ffd596; }
.top-bar-right { display: flex; align-items: center; gap: 16px; }

.status-item { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.status-item .label { color: rgba(255,255,255,0.6); }
.status-item .value { font-weight: bold; }
.status-item .spirit-icon { color: var(--color-secondary); }

.spirit-forecast {
  position: relative; cursor: pointer;
  display: flex; align-items: center;
}
.spirit-forecast .tooltip {
  display: none; position: absolute; top: 46px; left: 0;
  background: var(--color-white); color: var(--color-text);
  padding: 12px 16px; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  white-space: nowrap; z-index: 1001;
  font-size: 12px; min-width: 220px;
  border: 1px solid var(--color-border);
}
.spirit-forecast:hover .tooltip { display: block; }
.spirit-forecast .tooltip-title { font-weight: bold; margin-bottom: 6px; color: var(--color-primary); }
.spirit-forecast .tooltip-countdown { margin-bottom: 6px; }
.spirit-forecast .tooltip-countdown .time { font-weight: bold; color: var(--color-secondary); }
.spirit-forecast .tooltip-trend { display: flex; gap: 8px; align-items: center; }

.weather-forecast {
  position: relative; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.weather-forecast .tooltip {
  display: none; position: absolute; top: 46px; left: 0;
  background: var(--color-white); color: var(--color-text);
  padding: 12px 16px; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  white-space: nowrap; z-index: 1001;
  font-size: 12px; min-width: 200px;
  border: 1px solid var(--color-border);
}
.weather-forecast:hover .tooltip { display: block; }
.weather-forecast .tooltip-title { font-weight: bold; margin-bottom: 6px; color: var(--color-primary); }
.weather-forecast .tooltip-trend { display: flex; gap: 12px; align-items: center; margin-top: 6px; }

/* 通用 hover tooltip */
.status-item-tooltip { position: relative; cursor: pointer; }
.status-item-tooltip .tooltip {
  display: none; position: absolute; top: 40px; right: 0;
  background: var(--color-white); color: var(--color-text);
  padding: 10px 14px; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  white-space: nowrap; z-index: 1001;
  font-size: 12px; min-width: 120px;
  border: 1px solid var(--color-border);
}
.status-item-tooltip:hover .tooltip { display: block; }
.status-item-tooltip .tooltip-title { font-weight: bold; margin-bottom: 4px; color: var(--color-primary); }
.status-item-tooltip .tooltip .time { font-weight: bold; color: var(--color-secondary); }

/* ========== 导航栏 ========== */
.nav-bar {
  position: fixed; top: 56px; left: 0; right: 0;
  height: 48px;
  background: var(--color-card);
  display: flex; align-items: center; justify-content: center;
  gap: 0;
  z-index: 999;
  border-bottom: 1px solid var(--color-border);
}
.nav-item {
  padding: 12px 32px;
  color: var(--color-text); font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  border-bottom: 3px solid transparent;
}
.nav-item:hover { background: rgba(232, 160, 79, 0.1); }
.nav-item.active {
  color: var(--color-primary); border-bottom-color: var(--color-primary);
  font-weight: bold;
}
/* 导航栏未读消息徽章 + 闪烁 */
.nav-badge {
  display: inline-block;
  background: var(--color-danger); color: white;
  border-radius: 10px; font-size: 11px; padding: 1px 6px;
  margin-left: 4px; min-width: 18px; text-align: center;
  vertical-align: middle; font-weight: bold;
}
.nav-item.has-unread {
  animation: navFlash 1.2s ease-in-out infinite;
}
.nav-item.flash-strong {
  animation: navFlashStrong 0.5s ease-in-out 6;
}
@keyframes navFlash {
  0%, 100% { background: transparent; }
  50% { background: rgba(199, 91, 91, 0.15); }
}
@keyframes navFlashStrong {
  0%, 100% { background: transparent; }
  50% { background: rgba(199, 91, 91, 0.35); }
}

/* ========== 主内容区 ========== */
.main-content {
  margin-top: 104px;
  padding: 16px;
  min-height: calc(100vh - 104px - 60px);
}

/* ========== 地图页面统一布局 ========== */
.map-container {
  max-width: 900px;
  margin: 0 auto;
}
.map-frame {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 16px;
  border: 3px solid var(--color-border);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(74,59,42,0.18);
  user-select: none;
}

/* ========== 底部版权 ========== */
.footer {
  text-align: center; padding: 20px;
  color: var(--color-text-light); font-size: 12px;
  border-top: 1px solid var(--color-border);
}

/* ========== 卡片 ========== */
.card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.card-title {
  font-size: 18px; font-weight: bold; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 2px solid var(--color-card);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-block; padding: 8px 24px;
  border: none; border-radius: 6px; cursor: pointer;
  font-size: 14px; font-family: inherit;
  transition: all 0.2s; text-align: center;
}
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-secondary); color: white; }
.btn-danger { background: var(--color-danger); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--color-primary); color: var(--color-primary); }
.btn-gray { background: #ccc; color: #666; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-lg { padding: 12px 36px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: bold; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px;
  border: 1px solid var(--color-border); border-radius: 6px;
  font-size: 14px; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--color-primary);
}

/* ========== 列表 ========== */
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-card);
}
.list-item:hover { background: var(--color-card-alt); }
.list-item:last-child { border-bottom: none; }

/* ========== 弹窗 ==========
 * 弹窗体系：.modal-overlay 默认 display:none，加 .show 才显示(flex 居中)。
 * z-index:2000 为基线——JS 中每多叠加一个弹窗会按 2000 + N*500 递增，
 * 保证后开的弹窗盖在上层，关闭后整体层级回落。
 */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 2000;
  justify-content: center; align-items: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--color-white); border-radius: 12px;
  padding: 24px; min-width: 400px; max-width: 800px;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal.modal-lg {
  width: 94vw; max-width: 1120px; min-height: 520px;
  max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.modal.modal-lg .modal-body {
  flex: 1; overflow-y: auto; padding-right: 4px;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 2px solid var(--color-card);
  flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: bold; }
.modal-close { cursor: pointer; font-size: 24px; color: var(--color-text-light); }

/* ========== 物品图标 ========== */
.item-icon {
  width: 48px; height: 48px;
  border-radius: 6px; border: 2px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; text-align: center;
}
.item-icon.q1 { border-color: var(--quality-1); background: #f5f5f5; }
.item-icon.q2 { border-color: var(--quality-2); background: #eaf6ea; }
.item-icon.q3 { border-color: var(--quality-3); background: #e8f0fc; }
.item-icon.q4 { border-color: var(--quality-4); background: #f3e8f8; }
.item-icon.q5 { border-color: var(--quality-5); background: #fdf0e0; }

/* ========== Toast 提示 ========== */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 8px;
  color: white; font-size: 14px; z-index: 3000;
  animation: toastIn 0.3s ease;
}
.toast.success { background: var(--color-secondary); }
.toast.error { background: var(--color-danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== 品质标签 ========== */
.quality-tag {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: bold;
}
.quality-tag.q1 { background: #E0DDD8; color: #6B6B6B; }
.quality-tag.q2 { background: #D4EBD4; color: #2D7A2D; }
.quality-tag.q3 { background: #C5DCF5; color: #1E5BA8; }
.quality-tag.q4 { background: #DCC6E8; color: #6B2E8A; }
.quality-tag.q5 { background: #F2DCA8; color: #A66A1E; }

/* ========== 词条卡品质配色方案 ========== */
/* 普通 — 石灰色调，朴素沉稳 */
.entry-card-q1 {
  --ec-border: #B0B0B0;
  --ec-bg-from: #F5F2ED;
  --ec-bg-to: #EDE8E0;
  --ec-name: #6B6B6B;
  --ec-glow: rgba(176,176,176,0.15);
}
/* 优良 — 翠绿色调，生机盎然 */
.entry-card-q2 {
  --ec-border: #52A352;
  --ec-bg-from: #EEF7EE;
  --ec-bg-to: #DCEBDC;
  --ec-name: #2D7A2D;
  --ec-glow: rgba(82,163,82,0.20);
}
/* 稀有 — 深蓝色调，深邃如海 */
.entry-card-q3 {
  --ec-border: #3A7BD5;
  --ec-bg-from: #E8F1FC;
  --ec-bg-to: #D0E2F8;
  --ec-name: #1E5BA8;
  --ec-glow: rgba(58,123,213,0.22);
}
/* 史诗 — 皇家紫调，神秘奥术 */
.entry-card-q4 {
  --ec-border: #8E44AD;
  --ec-bg-from: #F0E6F5;
  --ec-bg-to: #E0CFEB;
  --ec-name: #6B2E8A;
  --ec-glow: rgba(142,68,173,0.25);
}
/* 传说 — 琥珀金调，与游戏主色呼应 */
.entry-card-q5 {
  --ec-border: #E8A04F;
  --ec-bg-from: #FDF4E3;
  --ec-bg-to: #F5DFB8;
  --ec-name: #A66A1E;
  --ec-glow: rgba(232,160,79,0.30);
}
/* 词条卡通用样式 */
.entry-card {
  padding: 12px;
  border-radius: 10px;
  border: 2px solid var(--ec-border, var(--color-border));
  background: linear-gradient(135deg, var(--ec-bg-from, var(--color-card-alt)), var(--ec-bg-to, var(--color-card-alt)));
  display: flex;
  flex-direction: column;
  min-height: 130px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--ec-glow, rgba(0,0,0,0.10));
}
.entry-card .entry-name {
  font-weight: bold;
  font-size: 14px;
  color: var(--ec-name, var(--color-text));
}
.entry-card .entry-desc {
  font-size: 11px;
  color: var(--color-text-light);
  line-height: 1.5;
  height: 49.5px;
  overflow: hidden;
  margin: 4px 0 6px;
  flex: 1;
}
/* 传说品质顶部光带 */
.entry-card-q5::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #FFD700, #E8A04F, #FFD700, transparent);
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
/* 史诗品质微光 */
.entry-card-q4::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #B07CCD, #8E44AD, #B07CCD, transparent);
}
/* 已装载状态高亮 */
.entry-card.loaded {
  border-color: var(--color-primary);
  border-width: 2px;
  box-shadow: 0 0 0 1px var(--color-primary), 0 2px 8px rgba(232,160,79,0.15);
}

/* ========== 通用 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }

/* ========== 背包 ========== */
.backpack-btn {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.backpack-btn .icon { margin-right: 4px; }
.backpack-btn:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
.backpack-btn:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }

.bp-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--color-card);
}
.bp-slots-info { font-size: 14px; display: flex; align-items: center; gap: 12px; }
.bp-slots-info strong { color: var(--color-primary); }

/* 容量进度条 */
.bp-capacity-bar {
  width: 120px; height: 8px; background: var(--color-card-alt);
  border-radius: 4px; overflow: hidden; border: 1px solid var(--color-border);
}
.bp-capacity-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.3s ease;
}

.bp-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.bp-tab {
  padding: 5px 14px; border: 1px solid var(--color-border);
  border-radius: 18px; background: var(--color-card-alt);
  color: var(--color-text); font-size: 12px; cursor: pointer;
  transition: all 0.2s;
}
.bp-tab:hover { border-color: var(--color-primary); color: var(--color-primary); }
.bp-tab.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.bp-tab.bp-tab-batch { margin-left: auto; color: var(--color-primary); border-color: var(--color-primary); font-weight: 600; }
.bp-tab.bp-tab-batch:hover { background: var(--color-primary); color: #fff; }

/* 仓库同类批量转移选择器 */
.wh-batch-info { font-size: 13px; color: var(--color-text); margin-bottom: 12px; line-height: 1.6; }
.wh-batch-info strong { color: var(--color-primary); }
.wh-transfer-list { display: flex; flex-direction: column; gap: 8px; }
.wh-transfer-opt { text-align: left; justify-content: flex-start; }
.wh-transfer-note { font-size: 12px; color: var(--color-text-light); padding: 6px 2px; }

/* ========== 存入哪个仓库 弹窗（重做 UI） ========== */
.wh-pick-modal .modal-body { padding-top: 4px; }
.wh-pick-smart {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; margin-bottom: 14px;
  border: none; border-radius: 12px; cursor: pointer; text-align: left;
  color: #fff;
  background: linear-gradient(135deg, #F2B45C 0%, #E8A04F 55%, #D8943F 100%);
  box-shadow: 0 6px 16px rgba(232,160,79,0.35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.wh-pick-smart:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(232,160,79,0.45); }
.wh-pick-smart:active { transform: translateY(0); }
.wh-pick-smart-star { font-size: 20px; line-height: 1; }
.wh-pick-smart-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wh-pick-smart-txt b { font-size: 15px; }
.wh-pick-smart-txt i { font-style: normal; font-size: 12px; opacity: .9; }
.wh-pick-smart-go { font-size: 18px; }

.wh-pick-label {
  font-size: 12px; color: var(--color-text-light); margin: 2px 2px 8px;
  letter-spacing: .5px;
}
.wh-pick-list { display: flex; flex-direction: column; gap: 10px; }
.wh-pick-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: var(--color-card-alt);
  border: 1px solid var(--color-border);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.wh-pick-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 6px 16px rgba(232,160,79,0.22);
}
.wh-pick-card.wh-pick-primary { border-color: var(--color-primary); background: #FFF7EC; }
.wh-pick-card.wh-pick-full { opacity: .65; cursor: not-allowed; }
.wh-pick-card.wh-pick-full:hover { transform: none; box-shadow: none; border-color: var(--color-border); }
.wh-pick-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--color-card);
}
.wh-pick-main { flex: 1; min-width: 0; }
.wh-pick-name { font-size: 14px; font-weight: 600; color: var(--color-text); display: flex; align-items: center; gap: 6px; }
.wh-pick-badge {
  font-size: 10px; font-weight: 700; color: #fff; background: var(--color-primary);
  padding: 1px 6px; border-radius: 6px;
}
.wh-pick-setdef {
  margin-left: auto;
  font-size: 11px; font-weight: 600; line-height: 1;
  color: var(--color-primary); background: transparent;
  border: 1px solid var(--color-primary); border-radius: 12px;
  padding: 3px 8px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.wh-pick-setdef:hover { background: var(--color-primary); color: #fff; }
.wh-pick-bar {
  height: 6px; border-radius: 4px; background: var(--color-card);
  margin: 6px 0 4px; overflow: hidden;
}
.wh-pick-bar span {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #7CC3B5, #5BA89A);
}
.wh-pick-card.wh-pick-full .wh-pick-bar span { background: var(--color-danger); }
.wh-pick-meta { font-size: 11px; color: var(--color-text-light); }
.wh-pick-card.wh-pick-full .wh-pick-meta { color: var(--color-danger); }
.wh-pick-go {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--color-primary);
  white-space: nowrap;
}
.wh-pick-card.wh-pick-full .wh-pick-go { color: var(--color-text-light); }
.wh-pick-empty {
  text-align: center; color: var(--color-text-light); font-size: 13px;
  padding: 24px 0;
}
.wh-pick-tip {
  margin-top: 14px; font-size: 12px; color: var(--color-text-light);
  line-height: 1.5; padding-top: 10px; border-top: 1px dashed var(--color-border);
}

/* 网格容器 */
.bp-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  min-height: 280px;
}
@media (max-width: 1024px) { .bp-grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 768px) { .bp-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 480px) { .bp-grid { grid-template-columns: repeat(4, 1fr); } }

/* 分页导航 */
.bp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0 8px;
  margin-top: 8px;
}
.bp-pagination .btn-sm { min-width: 36px; text-align: center; }
.bp-page-ellipsis { color: var(--color-text-light); font-size: 14px; padding: 0 4px; }
.bp-page-info { color: var(--color-text-light); font-size: 13px; margin-left: 12px; }

/* 格子基础样式 */
.bp-item {
  position: relative;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  padding: 5px 4px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 88px;
  aspect-ratio: 1 / 1;   /* 正方形格子 */
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.bp-item:hover {
  transform: translateY(-3px) scale(1.05);
  z-index: 10;
}

/* 品质配色 - 与词条卡配色统一 */
.bp-item.q1 {
  border-color: #B0B0B0;
  background: linear-gradient(135deg, #F5F5F5, #E8E8E8);
}
.bp-item.q2 {
  border-color: #52A352;
  background: linear-gradient(135deg, #EDF7ED, #D4EBD4);
}
.bp-item.q3 {
  border-color: #3A7BD5;
  background: linear-gradient(135deg, #E8F0FE, #D0E0F8);
}
.bp-item.q4 {
  border-color: #8E44AD;
  background: linear-gradient(135deg, #F5E8FA, #E8D5F0);
}
.bp-item.q5 {
  border-color: #E8A04F;
  background: linear-gradient(135deg, #FFF8E8, #F5E0C0);
  animation: bpLegendaryGlow 2s ease-in-out infinite;
}
@keyframes bpLegendaryGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(232,160,79,0.3); }
  50% { box-shadow: 0 0 12px rgba(232,160,79,0.6); }
}

/* 悬停发光 */
.bp-item.q1:hover { box-shadow: 0 3px 12px rgba(176,176,176,0.4); }
.bp-item.q2:hover { box-shadow: 0 3px 12px rgba(82,163,82,0.4); }
.bp-item.q3:hover { box-shadow: 0 3px 12px rgba(58,123,213,0.4); }
.bp-item.q4:hover { box-shadow: 0 3px 12px rgba(142,68,173,0.4); }
.bp-item.q5:hover { box-shadow: 0 3px 16px rgba(232,160,79,0.5); }

/* 空格 */
.bp-item.empty {
  border: 2px dashed var(--color-border);
  background: var(--color-card-alt);
  opacity: 0.35;
  cursor: default;
}
.bp-item.empty:hover { transform: none; box-shadow: none; }

/* 背包扩容提示格子 */
.bp-expand-slot {
  border: 2px dashed #8E44AD;
  background: rgba(142, 68, 173, 0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s;
}
.bp-expand-slot:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(142, 68, 173, 0.3);
  background: rgba(142, 68, 173, 0.15);
  border-color: #8E44AD;
}
.bp-expand-slot.locked {
  border: 2px dashed #E74C3C;
  background: rgba(231, 76, 60, 0.06);
  cursor: not-allowed;
}
.bp-expand-slot.locked:hover {
  transform: none;
  box-shadow: none;
  background: rgba(231, 76, 60, 0.08);
}
.bp-expand-slot.maxed {
  border: 2px solid #52A352;
  background: rgba(82, 163, 82, 0.06);
  cursor: default;
}
.bp-expand-slot.maxed:hover {
  transform: none;
  box-shadow: none;
}
.bp-expand-icon {
  font-size: 24px;
  line-height: 1;
}
.bp-expand-label {
  font-size: 11px;
  color: var(--color-text);
  margin-top: 2px;
}
.bp-expand-cost {
  font-size: 10px;
  margin-top: 1px;
}

.bp-icon {
  font-size: 30px; width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bp-icon img { border-radius: 6px; }
.bp-name {
  font-size: 11px; text-align: center; word-break: break-all;
  line-height: 1.25; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; width: 100%;
}

/* 品质标签条 */
.bp-quality-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: 8px 8px 0 0;
}

/* 数量徽章 */
.bp-qty {
  position: absolute; bottom: 3px; right: 4px;
  font-size: 11px; font-weight: bold; color: white;
  background: rgba(0,0,0,0.55); border-radius: 8px;
  padding: 0 5px; min-width: 18px; text-align: center;
}

/* 强化等级徽章 */
.bp-upgrade {
  position: absolute; top: 3px; right: 4px;
  font-size: 10px; font-weight: bold; color: white;
  background: var(--color-danger); border-radius: 8px;
  padding: 0 5px;
}

/* 扩展提示 */
.bp-expand-tip {
  position: absolute; top: 3px; left: 3px;
}

/* 点击道具时：按钮叠加在道具格子上 */
/* 道具激活状态 - 隐藏原始内容，显示操作按钮 */
.bp-item.active {
  transform: scale(1.05);
  z-index: 20;
}
.bp-item.active:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.bp-item.active .bp-icon,
.bp-item.active .bp-name,
.bp-item.active .bp-quality-bar,
.bp-item.active .bp-qty,
.bp-item.active .bp-upgrade {
  display: none;
}

/* 操作按钮叠加层 */
.bp-item-actions {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  gap: 3px;
  z-index: 10;
  overflow: hidden;
}
.bp-item.active .bp-item-actions {
  display: flex;
}

/* 操作按钮顶部品质色条 */
.bp-act-bar {
  height: 3px;
  border-radius: 8px 8px 0 0;
  flex-shrink: 0;
}

/* 操作按钮标题（物品名称） */
.bp-act-title {
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 4px 0;
}

/* 操作按钮 */
.bp-act-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  white-space: nowrap;
  flex: 1;
  min-height: 0;
}
.bp-act-btn.bp-act-wh {
  color: #52A352;
  background: #EDF7ED;
}
.bp-act-btn.bp-act-wh:hover {
  background: #D4EBD4;
}
.bp-act-btn.bp-act-sc {
  color: #8E44AD;
  background: #F5E8FA;
}
.bp-act-btn.bp-act-sc:hover {
  background: #E8D5F0;
}
.bp-act-btn.bp-act-bp {
  color: #3A7BD5;
  background: #E8F0FE;
}
.bp-act-btn.bp-act-bp:hover {
  background: #D0E0F8;
}
.bp-act-btn.bp-act-use {
  color: #E8A04F;
  background: #FFF8E8;
}
.bp-act-btn.bp-act-use:hover {
  background: #F5E0C0;
}

/* 操作按钮：宽度适中(不撑满整格)、居中，存入仓库 与 存入灵卡 等宽一致 */
.bp-item-actions > .bp-act-btn { align-self: center; width: 100%; max-width: 110px; }

/* 操作行：存入仓库 与 存入灵卡 等宽堆叠、底部对齐；悬浮其中一个则高度变 2 倍 */
.bp-act-row { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: flex-end; margin-top: auto; }
.bp-wh-wrap { position: relative; display: flex; width: 100%; max-width: 110px; height: 28px; transition: height .18s ease; }
.bp-wh-wrap .bp-act-wh { flex: 1; min-width: 0; padding-right: 26px; width: 100%; height: 100%; }
.bp-act-row > .bp-act-sc { flex: 0 0 auto; width: 100%; max-width: 110px; height: 28px; transition: height .18s ease; }
.bp-wh-wrap:hover { height: 56px; }
.bp-act-row > .bp-act-sc:hover { height: 56px; }
.bp-wh-setting {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; color: #6B7280; cursor: pointer; border-radius: 4px;
  border-left: 1px solid rgba(0,0,0,0.10);
}
.bp-wh-setting:hover { background: rgba(0,0,0,0.06); color: #4B5563; }

/* 全局浮动信息层 - 悬停物品时弹出独立信息面板 */
.bp-float-info {
  position: fixed;
  background: rgba(30,30,30,0.95);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 240px;
  min-width: 160px;
  z-index: 10000;
  pointer-events: none;
  display: none;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
}
.bp-float-info .bp-fi-name {
  font-size: 15px; font-weight: bold; margin-bottom: 6px;
}
.bp-float-info .bp-fi-quality {
  display: inline-block; padding: 1px 6px; border-radius: 6px;
  font-size: 10px; font-weight: bold; color: white; margin-right: 4px;
}
.bp-float-info .bp-fi-desc {
  font-size: 12px; color: #ddd; margin: 6px 0;
  line-height: 1.5;
  max-height: 80px; overflow: hidden;
}
.bp-float-info .bp-fi-attrs {
  font-size: 11px; color: #eee; margin-top: 4px;
}
.bp-float-info .bp-fi-attrs div { margin-bottom: 2px; }
.bp-float-info .bp-fi-attrs strong { color: #fff; }

/* 选中状态 */
.bp-item.bp-selected {
  outline: 3px solid var(--color-primary);
  outline-offset: 1px;
}

/* 品质小标签 */
.bp-quality-tag {
  display: inline-block; padding: 1px 8px; border-radius: 8px;
  font-size: 11px; font-weight: bold; color: white;
}
.bp-quality-tag.q1 { background: #B0B0B0; }
.bp-quality-tag.q2 { background: #52A352; }
.bp-quality-tag.q3 { background: #3A7BD5; }
.bp-quality-tag.q4 { background: #8E44AD; }
.bp-quality-tag.q5 { background: #E8A04F; }

/* ========== 灵卡槽 ========== */
.bp-spirit-section {
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--color-card);
}
.bp-spirit-grid {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.bp-spirit-slot {
  width: 80px; padding: 4px;
  border: 2px solid var(--color-border); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; transition: all 0.15s; text-align: center;
  position: relative; overflow: hidden;
  aspect-ratio: 1/1.1;
}
/* 灵卡槽品质配色（与背包格子一致） */
.bp-spirit-slot.q1 { background: linear-gradient(135deg, rgba(176,176,176,0.15), rgba(176,176,176,0.05)); border-color: #B0B0B0; }
.bp-spirit-slot.q2 { background: linear-gradient(135deg, rgba(82,163,82,0.15), rgba(82,163,82,0.05)); border-color: #52A352; }
.bp-spirit-slot.q3 { background: linear-gradient(135deg, rgba(58,123,213,0.15), rgba(58,123,213,0.05)); border-color: #3A7BD5; }
.bp-spirit-slot.q4 { background: linear-gradient(135deg, rgba(142,68,173,0.15), rgba(142,68,173,0.05)); border-color: #8E44AD; }
.bp-spirit-slot.q5 { background: linear-gradient(135deg, rgba(232,160,79,0.2), rgba(232,160,79,0.08)); border-color: #E8A04F; }
.bp-spirit-slot.open.empty {
  background: linear-gradient(135deg, #F5E8FA, #E8D5F0);
  border-color: #8E44AD; border-style: dashed;
}
.bp-spirit-slot.open:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 12px rgba(142,68,173,0.3);
}
.bp-spirit-slot.q5:hover {
  box-shadow: 0 3px 12px rgba(232,160,79,0.4);
}
/* 灵卡槽品质顶部色条 */
.bp-spirit-slot .bp-quality-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: 10px 10px 0 0;
}
.bp-spirit-slot-icon { font-size: 16px; margin-top: 2px; display: flex; align-items: center; justify-content: center; }
.bp-spirit-slot-icon img { width: 32px; height: 32px; }
.bp-spirit-slot-label { font-size: 10px; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 76px; }
.bp-spirit-slot .bp-qty { font-size: 10px; color: var(--color-text-light); background: rgba(0,0,0,0.3); padding: 0 4px; border-radius: 3px; position: absolute; bottom: 3px; right: 3px; }
.bp-spirit-slot.locked {
  border: 2px dashed var(--color-border);
  background: var(--color-card-alt); opacity: 0.4;
  cursor: default;
}

/* modal-sm */
.modal-sm .modal-body { max-width: 400px; }

/* ======================================================================
 * 移动端 / 平板 响应式适配（全局组件层）
 * 设计目标：
 *   - 导航栏(.nav-bar) 5 个菜单在窄屏下横向滚动，不再折行溢出
 *   - 顶部状态栏(.top-bar) 压缩内边距/间距，过窄时横向滚动
 *   - 弹窗(.modal) 在手机上变全屏，平板上限宽自适应
 *   - 卡片/按钮/表单/主内容区 在窄屏下收窄内边距，输入框字号 ≥16px 防 iOS 聚焦缩放
 * 断点约定：≤1024 平板微调 / ≤768 手机主适配 / ≤480 小屏全屏弹窗
 * 注意：各页面自有样式(town.css / scene.css / home.css 等)在 main.css 之后加载，
 *       会覆盖此处同优先级规则；页面级特殊布局请在各自 css 内独立适配。
 * ==================================================================== */

/* 隐藏横向滚动条（导航栏 / 状态栏滚动容器） */
.nav-bar::-webkit-scrollbar,
.top-bar::-webkit-scrollbar { display: none; }
.nav-bar, .top-bar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- 平板：≤1024px ---------- */
@media (max-width: 1024px) {
  .top-bar { padding: 0 14px; }
  .top-bar-left { gap: 16px; }
  .top-bar-right { gap: 12px; }
  .nav-item { padding: 12px 24px; }
  .main-content { padding: 16px; }
  .modal { max-width: 90vw; }
}

/* ---------- 手机：≤768px ---------- */
@media (max-width: 768px) {
  /* 顶部状态栏：改为两行紧凑布局（状态行 + 账户行），固定高度避免挤压/重叠 */
  .top-bar {
    height: 96px;
    flex-wrap: wrap;
    align-content: center;
    padding: 5px 10px;
    overflow: visible;
  }
  .top-bar-left,
  .top-bar-right {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }
  .top-bar-left {
    gap: 4px 12px;
    justify-content: flex-start;
    padding-right: 90px;
  }
  .top-bar-right {
    gap: 6px 12px;
    justify-content: flex-start;
    font-size: 12px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  .top-bar-center {
    position: absolute;
    top: 6px;
    right: 10px;
    transform: none;
    margin: 0;
    z-index: 2;
  }
  .status-item { font-size: 13px; white-space: nowrap; }
  .status-item .label,
  .status-item .value { white-space: nowrap; }

  /* 挂机停止提醒：移动端改为浮层横幅，避免被头部裁切 */
  .afk-stop-notice {
    position: fixed;
    top: 150px; left: 8px; right: 8px;
    max-width: none;
    z-index: 1200;
  }

  /* 导航栏：横向滑动，菜单不折行、间距舒适 */
  .nav-bar {
    top: 96px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    gap: 0;
  }
  .nav-item {
    flex: 0 0 auto;
    padding: 13px 18px;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }

  /* 主内容区：顶部占位跟随新头部高度(96 + 48) */
  .main-content { margin-top: 152px; padding: 12px; min-height: calc(100vh - 152px - 40px); }

  /* 弹窗：宽屏自适应，最大 92vw */
  .modal {
    min-width: 0;
    max-width: 92vw;
    width: 92vw;
    padding: 18px;
  }
  .modal.modal-lg { width: 92vw; max-width: 92vw; min-height: auto; }

  /* 卡片 / 标题收窄 */
  .card { padding: 16px; }
  .card-title { font-size: 16px; margin-bottom: 12px; padding-bottom: 10px; }

  /* 按钮紧凑化 */
  .btn { padding: 9px 18px; }
  .btn-lg { padding: 11px 28px; font-size: 15px; }

  /* 表单：输入框字号 ≥16px，避免移动端聚焦时页面缩放 */
  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 16px; padding: 11px; }
  .form-group label { font-size: 14px; }
}

/* ---------- 小屏手机：≤480px ---------- */
@media (max-width: 480px) {
  .top-bar { padding: 4px 8px; }
  .top-bar-left { gap: 4px 8px; padding-right: 84px; }
  .top-bar-right { gap: 4px 8px; }
  .status-item { font-size: 12px; }

  .nav-item { padding: 12px 14px; }

  .main-content { padding: 10px; }

  /* 卡片更紧凑 */
  .card { padding: 12px; margin-bottom: 12px; }
  .card-title { font-size: 15px; }

  /* 按钮在小屏更紧凑 */
  .btn { padding: 10px 16px; font-size: 14px; }
  .btn-lg { padding: 12px 24px; font-size: 15px; }

  /* 弹窗：全屏化 */
  .modal-overlay { padding: 0; }
  .modal {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    padding: 16px;
  }
  .modal.modal-lg {
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  /* 弹窗底部操作区：按钮堆叠占满宽度 */
  .modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-footer .btn { flex: 1 1 auto; width: 100%; }
}

/* ---------- 通用移动端增强（全部在媒体查询内，不影响 PC 端） ---------- */
@media (max-width: 768px) {
  /* 防止任何固定宽高元素导致页面横向溢出 */
  html, body { overflow-x: hidden; }
  img, video, canvas { max-width: 100%; height: auto; }

  /* 触摸友好的表单控件：≥40px 触控高度、16px 字号避免 iOS 聚焦缩放 */
  input, select, textarea, button { font-size: 16px; }
  input[type="text"], input[type="number"], input[type="search"], input[type="password"],
  select, textarea { min-height: 40px; }

  /* 数据表格在窄屏可横向滚动，避免挤成一团 */
  table { font-size: 13px; }
  .table-wrap, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 网格类自适应列数，窄屏不再溢出 */
  .grid, .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---------- 横屏矮高度设备：降低顶部占位 ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .top-bar { height: 84px; }
  .nav-bar { top: 84px; height: 48px; }
  .main-content { margin-top: 140px; min-height: calc(100vh - 140px - 40px); }
}

/* ---------- 通用弹窗内部 移动端安全网（≤768，不影响 PC 端） ----------
 * 覆盖所有 JS 动态生成的弹窗内容（物品详情、NPC 对话、各类面板、仓库/背包选择器等）。
 * 核心三招：长文本可断行、flex 子项可收缩、横向行可换行，从根本上杜绝文字被挤压成一条或溢出。 */
@media (max-width: 768px) {
  .modal-body { word-break: break-word; overflow-wrap: anywhere; }
  /* 弹窗内所有 flex 子项允许收缩，长文本正常换行而非被挤压/溢出 */
  .modal-body * { min-width: 0; }
  /* 横向布局行（标题+操作、信息行等）允许换行 */
  .modal-body [class$="-row"],
  .modal-body [class*="row-"],
  .modal-body [class*="Row"],
  .modal-body .flex-row,
  .modal-body .info-row,
  .modal-body .action-row { flex-wrap: wrap; }
  /* 弹窗内按钮组/操作行：换行且撑满，避免挤在一行被压扁 */
  .modal-body .modal-footer,
  .modal-body .action-bar,
  .modal-body .btn-row { flex-wrap: wrap; }
  .modal-body .modal-footer .btn,
  .modal-body .action-bar .btn { flex: 1 1 auto; }
  /* 两列并排的信息/图标+文字：窄屏堆叠，避免每列过窄文字挤压 */
  .modal-body .detail-row,
  .modal-body .info-line { flex-wrap: wrap; }
  /* 弹窗内表格：允许横向滚动，避免挤成一团 */
  .modal-body table { font-size: 12px; }
  .modal-body .table-wrap,
  .modal-body .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ===== 装备耐久条（背包候选卡 / 已穿戴行 / 通用 tooltip 共用） ===== */
.dura-bar { height: 6px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin: 4px 0 2px; }
.dura-bar i { display: block; height: 100%; border-radius: 4px; transition: width .3s; }
.bp-dura { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--color-text-light, #888); margin-top: 3px; }
.bp-dura .dura-bar { flex: 1; margin: 0; }
.bp-dura small { white-space: nowrap; }
.bp-er-dura { font-size: 11px; color: #888; margin-left: 6px; }
.git-dura { margin-top: 5px; font-size: 12px; padding-top: 5px; border-top: 1px dashed rgba(0,0,0,.08); }
.git-ok { color: #27ae60; }
.git-warn { color: #e67e22; }
.git-broken { color: #e74c3c; font-weight: 600; }
