/* ── 全局基础样式 ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #000e22;
  --bg2:      #001538;
  --card:     rgba(0,30,70,.75);
  --border:   rgba(100,180,255,.18);
  --primary:  #2563EB;
  --accent:   #00C4FF;
  --gold:     #FFD700;
  --text:     #E0F2FE;
  --muted:    #64748B;
  --danger:   #EF4444;
  --success:  #10B981;
  --radius:   14px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'PingFang SC', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── 卡片 ───────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── 按钮 ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all .2s; white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1D4ED8; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,.45); }
.btn-gold { background: linear-gradient(135deg,#FFB300,#FFD700); color: #000; }
.btn-gold:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid rgba(100,180,255,.3); }
.btn-ghost:hover:not(:disabled) { background: rgba(100,180,255,.1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ── 表单 ───────────────────────────────────────────────────── */
.input {
  width: 100%; padding: 11px 14px;
  background: rgba(0,20,50,.6); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 15px;
  outline: none; transition: border-color .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,196,255,.15); }
.input::placeholder { color: var(--muted); }

/* ── 顶栏 ───────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(0,10,30,.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 100;
}
.topbar-back {
  color: var(--accent); text-decoration: none; font-size: 22px;
  line-height: 1; padding: 4px; border-radius: 8px;
  transition: background .15s;
}
.topbar-back:hover { background: rgba(100,180,255,.12); }
.topbar-title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; color: #E0F2FE; }
.topbar-coins { font-size: 13px; font-weight: 600; color: var(--gold); }

/* ── 徽章 ───────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1.5;
}
.badge-vip { background: linear-gradient(135deg,#FF8F00,#FFD700); color: #000; }
.badge-new { background: var(--danger); color: #fff; }

/* ── 页面容器 ──────────────────────────────────────────────── */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-body { flex: 1; overflow-y: auto; padding: 16px; max-width: 600px; margin: 0 auto; width: 100%; }

/* ── 海洋背景粒子 ──────────────────────────────────────────── */
.ocean-bg {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg,#000e22 0%,#001538 40%,#001e48 70%,#000a18 100%);
  overflow: hidden;
}
.ocean-bubble {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(120,220,255,.4);
  animation: bubbleRise linear infinite;
}
@keyframes bubbleRise {
  0%  { transform: translateY(0) translateX(0); opacity: .7; }
  50% { transform: translateY(-45vh) translateX(12px); opacity: .4; }
  100%{ transform: translateY(-100vh) translateX(-8px); opacity: 0; }
}

/* ── 进度条 ─────────────────────────────────────────────────── */
.progress-bar { background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; height: 8px; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .4s; background: var(--accent); }

/* ── 分割线 ─────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── 空状态 ─────────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); font-size: 15px; }

/* ── 列表项 ─────────────────────────────────────────────────── */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

/* ── 技能/皮肤网格 ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
@media(max-width:400px){ .grid-3 { grid-template-columns: 1fr 1fr; } }

/* ── 排行榜条目 ─────────────────────────────────────────────── */
.rank-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 8px;
  background: rgba(0,30,70,.5); border: 1px solid var(--border);
  transition: background .2s;
}
.rank-num { font-size: 18px; font-weight: 900; min-width: 32px; text-align: center; }
.rank-1 { color: #FFD700; }
.rank-2 { color: #C0C0C0; }
.rank-3 { color: #CD7F32; }

/* ── Tab 切换 ───────────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 4px; padding: 4px;
  background: rgba(0,20,50,.5); border-radius: 12px; border: 1px solid var(--border);
}
.tab-btn {
  flex: 1; padding: 8px 4px; border: none; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.tab-btn.active { background: var(--primary); color: #fff; }

/* ── 任务卡片 ───────────────────────────────────────────────── */
.task-card {
  padding: 14px 16px; border-radius: 12px; margin-bottom: 10px;
  background: rgba(0,30,70,.6); border: 1px solid var(--border);
}
.task-card.done { border-color: rgba(16,185,129,.4); }
.task-card.claimed { opacity: .55; }

/* ── 签到格子 ───────────────────────────────────────────────── */
.checkin-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.checkin-day {
  aspect-ratio: 1; border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  border: 1.5px solid var(--border); cursor: pointer; transition: all .2s;
  background: rgba(0,20,50,.5);
}
.checkin-day.checked { background: linear-gradient(135deg,#10B981,#059669); border-color: #10B981; color: #fff; }
.checkin-day.today   { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,196,255,.3); }
.checkin-day.makeup  { background: rgba(245,158,11,.2); border-color: #F59E0B; }

/* ── 好友头像 ───────────────────────────────────────────────── */
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg,var(--primary),var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* ── 皮肤卡片 ───────────────────────────────────────────────── */
.skin-card {
  border-radius: 12px; padding: 14px; text-align: center; cursor: pointer;
  border: 2px solid var(--border); transition: all .25s;
  background: rgba(0,20,50,.6);
}
.skin-card.owned  { border-color: rgba(16,185,129,.5); }
.skin-card.active { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,215,0,.35); }
.skin-cannon-preview { width: 70px; height: 70px; margin: 0 auto 8px; }

/* ── 动画 ───────────────────────────────────────────────────── */
@keyframes fadeSlideIn { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }
.fade-in { animation: fadeSlideIn .35s ease both; }

@keyframes pulse { 0%,100%{transform:scale(1);} 50%{transform:scale(1.06);} }
.pulse { animation: pulse 1.6s ease-in-out infinite; }

@keyframes glow { 0%,100%{box-shadow:0 0 8px rgba(0,196,255,.4);} 50%{box-shadow:0 0 22px rgba(0,196,255,.8);} }
.glow { animation: glow 2s ease-in-out infinite; }
