/* ============================================ */
/*  《炼尘》修仙主题 UI — 完整样式系统          */
/*  配色: 暗金/绛红/青蓝 · 毛玻璃 · 呼吸动画    */
/*  全屏布局 V2: 左28%右72%, 100vh, 日志左下    */
/* ============================================ */

/* ── CSS Variables ── */
:root {
  --lc-bg-0: #07070d;
  --lc-bg-1: #0d1018;
  --lc-bg-2: #151a24;
  --lc-panel: rgba(18, 22, 32, 0.88);
  --lc-panel-solid: #141a25;
  --lc-gold: #d8b45a;
  --lc-gold-soft: #f0d27a;
  --lc-jade: #5eead4;
  --lc-cyan: #60a5fa;
  --lc-purple: #a78bfa;
  --lc-red: #ef4444;
  --lc-green: #34d399;
  --lc-text-strong: #f4ead2;
  --lc-text: #d1d5db;
  --lc-text-muted: #8b93a3;
  --lc-text-faint: #555e70;
  --lc-border: rgba(216, 180, 90, 0.22);
  --lc-border-strong: rgba(216, 180, 90, 0.5);
  --lc-glow-gold: rgba(216, 180, 90, 0.28);
  --lc-glow-jade: rgba(94, 234, 212, 0.2);
  --lc-radius-sm: 6px;
  --lc-radius: 8px;
  --lc-radius-lg: 16px;
  --lc-gap: 12px;
  --bg: var(--lc-bg-0);
  --panel: var(--lc-panel);
  --panel-solid: var(--lc-panel-solid);
  --gold: var(--lc-gold);
  --gold-light: var(--lc-gold-soft);
  --gold-glow: var(--lc-glow-gold);
  --gold-dim: rgba(216, 180, 90, 0.15);
  --red: #c0392b;
  --red-light: var(--lc-red);
  --cyan: #3498db;
  --cyan-light: var(--lc-cyan);
  --green: var(--lc-green);
  --purple: var(--lc-purple);
  --text: var(--lc-text);
  --text-dim: var(--lc-text-faint);
  --border-gold: var(--lc-border);
  --radius: var(--lc-radius);
  --transition: 0.3s ease;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
}

