/* ============ 公共基础样式（Reset / 排版 / 按钮 / 导航 / 页脚 / 弹窗 / 客服） ============ */
/* ============================================
   优米彩对单助手 - 智能数据趋势分析平台
   视觉风格：科技数据风 (TradingView / CoinMarketCap)
   主色：深蓝 + 紫色 + 白色
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #080d1e;
  --bg-secondary: #0d1333;
  --bg-card: #111940;
  --bg-card-hover: #162050;
  --bg-input: #0f1738;
  --purple-500: #7c3aed;
  --purple-600: #6d28d9;
  --purple-400: #a78bfa;
  --purple-300: #c4b5fd;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-600: #2563eb;
  --cyan-400: #22d3ee;
  --green-400: #4ade80;
  --red-400: #f87171;
  --yellow-400: #fbbf24;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(124, 58, 237, 0.15);
  --border-light: rgba(255,255,255,0.06);
  --gradient-purple: linear-gradient(135deg, #7c3aed, #3b82f6);
  --gradient-bg: linear-gradient(135deg, #0d1333 0%, #1a0a2e 50%, #0d1333 100%);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 30px rgba(124,58,237,0.2);
  --radius: 12px;
  --radius-lg: 20px;
  --font-main: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --max-width: 1200px;
  --nav-height: 72px;

  /* ============================================================
     z-index 层级配置
     说明：全局最高层级只在此处维护，业务弹窗的局部层级仍写在各自规则内。
     层级从高到低：
       --z-kefu   客服相关弹层（浮窗 / 聊天窗 / 客服选择），始终置顶
       --z-config 自动识别配置向导，仅低于客服、高于其他弹框
     注：2147483647 为 CSS z-index 最大有效整数，故客服取最大值，
         配置向导取 2147483646 保持“第二”。
     ============================================================ */
  --z-kefu: 2147483647;
  --z-config: 2147483646;
}

html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; overscroll-behavior-x: none; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden; /* 旧浏览器兜底 */
  overflow-x: clip;   /* 不产生滚动容器，保证子元素 position: sticky 生效 */
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple-400); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--purple-300); }

img { max-width: 100%; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* === Typography === */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }
p { color: var(--text-secondary); }

.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--purple-400);
  margin-bottom: 12px;
}
.section-label::before {
  content: ''; width: 20px; height: 2px;
  background: var(--gradient-purple); border-radius: 2px;
}
.section-title { margin-bottom: 16px; }
.section-desc {
  font-size: 1.05rem; color: var(--text-secondary);
  max-width: 600px; margin-bottom: 48px;
}
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 10px;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.25s ease;
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-purple); color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.5);
  color: #fff;
}
.btn-secondary {
  background: transparent; color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}
