/* =====================
   天工赛车 · 天空蓝科技主题
   Sky Blue Tech v1.0
   ===================== */

/* ── 主题变量 ── */
:root {
  --blue: #378ADD;
  --blue-dark: #185FA5;
  --blue-light: #85B7EB;
  --blue-pale: #B5D4F4;
  --blue-glow: rgba(55, 138, 221, 0.2);
  --blue-border: rgba(55, 138, 221, 0.15);
  --blue-border-strong: rgba(55, 138, 221, 0.3);
  
  --bg-page: #E6F1FB;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-surface: #FFFFFF;
  --bg-nav: rgba(255, 255, 255, 0.9);
  
  --text-primary: #0C447C;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-white: #FFFFFF;
  
  --shadow-card: 0 4px 20px rgba(55, 138, 221, 0.08);
  --shadow-btn: 0 4px 16px rgba(55, 138, 221, 0.2);
  
  --green: #10B981;
  --red: #EF4444;
  --orange: #F59E0B;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-round: 9999px;
  
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── 全局 ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overscroll-behavior: none; }  /* [P1-iOS] 全局禁止橡皮筋回弹 */
/* [P0-iOS] 禁止 iOS Safari 输入框自动缩放：font-size < 16px 时 iOS 会 zoom in 113% */
input, textarea, select { font-size: 16px !important; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
#app { height: 100%; display: flex; flex-direction: column; }

/* ── Loading ── */
.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; gap: 20px;
  background: linear-gradient(135deg, #E6F1FB 0%, #D4ECF7 100%);
}
.loading-screen .spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--blue-pale);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen p { color: var(--blue); font-size: 15px; }

/* ── 页面底座 ── */
.page { min-height: 100vh; background: linear-gradient(135deg, #E6F1FB 0%, #D4ECF7 100%); }
.page-home {
  display: flex; flex-direction: column;
  height: 100dvh; padding: 0;
  overflow: hidden;
}

/* ── 天空蓝装饰背景纹理 ── */
body::before {
  content: ''; position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(133,183,235,0.06) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(55,138,221,0.04) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(181,212,244,0.05) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── 登录页面 ── */
.login-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px;
  background:
    linear-gradient(135deg, rgba(230,241,251,0.95) 0%, rgba(212,236,247,0.95) 100%),
    url('/backgrounds/login-bg.webp') center/cover no-repeat;
  position: relative; overflow: hidden;
}

.login-logo { text-align: center; margin-bottom: 36px; position: relative; z-index: 1; }
.login-logo-icon {
  width: 72px; height: 72px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 6px 24px rgba(55,138,221,0.25);
  position: relative;
}
.login-logo-icon i { color: #fff; font-size: 30px; }
.login-logo h1 {
  font-size: 26px; font-weight: 700; color: var(--text-primary);
  letter-spacing: 4px;
}
.login-logo p { color: var(--blue); font-size: 13px; margin-top: 4px; letter-spacing: 2px; }

.login-form {
  width: 100%; max-width: 360px;
  background: var(--bg-card);
  /* [P0-iOS] 移除 backdrop-filter: blur(20px) — 每个 blur() 创建独立 GPU 合成层 */
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border: 0.5px solid var(--blue-border);
  box-shadow: var(--shadow-card);
  position: relative; z-index: 1;
}

.login-tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--blue-border); }
.login-tab {
  flex: 1; padding: 10px 0; border: none; background: none;
  color: var(--text-muted); font-size: 15px; cursor: pointer; position: relative;
}
.login-tab.active { color: var(--blue); font-weight: 600; }
.login-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 20%; right: 20%;
  height: 2px; background: var(--blue); border-radius: 2px;
}

.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.login-field label i { color: var(--blue); }

.lux-input {
  display: block; width: 100%;
  padding: 12px 16px; border: 1px solid var(--blue-border);
  border-radius: 10px; background: rgba(255,255,255,0.6);
  color: var(--text-primary); font-size: 15px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.lux-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); background: #fff; }
.lux-input::placeholder { color: var(--text-muted); }

.login-btn {
  display: block; width: 100%;
  padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: transform 0.2s, opacity 0.2s;
  letter-spacing: 4px; margin-top: 8px;
  box-shadow: var(--shadow-btn);
}
.login-btn:active { transform: scale(0.97); opacity: 0.9; }
.login-btn i { margin-right: 6px; }

