/* ============ 深海捕鱼 H5 壳 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep: #021127;
  --bg-mid: #05304f;
  --cyan: #35e0c0;
  --gold: #ffd76a;
  --gold-deep: #e8a317;
  --text: #eaf6ff;
  --text-dim: #7fa8c9;
  --card-bg: rgba(9, 34, 61, 0.55);
  --card-border: rgba(120, 200, 255, 0.16);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 60%, #04263f 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ============ 海洋背景 ============ */
.ocean { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.light-beam {
  position: absolute; top: -10%; width: 140px; height: 70%;
  background: linear-gradient(180deg, rgba(140, 220, 255, 0.10), transparent 80%);
  transform: rotate(14deg); filter: blur(6px);
}
.beam-1 { left: 12%; }
.beam-2 { right: 18%; height: 55%; opacity: 0.7; }

.bubble {
  position: absolute; bottom: -40px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), rgba(255,255,255,0.04) 60%);
  border: 1px solid rgba(255,255,255,0.10);
  animation: rise linear infinite;
}
.b1 { left: 8%;  width: 14px; height: 14px; animation-duration: 11s; }
.b2 { left: 26%; width: 8px;  height: 8px;  animation-duration: 8s;  animation-delay: 2s; }
.b3 { left: 47%; width: 18px; height: 18px; animation-duration: 13s; animation-delay: 1s; }
.b4 { left: 66%; width: 10px; height: 10px; animation-duration: 9s;  animation-delay: 4s; }
.b5 { left: 82%; width: 16px; height: 16px; animation-duration: 12s; animation-delay: 3s; }
.b6 { left: 92%; width: 7px;  height: 7px;  animation-duration: 7s;  animation-delay: 5s; }

@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-105vh) translateX(30px); opacity: 0; }
}

/* left 初始 -120px：动画延迟期间鱼藏在屏幕外，避免卡在左侧不动 */
.fish { position: absolute; left: -120px; fill: rgba(140, 200, 240, 0.16); }
.fish .eye { fill: rgba(180, 220, 250, 0.25); }
/* SVG 原始朝向头朝左，swim 向右游 → 统一水平翻转使鱼头朝前 */
.f1 { width: 64px; top: 22%; animation: swim 26s linear infinite; transform: scaleX(-1); }
.f2 { width: 44px; top: 48%; animation: swim 34s linear infinite 6s; transform: scaleX(-1); }
.f3 { width: 88px; top: 70%; animation: swim 42s linear infinite 12s; opacity: 0.7; transform: scaleX(-1); }

@keyframes swim {
  0%   { left: -120px; }
  100% { left: 105vw; }
}

.seaweed {
  position: absolute; bottom: 0; width: 60px; height: 90px;
  background: linear-gradient(180deg, rgba(53, 224, 192, 0.10), transparent);
  border-radius: 50% 50% 0 0;
  transform-origin: bottom center;
  animation: sway 5s ease-in-out infinite alternate;
}
.s1 { left: 6%; }
.s2 { right: 10%; height: 130px; animation-duration: 6s; }

@keyframes sway {
  from { transform: rotate(-6deg); }
  to   { transform: rotate(6deg); }
}

