/**
 * 基础样式 - Retro-Futurism 风格
 * 暗色+金色主题，霓虹效果
 */

:root {
  /* 主色调 - 暗金奢华 */
  --p: #fbbf24;
  --pd: #d97706;
  --pglow: rgba(251, 191, 36, 0.35);
  
  /* 辅助色 */
  --s: #38bdf8;
  --sglow: rgba(56, 189, 248, 0.25);
  --a: #ef4444;
  --ok: #22c55e;
  --pp: #a855f7;
  --og: #f97316;
  --pk: #ec4899;
  
  /* 背景色系 - 深色层次 */
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a25;
  --bg4: #222235;
  
  /* 卡片 */
  --card: rgba(255,255,255,0.03);
  --card2: rgba(255,255,255,0.06);
  --card3: rgba(255,255,255,0.10);
  
  /* 边框 */
  --bd: rgba(251, 191, 36, 0.08);
  --bd2: rgba(251, 191, 36, 0.15);
  --bd3: rgba(255,255,255,0.06);
  
  /* 文字 */
  --tx: #f1f5f9;
  --tx2: #cbd5e1;
  --txm: #64748b;
  --txd: #334155;
  
  /* 效果 */
  --glow-gold: 0 0 20px var(--pglow), 0 0 40px rgba(251,191,36,0.1);
  --glow-blue: 0 0 20px var(--sglow), 0 0 40px rgba(56,189,248,0.1);
  --glow-text: 0 0 10px var(--pglow);
  
  /* 圆角 */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  /* 间距 */
  --gap: 8px;
  --pad: 16px;
  --pad-sm: 12px;
  --pad-xs: 8px;
  --pad-lg: 24px;
  
  /* 布局 */
  --app-w: 1320px;
  --left-w: 420px;
  --right-w: 880px;
  
  /* 字体 */
  --font-display: 'Orbitron', monospace;
  --font-body: 'Noto Sans SC', 'Inter', sans-serif;
  
  /* 阴影 */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(251,191,36,0.05);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.5), 0 0 30px var(--pglow);
  --shadow-btn: 0 4px 16px rgba(251,191,36,0.15);
  
  /* 过渡 */
  --transition-fast: all .15s cubic-bezier(.4,0,.2,1);
  --transition: all .25s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .4s cubic-bezier(.4,0,.2,1);
}

/* 重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: rgba(251,191,36,.3); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--p); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--tx);
  overflow-x: hidden;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 15% 35%, rgba(251,191,36,.04) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 25%, rgba(56,189,248,.03) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 80%, rgba(168,85,247,.02) 0%, transparent 35%);
}

/* 应用容器 */
.app {
  position: relative;
  z-index: 1;
  max-width: var(--app-w);
  margin: 0 auto;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 100vh;
}

/* 顶部栏 */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pad-sm) var(--pad-lg);
  background: linear-gradient(135deg, rgba(17,17,24,.95), rgba(26,26,37,.9));
  border-radius: var(--radius-xl);
  border: 1px solid var(--bd);
  gap: var(--pad);
  flex-wrap: wrap;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 32px rgba(0,0,0,.3), inset 0 1px 0 rgba(251,191,36,.06);
  position: relative;
  overflow: hidden;
}

.top-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--p), transparent);
  opacity: .4;
}

.game-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--p), #fef08a, var(--p));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 3px;
  text-transform: uppercase;
  position: relative;
  text-shadow: 0 0 30px rgba(251,191,36,.15);
}

.game-title::after {
  content: '✦';
  -webkit-text-fill-color: var(--p);
  font-size: .6rem;
  margin-left: 6px;
  opacity: .6;
}

/* 顶部统计数据 */
.top-stats {
  display: flex;
  gap: var(--pad);
  align-items: center;
  flex-wrap: wrap;
}

.ts {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  padding: 6px 16px;
  background: var(--card);
  border-radius: 100px;
  border: 1px solid var(--bd3);
  transition: var(--transition);
  position: relative;
}

.ts:hover {
  border-color: var(--bd2);
  background: var(--card2);
}

.ts .svg-icon {
  opacity: .8;
}

.ts .v {
  font-family: var(--font-display);
  color: var(--p);
  font-weight: 700;
  font-size: .85rem;
  text-shadow: 0 0 8px rgba(251,191,36,.15);
}

.ts .l {
  color: var(--txm);
  font-size: .7rem;
  letter-spacing: .5px;
}

/* 顶部按钮 */
.top-btns {
  display: flex;
  gap: 6px;
}

.tbtn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--bd3);
  border-radius: var(--radius-sm);
  color: var(--txm);
  cursor: pointer;
  font-size: .9rem;
  transition: var(--transition);
  position: relative;
}

.tbtn .svg-icon {
  width: 18px;
  height: 18px;
}

