/* ==========================================================================
   分销人员移动端 H5 - 现代化金融科技设计系统 (Fintech Design System)
   ========================================================================== */

:root {
  /* 主题色系 */
  --primary: #2563eb;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #6366f1 100%);
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  /* 辅助状态色 */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  /* 中性色层次 */
  --bg-app: #f4f6fa;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-light: #e8edf5;
  --border-hover: #cbd5e1;

  /* 阴影规范 */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-primary: 0 8px 20px -4px rgba(37, 99, 235, 0.35);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.03);

  /* 圆角规范 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body, #root {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background-color: #0f172a;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  user-select: none;
}

/* 移动端外层机型容器 (支持在桌面高保真渲染，在移动端全屏自适应) */
.mobile-wrapper {
  width: 100%;
  max-width: 440px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  background-color: var(--bg-app);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.12);
}

@media (min-width: 480px) {
  body {
    padding: 24px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: auto;
  }
  #root {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
  }
  .mobile-wrapper {
    height: 890px;
    max-height: calc(100vh - 48px);
    border-radius: 36px;
    overflow: hidden;
    border: 8px solid #1e293b;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
  }
}

/* 主内容滚动容器 */
.content-body {
  flex: 1;
  min-height: 0;
  padding: 16px 16px 20px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.content-body::-webkit-scrollbar {
  display: none;
}

/* 顶部导航栏 */
.header-bar {
  flex-shrink: 0;
  background: #ffffff;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* 资产主大卡片 (黑金商务科技感) */
.wallet-card {
  background: linear-gradient(145deg, #090e17 0%, #151d2a 50%, #0d131f 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 24px 20px 20px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 36px -8px rgba(9, 14, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wallet-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(99, 102, 241, 0.15) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.wallet-card::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: 20%;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

/* 悬浮白底卡片 */
.fintech-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fintech-card:active {
  transform: scale(0.99);
}

/* 底部导航栏 */
.tabbar {
  flex-shrink: 0;
  width: 100%;
  height: 60px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: content-box;
}

@media (min-width: 480px) {
  .tabbar {
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
  }
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  flex: 1;
  height: 100%;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-item svg {
  margin-bottom: 3px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-item.active {
  color: var(--primary);
  font-weight: 700;
}

.tab-item.active svg {
  transform: translateY(-2px);
  color: var(--primary);
}

.tab-item.active::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 16px;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* 按钮设计规范 */
.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-primary);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-secondary:active {
  background: #e2e8f0;
  transform: scale(0.98);
}

/* 表单输入控件 */
.input-control {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-control::placeholder {
  color: var(--text-muted);
}

/* 徽标状态 Pill */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: #b45309;
  border: 1px solid var(--warning-border);
}

.badge-info {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.badge-vip {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
  font-weight: 700;
}

/* 弹窗遮罩与抽屉 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease-out;
}

.modal-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 32px 20px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  animation: sheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: #cbd5e1;
  border-radius: var(--radius-full);
  margin: 0 auto 16px auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* 骨架屏动画 Shimmer */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-animate {
  animation: spin 1s linear infinite;
}

/* 快捷芯片 Pill */
.chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chip.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}
