/* ===== CSS 变量 ===== */
:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a26;
  --card: #1e1e2e;
  --card2: #252538;
  --border: #2a2a40;
  --nova: #7c6fff;
  --nova2: #9d8fff;
  --nova-glow: rgba(124, 111, 255, 0.3);
  --gold: #f5c842;
  --green: #4caf76;
  --red: #e05555;
  --text: #e8e8f0;
  --text2: #9090b0;
  --text3: #5a5a80;
  --radius: 16px;
  --radius-sm: 10px;
}

/* ===== 基础重置 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; overflow: hidden; }
#app { height: 100vh; display: flex; flex-direction: column; }

/* ===== 加载屏幕 ===== */
.loading-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(ellipse at center, #1a1030 0%, var(--bg) 70%);
}
.logo-pulse {
  font-size: 64px;
  animation: pulse 1.5s ease-in-out infinite;
}
.loading-title { font-size: 28px; font-weight: 800; color: var(--nova2); letter-spacing: 2px; }
.loading-sub { font-size: 14px; color: var(--text3); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ===== 主布局 ===== */
#main-app { display: flex; flex-direction: column; height: 100vh; }

/* ===== 顶部 Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nova), #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
}
.user-name { font-size: 15px; font-weight: 600; }
.user-level { font-size: 12px; color: var(--nova2); }
.header-balance {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg3);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 15px; font-weight: 700; color: var(--gold);
}

/* ===== 内容区 ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 80px;
}
.main-content::-webkit-scrollbar { display: none; }

/* ===== 底部导航 ===== */
.bottom-nav {
  display: flex;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.nav-icon { font-size: 22px; transition: transform 0.2s; }
.nav-label { font-size: 11px; color: var(--text3); margin-top: 3px; transition: color 0.2s; }
.nav-item.active .nav-label { color: var(--nova2); }
.nav-item.active .nav-icon { transform: scale(1.15); }
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 2px;
  background: var(--nova);
  border-radius: 0 0 2px 2px;
}

/* ===== 通用卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card-title { font-size: 13px; color: var(--text2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== 挖矿主页 ===== */
.mine-hero {
  background: linear-gradient(135deg, #1a1035 0%, #0f0f20 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 20px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.mine-hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse, var(--nova-glow) 0%, transparent 60%);
  pointer-events: none;
}
.mine-emoji { font-size: 72px; margin-bottom: 8px; display: block; }
.mine-balance { font-size: 42px; font-weight: 800; color: #fff; margin: 8px 0; }
.mine-balance-label { font-size: 13px; color: var(--text2); margin-bottom: 20px; }
.mine-rate { font-size: 13px; color: var(--nova2); margin-bottom: 24px; }

.btn-claim {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn-claim.ready {
  background: linear-gradient(135deg, var(--nova), #a855f7);
  color: #fff;
  box-shadow: 0 4px 20px var(--nova-glow);
}
.btn-claim.ready:active { transform: scale(0.97); }
.btn-claim.waiting {
  background: var(--bg3);
  color: var(--text3);
  border: 1px solid var(--border);
  cursor: not-allowed;
}

.countdown { font-size: 24px; font-weight: 700; color: var(--nova2); margin: 4px 0; }
.countdown-label { font-size: 13px; color: var(--text3); }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* 签到按钮 */
.btn-checkin {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-checkin.available {
  background: linear-gradient(135deg, #1e4030, #0f2a1e);
  border-color: var(--green);
  color: var(--green);
}
.btn-checkin.available:active { transform: scale(0.98); }

/* ===== 任务页 ===== */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.task-item:active { transform: scale(0.99); background: var(--card2); }
.task-item.completed { opacity: 0.5; cursor: default; }
.task-icon { font-size: 28px; flex-shrink: 0; }
.task-info { flex: 1; }
.task-title { font-size: 14px; font-weight: 600; }
.task-desc { font-size: 12px; color: var(--text2); margin-top: 2px; }
.task-reward {
  font-size: 14px; font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}
.task-done { font-size: 20px; color: var(--green); }

/* ===== 邀请页 ===== */
.invite-hero {
  background: linear-gradient(135deg, #1e1535, #101025);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.invite-emoji { font-size: 56px; }
.invite-title { font-size: 20px; font-weight: 800; margin: 10px 0 6px; }
.invite-desc { font-size: 13px; color: var(--text2); line-height: 1.5; }
.invite-code-box {
  display: flex;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 16px 0;
  gap: 10px;
}
.invite-code { font-size: 20px; font-weight: 700; font-family: monospace; letter-spacing: 3px; flex: 1; }
.btn-copy {
  padding: 8px 16px;
  background: var(--nova);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.btn-share {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--nova), #a855f7);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
}
.invite-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

.invited-list { }
.invited-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.invited-item:last-child { border-bottom: none; }
.invited-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nova), #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.invited-name { font-size: 14px; font-weight: 500; }
.invited-date { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* ===== 排行榜 ===== */
.rank-my {
  background: linear-gradient(135deg, #1c1535, #0f0f25);
  border: 1px solid var(--nova);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rank-badge {
  background: var(--nova);
  color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-no { width: 28px; text-align: center; font-size: 15px; font-weight: 700; color: var(--text3); }
.rank-no.gold { color: #f5c842; }
.rank-no.silver { color: #c0c0c0; }
.rank-no.bronze { color: #cd7f32; }
.rank-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nova), #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.rank-info { flex: 1; }
.rank-name { font-size: 14px; font-weight: 600; }
.rank-sub { font-size: 11px; color: var(--text3); }
.rank-score { font-size: 15px; font-weight: 700; color: var(--gold); }

/* ===== 工具 ===== */
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text3); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 35, 0.95);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  backdrop-filter: blur(10px);
  z-index: 9999;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
