* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f4f6; color: #1f2937; max-width: 480px; margin: 0 auto;
  min-height: 100vh; position: relative;
}
.page { display: none; padding-bottom: 70px; min-height: 100vh; }
.page.active { display: block; }
.topbar {
  background: #fff; padding: 14px 16px; font-size: 17px; font-weight: 600;
  position: sticky; top: 0; z-index: 10; border-bottom: 1px solid #eee;
}
.back { font-size: 24px; margin-right: 8px; cursor: pointer; color: #6b7280; }

/* 登录 */
.login-box { padding: 60px 28px; }
.logo { font-size: 30px; font-weight: 700; text-align: center; color: #2563eb; }
.slogan { text-align: center; color: #9ca3af; margin: 8px 0 40px; }
.login-box input {
  width: 100%; padding: 14px; margin-bottom: 14px; border: 1px solid #e5e7eb;
  border-radius: 10px; font-size: 15px; background: #fff;
}
.auth-tabs { display: flex; gap: 24px; justify-content: center; margin-bottom: 22px; }
.auth-tab {
  font-size: 16px; color: #9ca3af; padding-bottom: 6px; cursor: pointer; font-weight: 600;
  border-bottom: 2px solid transparent;
}
.auth-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.auth-tip { text-align: center; color: #9ca3af; font-size: 12px; margin-top: 14px; }
.btn-primary {
  width: 100%; padding: 14px; background: #2563eb; color: #fff; border: none;
  border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer;
}

/* 游戏分类 */
.cat-tabs {
  display: flex; gap: 8px; padding: 12px 12px 0; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; padding: 6px 14px; border-radius: 16px; font-size: 13px;
  background: #fff; color: #6b7280; cursor: pointer; white-space: nowrap;
  border: 1px solid #e5e7eb;
}
.cat-tab.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* 游戏列表 */
.game-list { padding: 12px; }
.game-card {
  background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 14px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.game-icon {
  width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg,#60a5fa,#a78bfa);
  display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0;
  color: #fff; font-weight: 700; overflow: hidden;
}
.game-icon img { width: 100%; height: 100%; object-fit: cover; }
.game-info { flex: 1; }
.game-name { font-weight: 600; font-size: 16px; }
.game-cat { color: #9ca3af; font-size: 13px; margin-top: 3px; }
.game-reward { color: #f59e0b; font-weight: 700; font-size: 15px; }
.game-reward small { font-weight: 400; font-size: 12px; }

/* 详情 */
.detail { padding: 16px; }
.detail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.detail-intro { background: #fff; border-radius: 12px; padding: 14px; color: #6b7280; font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.task-item {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.task-meta { flex: 1; }
.task-title { font-weight: 600; }
.task-cond { color: #9ca3af; font-size: 13px; margin-top: 4px; }
.task-reward { color: #f59e0b; font-weight: 700; margin-right: 10px; }
.btn-do {
  padding: 8px 16px; background: #2563eb; color: #fff; border: none;
  border-radius: 20px; font-size: 14px; cursor: pointer; white-space: nowrap;
}

/* 任务中心 */
.task-tabs {
  display: flex; gap: 16px; padding: 12px 16px; background: #fff;
  border-bottom: 1px solid #f0f0f0; overflow-x: auto; position: sticky; top: 49px; z-index: 9;
}
.task-tab {
  font-size: 14px; color: #9ca3af; font-weight: 600; white-space: nowrap;
  padding-bottom: 4px; border-bottom: 2px solid transparent; cursor: pointer;
}
.task-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.task-list { padding: 12px; }
.tk {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.tk-status { font-size: 13px; padding: 3px 10px; border-radius: 12px; }
.st-doing { background: #fef3c7; color: #d97706; }
.st-pending { background: #dbeafe; color: #2563eb; }
.st-reviewing { background: #fde68a; color: #b45309; }
.st-settled { background: #d1fae5; color: #059669; }
.st-rejected { background: #fee2e2; color: #dc2626; }

/* 钱包 */
.wallet-card {
  margin: 16px; padding: 24px; border-radius: 16px;
  background: linear-gradient(135deg,#2563eb,#7c3aed); color: #fff;
}
.wallet-balance { font-size: 14px; }
.wallet-balance span { font-size: 36px; font-weight: 700; display: block; }
.wallet-sub { display: flex; gap: 30px; margin: 18px 0; }
.wallet-sub span { font-size: 18px; font-weight: 600; display: block; }
.wallet-sub small, .wallet-balance small { opacity: .8; font-size: 12px; }
.btn-withdraw {
  width: 100%; padding: 12px; background: rgba(255,255,255,.2); color: #fff;
  border: 1px solid rgba(255,255,255,.4); border-radius: 10px; font-size: 15px; cursor: pointer;
}
.logs-title { padding: 8px 16px; color: #6b7280; font-size: 14px; }
.wallet-actions { display: flex; justify-content: flex-end; padding: 0 16px; margin-top: -6px; }
.wallet-actions span { color: #2563eb; font-size: 13px; cursor: pointer; }

/* 提现记录 */
.wdlist { max-height: 56vh; overflow-y: auto; margin-bottom: 12px; }
.wd-rec { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.wd-rec:last-child { border-bottom: none; }
.wd-rec-main { display: flex; align-items: center; justify-content: space-between; }
.wd-rec-amt { font-weight: 700; font-size: 16px; }
.wd-rec-sub { color: #9ca3af; font-size: 12px; margin-top: 4px; }
.wd-reason { color: #dc2626; font-size: 12px; margin-top: 4px; }

/* 邀请 */
.invite-card {
  margin: 16px; padding: 24px; border-radius: 16px;
  background: linear-gradient(135deg,#f59e0b,#ef4444); color: #fff;
}
.invite-hd { font-size: 14px; opacity: .9; }
.invite-code {
  display: flex; align-items: center; gap: 12px; margin: 10px 0 4px;
}
.invite-code span { font-size: 30px; font-weight: 700; letter-spacing: 2px; }
.btn-copy {
  margin-left: auto; padding: 6px 16px; background: rgba(255,255,255,.25); color: #fff;
  border: 1px solid rgba(255,255,255,.5); border-radius: 8px; font-size: 13px; cursor: pointer;
}
.invite-sub { display: flex; gap: 30px; margin: 16px 0 12px; }
.invite-sub span { font-size: 20px; font-weight: 700; display: block; }
.invite-sub small { opacity: .85; font-size: 12px; }
.invite-tip { font-size: 12px; opacity: .9; line-height: 1.5; }
.logs { padding: 0 16px; }
.log-item {
  background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.log-remark { font-size: 14px; }
.log-time { color: #9ca3af; font-size: 12px; margin-top: 3px; }
.log-amt { font-weight: 700; }
.amt-in { color: #059669; }
.amt-out { color: #dc2626; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; display: none;
  border-top: 1px solid #eee; z-index: 20;
}
.tabbar.show { display: flex; }
.tab {
  flex: 1; text-align: center; padding: 8px 0; font-size: 20px; cursor: pointer; color: #9ca3af;
}
.tab span { display: block; font-size: 11px; margin-top: 2px; }
.tab.active { color: #2563eb; }

/* 弹层 */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100; align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-box { background: #fff; border-radius: 16px; padding: 24px; width: 84%; max-width: 360px; }
.modal-box h3 { margin-bottom: 16px; }
.modal-box input, .modal-box select {
  width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 15px;
}
.modal-btns { display: flex; gap: 12px; }
.modal-btns button { flex: 1; padding: 12px; border-radius: 10px; border: 1px solid #e5e7eb; background: #fff; font-size: 15px; cursor: pointer; }
.modal-btns .btn-primary { border: none; }

/* toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 20px; border-radius: 20px;
  font-size: 14px; z-index: 200; opacity: 0; transition: opacity .3s; pointer-events: none;
}
.toast.show { opacity: 1; }
.empty { text-align: center; color: #9ca3af; padding: 60px 0; }

/* 游客登录补充 */
.btn-outline {
  width: 100%; padding: 14px; background: #fff; color: #2563eb;
  border: 1px solid #2563eb; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.divider { display: flex; align-items: center; text-align: center; color: #9ca3af;
  font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
.divider span { padding: 0 12px; }

/* 首页赚钱入口 */
.earn-row { display: flex; gap: 10px; padding: 12px 12px 0; }
.earn-item {
  flex: 1; background: #fff; border-radius: 14px; padding: 14px 6px; text-align: center;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.earn-icon { font-size: 26px; }
.earn-item span { display: block; font-size: 14px; font-weight: 600; margin-top: 4px; }
.earn-item small { display: block; color: #f59e0b; font-size: 12px; margin-top: 2px; }

/* 签到阶梯 */
.ladder { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ladder-day {
  flex: 1 0 18%; min-width: 56px; text-align: center; padding: 10px 4px;
  border-radius: 10px; background: #f3f4f6; color: #6b7280;
}
.ladder-day small { display: block; font-size: 11px; }
.ladder-day span { font-size: 14px; font-weight: 700; }
.ladder-day.active { background: #fef3c7; color: #d97706; box-shadow: 0 0 0 2px #f59e0b inset; }
.ladder-day.done { background: #dcfce7; color: #16a34a; }

/* 排行榜 */
.rank-tabs { display: flex; gap: 24px; padding: 12px 16px; background: #fff; }
.rank-tab { font-size: 15px; color: #9ca3af; font-weight: 600; padding-bottom: 4px; border-bottom: 2px solid transparent; cursor: pointer; }
.rank-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.rank-list { padding: 12px 16px 80px; }
.rank-item {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.rank-item.me { background: #eff6ff; box-shadow: 0 0 0 1px #bfdbfe inset; }
.rank-no { width: 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 50%; background: #f3f4f6; color: #6b7280; font-weight: 700; font-size: 14px; }
.rank-1 { background: #fbbf24; color: #fff; }
.rank-2 { background: #cbd5e1; color: #fff; }
.rank-3 { background: #f59e0b; color: #fff; }
.rank-name { flex: 1; font-size: 15px; }
.rank-income { color: #ef4444; font-weight: 700; }
.rank-me { position: fixed; bottom: 56px; left: 0; right: 0; max-width: 480px; margin: 0 auto; padding: 0 16px 8px; }
.rank-me .rank-item { margin-bottom: 0; box-shadow: 0 -2px 8px rgba(0,0,0,.08); }

/* 个人信息条 */
.profile-bar {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: #fff; border-bottom: 1px solid #f0f0f0;
}
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg,#2563eb,#7c3aed); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.profile-meta { flex: 1; }
.profile-name { font-size: 16px; font-weight: 600; }
.profile-id { color: #9ca3af; font-size: 12px; margin-top: 2px; }
.btn-logout {
  padding: 7px 14px; background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb;
  border-radius: 18px; font-size: 13px; cursor: pointer;
}

/* 提现余额提示 */
.wd-balance {
  font-size: 13px; color: #6b7280; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.wd-balance b { color: #f59e0b; font-size: 15px; }
.wd-all { margin-left: auto; color: #2563eb; font-weight: 600; cursor: pointer; }

/* 加载骨架 */
.skeleton-card {
  background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 14px;
}
.sk-avatar { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; }
.sk-lines { flex: 1; }
.sk-line { height: 14px; border-radius: 7px; margin-bottom: 8px; }
.sk-line.short { width: 50%; }
.sk-avatar, .sk-line {
  background: linear-gradient(90deg,#eee 25%,#f5f5f5 37%,#eee 63%);
  background-size: 400% 100%; animation: sk 1.2s ease infinite;
}
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