.login-bottom { text-align: center; margin-top: 16px; }
.login-bottom a { color: var(--text-muted); font-size: 12px; }

/* ── 首页/游戏大厅 ── 全新设计 */
.home-header {
  position: relative;
  padding: 20px 20px 28px;
  overflow: hidden;
}
.home-header-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #2B6CB0 0%, #1A365D 50%, #2C5282 100%);
  z-index: 0;
}
.home-header-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(66,153,225,0.3) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(255,255,255,0.05) 0%, transparent 50%);
}
.home-header-content {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
}
.home-header-left {
  display: flex; align-items: center; gap: 14px;
}
.home-logo-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  /* [P0-iOS] 移除 backdrop-filter: blur(8px) — 独立 GPU 合成层 */
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.home-logo-text {
  display: flex; flex-direction: column; gap: 2px;
}
.home-title-main {
  font-size: 20px; font-weight: 700; color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.home-title-sub {
  font-size: 11px; color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
}
.home-online-count {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.1);
  /* [P0-iOS] 移除 backdrop-filter: blur(8px) — 独立 GPU 合成层 */
  border-radius: 20px;
  font-size: 12px; color: rgba(255,255,255,0.8);
  border: 0.5px solid rgba(255,255,255,0.08);
}
.home-online-count i { font-size: 11px; }