.tbtn:hover {
  border-color: var(--bd2);
  background: var(--card2);
  color: var(--p);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.tbtn:active {
  transform: scale(.92);
}

/* 主布局 */
.main {
  display: grid;
  grid-template-columns: var(--left-w) 1fr;
  gap: var(--gap);
  flex: 1;
  min-height: 0;
}

@media (max-width: 1100px) {
  .main {
    grid-template-columns: 1fr;
  }
  :root {
    --left-w: 100%;
  }
  .player-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 左右面板 */
.left-panel, .right-panel {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 0;
}

.right-panel {
  flex: 1;
}

/* 面板通用 */
.panel {
  background: linear-gradient(145deg, var(--bg2), var(--bg3));
  border-radius: var(--radius-lg);
  padding: var(--pad);
  border: 1px solid var(--bd);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--p), transparent);
  opacity: .3;
}

.panel-title {
  font-family: var(--font-display);
  font-size: .8rem;
  margin-bottom: var(--pad-sm);
  color: var(--p);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  text-shadow: 0 0 8px rgba(251,191,36,.1);
}

.panel-title .svg-icon {
  opacity: .7;
}

/* 玩家行 */
.player-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

/* 玩家卡片 */
.p-card {
  padding: var(--pad-sm) var(--pad);
  border-radius: var(--radius);
  border: 1px solid var(--bd);
  display: flex;
  align-items: center;
  gap: var(--pad-sm);
  background: var(--bg2);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.p-card:hover {
  border-color: var(--bd2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

.p-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: .6;
}

.p-card.avatar-card::after { background: linear-gradient(90deg, var(--s), transparent); }
.p-card.chapter-card::after { background: linear-gradient(90deg, var(--pp), transparent); }
.p-card.daily-card::after { background: linear-gradient(90deg, var(--og), transparent); }
.p-card.prestige-card::after { background: linear-gradient(90deg, var(--pd), transparent); }

.p-avatar {
  font-size: 1.6rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card2);
  border-radius: var(--radius);
  border: 1px solid var(--bd3);
  flex-shrink: 0;
  position: relative;
}

.p-avatar .svg-icon {
  width: 22px;
  height: 22px;
}

.p-info {
  flex: 1;
  min-width: 0;
}

.p-title {
  font-family: var(--font-display);
  font-size: .75rem;
  color: var(--s);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .5px;
}

.p-lvl {
  font-size: .65rem;
  color: var(--txm);
}

.p-exp {
  width: 100%;
  height: 4px;
  background: var(--card2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
  position: relative;
}

.p-exp-f {
  height: 100%;
  background: linear-gradient(90deg, var(--s), var(--p));
  transition: width .4s ease;
  border-radius: 4px;
  position: relative;
}

/* 点击区 */
.click-panel {
  align-items: center;
}

.coin-btn {
  width: 140px;
  height: 140px;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef08a, var(--p) 40%, var(--pd) 80%, #92400e);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition);
  position: relative;
  box-shadow: 
    0 0 0 4px rgba(251,191,36,.15),
    0 0 0 8px rgba(251,191,36,.05),
    0 8px 32px rgba(0,0,0,.4),
    inset 0 -4px 8px rgba(0,0,0,.3),
    inset 0 4px 8px rgba(255,255,255,.15);
  font-family: var(--font-display);
  color: #422006;
  font-weight: 900;
  font-size: .8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
  margin: 12px auto;
}

.coin-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(251,191,36,.15);
  animation: coinPulse 3s ease-in-out infinite;
}

.coin-btn:hover {
  transform: scale(1.05);
  box-shadow: 
    0 0 0 4px rgba(251,191,36,.25),
    0 0 0 10px rgba(251,191,36,.08),
    0 0 40px var(--pglow),
    0 12px 40px rgba(0,0,0,.4),
    inset 0 -4px 8px rgba(0,0,0,.3),
    inset 0 4px 8px rgba(255,255,255,.15);
}

.coin-btn:active {
  transform: scale(.92);
}

.coin-btn .svg-icon {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}

.coin-text {
  text-shadow: 0 1px 2px rgba(255,255,255,.3);
}

@keyframes coinPulse {
  0%, 100% { opacity: .3; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.05); }
}

/* Boss区域 */
.boss-panel .panel-title .svg-icon { margin-right: 4px; }

.boss-lvl {
  font-size: .7rem;
  color: var(--a);
  padding: 2px 10px;
  background: rgba(239,68,68,.1);
  border-radius: 100px;
  border: 1px solid rgba(239,68,68,.15);
}

.boss-info {
  display: flex;
  align-items: center;
  gap: var(--pad-sm);
  margin-bottom: var(--pad-sm);
}

.boss-avatar {
  font-size: 2.5rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(239,68,68,.08), rgba(239,68,68,.02));
  border-radius: var(--radius);
  border: 1px solid rgba(239,68,68,.15);
  flex-shrink: 0;
}

.boss-avatar .svg-icon {
  width: 36px;
  height: 36px;
}

.boss-details {
  flex: 1;
  min-width: 0;
}

.boss-name {
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 4px;
  color: var(--tx2);
}