#splash-screen {
  background:
    radial-gradient(circle at 50% 38%, rgba(94, 234, 212, 0.08), transparent 26%),
    radial-gradient(circle at 50% 46%, rgba(216, 180, 90, 0.12), transparent 34%),
    linear-gradient(180deg, #07070d 0%, #0d1018 52%, #07070d 100%) !important;
}
.menu-orbit {
  position: absolute;
  width: min(58vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(216, 180, 90, 0.14);
  border-radius: 50%;
  box-shadow: inset 0 0 42px rgba(94, 234, 212, 0.05), 0 0 80px rgba(216, 180, 90, 0.06);
  animation: menuOrbit 22s linear infinite;
  pointer-events: none;
}
@keyframes menuOrbit {
  to { transform: rotate(360deg); }
}

/* ── Panel Glass Effect ── */
.panel,
.card,
.info-card,
.tb,
.ic,
.log-box,
#reincarnation-modal,
#fate-modal,
#market-modal,
#chain-modal,
.sect-modal-content {
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
}

/* ── Buttons ── */
button,
.btn {
  background: linear-gradient(135deg, #1a1a28, #2a2a3e);
  border: 1px solid var(--gold);
  color: var(--gold);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: 6px;
  letter-spacing: 1px;
  font-family: inherit;
}
button:hover,
.btn:hover {
  box-shadow: 0 0 15px var(--gold-glow);
  transform: translateY(-1px);
  border-color: var(--gold-light);
  color: var(--gold-light);
}
button:active,
.btn:active {
  transform: scale(0.98);
}
button:disabled,
.btn:disabled {
  opacity: 0.4;
  border-color: #4b5563;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ── btn-cultivate: 灵气聚集动画 ── */
.btn-cultivate {
  position: relative;
  overflow: hidden;
}
.btn-cultivate:hover {
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.5), 0 0 40px rgba(46, 204, 113, 0.2);
  border-color: var(--green);
  color: var(--green);
}
.btn-cultivate:hover::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(transparent, rgba(46, 204, 113, 0.1), transparent, rgba(46, 204, 113, 0.1), transparent);
  animation: spin 2s linear infinite;
  pointer-events: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── btn-tribulation: 雷光闪烁 ── */
.btn-tribulation {
  position: relative;
  border-color: var(--red);
  color: var(--red-light);
  background: linear-gradient(135deg, #1a0a0a, #2a1010);
}
.btn-tribulation:hover {
  box-shadow: 0 0 20px rgba(192, 57, 43, 0.6), 0 0 40px rgba(192, 57, 43, 0.3);
  border-color: var(--red-light);
  color: #ff6b6b;
  animation: tribulationGlow 0.3s ease infinite alternate;
}
@keyframes tribulationGlow {
  0%   { box-shadow: 0 0 10px rgba(192, 57, 43, 0.4); }
  100% { box-shadow: 0 0 25px rgba(231, 76, 60, 0.8), 0 0 50px rgba(231, 76, 60, 0.3); }
}

/* ── Progress Bars ── */
.progress-bar {
  background: #111827;
  border-radius: 6px;
  height: 16px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid #374151;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
}
.progress-text {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  line-height: 16px;
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  z-index: 1;
}

.bar-hp { background: linear-gradient(90deg, var(--red), var(--red-light)); animation: pulse 2s infinite; }
.bar-spirit { background: linear-gradient(90deg, var(--cyan), var(--green)); }
.bar-cultivation { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.bar-lifespan { background: linear-gradient(90deg, var(--red), var(--red-light)); }
.bar-exp { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.bar-daoheart { background: linear-gradient(90deg, var(--purple), #bb77ee); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ════════════════════════════════════════════ */
/*  Phase 1: 战斗视觉特效动画                  */
/* ════════════════════════════════════════════ */

/* 攻击闪光（box-shadow脉冲） */
@keyframes attackFlash {
  0% { box-shadow: 0 0 0 rgba(248, 113, 113, 0); }
  30% { box-shadow: 0 0 30px rgba(248, 113, 113, 0.7), 0 0 60px rgba(248, 113, 113, 0.3); }
  60% { box-shadow: 0 0 15px rgba(248, 113, 113, 0.3); }
  100% { box-shadow: 0 0 0 rgba(248, 113, 113, 0); }
}

/* 暴击特效 */
@keyframes critBurst {
  0% { transform: scale(1); filter: brightness(1) hue-rotate(0deg); }
  30% { transform: scale(1.15); filter: brightness(2) hue-rotate(30deg); }
  60% { transform: scale(1.08); filter: brightness(1.5) hue-rotate(15deg); }
  100% { transform: scale(1); filter: brightness(1) hue-rotate(0deg); }
}

/* 闪避效果 */
@keyframes dodgeShimmer {
  0% { opacity: 0.3; filter: blur(1px); text-shadow: 0 0 0 rgba(59,130,246,0); }
  30% { opacity: 0.6; filter: blur(0px); text-shadow: 0 0 12px rgba(59,130,246,0.8); }
  60% { opacity: 0.9; filter: blur(0px); text-shadow: 0 0 8px rgba(59,130,246,0.4); }
  100% { opacity: 1; filter: blur(0px); text-shadow: 0 0 0 rgba(59,130,246,0); }
}

/* 敌人生成入场 */
@keyframes enemyAppear {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  50% { transform: scale(1.1) rotate(5deg); opacity: 0.8; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* 敌人受伤摇晃 */
@keyframes hitShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
}

/* 浮动数字上升 */
@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  60% { transform: translateY(-50px) scale(1.2); opacity: 0.9; }
  100% { transform: translateY(-80px) scale(0.8); opacity: 0; }
}

/* ════════════════════════════════════════════ */
/*  Phase 2: 炼丹炉动画                        */
/* ════════════════════════════════════════════ */

/* 火焰跳动 */
@keyframes flameDance {
  0%, 100% { transform: scaleY(1) scaleX(1); opacity: 0.9; }
  25% { transform: scaleY(1.15) scaleX(0.95); opacity: 1; }
  50% { transform: scaleY(0.85) scaleX(1.1); opacity: 0.8; }
  75% { transform: scaleY(1.1) scaleX(0.9); opacity: 1; }
}

/* 气泡上浮 */
@keyframes bubbleRise {
  0% { transform: translateY(0) scale(0.5); opacity: 0.6; }
  50% { transform: translateY(-15px) scale(1.1); opacity: 0.9; }
  100% { transform: translateY(-30px) scale(0.3); opacity: 0; }
}

/* 成功金光 */
@keyframes successRadiance {
  0% { box-shadow: 0 0 0 rgba(52, 211, 153, 0); }
  20% { box-shadow: 0 0 40px rgba(52, 211, 153, 0.7), 0 0 80px rgba(52, 211, 153, 0.3); }
  50% { box-shadow: 0 0 20px rgba(52, 211, 153, 0.5); }
  80% { box-shadow: 0 0 40px rgba(52, 211, 153, 0.7), 0 0 80px rgba(52, 211, 153, 0.3); }
  100% { box-shadow: 0 0 0 rgba(52, 211, 153, 0); }
}

/* 炸炉效果 */
@keyframes explosion {
  0% { transform: scale(1); filter: brightness(1); }
  20% { transform: scale(1.4); filter: brightness(3) saturate(0); }
  50% { transform: scale(1.2); filter: brightness(2) saturate(2); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* ════════════════════════════════════════════ */
/*  Phase 3: 突破/渡劫特效                      */
/* ════════════════════════════════════════════ */

/* 天雷闪烁 */
@keyframes lightningStrike {
  0% { background: rgba(255, 255, 255, 0); }
  5% { background: rgba(255, 255, 255, 0.95); }
  10% { background: rgba(255, 255, 255, 0); }
  15% { background: rgba(200, 220, 255, 0.85); }
  20% { background: rgba(255, 255, 255, 0); }
  25% { background: rgba(150, 200, 255, 0.7); }
  30% { background: rgba(255, 255, 255, 0); }
  100% { background: rgba(255, 255, 255, 0); }
}

/* 突破光环 */
@keyframes breakthroughAura {
  0% { box-shadow: inset 0 0 0 rgba(212, 168, 75, 0); }
  10% { box-shadow: inset 0 0 80px rgba(212, 168, 75, 0.6), 0 0 40px rgba(212, 168, 75, 0.3); }
  30% { box-shadow: inset 0 0 120px rgba(212, 168, 75, 0.4), 0 0 60px rgba(212, 168, 75, 0.2); }
  60% { box-shadow: inset 0 0 60px rgba(212, 168, 75, 0.2); }
  100% { box-shadow: inset 0 0 0 rgba(212, 168, 75, 0); }
}

/* ── Cards ── */
.card,
.info-card,
.mcard,
.item-card,
.monster-card,
.area-card,
.path-card,
.equip-slot {
  background: var(--panel);
  border: 1px solid var(--border-gold);
  transition: all var(--transition);
}
.card:hover,
.info-card:hover,
.mcard:hover,
.item-card:hover,
.monster-card:hover,
.area-card:hover,
.path-card:hover,
.equip-slot:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 4px 20px var(--gold-dim);
}

/* ── Log Entry ── */
.log-entry {
  margin-bottom: 4px;
  padding: 2px 0;
}
.log-entry:nth-child(odd) {
  color: #a0a0b0;
}

/* ── Log Box ── */
.log-box {
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.8;
  color: #86efac;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #d4a84b44; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #d4a84b88; }

/* ============================================ */
/*  全屏自适应网格布局 V2 (LC-20260526-025)       */
/*  左28%右72%, 100vh, 日志左下                  */
/* ============================================ */

html, body {
  height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

#app {
  width: 100vw;
  height: 100vh;
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: none;
  overflow: hidden;
  box-sizing: border-box;
}
#app.visible {
  display: grid;
  grid-template-rows: 50px 1fr 28px;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "topbar  topbar  topbar"
    "left    main    right"
    "bottomb bottomb bottomb";
  width: 100vw;
  height: 100vh;
}

/* ════════════════════════════════════════════ */
/*  V330: 造梦西游风格布局                       */
/* ════════════════════════════════════════════ */

/* ── 顶部状态栏 ── */
#top-bar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  padding: 4px 12px;
  background: linear-gradient(135deg, #1a1f29, #222a36);
  border-bottom: 1px solid #d4a84b44;
  gap: 8px;
  z-index: 100;
  height: 50px;
  box-sizing: border-box;
}
.top-bar-stat { font-size: 0.78rem; white-space: nowrap; }
.top-bar-hp { color: #f87171; }
.top-bar-spirit { color: #60a5fa; }
.top-bar-gold { color: #fbbf24; }
.top-bar-btn {
  background: transparent; border: 1px solid #d4a84b44;
  color: #d4a84b; padding: 4px 10px; border-radius: 6px;
  cursor: pointer; font-size: 0.8rem;
  min-height: 32px;
}
.top-bar-btn:hover { background: #d4a84b22; }
.avatar-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(216, 180, 90, 0.55);
  background: radial-gradient(circle at 35% 25%, rgba(240, 210, 122, 0.28), rgba(20, 26, 37, 0.92));
  color: var(--lc-text-strong);
  font-weight: 700;
  letter-spacing: 0;
}
.character-name-btn {
  background: transparent;
  border: none;
  color: var(--lc-gold);
  padding: 3px 4px;
  min-height: 28px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0;
}
.character-name-btn:hover {
  box-shadow: none;
  color: var(--lc-gold-soft);
  transform: none;
}
.account-status {
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  color: #9ca3af;
  font-size: 0.72rem;
  padding: 3px 8px;
  white-space: nowrap;
}
.account-local { color: #9ca3af; border-color: rgba(139, 147, 163, 0.35); }
.account-syncing { color: var(--lc-gold-soft); border-color: var(--lc-border-strong); }
.account-synced { color: var(--lc-jade); border-color: rgba(94, 234, 212, 0.35); }
.account-conflict { color: var(--lc-purple); border-color: rgba(167, 139, 250, 0.45); }
.account-error { color: var(--lc-red); border-color: rgba(239, 68, 68, 0.45); }

/* ── 左侧栏 — 固定120px 行动按钮 ── */
#panel-left {
  grid-area: left;
  width: 120px;
  background: linear-gradient(180deg, #161b24 0%, #0e121a 100%);
  border-right: 1px solid #2d3742;
  display: flex;
  flex-direction: column;
  padding: 4px;
  overflow: hidden;
}
.nav-group-title {
  color: var(--lc-text-faint);
  font-size: 0.58rem;
  line-height: 1;
  padding: 7px 4px 3px;
  text-align: center;
}
.quest-card {
  padding: 7px;
  border: 1px solid rgba(216, 180, 90, 0.18);
  border-radius: 6px;
  background: rgba(12, 16, 24, 0.72);
}
.quest-chapter {
  color: var(--lc-gold-soft);
  font-size: 0.68rem;
  line-height: 1.25;
  margin-bottom: 5px;
}
.quest-step {
  color: var(--lc-text-strong);
  font-size: 0.76rem;
  line-height: 1.35;
  margin-bottom: 5px;
}
.quest-hint {
  color: var(--lc-text-muted);
  font-size: 0.66rem;
  line-height: 1.45;
  margin-bottom: 7px;
}
.quest-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(85, 94, 112, 0.35);
}
.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lc-gold), var(--lc-jade));
  transition: width 0.25s ease;
}
.quest-action-btn {
  width: 100%;
  margin-top: 7px;
  padding: 6px 8px;
  font-size: 0.72rem;
}
.panel-left-btn {
  width: 100%;
  padding: 6px 4px;
  font-size: 0.72rem;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  transition: background 0.15s;
  min-height: 44px;
}
.panel-left-btn:hover { background: rgba(212,168,75,0.1); color: #e5e7eb; }
.panel-left-btn .icon { font-size: 1.1rem; }
.panel-left-btn .label { font-size: 0.6rem; }

/* 左侧栏收起 */
#panel-left.collapsed { width: 28px; }
#panel-left.collapsed .panel-left-btn .label { display: none; }

/* ── 右侧栏 — 固定180px ── */
#panel-right {
  grid-area: right;
  width: 180px;
  background: linear-gradient(180deg, #161b24 0%, #0e121a 100%);
  border-left: 1px solid #2d3742;
  display: flex;
  flex-direction: column;
  padding: 4px;
  overflow-y: auto;
  gap: 2px;
}
#panel-right.collapsed { width: 28px; }
#panel-right.collapsed .right-section { display: none; }

/* 右侧栏分段 */
.right-section { margin-bottom: 2px; }
.right-clickable {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.right-clickable:hover,
.right-clickable:focus-visible {
  background: rgba(216, 180, 90, 0.06);
  border-color: rgba(216, 180, 90, 0.18);
  outline: none;
}
.right-section-title {
  font-size: 0.6rem;
  color: #d4a84b66;
  padding: 2px 4px;
  border-bottom: 1px solid #2d3742;
  margin-bottom: 2px;
}
.right-item {
  font-size: 0.65rem;
  padding: 2px 4px;
  color: #9ca3af;
  display: flex;
  justify-content: space-between;
}
.right-item .val { color: #e5e7eb; }
.character-sheet {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  margin-bottom: 16px;
}
.character-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 180, 90, 0.55);
  background: radial-gradient(circle at 35% 25%, rgba(240, 210, 122, 0.28), rgba(20, 26, 37, 0.95));
  color: var(--lc-text-strong);
  font-size: 1.6rem;
  font-weight: 800;
}
.character-sheet-name {
  color: var(--lc-text-strong);
  font-size: 1.15rem;
  font-weight: 700;
}
.character-sheet-sub,
.ui-detail-muted {
  color: var(--lc-text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}
.ui-detail-title {
  color: var(--lc-text-strong);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.ui-detail-row {
  color: var(--lc-text);
  margin-bottom: 8px;
}
.ui-detail-empty {
  color: var(--lc-text-muted);
  padding: 18px 8px;
  line-height: 1.6;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  text-align: left;
}
.detail-cell {
  background: rgba(12, 16, 24, 0.72);
  border: 1px solid rgba(85, 94, 112, 0.35);
  border-radius: 6px;
  padding: 8px 10px;
}
.detail-cell span {
  display: block;
  color: var(--lc-text-muted);
  font-size: 0.75rem;
}
.detail-cell strong {
  display: block;
  color: var(--lc-text-strong);
  font-size: 0.92rem;
  margin-top: 2px;
}
.detail-list-item {
  text-align: left;
  background: rgba(12, 16, 24, 0.72);
  border: 1px solid rgba(85, 94, 112, 0.35);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.detail-list-item strong {
  display: block;
  color: var(--lc-text-strong);
  margin-bottom: 4px;
}
.detail-list-item span {
  color: var(--lc-text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ── 主内容区 ── */
#panel-main {
  grid-area: main;
  position: relative;
  overflow: hidden;
  background: rgba(14,18,26,0.9);
}
#map-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* ── 内嵌面板（占据主内容区） ── */
#area-detail,
#combat-result,
#tribulation-ui,
#node-detail-embed,
#alchemy-embed,
#sect-embed,
#market-embed,
#dungeon-embed,
#pvp-embed {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  background: rgba(14,18,26,0.97);
  padding: 12px;
  z-index: 10;
}

/* ── 怪物战斗HUD ── */
#monster-list {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  background: rgba(14,18,26,0.97);
  padding: 12px;
  z-index: 10;
}
#monster-list:not(:empty) {
  display: block;
}

/* ── 底栏 ── */
#bottom-bar {
  grid-area: bottomb;
  display: flex;
  align-items: center;
  padding: 2px 8px;
  background: #0e121a;
  border-top: 1px solid #2d3742;
  font-size: 0.6rem;
  color: #6b7280;
  gap: 12px;
  height: 28px;
  box-sizing: border-box;
}
#bottom-bar .log-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#bottom-bar .quick-btn {
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 0.6rem;
  padding: 2px 6px;
}
#bottom-bar .quick-btn:hover { color: #d4a84b; }

/* ── 转换面板（物品列表） ── */
.item-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  grid-gap: 10px;
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 5px;
}
.item-card, .monster-card {
  background-color: #222a31;
  border: 1px solid #3b4854;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s;
}
.item-card:hover, .monster-card:hover {
  border-color: #d4af37;
}
.item-card button, .monster-card button {
  margin-top: 8px;
  width: 100%;
  padding: 6px;
  font-size: 0.8rem;
}

/* ── Headings ── */
h1, h2, h3 {
  color: var(--gold);
  letter-spacing: 2px;
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--gold-glow); }
  50% { box-shadow: 0 0 20px var(--gold-glow); }
}
.fade-in { animation: fadeIn 0.4s ease; }

/* ── Node Current (map) ── */
.node-current {
  animation: nodePulse 2s ease-in-out infinite;
}
@keyframes nodePulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(212, 168, 75, 0.5)); }
  50% { filter: drop-shadow(0 0 12px rgba(212, 168, 75, 0.9)); }
}

/* ── Map Path Lines Animation ── */
.map-connection-active {
  stroke-dasharray: 8, 4;
  animation: dashMove 0.8s linear infinite;
}
.map-connection-highlight {
  stroke-dasharray: 10, 5;
  animation: dashMove 0.6s linear infinite;
}
@keyframes dashMove {
  to { stroke-dashoffset: -24; }
}

/* ── Map SVG Styles ── */
.map-node-unlocked circle { fill: #2d6a4f; stroke: #34d399; stroke-width: 2; }
.map-node-current circle { fill: #d4af37; stroke: #fbbf24; stroke-width: 3; }
.map-node-discoverable circle { fill: none; stroke: #6b7280; stroke-width: 1.5; stroke-dasharray: 3,2; }
.map-node-hidden circle { fill: #1f2937; stroke: #374151; stroke-width: 1; }
.map-node-icon { fill: #fff; pointer-events: none; }
.map-node-label { fill: #d1d5db; pointer-events: none; }
.map-node-cost { fill: #fbbf24; pointer-events: none; }
.map-connection { stroke: #374151; stroke-width: 2; fill: none; }
.map-connection-active { stroke: #4b5563; stroke-width: 2; }
.map-connection-highlight { stroke: #d4af37; stroke-width: 2.5; }
.map-connection-locked { stroke: #1f2937; stroke-width: 1.5; stroke-dasharray: 4,4; }

/* ── Reincarnation / Fate overlay modal extras ── */
#reincarnation-modal h1,
#fate-modal h1 {
  color: var(--gold-light);
  font-size: 1.6rem;
  letter-spacing: 6px;
}

/* ── Sect system styles ── */
#sect-overlay .stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
}
#sect-overlay .progress-bar {
  background-color: #111827;
  border-radius: 6px;
  height: 16px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid #374151;
  position: relative;
}
#sect-overlay .progress-fill {
  background: linear-gradient(90deg, #8c6d31, #d4af37);
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
}

/* ── Life bar ── */
#ui-lifespan-low {
  color: #ef4444;
  animation: pulse 1s infinite;
}

/* ── Sect scrollbar ── */
#sect-overlay ::-webkit-scrollbar { width: 6px; }
#sect-overlay ::-webkit-scrollbar-track { background: #151b21; }
#sect-overlay ::-webkit-scrollbar-thumb { background: #3b4854; border-radius: 3px; }
#sect-overlay ::-webkit-scrollbar-thumb:hover { background: #d4af37; }

/* ── Fixed Overlays (modal screens) ── */
#fate-overlay, #market-overlay, #event-chain-overlay,
#sect-overlay, #alchemy-overlay {
  position: fixed !important;
  top: 0; left: 0; width: 100vw; height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999 !important;
}
/* 轮回转世覆盖层在所有 UI 之上 */
#reincarnation-overlay {
  z-index: 10000 !important;
}

/* ── 💎 道心特质徽章 ── */
.dao-trait-badge {
  background: #2d1b69;
  border: 1px solid #7c3aed;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: #c4b5fd;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── 🩸 暗伤警告色 ── */
.injury-warning { color: #f97316; }
.injury-danger  { color: #ef4444; animation: pulse 1s infinite; }

/* ── ☯️ 运势颜色 ── */
.luck-daji    { color: #fbbf24; }
.luck-ji      { color: #3b82f6; }
.luck-ping    { color: #34d399; }
.luck-xiong   { color: #9ca3af; }
.luck-daxiong { color: #6b7280; }

/* ── 🔥 灵根品级颜色 ── */
.root-quality-huang { color: #9ca3af; }
.root-quality-xuan  { color: #a78bfa; }
.root-quality-di    { color: #fbbf24; }
.root-quality-tian  { color: #ef4444; }

/* ── 区域卡片样式 ── */
.area-card {
  background: #222a31;
  border: 1px solid #3b4854;
  border-radius: 8px;
  padding: 16px;
  cursor: default;
  transition: border-color 0.2s;
}
.area-card:hover {
  border-color: #d4af37;
}
.area-card.unlocked {
  cursor: pointer;
}
.area-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 350px;
  overflow-y: auto;
}

/* ════════════════════════════════════════════ */
/*  V312: Emoji 视觉化                         */
/* ════════════════════════════════════════════ */

/* 怪物卡片呼吸浮动 */
@keyframes monsterBreathing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* 怪物卡片样式 */
.monster-card {
  text-align: center;
  padding: 16px;
  background: linear-gradient(180deg, #222a31, #1a2028);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

/* 怪物大图标 */
.monster-emoji-large {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px currentColor);
  animation: monsterBreathing 3s ease-in-out infinite;
}

/* 物品卡视觉升级 */
.item-card-visual {
  background: #222a31;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.item-card-visual:hover {
  transform: translateY(-2px);
}

/* Boss 金色边框光效 */
.monster-card-rank-boss {
  border: 2px solid #fbbf24 !important;
  box-shadow: 0 0 20px rgba(251,191,36,0.4), inset 0 0 20px rgba(251,191,36,0.05) !important;
}

/* 精英紫色边框 */
.monster-card-rank-elite {
  border: 2px solid #8b5cf6 !important;
  box-shadow: 0 0 15px rgba(139,92,246,0.3), inset 0 0 15px rgba(139,92,246,0.03) !important;
}

/* 普通灰色边框 */
.monster-card-rank-normal {
  border: 2px solid #4b5563 !important;
}

/* 物品品质边框 */
.item-quality-common  { border-color: #4b5563 !important; }
.item-quality-rare    { border-color: #fbbf24 !important; box-shadow: 0 0 8px rgba(251,191,36,0.2) !important; }
.item-quality-epic    { border-color: #8b5cf6 !important; box-shadow: 0 0 8px rgba(139,92,246,0.2) !important; }
.item-quality-legend  { border-color: #ef4444 !important; box-shadow: 0 0 8px rgba(239,68,68,0.2) !important; }

/* ── 详情页样式 ── */
.detail-section {
  background: #1a2028;
  border: 1px solid #2d3742;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}
.detail-section h4 {
  color: #d4af37;
  margin: 0 0 8px 0;
  font-size: 0.95rem;
}
.drop-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #9ca3af;
  padding: 2px 0;
}

/* ── 🔄 轮回转世覆盖层样式 ── */
#reincarnation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 12, 0.94);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}
#reincarnation-modal {
  background: #161d24;
  border: 2px solid #d4af37;
  border-radius: 16px;
  padding: 32px 40px;
  max-width: 780px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}
#reincarnation-modal h1 {
  color: #d4af37;
  font-size: 1.6rem;
  letter-spacing: 6px;
  margin: 0 0 8px 0;
}
#reincarnation-modal .subtitle {
  color: #6b7280;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* ── 结算页样式 ── */
.result-card {
  text-align: center;
  padding: 20px;
  background: #1a2028;
  border-radius: 8px;
  margin-bottom: 12px;
}
.result-card .result-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}
.result-card .result-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 8px;
}
.result-reward {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 4px 0;
  color: #fbbf24;
}

/* ── 渡劫进度条 ── */
#tribulation-progress .progress-bar {
  background-color: #111827;
  border-radius: 6px;
  height: 16px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid #374151;
  position: relative;
}

/* ── Stat Grid / Stat Card (已从 ui.js style.innerHTML 迁移) ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.stat-card {
  background: #1a222a;
  border: 1px solid #2d3742;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}
.stat-card .stat-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: #9ca3af;
}
.stat-card .stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fbbf24;
  margin-top: 2px;
}

/* ── Path Grid (轮回转世道途选择) ── */
.path-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── 响应式 ── */
@media (max-width: 640px) {
  * { touch-action: manipulation; }

  #app.visible {
    grid-template-columns: 1fr !important;
    grid-template-rows: 44px 1fr 28px !important;
    grid-template-areas:
      "topbar"
      "main"
      "bottomb" !important;
  }
  #panel-left { display: none !important; }
  #panel-right { display: none !important; }

  #top-bar { height: 44px; font-size: 0.72rem; padding: 2px 6px; overflow-x: auto; flex-wrap: nowrap; }

  /* Touch target 规范化 */
  .btn, .top-bar-btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  /* 字体适配 */
  .combat-log, .event-text {
    font-size: 14px !important;
  }

  /* 进度条高度 */
  .progress-bar {
    height: 20px;
  }

  .equip-row {
    font-size: 0.82rem;
  }

  /* 覆盖层通用宽度适配 */
  [id$="-overlay"] > div {
    max-width: 94vw !important;
    width: 94vw !important;
    left: 3vw !important;
    margin: 0 !important;
  }
  #market-overlay > div {
    max-width: 94vw !important;
    width: 94vw !important;
    left: 3vw !important;
    margin: 0 !important;
    padding: 16px !important;
  }
  #event-chain-overlay > div {
    max-width: 94vw !important;
    width: 94vw !important;
    padding: 20px !important;
  }
  #achievement-overlay > div {
    max-width: 94vw !important;
    width: 94vw !important;
    padding: 16px !important;
  }
  #save-overlay > div {
    max-width: 94vw !important;
    width: 94vw !important;
    padding: 16px !important;
  }
  #sect-overlay > div {
    max-width: 94vw !important;
    width: 94vw !important;
    padding: 16px !important;
  }
  #alchemy-overlay > div {
    max-width: 94vw !important;
    width: 94vw !important;
    padding: 12px !important;
  }
  #tower-overlay > div {
    max-width: 94vw !important;
    width: 94vw !important;
    padding: 16px !important;
  }
  #pvp-overlay > div {
    max-width: 94vw !important;
    width: 94vw !important;
    padding: 16px !important;
  }
  #fate-overlay > div,
  #path-overlay > div {
    max-width: 94vw !important;
    width: 94vw !important;
    padding: 24px 16px !important;
  }
  #tribulation-ui {
    padding: 8px;
  }

  /* 嵌入内容适配 */
  .item-list {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    max-height: 180px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .stat-card {
    padding: 10px 6px;
  }
  .stat-card .stat-value {
    font-size: 1rem;
  }
  .area-grid {
    grid-template-columns: 1fr;
    max-height: 250px;
  }
  .monster-card {
    padding: 10px;
  }
  .monster-emoji-large {
    font-size: 2.5rem;
  }
  .item-card-visual {
    padding: 8px;
  }
  #alchemy-recipe-list {
    flex: 0 0 40% !important;
  }
  #achievement-grid {
    grid-template-columns: 1fr !important;
  }
  #pvp-opponents {
    grid-template-columns: 1fr !important;
  }
  #tower-actions {
    flex-direction: column !important;
  }
  #tower-actions .btn {
    width: 100%;
  }
  #pvp-battle-area > div:last-child {
    flex-direction: column !important;
  }
  #pvp-battle-area > div:last-child .btn {
    width: 100%;
  }
}

/* ── V314: 右侧栏条目样式（迁移至 V330） ── */
.equip-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.78rem;
  border-bottom: 1px solid #1a1f29;
}
.equip-row span:first-child { color: #6b7280; }
.equip-row strong { color: #e5e7eb; }
.dao-stat {
  font-size: 0.78rem;
  color: #a78bfa;
  padding: 4px 0;
}
.dao-trait {
  font-size: 0.7rem;
  color: #9ca3af;
  padding: 2px 0;
}

/* 储物迷你列表 */
#storage-mini-list {
  font-size: 0.72rem;
}
.storage-mini-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  color: #9ca3af;
  border-bottom: 1px solid #1a1f29;
}
.storage-mini-item:last-child {
  border-bottom: none;
}