/* ── 用户资产卡片 ── */
.home-asset-card {
  position: relative;
  margin: -16px 16px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 4px 20px rgba(55,138,221,0.15);
}
.asset-card-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #FFFFFF 0%, #F7FAFC 100%);
  border: 0.5px solid var(--blue-border);
  border-radius: var(--radius-md);
}
.asset-card-content {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  padding: 16px 20px;
}
.asset-item {
  flex: 1;
  display: flex; align-items: center; gap: 12px;
}
.asset-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.asset-balance .asset-icon { background: rgba(55,138,221,0.1); color: var(--blue); }
.asset-backwater .asset-icon { background: rgba(16,185,129,0.1); color: var(--green); }
.asset-info {
  display: flex; flex-direction: column; gap: 2px;
}
.asset-label { font-size: 11px; color: var(--text-muted); }
.asset-value { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.asset-divider {
  width: 1px; height: 36px;
  background: var(--blue-border);
  flex-shrink: 0; margin: 0 16px;
}

/* ── 首页区块 ── */
.home-section {
  padding: 0 16px; margin-top: 20px; flex-shrink: 0;
}
.home-scroll-section {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 0 16px 16px; margin-top: 20px;
}
.home-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title-wrap {
  display: flex; align-items: center; gap: 8px;
}
.section-title-icon {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
}
.section-title-text {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
}
.section-more {
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; gap: 2px;
}
.section-badge {
  font-size: 9px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  padding: 3px 8px; border-radius: 10px;
  letter-spacing: 0.5px;
  animation: pulseBadge 2s ease-in-out infinite;
}
@keyframes pulseBadge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── 公告卡片 ── */
.notice-card-v2 {
  display: flex; overflow: hidden;
  background: var(--bg-card); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-radius: var(--radius-md);
  border: 0.5px solid var(--blue-border);
  box-shadow: var(--shadow-card);
}
.notice-accent {
  width: 4px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
}
.notice-content {
  flex: 1; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.5;
}
.notice-info-icon { color: var(--blue); font-size: 14px; flex-shrink: 0; }

/* ── 房间列表容器 ── */
.room-list-box {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;  /* [P1-iOS] 防止滚动穿透 */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 0 80px;
}
.room-list-box::-webkit-scrollbar { display: none; }
.rooms-grid { display: flex; flex-direction: column; }

/* ── 房间卡片 v2 ── */
.room-card-v2 {
  background: var(--bg-card);
  /* [P0-iOS] 移除 backdrop-filter: blur(8px) — 独立 GPU 合成层 */
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border: 0.5px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 8px rgba(55,138,221,0.06);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.room-card-v2:last-child { margin-bottom: 0; }
.room-card-v2:active {
  transform: scale(0.98);
  border-color: var(--blue-border-strong);
  box-shadow: 0 4px 16px rgba(55,138,221,0.15);
}
.rc-top {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
}
.rc-icon-wrap {
  position: relative;
  width: 56px; height: 56px; flex-shrink: 0;
}
.rc-icon-img {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.rc-status-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  z-index: 1;
}
.rc-status-dot.status-open { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.rc-status-dot.status-closed { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }

.rc-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.rc-name-row {
  display: flex; align-items: center; gap: 8px;
}
.rc-name {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-status-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0;
}
.rc-status-badge.status-open {
  background: rgba(34,197,94,0.1);
  color: #16a34a;
  border: 0.5px solid rgba(34,197,94,0.2);
}
.rc-status-badge.status-closed {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
  border: 0.5px solid rgba(239,68,68,0.2);
}
.rc-period-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}
.rc-period-row .room-period {
  display: inline-flex; align-items: center; gap: 4px;
}
.rc-period-row .room-period i { color: var(--blue); font-size: 11px; }

.rc-timer-section {
  flex-shrink: 0;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  min-width: 60px;
}
.rc-timer {
  font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.rc-timer.open { color: #22c55e; }
.rc-timer.closing { color: #f59e0b; }
.rc-timer.closed {
  color: #ef4444;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
}
.rc-timer.closed + .rc-timer-label { display: none; }
.rc-timer-label {
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap;
}

/* ── 房间卡片底部进度条 ── */
.rc-bottom { padding: 0 16px 14px; }
.rc-progress {
  height: 3px;
  background: rgba(55,138,221,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.rc-progress-bar {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s linear;
}
.rc-progress-bar.status-open { background: linear-gradient(90deg, var(--blue), var(--blue-dark)); }
.rc-progress-bar.status-closed { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* ── 底部导航 ── */
.nav-bar {
  display: flex; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-nav); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-top: 0.5px solid var(--blue-border);
  padding: 8px 0 4px; padding-bottom: var(--safe-bottom);
  z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); font-size: 11px;
  transition: color 0.2s;
}
.nav-item i { font-size: 20px; margin-bottom: 2px; transition: color 0.2s; }
.nav-item.active { color: var(--blue); }
.nav-item.active i { color: var(--blue); }
/* 客服未读角标 */
.nav-item[data-page="chat"] { position: relative; }
.unread-badge {
  position: absolute; top: 2px; right: 50%; margin-right: -22px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: #ff3b30; color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; border-radius: 8px; font-weight: 600;
  pointer-events: none; z-index: 10;
}

/* ── 钱包页面 ── */
.wallet-header {
  padding: 14px 20px; display: flex; align-items: center;
  background: var(--bg-nav); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-bottom: 0.5px solid var(--blue-border);
}
.wallet-header-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }

.wallet-balance-card {
  margin: 20px 16px; padding: 28px 20px;
  background:
    linear-gradient(135deg, var(--blue), var(--blue-dark)),
    url('/backgrounds/wallet-bg.webp') center/cover no-repeat;
  background-blend-mode: overlay;
  border-radius: var(--radius-lg);
  text-align: center; color: #fff;
  box-shadow: 0 6px 24px rgba(55,138,221,0.3);
}
.wallet-balance-label { font-size: 13px; opacity: 0.85; margin-bottom: 8px; }
.wallet-balance-amount { font-size: 36px; font-weight: 700; }
.wallet-balance-subtitle { font-size: 12px; opacity: 0.7; margin-top: 4px; }

.wallet-actions { display: flex; gap: 10px; padding: 0 16px; margin-bottom: 20px; }
.wallet-action-btn {
  flex: 1; padding: 12px; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 0.2s, background 0.2s;
}
.wallet-action-btn:active { transform: scale(0.96); }
.wallet-action-btn.recharge { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; box-shadow: var(--shadow-btn); }
.wallet-action-btn.withdraw { background: var(--bg-card); color: var(--text-secondary); border: 0.5px solid var(--blue-border); }
.wallet-action-btn.backwater { background: var(--bg-card); color: var(--blue); border: 0.5px solid var(--blue-border); }

.wallet-stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 0 16px; margin-bottom: 20px; }
.wallet-stat-card { padding: 14px; text-align: center; background: var(--bg-card); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */ border-radius: var(--radius-sm); border: 0.5px solid var(--blue-border); }
.wallet-stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.wallet-stat-value { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.wallet-stat-value.profit { color: var(--green); }
.wallet-stat-value.loss { color: var(--red); }

.wallet-tabs { display: flex; margin: 0 16px; border-bottom: 1px solid var(--blue-border); }
.wallet-tab { flex: 1; padding: 12px; border: none; background: none; color: var(--text-muted); font-size: 14px; cursor: pointer; position: relative; }
.wallet-tab.active { color: var(--blue); font-weight: 600; }
.wallet-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 20%; right: 20%; height: 2px; background: var(--blue); border-radius: 2px; }

/* ── 记录列表 ── */
.record-list { padding: 0 16px; margin-top: 12px; }
.record-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; margin-bottom: 8px;
  background: var(--bg-card); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-radius: var(--radius-md);
  border: 0.5px solid var(--blue-border);
  font-size: 13px;
}
.record-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.record-icon.in { background: rgba(16,185,129,0.1); color: var(--green); }
.record-icon.out { background: rgba(239,68,68,0.1); color: var(--red); }
.record-icon.neutral { background: rgba(55,138,221,0.1); color: var(--blue); }
.record-body { flex: 1; min-width: 0; }
.record-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.record-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.record-time { font-size: 11px; color: var(--text-muted); margin-top: 1px; opacity: 0.7; }
.record-amount {
  font-size: 15px; font-weight: 700; flex-shrink: 0;
  text-align: right;
}
.record-amount.in { color: var(--green); }
.record-amount.out { color: var(--red); }
.record-amount.neutral { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.empty-tip { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 13px; }

/* ── 个人中心 ── */
.profile-header {
  padding: 40px 20px 30px; text-align: center;
  background:
    linear-gradient(135deg, rgba(55,138,221,0.9), rgba(24,95,165,0.9)),
    url('/backgrounds/profile-bg.webp?v=2') center/cover no-repeat;
  background-blend-mode: overlay;
  border-bottom: 0.5px solid var(--blue-border);
  color: #fff;
}
.profile-avatar-box {
  width: 80px; height: 80px; margin: 0 auto 12px;
  background: rgba(255,255,255,0.2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.3);
  position: relative; cursor: pointer; overflow: hidden;
}
.profile-avatar-box img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover;
}
.profile-avatar-box i { font-size: 36px; color: #fff; }
.profile-avatar-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.45); padding: 6px 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.profile-avatar-box:active .profile-avatar-overlay,
.profile-avatar-overlay:hover { opacity: 1; }
.profile-avatar-overlay i { font-size: 14px; color: #fff; }
.profile-nickname { font-size: 20px; font-weight: 700; }
.profile-userid { font-size: 12px; opacity: 0.8; margin-top: 4px; }

.personal-menu { padding: 12px 16px; }
.menu-item {
  display: flex; align-items: center;
  padding: 14px 16px; margin-bottom: 4px;
  background: var(--bg-card); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-radius: var(--radius-sm);
  border: 0.5px solid transparent; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.menu-item:active { border-color: var(--blue-border); }
.menu-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-right: 12px; font-size: 14px;
}
.menu-icon.blue { background: rgba(55,138,221,0.1); color: var(--blue); }
.menu-icon.green { background: rgba(16,185,129,0.1); color: var(--green); }
.menu-icon.red { background: rgba(239,68,68,0.1); color: var(--red); }
.menu-icon.gray { background: var(--blue-pale); color: var(--text-muted); }
.menu-icon.orange { background: rgba(245,158,11,0.1); color: var(--orange); }
.menu-label { flex: 1; font-size: 14px; color: var(--text-primary); }
.menu-arrow { color: var(--text-muted); font-size: 16px; }
.menu-divider { height: 1px; margin: 8px 0; background: var(--blue-border); }

/* ── 客服页面 ── */
.service-wrapper {
  display: flex; flex-direction: column;
  height: 100vh;
  background: linear-gradient(135deg, #E6F1FB 0%, #D4ECF7 100%);
}
.service-top {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg-nav); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-bottom: 0.5px solid var(--blue-border);
}
.service-back {
  width: 36px; height: 36px; border: none; background: none;
  color: var(--blue); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background 0.2s;
}
.service-back:active { background: rgba(55,138,221,0.1); }
.service-top-info { flex: 1; }
.service-top-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.service-top-status { font-size: 11px; color: var(--green); display: flex; align-items: center; gap: 4px; margin-top: 1px; }
.service-top-status i { font-size: 7px; }
.service-top-status svg { width: 7px; height: 7px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); vertical-align: middle; margin-right: 3px; }
.service-top-more { color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 8px; }

.service-welcome {
  text-align: center; padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center;
}
.service-welcome-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(55,138,221,0.2);
}
.service-welcome-icon i { font-size: 32px; color: #fff; }
.service-welcome-icon svg { width: 32px; height: 32px; fill: #fff; }
.service-welcome-icon .icon-headset { font-size: 32px; line-height: 1; }
.service-welcome-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.service-welcome-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; max-width: 240px; }

.service-messages {
  flex: 1; overflow-y: auto; overscroll-behavior-y: contain; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.service-messages::-webkit-scrollbar { width: 3px; }
.service-messages::-webkit-scrollbar-thumb { background: var(--blue-pale); border-radius: 3px; }

/* 聊天消息气泡 */
.chat-msg {
  max-width: 80%; padding: 10px 14px;
  border-radius: 14px; font-size: 14px; line-height: 1.5;
  position: relative; word-break: break-word;
}
.chat-msg.agent {
  align-self: flex-start;
  background: #fff;
  border: 0.5px solid var(--blue-border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-time {
  font-size: 10px; color: var(--text-muted);
  margin-top: 4px; opacity: 0.7;
}
.chat-msg.user .chat-msg-time { color: rgba(255,255,255,0.6); }

/* [修复] 客服回复标识：用户消息被回复后，底部显示客服回复摘要，避免 msg.reply 覆盖 msg.content 造成假重复 */
.chat-msg-reply {
  margin-top: 8px; padding: 6px 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px; font-size: 12px;
  color: rgba(255,255,255,0.85);
  border-left: 2px solid rgba(255,255,255,0.5);
}
.chat-msg-reply i { margin-right: 4px; font-size: 10px; }

/* 系统消息 */
.chat-msg.system {
  align-self: center;
  background: rgba(55,138,221,0.06);
  color: var(--text-muted);
  font-size: 12px; padding: 6px 14px;
  border-radius: 20px;
  max-width: 90%;
  text-align: center;
}

.service-bottom {
  display: flex; padding: 10px 12px; gap: 8px;
  background: var(--bg-nav); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-top: 0.5px solid var(--blue-border);
  align-items: center;
}
.service-input {
  flex: 1; padding: 10px 16px;
  border: 0.5px solid var(--blue-border);
  border-radius: 20px;
  background: rgba(255,255,255,0.7);
  color: var(--text-primary); font-size: 14px;
  outline: none; transition: border-color 0.2s, background 0.2s;
}
.service-input:focus { border-color: var(--blue); background: #fff; }
.service-input::placeholder { color: var(--text-muted); }
.service-send {
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff; font-size: 15px; cursor: pointer; transition: transform 0.2s, opacity 0.2s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.service-send:active { transform: scale(0.92); }
.service-send i { margin: 0; }
.service-send svg { width: 1em; height: 1em; }
.service-send .icon-send { font-size: 16px; }
.icon-back { font-size: 18px; line-height: 1; }
/* 快捷回复栏 */
.service-quick-reply {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px 10px;
  background: var(--bg-card, #fff); border-top: 0.5px solid var(--blue-border, #e8edf3);
}
.qr-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 10px; font-size: 12px; border-radius: 12px;
  background: var(--bg-secondary, #f0f4f8); color: var(--text, #333);
  cursor: pointer; transition: transform 0.15s, background 0.15s, color 0.15s; white-space: nowrap;
  user-select: none; -webkit-user-select: none;
}
.qr-chip:active { transform: scale(0.95); background: var(--blue, #4a90d9); color: #fff; }

/* ── 返水页面 ── */
.bw-header {
  margin: 20px 16px; padding: 28px 20px; text-align: center;
  background:
    radial-gradient(ellipse 100% 80% at 50% 40%, rgba(55,138,221,0.12) 0%, transparent 70%),
    linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: 0 4px 20px rgba(55,138,221,0.25);
}
.bw-header-amount { font-size: 40px; font-weight: 700; margin-bottom: 4px; }
.bw-header-label { font-size: 13px; opacity: 0.8; }
.bw-header-label i { margin-right: 4px; }

.bw-stats {
  display: flex; gap: 8px; padding: 0 16px; margin-bottom: 16px;
}
.bw-stat {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 12px; background: var(--bg-card); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-radius: var(--radius-sm); border: 0.5px solid var(--blue-border);
}
.bw-stat-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: rgba(55,138,221,0.1); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.bw-stat-info { min-width: 0; }
.bw-stat-val { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.bw-stat-lbl { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

.bw-claim-area { padding: 0 16px 16px; }
.bw-claim-btn {
  display: block; width: 100%; padding: 14px;
  border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  letter-spacing: 2px; box-shadow: var(--shadow-btn);
  transition: transform 0.2s, opacity 0.2s;
}
.bw-claim-btn:active { transform: scale(0.97); opacity: 0.9; }
.bw-claim-btn:disabled { opacity: 0.5; transform: none; }

.bw-section { padding: 0 16px; margin-bottom: 20px; }
.bw-section-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.bw-section-title i { margin-right: 6px; }
.bw-list {
  background: var(--bg-card); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-radius: var(--radius-md);
  border: 0.5px solid var(--blue-border);
  overflow: hidden;
}
.bw-game-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 0.5px solid var(--blue-border);
}
.bw-game-item:last-child { border-bottom: none; }
.bw-game-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.bw-game-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }
.bw-game-stats strong { font-weight: 600; }

.bw-history-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 0.5px solid var(--blue-border);
}
.bw-history-item:last-child { border-bottom: none; }
.bw-history-amount { font-size: 16px; font-weight: 700; color: var(--green); }
.bw-history-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.bw-history-status { font-size: 12px; color: var(--green); font-weight: 500; }

.loading-tip { text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px; }

/* ── 设置页面 ── */
.settings-page { padding-bottom: 100px; }
.settings-header { display: flex; align-items: center; padding: 12px 16px; background: var(--bg-nav); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */ border-bottom: 0.5px solid var(--blue-border); }
.back-btn { background: none; border: none; color: var(--blue); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.settings-header h2 { flex: 1; text-align: center; font-size: 17px; font-weight: 600; color: var(--text-primary); }
.settings-list { padding: 12px 16px; }
.btn-danger { display: block; width: calc(100% - 32px); margin: 20px 16px; padding: 14px; border: 0.5px solid var(--red); border-radius: 10px; background: rgba(239,68,68,0.1); color: var(--red); font-size: 15px; cursor: pointer; letter-spacing: 2px; }

/* ── 键盘设置弹窗 ── */
.kbs-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
  justify-content: flex-end;
  animation: fadeIn 0.2s;
}
.kbs-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; background: var(--bg-nav); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-bottom: 0.5px solid var(--blue-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kbs-title { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.kbs-close {
  width: 32px; height: 32px; border: none; background: rgba(0,0,0,0.05);
  border-radius: 50%; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.kbs-body {
  flex: 1; overflow-y: auto; overscroll-behavior-y: contain; padding: 12px 16px;
  background: var(--bg-page);
}
.kbs-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.kbs-section { margin-bottom: 16px; }
.kbs-section-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 8px;
}
.kbs-option-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.kbs-option-item {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 8px;
  background: var(--bg-card); border: 0.5px solid var(--blue-border);
  font-size: 13px; cursor: pointer; transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  color: var(--text-primary);
}
.kbs-option-item:active { background: var(--blue-pale); }
.kbs-option-item.hidden { opacity: 0.4; background: rgba(0,0,0,0.03); display: inline-flex !important; }
.kbs-option-check { font-size: 11px; color: var(--green); }
.kbs-option-item.hidden .kbs-option-check { color: var(--red); }
.kbs-footer {
  display: flex; gap: 10px; padding: 12px 16px;
  background: var(--bg-nav); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */
  border-top: 0.5px solid var(--blue-border);
}
.kbs-btn {
  flex: 1; padding: 12px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.kbs-btn-reset { background: var(--bg-card); color: var(--text-secondary); border: 0.5px solid var(--blue-border); }
.kbs-btn-done { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; }
.kbs-btn:active { transform: scale(0.96); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── 隐藏 ── */
.hidden { display: none !important; }

/* ── PK10游戏页（天空蓝适配）─ 由 pk10-styles.css 优先控制 ── */
.pk10-page { background: var(--bg-page); }
.pk10-topbar { background: var(--bg-nav); border-bottom-color: var(--blue-border); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */ }
.pk10-back { color: var(--blue); }
.pk10-gamename { color: var(--text-primary); }
.pk10-info-card { background: var(--bg-card); border: 0.5px solid var(--blue-border); /* [P0-iOS] 移除 backdrop-filter: blur(12px) */ }
.pk10-period { background: var(--blue-pale); color: var(--text-primary); }
.pk10-action-btn { background: var(--bg-card); border-color: var(--blue-border); color: var(--text-secondary); }
.pk10-action-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.pk10-chat-area { background: var(--bg-page); }
