/* ============== 基础重置 ============== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #0f0a2e;
  color: #f3f4f6;
  overscroll-behavior: none;
}
body {
  background: radial-gradient(ellipse at top, #1e1b4b 0%, #0f0a2e 60%);
  background-attachment: fixed;
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea, select {
  font-family: inherit;
  user-select: text;
  -webkit-user-select: text;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

#app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

/* ============== 顶部状态栏 ============== */
#topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 10, 46, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 12px rgba(168,85,247,0.5);
}
.t-name { font-weight: 700; font-size: 16px; }
.t-streak { font-size: 11px; color: #fbbf24; }
.topbar-right { display: flex; gap: 8px; }
.stat {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.08);
  padding: 6px 12px; border-radius: 20px;
  font-weight: 700;
}
.stat-icon { font-size: 14px; }
.stat-val { color: #fbbf24; }

/* ============== 主内容 ============== */
#view {
  flex: 1;
  padding: 12px;
  padding-bottom: 80px;
  overflow-y: auto;
}

.card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
}
.section-title {
  font-size: 16px; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.empty {
  text-align: center; color: #6b7280; padding: 32px 16px; font-size: 14px;
}

/* ============== Hero 卡片（今日概览） ============== */
.hero-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(168,85,247,0.2));
  border-color: rgba(168,85,247,0.4);
  text-align: center;
}
.hero-title { font-size: 18px; font-weight: 700; }
.hero-sub { color: #c7d2fe; margin: 6px 0; font-size: 13px; }
.hero-sub b { color: #fbbf24; }
.hero-coins { font-size: 14px; margin-top: 4px; }
.hero-coins b { color: #fbbf24; font-size: 18px; }
.hero-comment {
  margin-top: 10px; padding: 10px;
  background: rgba(251,191,36,0.12);
  border-radius: 10px; color: #fde68a;
  font-size: 13px; text-align: left;
}

/* ============== 任务卡片 ============== */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px;
  transition: all 0.2s;
}
.task-approved {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.3);
}
.task-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 11px; padding: 2px 8px;
  background: rgba(255,255,255,0.08); border-radius: 10px;
  color: #d1d5db;
}
.tag-proof { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.badge-ok { background: rgba(34,197,94,0.2); color: #6ee7b7; }
.badge-pending { background: rgba(245,158,11,0.2); color: #fcd34d; }
.badge-rej { background: rgba(239,68,68,0.2); color: #fca5a5; }
.proof-thumb {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 8px; margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.15);
}
.task-action { flex-shrink: 0; }
.task-done { color: #6ee7b7; font-size: 13px; font-weight: 600; }

/* ============== 按钮 ============== */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; padding: 9px 18px;
  border-radius: 10px; font-weight: 600; font-size: 14px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary:disabled { opacity: 0.4; box-shadow: none; }
.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #422006; padding: 9px 18px;
  border-radius: 10px; font-weight: 700; font-size: 14px;
  box-shadow: 0 2px 8px rgba(251,191,36,0.4);
}
.btn-gold:disabled { opacity: 0.4; box-shadow: none; }
.btn-gold:active { transform: scale(0.96); }
.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #e5e7eb; padding: 9px 18px;
  border-radius: 10px; font-weight: 600; font-size: 14px;
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-secondary:active { transform: scale(0.96); }
.btn-warn {
  background: rgba(239,68,68,0.18);
  color: #fca5a5; padding: 9px 18px;
  border-radius: 10px; font-weight: 600; font-size: 14px;
}
.btn-warn:active { transform: scale(0.96); }
.btn-mini {
  background: rgba(255,255,255,0.1); color: #e5e7eb;
  padding: 4px 10px; border-radius: 8px; font-size: 12px;
}
.btn-text {
  color: #818cf8; font-size: 13px; padding: 8px;
  display: block; margin: 0 auto;
}

/* ============== 图鉴 ============== */
.power-card {
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(251,191,36,0.15));
  border-color: rgba(251,191,36,0.4);
  text-align: center;
}
.power-num {
  font-size: 40px; font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(251,191,36,0.4);
}
.power-label { color: #fde68a; font-size: 13px; margin-top: 2px; }
.power-syn { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.syn-tag {
  font-size: 11px; padding: 3px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.06); color: #6b7280;
  border: 1px solid transparent;
}
.syn-tag.syn-on {
  background: rgba(251,191,36,0.18); color: #fde68a;
  border-color: rgba(251,191,36,0.4);
}

.faction-block {
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  border-left-width: 4px;
  border-radius: 14px;
  padding: 0 0 12px 0;
  margin-bottom: 12px;
  overflow: hidden;
}
.faction-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; color: #fff;
  font-weight: 700;
}
.faction-emoji { font-size: 22px; }
.faction-name { flex: 1; font-size: 15px; }
.faction-count { font-size: 13px; opacity: 0.9; }
.faction-prog {
  height: 4px; background: rgba(255,255,255,0.08);
  margin: 0 14px 10px; border-radius: 2px; overflow: hidden;
}
.faction-prog div { height: 100%; transition: width 0.4s; }
.mech-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 0 12px;
}
.mech-cell {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  transition: transform 0.15s;
}
.mech-cell.owned:active { transform: scale(0.94); }
.mech-emoji { font-size: 32px; line-height: 1; }
.mech-locked { filter: brightness(0.4); }
.mech-name { font-size: 11px; font-weight: 600; margin-top: 4px; }
.mech-stars { font-size: 10px; letter-spacing: 1px; }
.mech-star-count {
  font-size: 9px; color: #fbbf24;
  background: rgba(251,191,36,0.15);
  border-radius: 6px; padding: 1px 4px;
  margin-top: 2px; display: inline-block;
}
.mech-detail { padding: 12px; }
.mech-skill {
  display: inline-block; padding: 4px 12px;
  background: rgba(99,102,241,0.2); border-radius: 12px;
  color: #c7d2fe; font-size: 13px;
}

/* ============== 召唤 / 抽卡 ============== */
.gacha-banner {
  background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(168,85,247,0.15));
  border-color: rgba(251,191,36,0.4);
  text-align: center;
}
.gacha-title { font-size: 22px; font-weight: 800; }
.gacha-sub { color: #e5e7eb; font-size: 13px; margin: 4px 0; }
.gacha-coins { color: #fbbf24; font-weight: 700; margin-top: 4px; }

.gacha-pool {
  border: 1px solid;
}
.gacha-pool-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.gacha-pool-name { font-size: 17px; font-weight: 700; }
.rate-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rate-pill {
  font-size: 11px; padding: 2px 8px;
  border: 1px solid; border-radius: 10px;
}
.pity { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.gacha-pool-btns { display: flex; gap: 8px; }
.gacha-pool-btns button { flex: 1; }

.rule-list { padding-left: 18px; font-size: 13px; color: #d1d5db; line-height: 1.8; }
.rule-list li { margin: 2px 0; }

/* 抽卡结果 */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  animation: fadeIn 0.2s;
}
.modal-box {
  background: #1e1b4b;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.draw-result { text-align: center; }
.draw-title { font-size: 20px; font-weight: 800; margin-bottom: 12px; color: #fbbf24; }
.draw-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.draw-cell {
  position: relative;
  background: rgba(255,255,255,0.05);
  border: 2px solid;
  border-radius: 12px; padding: 14px 8px;
}
.draw-cell.is-new { animation: pulseGlow 1s infinite alternate; }
.new-flag {
  position: absolute; top: -8px; right: -4px;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 8px;
  animation: shake 0.5s;
}

/* ============== 兑换商城 ============== */
.reward-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.reward-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px 10px; text-align: center;
}
.reward-card.disabled { opacity: 0.5; }
.reward-name { font-weight: 600; font-size: 13px; margin: 6px 0 4px; }
.reward-cost { color: #fbbf24; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.reward-btn { font-size: 12px; padding: 6px 14px; }

/* ============== 家长端 ============== */
.parent-lock { text-align: center; padding: 32px 20px; }
.parent-tabs {
  display: flex; gap: 4px; margin-bottom: 12px;
  overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.parent-tabs::-webkit-scrollbar { display: none; }
.ptab {
  white-space: nowrap; flex-shrink: 0;
  padding: 8px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.06); color: #9ca3af;
  font-size: 13px; font-weight: 600;
}
.ptab.active { background: #6366f1; color: #fff; }

.audit-list { display: flex; flex-direction: column; gap: 10px; }
.audit-card {
  background: rgba(255,255,255,0.04);
  border-radius: 12px; padding: 12px;
}
.audit-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; flex-wrap: wrap; gap: 4px;
}
.audit-img {
  width: 100%; max-height: 280px; object-fit: contain;
  border-radius: 10px; margin-bottom: 8px;
  background: #000;
  border: 1px solid rgba(255,255,255,0.1);
}
.audit-btns { display: flex; gap: 8px; }
.audit-btns button { flex: 1; }

.task-admin-list { display: flex; flex-direction: column; gap: 6px; }
.admin-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  font-size: 13px;
}

.bar-chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 160px; padding: 0 4px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 140px; }
.bar-val { font-size: 10px; color: #fbbf24; margin-bottom: 2px; }
.bar { width: 70%; background: linear-gradient(180deg, #8b5cf6, #6366f1); border-radius: 4px 4px 0 0; min-height: 4px; }
.bar-label { font-size: 10px; color: #9ca3af; margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-box {
  background: rgba(255,255,255,0.05);
  border-radius: 10px; padding: 12px 6px; text-align: center;
}
.sb-num { font-size: 22px; font-weight: 800; color: #fbbf24; }
.sb-label { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.field-label { display: block; font-size: 12px; color: #9ca3af; margin: 8px 0 4px; }
.text-input {
  width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; color: #fff;
  font-size: 15px;
}
.text-input:focus { outline: none; border-color: #6366f1; }
textarea.text-input { resize: vertical; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-btn {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px; font-size: 20px;
  border: 1px solid transparent;
}
.emoji-btn.on { border-color: #6366f1; background: rgba(99,102,241,0.25); }

.modal-head { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.log-list { max-height: 50vh; overflow-y: auto; }
.log-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
}

/* ============== 底部 Tab ============== */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 540px;
  display: flex;
  background: rgba(15, 10, 46, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 100;
}
.tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 6px 0; color: #6b7280;
  transition: color 0.2s;
}
.tab.active { color: #818cf8; }
.tab-icon { font-size: 22px; line-height: 1; position: relative; }
.tab-name { font-size: 11px; }
/* Tab 红点徽标 */
.tab-badge {
  position: absolute; top: -4px; right: -10px;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px rgba(15,10,46,0.9);
}
/* 家长端顶栏 */
.parent-topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.parent-topbar .parent-tabs { flex: 1; margin-bottom: 0; }
.ptab-refresh {
  flex-shrink: 0; width: 36px; height: 36px;
  background: rgba(99,102,241,0.15); color: #818cf8;
  border-radius: 10px; font-size: 16px;
}
.ptab-badge {
  display: inline-block; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 6px;
  border-radius: 8px; margin-left: 2px;
}

/* ============== 加载态 ============== */
.loading-box { text-align:center; padding:60px 20px; color:#9ca3af; }
.spinner {
  width:36px; height:36px;
  border:3px solid rgba(255,255,255,0.15);
  border-top-color:#818cf8; border-radius:50%;
  margin:0 auto 12px; animation:spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== Toast ============== */
#toasts {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; width: 90%; max-width: 380px;
}
.toast {
  padding: 10px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; text-align: center;
  opacity: 0; transform: translateY(-12px);
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-info { background: #6366f1; color: #fff; }
.toast-ok { background: #22c55e; color: #fff; }
.toast-err { background: #ef4444; color: #fff; }

/* ============== 安装提示 ============== */
.install-hint {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: #1e1b4b; border: 1px solid rgba(99,102,241,0.4);
  border-radius: 14px; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; z-index: 500;
  max-width: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: slideUp 0.3s;
}
.install-hint button {
  padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
}
.install-hint button#install-now { background: #6366f1; color: #fff; }
.install-hint button#install-no { background: rgba(255,255,255,0.1); color: #9ca3af; }

/* ============== 动画 ============== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulseGlow {
  from { box-shadow: 0 0 8px currentColor; }
  to { box-shadow: 0 0 24px currentColor; }
}
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.3; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============== 滚动条 ============== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============== 出征（闯关） ============== */
.chapter-block {
  background: rgba(255,255,255,0.04); border: 1px solid; border-radius: 16px;
  overflow: hidden; margin-bottom: 16px;
}
.chapter-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; color: #fff;
}
.chapter-icon { font-size: 28px; }
.chapter-name { font-size: 16px; font-weight: 700; }
.chapter-sub { font-size: 12px; opacity: 0.9; margin-top: 2px; }
.stage-list { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.stage-card {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04); border-radius: 12px; padding: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.15s;
}
.stage-card.open { border-color: rgba(34,197,94,0.35); }
.stage-card.cleared { opacity: 0.6; background: rgba(34,197,94,0.08); }
.stage-card.locked { opacity: 0.5; }
.stage-card.open:active { transform: scale(0.98); }
.stage-boss { font-size: 36px; width: 48px; text-align: center; flex-shrink: 0; }
.stage-info { flex: 1; min-width: 0; }
.stage-name { font-size: 14px; font-weight: 600; }
.stage-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.stage-meta .tag { font-size: 11px; }
.tag-reward { background: rgba(251,191,36,0.18); color: #fbbf24; }
.tag-ok { background: rgba(34,197,94,0.18); color: #22c55e; }
.tag-warn { background: rgba(245,158,11,0.18); color: #f59e0b; }
.stage-desc { font-size: 12px; color: #888; margin-top: 6px; }
.stage-action { flex-shrink: 0; }
.stage-badge { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 8px; display: inline-block; }
.stage-done { background: rgba(34,197,94,0.2); color: #22c55e; }
.stage-lock { background: rgba(156,163,175,0.15); color: #9ca3af; }
.battle-btn { padding: 8px 14px; font-size: 13px; }
.battle-btn:disabled { opacity: 0.5; }

/* ============== 战斗动画 ============== */
.battle-anim { background: rgba(0,0,0,0.85); }
.battle-stage {
  background: linear-gradient(180deg, #1e1b4b, #0f172a);
  border: 1px solid rgba(99,102,241,0.4); border-radius: 20px;
  padding: 24px; width: 92%; max-width: 400px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  position: relative;
}
.battle-side { flex: 1; text-align: center; }
.bs-emoji { font-size: 56px; animation: pulseGlow 1.4s ease-in-out infinite alternate; }
.battle-boss .bs-emoji { animation: shake 0.6s infinite; }
.bs-name { font-size: 12px; color: #cbd5e1; margin: 6px 0; }
.bs-bar {
  height: 10px; background: rgba(255,255,255,0.08); border-radius: 6px; overflow: hidden; margin: 8px 4px;
}
.bs-fill { height: 100%; border-radius: 6px; }
.me-fill { background: linear-gradient(90deg, #22c55e, #4ade80); }
.boss-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
.bs-num { font-size: 14px; font-weight: 700; color: #fff; }
.battle-vs { font-size: 32px; animation: shake 0.5s infinite; color: #fbbf24; }
.battle-result-text {
  position: absolute; bottom: 8px; left: 0; right: 0;
  text-align: center; font-size: 20px; font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* ============== 成就 ============== */
.ach-count {
  display: inline-block; background: rgba(99,102,241,0.25); color: #c7d2fe;
  padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700;
}
.ach-list { max-height: 60vh; overflow-y: auto; }
.ach-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: rgba(255,255,255,0.04); border-radius: 12px;
  margin-bottom: 8px; border: 1px solid rgba(255,255,255,0.06);
}
.ach-item.ach-done { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.08); }
.ach-icon { font-size: 32px; width: 44px; text-align: center; flex-shrink: 0; }
.ach-main { flex: 1; min-width: 0; }
.ach-name { font-size: 14px; font-weight: 700; color: #e5e7eb; }
.ach-tick { color: #22c55e; margin-left: 4px; }
.ach-desc { font-size: 12px; color: #888; margin-top: 2px; }
.ach-reward { font-size: 13px; font-weight: 700; color: #fbbf24; flex-shrink: 0; }

/* ============== 连击加成 ============== */
.streak-bonus {
  display: inline-block; background: rgba(251,191,36,0.22); color: #fbbf24;
  padding: 1px 7px; border-radius: 8px; font-size: 11px; font-weight: 700;
  margin-left: 4px; vertical-align: middle;
}
.streak-hint {
  margin-top: 8px; padding: 8px 12px; border-radius: 10px;
  font-size: 12px; color: #fbbf24; background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
}
.streak-hint.on {
  color: #fde68a; background: rgba(251,191,36,0.18);
  border-color: rgba(251,191,36,0.5);
  animation: pulseGlow 2s ease-in-out infinite alternate;
}

/* ============== 页游风格战斗舞台 ============== */
.battle-arena {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(ellipse at center, #1a1040 0%, #0a0520 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; overflow: hidden;
}
.battle-header {
  display: flex; align-items: center; gap: 16px;
  font-size: 18px; font-weight: 800; margin-bottom: 24px;
  text-shadow: 0 0 20px rgba(168,85,247,0.5);
}
.battle-field {
  display: flex; align-items: center; gap: 20px; width: 100%; max-width: 500px;
}
.battle-side { flex: 1; text-align: center; }
.battle-vs-icon { font-size: 32px; color: #fbbf24; animation: pulse 1s infinite; flex-shrink: 0; }
.battle-mech-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 10px; }
.battle-mech-card {
  background: rgba(255,255,255,0.06); border: 2px solid; border-radius: 12px;
  padding: 6px 8px; text-align: center; min-width: 60px;
}
.bm-emoji { font-size: 36px; line-height: 1.2; }
.bm-name { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.bm-element { font-size: 11px; font-weight: 600; }
.battle-hp-bar-wrap {
  height: 12px; background: rgba(255,255,255,0.08); border-radius: 6px;
  overflow: hidden; margin: 6px 0;
}
.battle-hp-bar {
  height: 100%; background: linear-gradient(90deg, #22c55e, #10b981);
  border-radius: 6px; transition: width 0.3s ease;
}
.battle-power-label { font-size: 12px; color: #888; margin-top: 2px; }
.battle-type-hint {
  margin-top: 16px; padding: 8px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 700; text-align: center;
  opacity: 0; transform: translateY(10px);
  transition: all 0.4s ease;
}
.battle-type-hint.show { opacity: 1; transform: translateY(0); }
.battle-type-hint.advantage {
  background: rgba(34,197,94,0.2); color: #4ade80;
  border: 1px solid rgba(34,197,94,0.4);
}
.battle-type-hint.weak {
  background: rgba(239,68,68,0.2); color: #f87171;
  border: 1px solid rgba(239,68,68,0.4);
}
.battle-result-text {
  margin-top: 20px; text-align: center; color: #fff;
  opacity: 0; transform: scale(0.8); transition: all 0.5s ease;
}
.battle-result-text.show { opacity: 1; transform: scale(1); }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.8; }
}
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-80px); }
}

/* ============== 世界大地图 ============== */
.world-map-wrap {
  position: relative; width: 100%; aspect-ratio: 4/3;
  background: radial-gradient(ellipse at 50% 30%, #1a1040 0%, #0a0520 60%, #050210 100%);
  border-radius: 16px; overflow: hidden; margin-bottom: 12px;
}
.world-map-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0.45;
}
.world-path { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.world-regions { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.world-region {
  position: absolute; transform: translate(-50%,-50%);
  font-size: 11px; font-weight: 800; text-shadow: 0 1px 6px #000;
  letter-spacing: 1px;
}
.world-map { position: absolute; inset: 0; z-index: 2; }
.world-node {
  position: absolute; transform: translate(-50%,-50%);
  text-align: center; cursor: default; z-index: 2;
  width: 44px; height: 44px;
}
.world-node.open { cursor: pointer; }
.world-node.open:active { transform: translate(-50%,-50%) scale(1.15); }
.world-node.cleared { opacity: 0.5; }
.world-node.locked { opacity: 0.25; pointer-events: none; }
.wn-scene-preview {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  width: 80px; height: 45px; border-radius: 6px; overflow: hidden;
  border: 2px solid var(--glow, #fbbf24); margin-bottom: 4px;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.world-node.open:hover .wn-scene-preview,
.world-node.open:active .wn-scene-preview { opacity: 1; }
.wn-scene-preview img { width: 100%; height: 100%; object-fit: cover; }
.wn-pin {
  width: 12px; height: 12px; border-radius: 50%;
  margin: 0 auto 2px; animation: pinPulse 2s ease-in-out infinite;
}
.world-node:not(.open) .wn-pin { animation: none; }
@keyframes pinPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.6); }
}
.wn-emoji { font-size: 14px; line-height: 1; }
.wn-label {
  font-size: 8px; font-weight: 700; color: #fff;
  margin-top: 1px; text-shadow: 0 1px 3px #000;
  white-space: nowrap; max-width: 60px; overflow: hidden; text-overflow: ellipsis;
}
.wn-meta { font-size: 7px; color: #aaa; text-shadow: 0 1px 2px #000; }
.world-hud {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  gap: 8px;
}
.wh-power { color: #fbbf24; font-size: 13px; font-weight: 700; }
.wh-counters { color: #aaa; font-size: 11px; }
.wh-ach-btn {
  background: rgba(255,255,255,0.1); color: #fff; border: none;
  padding: 4px 8px; border-radius: 8px; font-size: 16px; cursor: pointer;
}

/* ============== 战前选将 ============== */
.battle-prep { background: #12082e; border-radius: 20px; padding: 16px; max-width: 420px; width: 95%; }
.pick-mech-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.pick-mech-card {
  background: rgba(255,255,255,0.04); border: 2px solid; border-radius: 12px;
  padding: 10px 6px; text-align: center; cursor: pointer; position: relative;
  transition: all 0.2s;
}
.pick-mech-card.picked { background: rgba(34,197,94,0.12); border-color: #22c55e !important; transform: scale(1.03); }
.pick-mech-card .pm-check {
  position: absolute; top: 4px; right: 6px; color: #22c55e; font-weight: 900;
  opacity: 0; transition: opacity 0.2s;
}
.pick-mech-card.picked .pm-check { opacity: 1; }
.pm-emoji { font-size: 36px; line-height: 1.2; }
.pm-name { font-size: 12px; font-weight: 700; margin-top: 2px; }

/* ============== 交互式战斗 ============== */
.battle-mech-slots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.battle-mech-slot {
  background: rgba(255,255,255,0.04); border: 2px solid; border-radius: 12px;
  padding: 5px 6px; text-align: center; cursor: pointer; min-width: 66px;
  transition: transform 0.15s, opacity 0.3s;
}
.battle-mech-slot:active { transform: scale(0.95); }
.battle-mech-slot.fainted { opacity: 0.25; pointer-events: none; border-color: #333 !important; }
.slot-emoji { font-size: 30px; }
.slot-name { font-size: 11px; font-weight: 700; }
.slot-element { font-size: 10px; }
.slot-hp-wrap { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; margin: 4px 0; overflow: hidden; }
.slot-hp-bar { height: 100%; background: #22c55e; border-radius: 3px; transition: width 0.3s; }
.slot-hp-num { font-size: 10px; color: #888; }
.boss-hp-num { font-size: 12px; color: #888; margin-top: 2px; }
.battle-turn-hint {
  margin-top: 10px; text-align: center; color: #fbbf24; font-size: 14px;
  font-weight: 700; animation: pulse 1.5s infinite;
}
.pixel-mech { width: 42px; height: 42px; image-rendering: pixelated; object-fit: contain; }
.pixel-boss { width: 85px; height: 85px; image-rendering: pixelated; object-fit: contain; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5)); }
.slot-lv { font-size: 9px; color: #888; margin-top: -2px; }

/* 战斗顶栏 */
.battle-top-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; background: rgba(0,0,0,0.4);
  border-radius: 12px 12px 0 0; margin-bottom: 8px;
}
.btb-stage { font-size: 13px; font-weight: 700; color: #fbbf24; }
.btb-boss-name { font-size: 13px; color: #ef4444; font-weight: 700; }

/* 攻击光球 */
.battle-bullet {
  position: fixed; z-index: 2000; pointer-events: none;
  width: 14px; height: 14px; background: #fbbf24;
  border-radius: 50%; box-shadow: 0 0 12px #fbbf24, 0 0 24px #f59e0b;
  animation: bulletFly 0.35s ease-out forwards;
}
@keyframes bulletFly {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  50% { transform: translate(calc(var(--tx)*0.5), calc(var(--ty)*0.5)) scale(1.3); opacity: 0.9; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.4); opacity: 0; }
}

/* 伤害数字 */
.battle-dmg-num {
  position: absolute; top: 35%; left: 50%; transform: translateX(-50%);
  font-weight: 900; pointer-events: none; z-index: 100;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  animation: dmgFloat 1.2s ease-out forwards;
}
@keyframes dmgFloat {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -20px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(0.8); }
}

/* 战斗记录 */
.battle-log {
  margin: 8px 0; max-height: 72px; overflow-y: auto;
  background: rgba(0,0,0,0.3); border-radius: 8px; padding: 4px 8px;
  font-size: 11px; color: #ccc; min-height: 48px;
}
.log-line { padding: 1px 0; animation: logIn 0.2s ease; }
.log-line.faint { color: #ef4444; font-weight: 700; }
@keyframes logIn { 0% { opacity: 0; transform: translateX(-8px); } 100% { opacity: 1; transform: translateX(0); } }

/* 调整战场布局 */
.battle-field { flex-direction: column; gap: 12px; }
.battle-side.boss-side { order: 1; }
.battle-vs-icon { order: 2; font-size: 20px; }
.battle-side.player-side { order: 3; }


/* =========== 2D像素RPG战斗 =========== */
.battle-arena{position:fixed;inset:0;z-index:1000;background-size:cover!important;background-position:center!important;display:flex;flex-direction:column;padding:0;overflow:hidden;}
.battle-canvas{position:absolute;inset:0;z-index:5;pointer-events:none;}
.arena-vignette{position:absolute;inset:0;background:radial-gradient(ellipse at center,transparent 40%,rgba(0,0,0,0.5) 100%);pointer-events:none;z-index:1;}
.battle-stage-top{display:flex;align-items:center;justify-content:space-between;padding:4px 10px;z-index:3;gap:6px;}
.arena-title{font-size:13px;font-weight:800;color:#fbbf24;text-shadow:0 1px 4px rgba(0,0,0,0.8);}
.type-badge{font-size:10px;font-weight:700;padding:2px 6px;border-radius:6px;text-shadow:0 1px 2px #000;}
.type-badge.advantage{background:rgba(34,197,94,0.3);color:#4ade80;}
.type-badge.weak{background:rgba(239,68,68,0.3);color:#f87171;}
.battle-field-row{flex:1;display:flex;align-items:flex-end;justify-content:space-evenly;z-index:2;padding:0 6px;gap:4px;}
.battle-side-me{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;}
.battle-mech-col{display:flex;flex-direction:column;gap:20px;align-items:center;}
.battle-vs-zone{flex-shrink:0;font-size:30px;color:#fbbf24;animation:pulse 1s infinite;width:32px;text-align:center;align-self:center;text-shadow:0 0 20px rgba(251,191,36,0.5);}
.battle-side-boss{flex:1;display:flex;align-items:center;justify-content:center;align-self:center;}

/* 我方单位 */
.arena-unit{text-align:center;cursor:pointer;transition:transform 0.15s,opacity 0.3s;width:90px;position:relative;}
.arena-unit:active{transform:scale(0.9);}
.arena-unit.fainted{opacity:0.2;pointer-events:none;filter:grayscale(1)}
.unit-info{display:flex;align-items:center;justify-content:center;gap:4px;margin-bottom:2px;}
.unit-name{font-size:10px;font-weight:700;white-space:nowrap;max-width:80px;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 3px #000;}
.el-chip{font-size:9px;font-weight:600;padding:0 4px;border:1px solid;border-radius:4px;background:rgba(0,0,0,0.4);white-space:nowrap;}
.unit-hp-bar{width:80px;height:5px;background:rgba(255,255,255,0.08);border-radius:3px;overflow:hidden;margin:0 auto 3px;}
.unit-hp-bar .unit-hp-fill,.unit-hp-fill{height:100%;border-radius:3px;transition:width 0.4s;}
.slot-hp-bar{background:linear-gradient(90deg,#22c55e,#4ade80)!important;}
.boss-hp{background:linear-gradient(90deg,#ef4444,#f97316)!important;}
.unit-sprite-wrap{position:relative;width:80px;height:80px;margin:0 auto;display:flex;align-items:center;justify-content:center;}
.unit-sprite-wrap .arena-sprite{width:72px;height:72px;image-rendering:pixelated;object-fit:contain;position:relative;z-index:1;animation:breath 2s ease-in-out infinite;}
.unit-sprite-wrap .boss-spr{width:90px;height:90px;animation-duration:2.5s;}
@keyframes breath{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
.unit-shadow{position:absolute;bottom:2px;left:50%;transform:translateX(-50%);width:36px;height:8px;background:rgba(0,0,0,0.4);border-radius:50%;z-index:0;}
.slot-hp-num{font-size:9px;color:#aaa;margin-top:1px;}

/* Boss卡片 */
.boss-card{text-align:center;}
.boss-name-banner{font-size:13px;font-weight:800;color:#ef4444;text-shadow:0 1px 6px rgba(0,0,0,0.8),0 0 20px rgba(239,68,68,0.3);margin-bottom:2px;}
.boss-info-row{display:flex;align-items:center;justify-content:center;gap:6px;margin-bottom:4px;}
.boss-hp-num{font-size:10px;color:#fbbf24;font-weight:700;}
.boss-wrap .arena-sprite{width:100px;height:100px;}
.boss-wrap .unit-shadow{width:50px;height:10px;}
.boss-bar{width:140px;margin:4px auto 0;}

/* 文本框 */
.battle-textbox{margin:0 6px 8px;padding:6px 12px;background:rgba(0,0,0,0.75);border:1px solid rgba(255,255,255,0.06);border-radius:10px;min-height:50px;z-index:2;font-size:12px;color:#ddd;}
.battle-textbox .battle-turn-hint{color:#fbbf24;font-weight:700;font-size:13px;text-align:center;}
.battle-log-text{max-height:34px;overflow-y:auto;margin-top:2px;color:#bbb;font-size:11px;line-height:1.3;text-align:center;}

/* 特效 */
.battle-result-text{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:10;background:rgba(0,0,0,0.7);opacity:0;transition:opacity 0.5s;pointer-events:none;}
.battle-result-text.show{opacity:1;}
.battle-bullet{position:fixed;z-index:2000;pointer-events:none;width:14px;height:14px;background:radial-gradient(#fbbf24,#f59e0b);border-radius:50%;box-shadow:0 0 16px #fbbf24;animation:bulletFly 0.35s ease-out forwards;}
@keyframes bulletFly{0%{transform:translate(0,0) scale(1);opacity:1}50%{transform:translate(calc(var(--tx)*0.5),calc(var(--ty)*0.5)) scale(1.3);opacity:.9}100%{transform:translate(var(--tx),var(--ty)) scale(.3);opacity:0}}
.battle-dmg-num{position:absolute;top:30%;left:50%;transform:translateX(-50%);font-weight:900;pointer-events:none;z-index:100;text-shadow:0 2px 8px rgba(0,0,0,0.9);animation:dmgFloat 1.2s ease-out forwards;}
@keyframes dmgFloat{0%{opacity:1;transform:translate(-50%,0) scale(.4)}30%{opacity:1;transform:translate(-50%,-25px) scale(1.3)}100%{opacity:0;transform:translate(-50%,-70px) scale(.7)}}

/* =================================================================== *
 *  小厨神 女孩版主题覆盖（粉色系）
 *  覆盖男孩版的深蓝/紫色，改为暖粉色厨艺主题
 * =================================================================== */

:root {
  --girl-bg: #2d1832;
  --girl-card: #3d2440;
  --girl-primary: #e11d48;
  --girl-accent: #f9a8d4;
  --girl-text: #fce7f3;
}

/* 背景渐变 - 暖紫粉色 */
body {
  background: linear-gradient(180deg, #1a0a2e 0%, #2d1832 50%, #1a0a2e 100%) !important;
}

/* 主按钮 - 玫红色 */
.btn-primary {
  background: linear-gradient(135deg, #e11d48, #be123c) !important;
}
.btn-primary:active {
  background: linear-gradient(135deg, #be123c, #9f1239) !important;
}

/* 金色按钮（十连） */
.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* 卡片背景 - 深紫 */
.card {
  background: rgba(61, 36, 64, 0.85) !important;
  border: 1px solid rgba(244, 114, 182, 0.15) !important;
}

/* Tab 栏 */
#tabbar {
  background: rgba(45, 24, 50, 0.95) !important;
  border-top: 1px solid rgba(244, 114, 182, 0.2) !important;
}
.tab.active {
  color: #f9a8d4 !important;
}
.tab.active .tab-icon {
  transform: scale(1.15);
}

/* TopBar */
#topbar {
  background: rgba(45, 24, 50, 0.9) !important;
}

/* 标题色 */
.section-title, .t-name {
  color: #fce7f3 !important;
}

/* Power card 光效 */
.power-card {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.15), rgba(168, 85, 247, 0.1)) !important;
}
.power-num {
  color: #f9a8d4 !important;
  text-shadow: 0 0 20px rgba(244, 114, 182, 0.5) !important;
}

/* 任务卡片分类色 */
.task-card {
  border-left: 3px solid rgba(244, 114, 182, 0.3) !important;
}

/* 图鉴/菜谱册区块头 */
.faction-head {
  text-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
}

/* 世界地图区域标签 */
.world-region {
  text-shadow: 0 0 8px rgba(0,0,0,0.8), 0 0 16px currentColor !important;
}

/* 战斗竞技场标题 */
.arena-title {
  color: #fce7f3 !important;
}

/* 滚动条 - 粉色 */
::-webkit-scrollbar-thumb {
  background: rgba(244, 114, 182, 0.3) !important;
}

/* 输入框 */
.text-input, select {
  background: rgba(45, 24, 50, 0.9) !important;
  border-color: rgba(244, 114, 182, 0.3) !important;
  color: #fce7f3 !important;
}

/* Toast 成功色 */
.toast-ok {
  background: linear-gradient(135deg, #e11d48, #be123c) !important;
}


/* =================================================================== *
 *  菜谱图片展示样式
 * =================================================================== */
.recipe-img-box {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 4px;
}
.recipe-img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}
.recipe-img.locked-img {
  filter: brightness(0.2) grayscale(1);
  opacity: 0.5;
}
.lock-icon {
  position: absolute;
  font-size: 28px;
  opacity: 0.9;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
}
.recipe-flavor {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  margin: 2px 0;
}
.mech-cell.owned {
  background: linear-gradient(135deg, rgba(244,114,182,0.06), rgba(168,85,247,0.04));
}
.mech-cell.owned .recipe-img-box {
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
}


/* =================================================================== *
 *  页游风格战斗舞台 v2 - 小厨神版
 * =================================================================== */

/* === 全屏战斗覆盖层 === */
.battle-arena {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000;
  background-size: cover !important;
  background-position: center !important;
  display: flex !important;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  font-family: -apple-system, sans-serif;
}

/* 暗角效果 */
.arena-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at center, transparent 30%, rgba(10,5,20,0.65) 100%);
  pointer-events: none;
  z-index: 1;
}

/* === 顶部标题栏 === */
.battle-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  z-index: 5;
  gap: 8px;
  background: linear-gradient(180deg, rgba(10,5,20,0.7), transparent);
}
.arena-title {
  font-size: 15px;
  font-weight: 900;
  color: #f9a8d4;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 0 20px rgba(244,114,182,0.3);
  letter-spacing: 1px;
}
.type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.type-badge.advantage {
  background: rgba(74,222,128,0.2);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.4);
  animation: glow-pulse 1.5s infinite;
}
.type-badge.weak {
  background: rgba(248,113,113,0.2);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.4);
}

/* === 战斗场地 - 左右布局 === */
.battle-field-row {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  z-index: 2;
  padding: 0 8px;
  gap: 4px;
  min-height: 0;
}

/* 左侧 - 我方菜谱 */
.battle-side-me {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10px;
  gap: 6px;
}
.battle-mech-col {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  align-items: center;
}

/* 中间 VS 区域 */
.battle-vs-zone {
  flex-shrink: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #f9a8d4;
  text-shadow: 0 0 16px rgba(244,114,182,0.6);
  animation: vs-pulse 1.2s ease-in-out infinite;
}

/* 右侧 - 评委 */
.battle-side-boss {
  flex: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === 我方菜谱单位 === */
.arena-unit {
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.3s;
  width: 100px;
  position: relative;
}
.arena-unit:active {
  transform: scale(0.88);
}
.arena-unit.fainted {
  opacity: 0.15;
  pointer-events: none;
  filter: grayscale(1);
}
.unit-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-bottom: 2px;
}
.unit-name {
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.el-chip {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 6px;
  border: 1px solid;
  background: rgba(0,0,0,0.3);
}

/* HP 血条 */
.unit-hp-bar {
  width: 88px;
  height: 6px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto 2px;
}
.unit-hp-bar .unit-hp-fill,
.unit-hp-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
  background: linear-gradient(90deg, #22c55e, #4ade80);
}
.unit-hp-fill.low {
  background: linear-gradient(90deg, #ef4444, #f87171);
}
.unit-hp-fill.mid {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* 角色精灵图容器 */
.unit-sprite-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.unit-sprite-wrap .arena-sprite {
  width: 80px;
  height: 80px;
  image-rendering: -webkit-optimize-contrast;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
  animation: float-bob 2.5s ease-in-out infinite;
}
/* 阴影 */
.unit-shadow {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 10px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
  z-index: 1;
}

.slot-hp-num {
  font-size: 10px;
  color: #fbbf24;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
  margin-top: 1px;
}

/* === 评委卡片 === */
.boss-card {
  text-align: center;
  position: relative;
}
.boss-name-banner {
  font-size: 14px;
  font-weight: 900;
  color: #fde68a;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 16px rgba(251,191,36,0.4);
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.boss-info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.boss-hp-num {
  font-size: 12px;
  color: #fca5a5;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
.boss-wrap .arena-sprite {
  width: 120px !important;
  height: 120px !important;
  animation-duration: 3s !important;
  filter: drop-shadow(0 6px 12px rgba(220,38,38,0.3));
}
.boss-card .unit-shadow {
  width: 90px;
}
.boss-bar {
  width: 120px !important;
  height: 8px !important;
}
.boss-bar .unit-hp-fill {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

/* === 底部文本框 === */
.battle-textbox {
  margin: 0 10px 10px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(10,5,20,0.85), rgba(20,10,30,0.9));
  border: 1px solid rgba(244,114,182,0.15);
  border-radius: 12px;
  min-height: 56px;
  max-height: 100px;
  z-index: 5;
  font-size: 13px;
  color: #e9d5ff;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.battle-textbox .battle-turn-hint {
  color: #f9a8d4;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  text-shadow: 0 0 12px rgba(244,114,182,0.4);
}
.battle-textbox .battle-log-text {
  font-size: 12px;
  color: #c4b5fd;
  max-height: 36px;
  overflow-y: auto;
}

/* === 结果文字 === */
.battle-result-text {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 100;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.battle-result-text.show {
  display: flex;
  animation: result-in 0.4s ease;
}

/* === 动画 === */
@keyframes float-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes vs-pulse {
  0%, 100% { transform: scale(1) rotate(-5deg); opacity: 0.7; }
  50% { transform: scale(1.2) rotate(5deg); opacity: 1; }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(74,222,128,0.3); }
  50% { box-shadow: 0 0 16px rgba(74,222,128,0.6); }
}
@keyframes result-in {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes breath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* Canvas 粒子层 */
.battle-canvas {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