/* ── V314: 右侧栏样式 ── */
.sidebar-section-item {
  font-size: 0.72rem;
  padding: 6px 8px;
  margin: 3px 0;
  background: #1a2028;
  border-radius: 4px;
  border-left: 2px solid #d4a84b44;
}
.sidebar-item-name { color: #e5e7eb; }
.sidebar-item-level { color: #d4a84b; font-size: 0.65rem; margin-left: 4px; }
.sidebar-item-bar {
  height: 3px; background: #2d3742; border-radius: 2px; margin: 3px 0;
}
.sidebar-item-fill {
  height: 100%; background: linear-gradient(90deg, #d4a84b, #fbbf24);
  border-radius: 2px;
}
.sidebar-item-effect { color: #9ca3af; font-size: 0.65rem; }

/* ── V315: 嵌入模式样式 ── */
.embed-header {
  font-size: 1.1rem;
  font-weight: bold;
  color: #d4a84b;
  padding-bottom: 8px;
  border-bottom: 1px solid #2d3742;
  margin-bottom: 12px;
}
.embed-close {
  float: right;
  background: transparent;
  border: 1px solid #4b5563;
  color: #9ca3af;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}
.embed-close:hover {
  background: rgba(239,68,68,0.2);
  border-color: #ef4444;
  color: #ef4444;
}