/* ============ 视图与卡片 ============ */
.view { position: relative; z-index: 1; min-height: 100vh; }
.hidden { display: none !important; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* ============ 登录页 ============ */
#view-login { display: flex; align-items: center; justify-content: center; padding: 24px; }

.login-card {
  width: 100%; max-width: 380px;
  padding: 36px 28px 28px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.logo-icon { width: 72px; height: 72px; }
.logo-fish { fill: var(--cyan); }
.logo-tail { fill: var(--gold); }

.logo h1 {
  margin-top: 10px;
  font-size: 26px; letter-spacing: 6px;
  background: linear-gradient(90deg, #eaf6ff, var(--cyan) 55%, var(--gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.subtitle { margin-top: 6px; font-size: 11px; letter-spacing: 3px; color: var(--text-dim); }

.tabs { display: flex; margin: 26px 0 22px; background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 4px; }
.tab {
  flex: 1; padding: 10px 0; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--text-dim); font-size: 15px; font-weight: 600;
  transition: all 0.25s;
}
.tab.active { background: linear-gradient(135deg, rgba(53, 224, 192, 0.22), rgba(53, 224, 192, 0.08)); color: var(--cyan); }

.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1px solid rgba(120, 200, 255, 0.18);
  background: rgba(0, 0, 0, 0.28); color: var(--text); font-size: 15px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: rgba(127, 168, 201, 0.5); }
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(53, 224, 192, 0.15); }

.tips { margin-top: 16px; font-size: 12px; color: var(--text-dim); line-height: 1.6; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 700; color: #062018;
  padding: 12px 22px;
  transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.btn-block { width: 100%; padding: 14px; font-size: 16px; }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #1bb598);
  color: #03211a; box-shadow: 0 6px 20px rgba(53, 224, 192, 0.3);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #3a2402; box-shadow: 0 8px 26px rgba(255, 215, 106, 0.35);
}
.btn-gold:hover { filter: brightness(1.06); }

.btn-lg { padding: 15px 26px; font-size: 17px; border-radius: 14px; }

.btn-outline {
  background: transparent; border: 1px solid rgba(120, 200, 255, 0.35);
  color: var(--text); font-weight: 600;
}
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-ghost {
  background: transparent; border: 0; color: var(--text-dim); cursor: pointer;
  font-size: 13px; display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px;
}
.btn-ghost:hover { color: var(--cyan); }

.icon { width: 16px; height: 16px; fill: currentColor; }

/* ============ 主视图 ============ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(2, 17, 39, 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}
.user { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.user .icon { width: 20px; height: 20px; fill: var(--cyan); }

/* 滚动公告栏 */
.notice-bar {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 12px auto 0; padding: 9px 14px;
  background: linear-gradient(90deg, rgba(255, 206, 92, 0.12), rgba(9, 34, 61, 0.75));
  border: 1px solid rgba(255, 206, 92, 0.3);
  border-radius: 12px;
  font-size: 13px;
}
.notice-icon { width: 16px; height: 16px; fill: var(--gold); flex-shrink: 0; }
.notice-scroll { flex: 1; overflow: hidden; min-width: 0; }
.notice-track {
  display: inline-flex; white-space: nowrap;
  animation: noticeScroll 16s linear infinite;
}
.notice-track span { padding-right: 80px; color: var(--gold); }
@keyframes noticeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.main-wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; display: grid; gap: 14px; }

/* 游戏入口卡片 */
.game-card {
  padding: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(135deg, rgba(9, 34, 61, 0.75), rgba(10, 45, 66, 0.55)),
              radial-gradient(circle at 85% 20%, rgba(255, 215, 106, 0.18), transparent 55%);
  border-color: rgba(255, 215, 106, 0.25);
  overflow: hidden; position: relative;
}
.game-card::after {
  content: ""; position: absolute; top: -60%; right: -20%; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255, 215, 106, 0.16), transparent 65%);
  border-radius: 50%; pointer-events: none;
}
.game-name { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.game-meta { margin-top: 6px; font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }

/* 钱包卡片 */
.wallet-card { padding: 20px; }
.wallet-head { display: flex; align-items: center; justify-content: space-between; }
.wallet-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.wallet-label .icon { width: 15px; height: 15px; }

.balance {
  margin: 12px 0 18px; font-size: 28px; font-weight: 800; letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #fff, var(--gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.transfer-row { display: flex; gap: 10px; }
.transfer-row input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(120, 200, 255, 0.18);
  background: rgba(0, 0, 0, 0.28); color: var(--text); font-size: 15px;
  outline: none; font-variant-numeric: tabular-nums;
}
.transfer-row input:focus { border-color: var(--gold); }
.transfer-row input::placeholder { color: rgba(127, 168, 201, 0.5); }

/* 充值按钮行 */
.recharge-row { margin-top: 12px; }
.recharge-row .btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.main-withdraw-row { margin-top: 8px; }

/* 记住密码 */
.remember-row { text-align: left; margin-bottom: 12px; }
.remember-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); cursor: pointer; user-select: none; }
.remember-label input { width: 15px; height: 15px; accent-color: var(--gold); }