.btn-sm { padding: 10px 20px; font-size: 0.875rem; border-radius: 8px; }
.btn-lg { padding: 18px 36px; font-size: 1.05rem; border-radius: 12px; }
/* 会员/个人中心风格 CTA：橙红渐变（复用导航「个人中心」视觉） */
.btn-member {
  background: linear-gradient(135deg, #fb923c, #ef4444);
  box-shadow: 0 4px 20px rgba(239,68,68,0.45);
  color: #fff; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.btn-member:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(239,68,68,0.6);
  color: #fff;
}
/* 顶部导航登录态切换：登录后显示「个人中心」，隐藏「免费试用」（需覆盖 .btn / .mobile-menu a.btn 的 display） */
.nav-actions .js-user-center[hidden],
.mobile-menu .js-user-center[hidden],
.nav-actions .js-guest-only[hidden],
.mobile-menu .js-guest-only[hidden] { display: none; }
/* 登录后「个人中心」按钮：高对比橙红配色，突出于紫色主按钮（桌面 + 移动克隆） */
.nav-actions .js-user-center,
.mobile-menu .js-user-center {
  background: linear-gradient(135deg, #fb923c, #ef4444);
  box-shadow: 0 4px 20px rgba(239,68,68,0.45);
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.nav-actions .js-user-center:hover,
.mobile-menu .js-user-center:hover {
  box-shadow: 0 8px 30px rgba(239,68,68,0.6);
}

/* === Navigation === */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height); z-index: 1000;
  background: rgba(8,13,30,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.3s, box-shadow 0.3s;
}
.nav.scrolled {
  background: rgba(8,13,30,0.95);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.nav-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0 24px; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 800; color: #fff;
  text-decoration: none; letter-spacing: -0.02em;
}
.nav-logo-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--gradient-purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 900; color: #fff;
}
.nav-logo span.trend { color: var(--purple-400); }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a {
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  text-decoration: none; transition: color 0.2s; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-links a.active::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--gradient-purple); border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
/* 首页顶部“登录/注册”按钮：渐变描边玻璃（次级入口，弱于免费试用主 CTA） */
.nav-login-btn {
  background:
    linear-gradient(rgba(124,58,237,0.12), rgba(124,58,237,0.12)) padding-box,
    linear-gradient(135deg, #7c3aed, #3b82f6) border-box;
  border: 1px solid transparent;
  color: #ddd6fe;
}
.nav-login-btn:hover {
  background:
    linear-gradient(rgba(124,58,237,0.24), rgba(124,58,237,0.24)) padding-box,
    linear-gradient(135deg, #7c3aed, #3b82f6) border-box;
  color: #fff;
  box-shadow: 0 0 18px rgba(124,58,237,0.35);
  transform: translateY(-1px);
}
.nav-toggle {
  display: none; background: none; border: none; color: #fff;
  font-size: 1.5rem; cursor: pointer; padding: 4px;
}
/* Mobile menu */
.mobile-menu {
  display: none; position: fixed; top: var(--nav-height); left: 0; right: 0;
  background: rgba(8,13,30,0.98); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 20px 24px; z-index: 999;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; padding: 14px 0; color: var(--text-secondary);
  font-size: 1rem; font-weight: 500; border-bottom: 1px solid var(--border-light);
  text-decoration: none;
}
.mobile-menu a:hover { color: #fff; }
/* 移动菜单 CTA 按钮（克隆自桌面右上角，保持按钮外观，避免被 .mobile-menu a 的块级样式覆盖） */
.mobile-menu a.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-top: 10px; padding: 12px 20px;
  border-bottom: none; text-align: center;
}

/* === Footer === */
.footer {
  padding: 60px 0 32px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-light);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; margin-bottom: 48px;
}
.footer-brand p { font-size: 0.88rem; color: var(--text-muted); margin-top: 16px; line-height: 1.7; }
.footer-col { text-align: right; }
.footer-col h4 {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 20px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a {
  color: var(--text-secondary); font-size: 0.88rem;
  text-decoration: none; transition: color 0.2s;
}
.footer-col a:hover { color: var(--purple-400); }
.footer-bottom {
  padding-top: 24px; border-top: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { font-size: 0.8rem; color: var(--text-muted); }

.page-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,58,237,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 10%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 10%, transparent 80%);
}
/* === Animations === */
.fade-up {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* === Auth Modal (登录/注册弹窗) === */
.auth-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-modal[hidden] { display: none; }
.auth-overlay {
  position: absolute; inset: 0;
  background: rgba(8,13,30,0.75); backdrop-filter: blur(6px);
}
.auth-dialog {
  position: relative; width: 100%; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 32px;
  box-shadow: var(--shadow-glow);
  animation: authPop 0.3s ease;
}
@keyframes authPop {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-close {
  position: absolute; top: 14px; right: 18px;
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 1px solid rgba(248,113,113,0.65); border-radius: 50%;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 12px rgba(239,68,68,0.35);
  transition: background 0.2s, border-color 0.2s;
}
.auth-close:hover { background: linear-gradient(135deg, #f87171, #ef4444); border-color: #fca5a5; }
.auth-title { font-size: 1.3rem; text-align: center; margin-bottom: 24px; }
.auth-tabs {
  display: flex; gap: 6px; padding: 4px;
  background: var(--bg-input); border-radius: 10px; margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 10px 0; border: none; border-radius: 8px;
  background: transparent; color: var(--text-secondary);
  font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.25s;
}
.auth-tab.active { background: var(--gradient-purple); color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form[hidden] { display: none; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.auth-field input {
  background: var(--bg-input); border: 1px solid var(--border-light);
  border-radius: 10px; padding: 12px 14px; color: var(--text-primary);
  font-size: 0.95rem; outline: none; transition: border-color 0.2s;
}
.auth-field input:focus { border-color: var(--purple-500); }
.auth-field input::placeholder { color: var(--text-muted); }
.auth-submit { justify-content: center; width: 100%; margin-top: 4px; }
.auth-captcha-row { display: flex; align-items: center; gap: 10px; }
.auth-captcha-input { flex: 1; min-width: 0; }
.auth-captcha-canvas {
  display: block; width: 110px; height: 42px; flex-shrink: 0;
  border-radius: 10px; border: 1px solid var(--border-light);
  background: var(--bg-input); cursor: pointer;
  object-fit: contain;
  transition: border-color 0.2s;
}
.auth-captcha-canvas:hover { border-color: var(--purple-500); }
.auth-switch { text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.auth-switch a { color: var(--purple-400); }
.auth-switch a:hover { color: var(--purple-300); }

/* === 独立登录/注册页（复用 auth 弹窗样式，整页居中，样式不另起一套） === */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: calc(var(--nav-height) + 48px) 20px 64px;
}
.auth-page .auth-dialog { animation: none; max-width: 420px; }
@media (max-width: 768px) {
  .auth-page .auth-dialog { max-width: 360px; }
}

/* === 成功提示弹窗（登录/注册成功，动态注入） === */
.success-modal {
  position: fixed; inset: 0; z-index: 2200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: successFadeIn 0.22s ease;
}
.success-modal-out { animation: successFadeOut 0.22s ease forwards; }
.success-overlay {
  position: absolute; inset: 0;
  background: rgba(8,13,30,0.75);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.success-dialog {
  position: relative; width: 100%; max-width: 320px;
  padding: 34px 28px 30px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  animation: authPop 0.3s ease;
}
.success-icon {
  width: 76px; height: 76px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(124,58,237,0.28), rgba(59,130,246,0.14));
  box-shadow: 0 0 0 1px rgba(139,92,246,0.4), 0 0 30px rgba(124,58,237,0.45);
}
.success-icon svg { width: 52px; height: 52px; overflow: visible; }
.success-icon-circle {
  stroke-dasharray: 145; stroke-dashoffset: 145;
  animation: successCircleDraw 0.5s ease forwards;
}
.success-icon-check {
  stroke-dasharray: 40; stroke-dashoffset: 40;
  animation: successCheckDraw 0.45s ease 0.15s forwards;
}
.success-title { font-size: 1.25rem; color: #fff; margin-bottom: 6px; }
.success-subtitle { font-size: 0.88rem; color: var(--text-muted); }
@keyframes successFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes successFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes successCircleDraw { to { stroke-dashoffset: 0; } }
@keyframes successCheckDraw { to { stroke-dashoffset: 0; } }

/* === 通用提示弹窗（替代原生 alert，动态注入；见 js/utils/dialog.js） === */
.tip-modal {
  position: fixed; inset: 0; z-index: 2300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: successFadeIn 0.22s ease;
}
.tip-modal-out { animation: successFadeOut 0.2s ease forwards; }
.tip-overlay {
  position: absolute; inset: 0;
  background: rgba(8,13,30,0.75);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tip-dialog {
  position: relative; width: 100%; max-width: 340px;
  padding: 30px 26px 24px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  animation: authPop 0.3s ease;
}
.tip-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--blue-400);
  background: radial-gradient(circle at 50% 40%, rgba(96,165,250,0.28), rgba(96,165,250,0.08));
  box-shadow: 0 0 0 1px rgba(96,165,250,0.4), 0 0 24px rgba(96,165,250,0.35);
}
.tip-icon svg { width: 32px; height: 32px; }
.tip-modal-error .tip-icon {
  color: var(--red-400);
  background: radial-gradient(circle at 50% 40%, rgba(248,113,113,0.28), rgba(248,113,113,0.08));
  box-shadow: 0 0 0 1px rgba(248,113,113,0.4), 0 0 24px rgba(248,113,113,0.35);
}
.tip-modal-warning .tip-icon {
  color: var(--yellow-400);
  background: radial-gradient(circle at 50% 40%, rgba(251,191,36,0.28), rgba(251,191,36,0.08));
  box-shadow: 0 0 0 1px rgba(251,191,36,0.4), 0 0 24px rgba(251,191,36,0.35);
}
.tip-title { font-size: 1.15rem; color: #fff; margin-bottom: 8px; }
.tip-message { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; word-break: break-word; }
.tip-btn {
  width: 100%; margin-top: 22px; padding: 12px 0;
  border: none; border-radius: 10px;
  background: var(--gradient-purple); color: #fff;
  font-family: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 20px rgba(124,58,237,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.tip-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,0.5); }

/* 赠送弹窗（type=gift）：金色礼盒 + 金光脉冲 + 光点飘动 + 按钮流光 */
.tip-modal-gift .tip-dialog {
  max-width: 360px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(251,191,36,0.22), transparent 48%),
    linear-gradient(160deg, #1b1445 0%, #2a1650 52%, #3a1b2e 100%);
  border: 1px solid rgba(251,191,36,0.55);
  box-shadow:
    0 0 0 1px rgba(251,191,36,0.12),
    0 18px 50px rgba(0,0,0,0.55),
    0 0 42px rgba(251,191,36,0.22);
  animation: giftDialogIn 0.5s cubic-bezier(0.2,0.9,0.3,1.25);
}
.tip-modal-gift .tip-dialog::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(253,230,138,0.9) 1.4px, transparent 2px),
    radial-gradient(circle, rgba(244,114,182,0.75) 1.2px, transparent 1.8px);
  background-size: 52px 52px, 78px 78px;
  background-position: 0 0, 26px 18px;
  opacity: 0.32;
  animation: giftSparkleDrift 9s linear infinite;
}
.tip-modal-gift .tip-dialog > * { position: relative; z-index: 1; }
.tip-modal-gift .tip-icon {
  color: #fbbf24;
  background: radial-gradient(circle at 50% 40%, rgba(251,191,36,0.34), rgba(244,114,182,0.1));
  box-shadow: 0 0 0 1px rgba(251,191,36,0.55), 0 0 30px rgba(251,191,36,0.45);
  animation: giftIconPulse 1.6s ease-in-out infinite;
}
.tip-modal-gift .tip-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #fde68a, #fbbf24 45%, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.tip-modal-gift .tip-message {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #f8fafc;
}
.tip-modal-gift .tip-message-hl { color: #fbbf24; font-weight: 800; }
.tip-modal-gift .tip-btn {
  position: relative;
  overflow: hidden;
  color: #3b1d00;
  background: linear-gradient(135deg, #f59e0b, #fbbf24 55%, #f472b6);
  box-shadow: 0 6px 24px rgba(251,191,36,0.4);
  font-size: 1rem;
}
.tip-modal-gift .tip-btn::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  transform: skewX(-20deg);
  animation: giftButtonShine 2.4s ease-in-out infinite;
}
.tip-modal-gift .tip-btn:hover { box-shadow: 0 10px 34px rgba(251,191,36,0.55); }
@keyframes giftDialogIn {
  from { opacity: 0; transform: translateY(24px) scale(0.9); }
  60% { opacity: 1; transform: translateY(-3px) scale(1.02); }
  to { opacity: 1; transform: none; }
}
@keyframes giftIconPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(251,191,36,0.55), 0 0 22px rgba(251,191,36,0.35); }
  50% { transform: scale(1.06) rotate(-3deg); box-shadow: 0 0 0 1px rgba(251,191,36,0.65), 0 0 34px rgba(251,191,36,0.6); }
}
@keyframes giftSparkleDrift {
  from { background-position: 0 0, 26px 18px; }
  to { background-position: 52px 156px, 104px 252px; }
}
@keyframes giftButtonShine {
  0%, 65% { left: -60%; }
  100% { left: 120%; }
}
@media (prefers-reduced-motion: reduce) {
  .tip-modal-gift .tip-dialog,
  .tip-modal-gift .tip-icon,
  .tip-modal-gift .tip-dialog::before,
  .tip-modal-gift .tip-btn::after { animation: none; }
}

/* === 浮动客服窗口（主站与个人中心注入，页面右侧垂直居中卡片；个人中心仅“客服咨询”） === */
.kefu-widget {
  position: fixed; top: 50%; right: 64px;
  transform: translateY(-50%);
  z-index: var(--z-kefu); /* 浮动客服窗口：最高层 */
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 10px;
  background: linear-gradient(180deg, rgba(28,26,58,0.96), rgba(12,11,30,0.97));
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 18px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.45), 0 0 26px rgba(251,191,36,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  touch-action: none;
}
.kefu-widget[hidden] { display: none; }
.kefu-title {
  width: 100%; padding-bottom: 9px;
  text-align: center; white-space: nowrap;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--yellow-400);
  border-bottom: 1px solid rgba(251,191,36,0.25);
}
.kefu-close {
  position: absolute; top: -12px; right: -12px;
  width: 20px; height: 20px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; line-height: 1; cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626); border: 2px solid #f87171; border-radius: 50%;
  box-shadow: 0 3px 10px rgba(239,68,68,0.45);
  transition: background 0.2s, transform 0.2s;
}
.kefu-close:hover { background: linear-gradient(135deg, #f87171, #ef4444); border-color: #fca5a5; transform: scale(1.08); }
.kefu-items { display: flex; flex-direction: column; gap: 9px; }
.kefu-item {
  width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 13px;
  font-family: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, filter 0.2s;
}
/* 客服图标品牌色底（与关于页/充值页客服卡片一致：微信绿 / Telegram 蓝 / 客服紫） */
.kefu-item-wechat {
  background: linear-gradient(135deg, #07C160, #1AAD19);
  box-shadow: 0 6px 16px rgba(7,193,96,0.4);
}
.kefu-item-telegram {
  background: linear-gradient(135deg, #26A5E4, #1d7fc0);
  box-shadow: 0 6px 16px rgba(38,165,228,0.4);
}
.kefu-item-service {
  background: var(--gradient-purple);
  box-shadow: 0 6px 16px rgba(124,58,237,0.45);
}
.kefu-item:hover {
  transform: translateY(-2px) scale(1.05);
  filter: brightness(1.12);
  border-color: rgba(255,255,255,0.35);
}
.kefu-item-wechat:hover { box-shadow: 0 0 18px rgba(7,193,96,0.6); }
.kefu-item-telegram:hover { box-shadow: 0 0 18px rgba(38,165,228,0.6); }
.kefu-item-service:hover { box-shadow: 0 0 18px rgba(124,58,237,0.65); }
.kefu-item-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kefu-item-caption {
  font-size: 0.62rem; line-height: 1; white-space: nowrap;
  color: var(--text-secondary);
}

/* 移动端客服按钮：默认隐藏，仅移动端显示；微信绿配色
   收起态=三角图标(1上2下)+「客服咨询」文案，展开态=向上折叠箭头 */
.kefu-trigger {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  color: #fff; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 13px;
  background: linear-gradient(135deg, #07C160, #1AAD19);
  box-shadow: 0 6px 16px rgba(7,193,96,0.45);
  transition: transform 0.2s, filter 0.2s;
}
.kefu-trigger:hover { transform: translateY(-2px) scale(1.05); filter: brightness(1.12); }
.kefu-trigger-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kefu-trigger-grid {
  display: grid; grid-template-columns: repeat(2, auto);
  gap: 2px; justify-items: center; align-items: center;
}
.kefu-trigger-grid > :first-child { grid-column: 1 / -1; }
.kefu-trigger-chevron { display: none; align-items: center; justify-content: center; }
.kefu-trigger-caption {
  font-size: 0.62rem; line-height: 1; white-space: nowrap;
  color: var(--text-secondary);
}
.kefu-widget--expanded .kefu-trigger-grid,
.kefu-widget--expanded .kefu-trigger-caption { display: none; }
.kefu-widget--expanded .kefu-trigger-chevron { display: flex; }
.kefu-item-service,
.kefu-trigger { position: relative; }
.kefu-badge {
  position: absolute; top: -6px; right: -6px; z-index: 4;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #080d1e; border-radius: 999px;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  box-shadow: 0 2px 8px rgba(239,68,68,0.55);
  pointer-events: none;
}
.kefu-badge[hidden] { display: none; }
.kefu-widget--expanded .kefu-trigger .kefu-badge { display: none; }

/* 微信图标点击弹出的二维码卡片 */
.kefu-qr-pop {
  position: absolute; top: 50%; right: calc(100% + 12px);
  transform: translateY(-50%);
  width: 128px; padding: 8px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 24px rgba(251,191,36,0.2);
}
.kefu-qr-pop[hidden] { display: none; }
.kefu-qr-pop img { width: 100%; height: auto; display: block; border-radius: 6px; }
.kefu-qr-pop span {
  display: block; margin-top: 5px; text-align: center;
  font-size: 0.66rem; font-weight: 600; color: #334155;
}

/* 移动端：客服按钮固定；标题与项由 .kefu-panel 浮层自按钮向上滑出 */
@media (max-width: 768px) {
  .kefu-widget { right: 10px; }
  /* 关闭按钮：收起态贴客服图标左上角、展开态贴面板左上角（外露，方便点击） */
  .kefu-close--collapse,
  .kefu-close--expand { top: -10px; left: -10px; right: auto; }
  /* 收起态关闭按钮需高于客服图标，避免被图标遮挡而点不到 */
  .kefu-close--collapse { z-index: 3; }
  /* 展开态隐藏收起态的关闭按钮（展开态按钮在面板内，随面板显隐） */
  .kefu-widget--expanded .kefu-close--collapse { display: none; }
  .kefu-title { font-size: 0.6rem; padding-bottom: 7px; }
  .kefu-items { gap: 7px; }
  .kefu-item { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; }
  .kefu-item-caption,
  .kefu-trigger-caption { font-size: 0.58rem; }
  .kefu-qr-pop { width: 110px; }
  /* 客服按钮显示；收起态仅留按钮与文案 */
  .kefu-trigger { display: flex; width: 38px; height: 38px; border-radius: 11px; }
  /* 客服图标置于最底层，避免遮挡左上角关闭按钮 */
  .kefu-trigger-group { z-index: 1; }
  /* 展开面板：绝对定位浮在按钮上方，向上滑出 / 收回 */
  .kefu-panel {
    position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 10px 8px;
    background: linear-gradient(180deg, rgba(28,26,58,0.96), rgba(12,11,30,0.97));
    border: 1px solid rgba(251,191,36,0.35);
    border-radius: 16px;
    box-shadow: 0 10px 34px rgba(0,0,0,0.45), 0 0 26px rgba(251,191,36,0.18);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transform-origin: bottom center;
    transform: translateX(-50%);
    transition: transform 0.24s ease, opacity 0.24s ease;
  }
  .kefu-widget--collapsed .kefu-panel {
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateX(-50%) translateY(10px) scale(0.96);
    transition: transform 0.24s ease, opacity 0.24s ease, visibility 0s linear 0.24s;
  }
}

/* 仅真·移动端（无 hover，与 common.js 的 isMobile 判定一致）剥离卡片外壳，
   卡片样式改由 .kefu-panel 承载；PC 端缩窗时保留桌面卡片外壳（否则外边框消失） */
@media (max-width: 768px) and (hover: none) {
  .kefu-widget {
    gap: 0; padding: 0;
    background: none; border: none; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
}

/* 登录页移动端：客服浮窗移到右下角（桌面端保持右侧垂直居中） */
@media (max-width: 768px) {
  .page-login .kefu-widget {
    top: auto; right: 10px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    transform: none;
  }
}

/* 个人中心电脑端：保持基础样式的右侧垂直居中（展开显示微信 / Telegram / 在线客服三项） */
/* 个人中心移动端 / 平板：无发送框时客服底部距底部 Tab 导航栏（实测约 68px）上方 8px；
   发送框显示时由 initKefuMsgDockAlign 动态对齐到发送框外框上方 8px */
@media (max-width: 1024px) {
  .page-user .kefu-widget {
    top: auto; right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    transform: none;
  }
}

/* === 客服新消息提示条（聊天弹窗关闭时收到客服消息） === */
.kefu-msg-toast {
  position: fixed; top: calc(var(--nav-height) + 12px); right: 20px; z-index: var(--z-kefu); /* 客服新消息提示：最高层 */
  width: min(320px, calc(100vw - 32px));
  border: 1px solid rgba(251,191,36,0.4); border-radius: 14px;
  background: linear-gradient(180deg, rgba(28,26,58,0.98), rgba(12,11,30,0.99));
  box-shadow: 0 12px 36px rgba(0,0,0,0.45), 0 0 22px rgba(251,191,36,0.14);
  animation: kefu-toast-in 0.24s ease;
}
.kefu-msg-toast[hidden] { display: none; }
.kefu-msg-toast-btn {
  width: 100%; padding: 11px 14px;
  display: flex; flex-direction: column; gap: 3px;
  border: 0; background: transparent; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.kefu-msg-toast-title {
  color: var(--yellow-400);
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.02em;
}
.kefu-msg-toast-text {
  color: var(--text-secondary);
  font-size: 0.76rem; line-height: 1.45;
  white-space: pre-line; word-break: break-word;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
@keyframes kefu-toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 768px) {
  .kefu-msg-toast {
    left: 10px; right: 10px; width: auto;
    top: calc(var(--nav-height) + 8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .kefu-msg-toast { animation: none; }
}

/* === 在线客服聊天弹窗（关于页在线客服卡触发；外壳网站风格，内容为第三方 iframe） === */
.kefu-chat-modal {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--z-kefu); /* 在线客服聊天窗：最高层 */
}
.kefu-chat-modal[hidden] { display: none; }
.kefu-chat-modal-box {
  position: relative;
  width: 360px; max-width: calc(100vw - 40px);
  height: min(448px, 64vh);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(24,32,80,0.98), rgba(10,15,38,0.99));
  border: 1px solid var(--border-color);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 30px rgba(124,58,237,0.22);
}
.kefu-chat-modal-head {
  flex: 0 0 auto; height: 48px; padding: 0 56px 0 16px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary); font-size: 0.92rem; font-weight: 700;
  background: linear-gradient(90deg, rgba(124,58,237,0.24), rgba(59,130,246,0.08));
  border-bottom: 1px solid var(--border-light);
}
.kefu-chat-modal-head-icon {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-purple);
}
.kefu-chat-modal-box iframe { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; border: 0; display: block; background: #fff; }
.kefu-chat-modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 36px; height: 36px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; line-height: 1; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 1px solid rgba(248,113,113,0.65); border-radius: 10px;
  box-shadow: 0 4px 12px rgba(239,68,68,0.35);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.kefu-chat-modal-close:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
  border-color: #fca5a5;
  transform: scale(1.05);
}

/* 移动端：底部居中，左右等距；弹窗贴底 8px（个人中心另见下方避让导航栏） */
@media (max-width: 768px) {
  .kefu-chat-modal { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .kefu-chat-modal-box { max-width: calc(100vw - 24px); height: 47vh; border-radius: 14px; }
  .kefu-chat-modal-head { height: 48px; padding: 0 52px 0 12px; gap: 6px; font-size: 0.85rem; }
}

/* 个人中心（有底部 Tab 导航栏，≤1024 显示）：聊天弹窗贴导航栏上方 8px */
@media (max-width: 1024px) {
  .page-user .kefu-chat-modal { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
}

/* === Responsive (base) === */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  :root { --nav-height: 64px; }
  /* 移动端 logo：禁止中文在字符间换行导致「对单助手」断行，并缩小尺寸确保容纳操作区 */
  .nav-logo { font-size: 1.15rem; gap: 8px; white-space: nowrap; }
  .nav-logo-icon { width: 34px; height: 34px; font-size: 0.9rem; flex-shrink: 0; }
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  /* 登录后：移动端顶部导航直接显示「个人中心」按钮（[hidden] 特异性更高，未登录仍隐藏） */
  .nav-actions .js-user-center { display: inline-flex; }
  /* 未登录：移动端顶部导航显示「登录」按钮 */
  .nav-actions .js-guest-only { display: inline-flex; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col { text-align: left; }
  .auth-dialog { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
}
/* 极窄屏（≤380px）：进一步缩小 logo，避免 nowrap 后整体溢出裁切汉堡按钮 */
@media (max-width: 380px) {
  .nav-logo { font-size: 1rem; }
  .nav-logo-icon { width: 30px; height: 30px; }
}

/* === 自定义下拉（替换原生 select 展开列表） === */
.uc-select { position: relative; display: inline-flex; align-items: center; }
/* 原生 select 仅作取值载体：视觉隐藏且不接收点击 */
.uc-select > select {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.uc-select-display {
  flex: 1; min-width: 0; width: 100%;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0; margin: 0; border: 0; background: transparent;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
}
.uc-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-select-arrow { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s; }
.uc-select.is-open .uc-select-arrow { transform: rotate(180deg); }
.uc-select:focus-within { border-color: rgba(124,58,237,0.5); }
/* history 页原生下拉自带背景箭头，包裹后需去除 */
.filter-select.uc-select { background-image: none; padding-right: 16px; }

.uc-select-panel {
  position: fixed; z-index: 2300;
  min-width: 120px; max-width: calc(100vw - 16px);
  max-height: 260px; overflow-y: auto;
  padding: 6px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 12px; box-shadow: 0 18px 48px rgba(0,0,0,0.5);
}
.uc-select-panel[hidden] { display: none; }
.uc-select-option {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 0.85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}
.uc-select-option:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.uc-select-option.is-selected { background: var(--gradient-purple); color: #fff; font-weight: 600; }