.boss-hp-bar {
  width: 100%;
  height: 8px;
  background: var(--card2);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.3);
}

.boss-hp-f {
  height: 100%;
  background: linear-gradient(90deg, var(--og), var(--a));
  border-radius: 8px;
  transition: width .3s ease;
  position: relative;
}

.boss-hp-f.low {
  background: linear-gradient(90deg, var(--a), #dc2626);
  animation: bossHpLow .5s ease-in-out infinite;
}

.boss-hp-text {
  font-size: .65rem;
  color: var(--txm);
  margin-top: 4px;
}

.boss-hp-text span { font-weight: 700; color: var(--tx2); }

.boss-atk {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--a), #dc2626);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: .85rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .5px;
  box-shadow: 0 4px 16px rgba(239,68,68,.2);
}

.boss-atk .svg-icon { width: 18px; height: 18px; }

.boss-atk:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(239,68,68,.3), 0 0 20px rgba(239,68,68,.1);
}

.boss-atk:active {
  transform: scale(.97);
}

/* 导航标签 */
.nav-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  background: var(--bg2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bd);
}

.nav-t {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--txm);
  cursor: pointer;
  font-size: .75rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  min-width: fit-content;
  font-family: var(--font-body);
  position: relative;
}

.nav-t .svg-icon {
  width: 16px;
  height: 16px;
  opacity: .5;
  transition: var(--transition);
}

.nav-t:hover {
  color: var(--tx2);
  background: var(--card);
}

.nav-t:hover .svg-icon {
  opacity: .7;
}

.nav-t.on {
  background: linear-gradient(145deg, var(--p), var(--pd));
  color: #422006;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--pglow);
}

.nav-t.on .svg-icon {
  opacity: 1;
  color: #422006;
}

/* 标签内容 */
.tab-container {
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--bg2), var(--bg3));
  border: 1px solid var(--bd);
  box-shadow: var(--shadow-card);
  position: relative;
}

.tab-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--p), transparent);
  opacity: .3;
}

.tab-c {
  display: none;
  padding: var(--pad);
  flex: 1;
  overflow-y: auto;
  height: 100%;
}

.tab-c.on {
  display: flex;
  flex-direction: column;
}

/* SVG图标通用 */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.svg-icon svg {
  width: 100%;
  height: 100%;
}

/* 模态框 */
.modal-ov {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .2s ease;
}

.modal {
  background: linear-gradient(145deg, var(--bg2), var(--bg4));
  border-radius: var(--radius-xl);
  padding: var(--pad-lg);
  border: 1px solid var(--bd);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(251,191,36,.05);
  animation: scaleIn .25s ease;
}

.modal h2 {
  font-family: var(--font-display);
  color: var(--p);
  margin-bottom: var(--pad-sm);
  letter-spacing: 2px;
}

/* 按钮 */
.m-btn {
  padding: 10px 28px;
  background: linear-gradient(145deg, var(--p), var(--pd));
  border: none;
  border-radius: var(--radius-sm);
  color: #422006;
  cursor: pointer;
  font-weight: 700;
  font-size: .85rem;
  transition: var(--transition);
  font-family: var(--font-body);
  letter-spacing: .5px;
  box-shadow: 0 4px 16px var(--pglow);
}

.m-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--pglow), 0 0 30px var(--pglow);
}

.m-btn:active { transform: scale(.97); }
.m-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* 升级面板倍率条 */
.multiplier-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 推荐面板 */
.recommend-panel {
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(56,189,248,.06), rgba(56,189,248,.02));
  border: 1px solid rgba(56,189,248,.15);
  border-radius: var(--radius);
}

.rec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 4px;
  background: var(--card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.rec-item:hover {
  background: var(--card2);
  transform: translateX(3px);
}

.rec-item:last-child { margin-bottom: 0; }

/* 按钮悬停光效 */
.u-btn, .sm-btn, .m-btn, .boss-atk {
  position: relative;
  overflow: hidden;
}

.u-btn::after, .sm-btn::after, .m-btn::after, .boss-atk::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.u-btn:hover::after, .sm-btn:hover::after, .m-btn:hover::after, .boss-atk:hover::after {
  opacity: 1;
}

/* 通知样式 */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.notification {
  padding: 14px 22px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--bg3), var(--bg2));
  border: 1px solid var(--bd);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  animation: slideIn .3s ease-out, fadeOut .3s ease-out 2.7s forwards;
  pointer-events: auto;
  max-width: 360px;
  backdrop-filter: blur(10px);
}

.notification.success { border-left: 3px solid var(--ok); }
.notification.warning { border-left: 3px solid var(--og); }
.notification.error { border-left: 3px solid var(--a); }
.notification.info { border-left: 3px solid var(--s); }

/* 底部收集按钮 */
.collect-all-btn {
  padding: 8px 18px;
  background: linear-gradient(145deg, var(--pp), #7c3aed);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(168,85,247,.2);
}

.collect-all-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(168,85,247,.3);
}

.collect-all-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