/* 充值弹窗：支付方式切换 */
.pay-type-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.pay-tab {
  flex: 1; padding: 9px 0; border-radius: 10px; border: 1px solid rgba(120, 200, 255, 0.2);
  background: rgba(0, 0, 0, 0.25); color: var(--text-dim); font-size: 14px; cursor: pointer;
}
.pay-tab.active {
  background: linear-gradient(135deg, #ffce5c, #e0a52e); color: #3a2500;
  font-weight: 700; border-color: transparent;
}

/* USDT 充值订单详情 */
.usdt-order-box { text-align: center; }
.usdt-pay-amount { background: rgba(0, 0, 0, 0.3); border: 1px dashed rgba(255, 206, 92, 0.5); border-radius: 12px; padding: 9px; margin-bottom: 12px; }
.usdt-pay-amount .lbl { font-size: 12px; color: var(--text-dim); }
.usdt-pay-amount .num { font-size: 21px; font-weight: 800; color: var(--gold); letter-spacing: 1px; margin: 3px 0; }
.usdt-pay-amount .sub { font-size: 12px; color: #ff9a9a; }
.usdt-addr-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.usdt-addr {
  flex: 1; min-width: 0; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(120, 200, 255, 0.18);
  border-radius: 10px; padding: 10px 12px; font-size: 12px; word-break: break-all;
  font-family: Consolas, monospace; color: var(--cyan); text-align: left;
}
.usdt-qr-wrap { display: flex; justify-content: center; margin-bottom: 10px; }
.usdt-qr-wrap img, .usdt-qr-wrap canvas { border-radius: 10px; background: #fff; padding: 6px; }
.usdt-countdown { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.usdt-countdown b { color: var(--gold); font-size: 16px; }
.usdt-tips {
  text-align: left; font-size: 12px; color: var(--text-dim); line-height: 1.8;
  background: rgba(0, 0, 0, 0.22); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
}
.usdt-credit-tip { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.usdt-credit-tip b { color: var(--cyan); }

/* ============ 提现中心 ============ */
.field select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(120, 200, 255, 0.18);
  background: rgba(0, 0, 0, 0.28); color: var(--text); font-size: 15px;
  outline: none; appearance: none; -webkit-appearance: none;
}
.field select:focus { border-color: var(--cyan); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; cursor: pointer; }

.payout-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid rgba(120, 200, 255, 0.08);
}
.payout-item:last-child { border-bottom: 0; }
.payout-head { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 140px; }
.payout-name { font-size: 14px; font-weight: 600; }
.payout-status { font-size: 12px; color: var(--text-dim); }
.payout-status.bound { color: var(--cyan); }
.payout-body { width: 100%; padding: 10px 0 2px; }
.payout-img { max-width: 150px; max-height: 150px; border-radius: 10px; border: 1px solid rgba(120, 200, 255, 0.18); }
.payout-actions { display: flex; gap: 8px; align-items: center; }
.payout-actions label.btn-sm { display: inline-flex; align-items: center; }

/* 记录卡片 */
.records-card { padding: 18px 20px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text-dim); margin-bottom: 12px; letter-spacing: 1px; }

.record-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid rgba(120, 200, 255, 0.08);
}
.record-item:last-child { border-bottom: 0; }
.record-main { display: flex; flex-direction: column; gap: 3px; }
.record-title { font-size: 14px; font-weight: 600; }
.record-sub { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.record-amount { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.record-amount.in { color: var(--cyan); }
.record-amount.out { color: var(--gold); }
.empty { padding: 26px 0; text-align: center; font-size: 13px; color: var(--text-dim); }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(1, 8, 20, 0.72);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease;
}
/* 确认弹窗层级高于充值弹窗（DOM在前，需提升z-index避免被盖住） */
#modal.modal-mask { z-index: 110; }

.modal {
  width: 84%; max-width: 340px; padding: 24px 22px;
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, #0a2a4a, #061d33);
  border: 1px solid var(--card-border); border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: popIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 12px; text-align: center; flex-shrink: 0; }
.modal-body {
  font-size: 14px; color: var(--text-dim); line-height: 1.7; text-align: center; margin-bottom: 22px;
  overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; overscroll-behavior: contain;
}
.modal-actions { display: flex; gap: 12px; flex-shrink: 0; }
.modal-actions .btn { flex: 1; padding: 12px; }

/* USDT订单：返回/取消并排 */
.usdt-actions { display: flex; gap: 10px; margin-bottom: 6px; }
.usdt-actions .btn { flex: 1; }

/* USDT订单详情模式：只显示转账信息，隐藏支付方式切换与底部充值按钮 */
#recharge-modal.usdt-order-mode .pay-type-tabs { display: none; }
#recharge-modal.usdt-order-mode .modal-body { text-align: left; }
#recharge-modal.usdt-order-mode .modal-actions #recharge-ok { display: none; }

.modal-body b { color: var(--gold); font-size: 18px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* ============ Toast ============ */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-80px);
  z-index: 200; max-width: 86%;
  padding: 12px 20px; border-radius: 12px;
  background: rgba(6, 29, 51, 0.92); color: var(--text);
  border: 1px solid var(--card-border);
  font-size: 14px; line-height: 1.5; text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.3s;
  opacity: 0; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: rgba(53, 224, 192, 0.5); color: var(--cyan); }
.toast.error { border-color: rgba(255, 110, 110, 0.55); color: #ff9a9a; }

/* ============ 响应式 ============ */
@media (max-width: 420px) {
  .balance { font-size: 25px; }
  .game-card { flex-direction: column; text-align: center; }
  .btn-lg { width: 100%; }
  .transfer-row { flex-wrap: wrap; }
  .transfer-row input { flex-basis: 100%; }
  .transfer-row .btn { flex: 1; }
  /* 充值弹窗输入框防iOS聚焦自动放大 */
  #recharge-amount { font-size: 16px; }
}
