/* ================================================================
   style.css - 小浩子账户 - CSS 变量 + 夜间模式支持
   ================================================================ */

/* ---- 日间模式 CSS 变量（默认） ---- */
:root {
  /* 品牌色 */
  --hb-accent: #0078d4;
  --hb-accent-light: #eff6fc;
  --hb-accent-dark: #106ebe;

  /* 背景 */
  --hb-body-bg: #f3f3f3;
  --hb-bg: #f5f7fa;
  --hb-surface: #ffffff;
  --hb-surface-hover: #f8fafc;
  --hb-muted-bg: #f1f5f9;
  --hb-muted-bg2: #f8fafc;

  /* 文字 */
  --hb-text: #1f2937;
  --hb-text-alt: #1e293b;
  --hb-text-secondary: #6b7280;
  --hb-text-muted: #94a3b8;
  --hb-text-placeholder: #9ca3af;
  --hb-text-inverse: #ffffff;

  /* 边框 */
  --hb-border: #e4e7ed;
  --hb-border-light: #f1f5f9;
  --hb-border-medium: #e5e7eb;
  --hb-border-medium2: #d1d5db;
  --hb-border-strong: #cbd5e1;
  --hb-border-table: #e2e8f0;
  --hb-border-divider: #f1f5f9;

  /* 表格 */
  --hb-table-header-bg: #f8fafc;
  --hb-table-header-text: #64748b;
  --hb-table-row-hover: #f1f5f9;

  /* 标签导航 */
  --hb-tab-bg: transparent;
  --hb-tab-text: #64748b;
  --hb-tab-hover-bg: #f1f5f9;
  --hb-tab-hover-text: #1e293b;
  --hb-tab-active-bg: #3b82f6;
  --hb-tab-active-text: #ffffff;
  --hb-tab-indicator: #3b82f6;
  --hb-tab-table-indicator: #3b82f6;

  /* 按钮 */
  --hb-btn-primary-bg-start: #0078d4;
  --hb-btn-primary-bg-end: #106ebe;
  --hb-btn-primary-text: #ffffff;
  --hb-btn-emerald-bg-start: #10b981;
  --hb-btn-emerald-bg-end: #059669;
  --hb-btn-emerald-text: #ffffff;
  --hb-btn-rose-bg-start: #ef4444;
  --hb-btn-rose-bg-end: #dc2626;
  --hb-btn-rose-text: #ffffff;
  --hb-btn-white-bg: #ffffff;
  --hb-btn-white-text: #323130;
  --hb-btn-white-border: #e4e7ed;
  --hb-btn-white-hover-bg: #f5f7fa;
  --hb-btn-white-hover-border: #cbd5e1;

  /* 状态色 */
  --hb-success: #10b981;
  --hb-success-dark: #059669;
  --hb-success-text: #059669;
  --hb-success-bg: rgba(16,185,129,0.12);
  --hb-success-border: rgba(16,185,129,0.25);
  --hb-error: #ef4444;
  --hb-error-dark: #dc2626;
  --hb-error-text: #dc2626;
  --hb-error-bg: rgba(239,68,68,0.12);
  --hb-error-border: rgba(239,68,68,0.25);
  --hb-warn: #f59e0b;
  --hb-info: #4f46e5;
  --hb-info-bg: rgba(102,126,234,0.1);
  --hb-info-text: #4f46e5;
  --hb-info-border: rgba(102,126,234,0.2);

  /* 银行板块背景 */
  --hb-bank-deposit-bg: rgba(16,185,129,0.06);
  --hb-bank-deposit-border: rgba(16,185,129,0.15);
  --hb-bank-deposit-hover: rgba(16,185,129,0.1);
  --hb-bank-withdraw-bg: rgba(100,116,139,0.06);
  --hb-bank-withdraw-border: rgba(100,116,139,0.12);
  --hb-bank-withdraw-hover: rgba(100,116,139,0.1);
  --hb-bank-loan-bg: rgba(245,158,11,0.06);
  --hb-bank-loan-border: rgba(245,158,11,0.15);
  --hb-bank-loan-hover: rgba(245,158,11,0.1);
  --hb-bank-repay-bg: rgba(244,63,94,0.06);
  --hb-bank-repay-border: rgba(244,63,94,0.12);
  --hb-bank-repay-hover: rgba(244,63,94,0.1);

  /* 徽章 */
  --hb-badge-bg: #f1f5f9;
  --hb-badge-text: #475569;

  /* 阴影 */
  --hb-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --hb-shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --hb-shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --hb-shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);

  /* 弹窗 */
  --hb-modal-bg: #ffffff;
  --hb-modal-overlay: rgba(0,0,0,0.35);

  /* 登录背景渐变 */
  --hb-auth-bg-start: #667eea;
  --hb-auth-bg-mid: #764ba2;
  --hb-auth-bg-end: #6B73FF;
  --hb-auth-card-bg: rgba(255,255,255,.98);
  --hb-auth-card-border: rgba(255,255,255,.3);

  /* 资产卡渐变（三个卡片分别保持品牌色，夜间微调亮度即可） */
  --hb-asset-card-text: #ffffff;

  /* 下拉菜单 */
  --hb-dropdown-bg: rgba(255,255,255,.92);
  --hb-dropdown-border: rgba(255,255,255,.3);
  --hb-dropdown-divider: rgba(102,126,234,0.1);
  --hb-dropdown-handle: rgba(0,0,0,0.1);

  /* 顶栏 */
  --hb-topbar-bg: rgba(255,255,255,.82);
  --hb-topbar-border: rgba(0,0,0,0.06);
  --hb-topbar-shadow: 0 1px 3px rgba(0,0,0,0.04);
  --hb-topbar-sticky-shadow: 0 4px 20px rgba(0,0,0,0.08);

  /* 管理员顶栏 */
  --hb-admin-topbar-start: #1e3a5f;
  --hb-admin-topbar-end: #0f172a;

  /* 头像 */
  --hb-avatar-border: #ffffff;

  /* 滚动条 */
  --hb-scrollbar-thumb: #cbd5e1;
  --hb-scrollbar-thumb-hover: #94a3b8;

  /* 骨架屏 */
  --hb-skeleton-start: #e5e7eb;
  --hb-skeleton-mid: #f3f4f6;
  --hb-skeleton-end: #e5e7eb;

  /* 圆角 */
  --hb-radius: 12px;
  --hb-radius-lg: 20px;
}

/* ---- 夜间模式 CSS 变量 ---- */
[data-theme="dark"] {
  --hb-accent: #60a5fa;
  --hb-accent-light: #1e3a5f;
  --hb-accent-dark: #3b82f6;

  --hb-body-bg: #0f172a;
  --hb-bg: #111827;
  --hb-surface: #1e293b;
  --hb-surface-hover: #233044;
  --hb-muted-bg: #1e293b;
  --hb-muted-bg2: #1e293b;

  --hb-text: #f1f5f9;
  --hb-text-alt: #e2e8f0;
  --hb-text-secondary: #94a3b8;
  --hb-text-muted: #64748b;
  --hb-text-placeholder: #64748b;
  --hb-text-inverse: #f1f5f9;

  --hb-border: #334155;
  --hb-border-light: #1e293b;
  --hb-border-medium: #334155;
  --hb-border-medium2: #475569;
  --hb-border-strong: #475569;
  --hb-border-table: #334155;
  --hb-border-divider: #1e293b;

  --hb-table-header-bg: #1e293b;
  --hb-table-header-text: #94a3b8;
  --hb-table-row-hover: #233044;

  --hb-tab-bg: transparent;
  --hb-tab-text: #94a3b8;
  --hb-tab-hover-bg: #1e293b;
  --hb-tab-hover-text: #e2e8f0;
  --hb-tab-active-bg: #3b82f6;
  --hb-tab-active-text: #ffffff;
  --hb-tab-indicator: #60a5fa;
  --hb-tab-table-indicator: #60a5fa;

  --hb-btn-white-bg: #334155;
  --hb-btn-white-text: #e2e8f0;
  --hb-btn-white-border: #475569;
  --hb-btn-white-hover-bg: #3b4556;
  --hb-btn-white-hover-border: #64748b;

  --hb-success-text: #34d399;
  --hb-success-bg: rgba(52,211,153,0.15);
  --hb-success-border: rgba(52,211,153,0.3);
  --hb-error-text: #f87171;
  --hb-error-bg: rgba(248,113,113,0.15);
  --hb-error-border: rgba(248,113,113,0.3);
  --hb-info-bg: rgba(96,165,250,0.12);
  --hb-info-text: #93c5fd;
  --hb-info-border: rgba(96,165,250,0.25);

  --hb-bank-deposit-bg: rgba(52,211,153,0.08);
  --hb-bank-deposit-border: rgba(52,211,153,0.15);
  --hb-bank-deposit-hover: rgba(52,211,153,0.13);
  --hb-bank-withdraw-bg: rgba(148,163,184,0.08);
  --hb-bank-withdraw-border: rgba(148,163,184,0.12);
  --hb-bank-withdraw-hover: rgba(148,163,184,0.13);
  --hb-bank-loan-bg: rgba(251,191,36,0.08);
  --hb-bank-loan-border: rgba(251,191,36,0.15);
  --hb-bank-loan-hover: rgba(251,191,36,0.13);
  --hb-bank-repay-bg: rgba(251,113,133,0.08);
  --hb-bank-repay-border: rgba(251,113,133,0.12);
  --hb-bank-repay-hover: rgba(251,113,133,0.13);

  --hb-badge-bg: #334155;
  --hb-badge-text: #94a3b8;

  --hb-shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --hb-shadow-md: 0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -1px rgba(0,0,0,.3);
  --hb-shadow-lg: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -2px rgba(0,0,0,.3);
  --hb-shadow-xl: 0 20px 25px -5px rgba(0,0,0,.5), 0 10px 10px -5px rgba(0,0,0,.3);

  --hb-modal-bg: #1e293b;
  --hb-modal-overlay: rgba(0,0,0,0.6);

  --hb-auth-bg-start: #312e81;
  --hb-auth-bg-mid: #4c1d95;
  --hb-auth-bg-end: #3730a3;
  --hb-auth-card-bg: rgba(30,41,59,.96);
  --hb-auth-card-border: rgba(51,65,85,.6);

  --hb-dropdown-bg: rgba(30,41,59,0.95);
  --hb-dropdown-border: rgba(51,65,85,0.5);
  --hb-dropdown-divider: rgba(51,65,85,0.5);
  --hb-dropdown-handle: rgba(148,163,184,0.3);

  --hb-topbar-bg: rgba(30,41,59,0.85);
  --hb-topbar-border: rgba(51,65,85,0.6);
  --hb-topbar-shadow: 0 1px 3px rgba(0,0,0,0.2);
  --hb-topbar-sticky-shadow: 0 4px 20px rgba(0,0,0,0.3);

  --hb-admin-topbar-start: #0f172a;
  --hb-admin-topbar-end: #020617;

  --hb-avatar-border: #334155;

  --hb-scrollbar-thumb: #475569;
  --hb-scrollbar-thumb-hover: #64748b;

  --hb-skeleton-start: #334155;
  --hb-skeleton-mid: #3b4556;
  --hb-skeleton-end: #334155;
}


/* ===== 全局重置 ===== */
* {
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background-color: var(--hb-body-bg);
  color: var(--hb-text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== 登录页全面优化 (v2) ===== */

/* ===== 登录页背景 ===== */
.auth-bg {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,.02) 0px,
      rgba(255,255,255,.02) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255,255,255,.015) 0px,
      rgba(255,255,255,.015) 1px,
      transparent 1px,
      transparent 18px
    ),
    linear-gradient(155deg, var(--hb-auth-bg-start) 0%, var(--hb-auth-bg-mid) 35%, rgba(102,126,234,1) 65%, var(--hb-auth-bg-end) 100%);
}
.auth-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 25%, rgba(255,255,255,.35) 0%, transparent 45%),
              radial-gradient(circle at 80% 65%, rgba(255,255,255,.22) 0%, transparent 38%),
              radial-gradient(circle at 50% 85%, rgba(255,255,255,.18) 0%, transparent 32%);
  pointer-events: none;
}
.auth-bg::after {
  content: "";
  position: absolute;
  inset: -120px;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.18) 0%, transparent 22%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.12) 0%, transparent 24%),
    radial-gradient(circle at 85% 30%, rgba(255,255,255,0.08) 0%, transparent 20%);
  pointer-events: none;
}
/* 噪点纹理覆盖层 */
.auth-bg .bg-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  opacity: 0.5;
}
[data-theme="dark"] .auth-bg {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,.01) 0px,
      rgba(255,255,255,.01) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255,255,255,.008) 0px,
      rgba(255,255,255,.008) 1px,
      transparent 1px,
      transparent 18px
    ),
    linear-gradient(155deg, var(--hb-auth-bg-start) 0%, #1a1a2e 35%, #16213e 65%, var(--hb-auth-bg-end) 100%);
}
[data-theme="dark"] .auth-bg::before {
  background: radial-gradient(circle at 20% 25%, rgba(255,255,255,.1) 0%, transparent 45%),
              radial-gradient(circle at 80% 65%, rgba(255,255,255,.06) 0%, transparent 38%),
              radial-gradient(circle at 50% 85%, rgba(255,255,255,.04) 0%, transparent 32%);
}
[data-theme="dark"] .auth-bg::after {
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.05) 0%, transparent 22%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.03) 0%, transparent 24%),
    radial-gradient(circle at 85% 30%, rgba(255,255,255,0.02) 0%, transparent 20%);
}
[data-theme="dark"] .auth-bg .bg-noise {
  opacity: 0.35;
}

/* 登录卡片玻璃效果 */
.auth-card {
  position: relative;
  z-index: 1;
  background: var(--hb-auth-card-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--hb-auth-card-border);
  border-top: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.15), 0 0 120px rgba(102,126,234,0.1);
  animation: cardIn .5s cubic-bezier(.2, .8, .2, 1) both;
}

/* ===== 主内容页全面优化 (v2) ===== */
/* ===== 卡片通用 ===== */
.hb-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border-light);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  position: relative;
}
.hb-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-color: var(--hb-border);
}
[data-theme="dark"] .hb-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* ===== 主内容页全面优化 (v2) ===== */
/* 资产卡片渐变 */
.asset-card {
  border-radius: var(--hb-radius-lg);
  padding: 1.5rem;
  color: var(--hb-asset-card-text);
  position: relative;
  overflow: hidden;
  box-shadow: var(--hb-shadow-md);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.asset-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
  z-index: 0;
}
.asset-card > * {
  position: relative;
  z-index: 1;
}
.asset-card:nth-child(1) {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #a855f7 100%);
}
.asset-card:nth-child(2) {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 60%, #fb7185 100%);
}
.asset-card:nth-child(3) {
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 60%, #22d3ee 100%);
}
[data-theme="dark"] .asset-card:nth-child(1) {
  background: linear-gradient(135deg, #3730a3 0%, #6d28d9 60%, #8b5cf6 100%);
}
[data-theme="dark"] .asset-card:nth-child(2) {
  background: linear-gradient(135deg, #be185d 0%, #e11d48 60%, #f43f5e 100%);
}
[data-theme="dark"] .asset-card:nth-child(3) {
  background: linear-gradient(135deg, #0e7490 0%, #0284c7 60%, #06b6d4 100%);
}
.asset-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: var(--hb-shadow-xl), inset 0 0 60px rgba(255,255,255,0.12);
}
.asset-card .font-mono {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ===== 顶栏 ===== */
.hb-topbar {
  background: var(--hb-surface);
  border-bottom: 1px solid var(--hb-border);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  height: auto;
}
[data-theme="dark"] .hb-topbar {
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.hb-topbar-admin {
  background: linear-gradient(135deg, var(--hb-admin-topbar-start) 0%, var(--hb-admin-topbar-end) 100%);
}

/* ===== 主内容页全面优化 (v2) ===== */
/* ===== 标签导航 ===== */
.tab-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--hb-scrollbar-thumb) transparent;
}
.tab-scroll::-webkit-scrollbar {
  height: 4px;
}
.tab-scroll::-webkit-scrollbar-thumb {
  background: var(--hb-scrollbar-thumb);
  border-radius: 9999px;
}
.tab-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.tab-btn {
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  transition: color 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--hb-tab-text);
  border-radius: 0;
  position: relative;
}
.tab-btn.active {
  background: transparent;
  color: var(--hb-accent);
  font-weight: 600;
}
.tab-btn:not(.active):hover {
  background: transparent;
  color: var(--hb-tab-hover-text);
}
.tab-btn::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2.5px;
  background: var(--hb-accent);
  border-radius: 9999px;
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tab-btn.active::after { width: 60%; }
.tab-btn:not(.active):hover::after {
  width: 30%;
  opacity: 0.4;
}

/* 工具栏大小 */
.tab-btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}
.tab-btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* 工具栏顺序拖拽 */
.toolbar-order-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--hb-surface);
  border: 1px solid var(--hb-border-light);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  transition: all 0.2s ease;
}
.toolbar-order-item:hover {
  background: var(--hb-surface-hover);
  border-color: var(--hb-border);
}
.toolbar-order-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.toolbar-order-item .drag-handle {
  color: var(--hb-text-muted);
  font-size: 14px;
}
.toolbar-order-item .item-label {
  font-size: 0.85rem;
  color: var(--hb-text);
}
.toolbar-remove-btn {
  margin-left: 4px;
  padding: 0 4px;
  background: transparent;
  border: none;
  color: var(--hb-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.toolbar-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* 已隐藏的工具栏项 */
.toolbar-hidden-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--hb-muted-bg);
  border: 1px dashed var(--hb-border);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  opacity: 0.7;
}
.toolbar-hidden-item:hover {
  background: var(--hb-surface);
  border-style: solid;
  border-color: var(--hb-accent);
  opacity: 1;
}
.toolbar-hidden-item .item-label {
  font-size: 0.8rem;
  color: var(--hb-text-muted);
}
.toolbar-hidden-item:hover .item-label {
  color: var(--hb-text);
}

/* ===== 主内容页全面优化 (v2) ===== */
/* ===== 按钮 ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--hb-btn-primary-bg-start) 0%, var(--hb-btn-primary-bg-end) 100%);
  color: var(--hb-btn-primary-text);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: .875rem;
  padding: .75rem 1.25rem;
  transition: all .25s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,120,212,.25);
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,120,212,.35);
}
.btn-primary:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
  box-shadow: 0 1px 6px rgba(0,120,212,.2);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--hb-accent);
  outline-offset: 2px;
}

.hb-btn-white {
  background: var(--hb-btn-white-bg);
  color: var(--hb-btn-white-text);
  border: 1px solid var(--hb-btn-white-border);
  border-radius: 10px;
  font-weight: 500;
  font-size: .875rem;
  padding: .75rem 1.25rem;
  transition: all .25s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;
}
.hb-btn-white:hover {
  background: var(--hb-btn-white-hover-bg);
  border-color: var(--hb-btn-white-hover-border);
  transform: translateY(-1px);
}
.hb-btn-white:active {
  transform: scale(0.97);
}
.hb-btn-white:focus-visible {
  outline: 2px solid var(--hb-accent);
  outline-offset: 2px;
}

.btn-emerald {
  background: linear-gradient(135deg, var(--hb-btn-emerald-bg-start) 0%, var(--hb-btn-emerald-bg-end) 100%);
  color: var(--hb-btn-emerald-text);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: .875rem;
  padding: .75rem 1.25rem;
  transition: all .25s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16,185,129,.25);
  position: relative;
  overflow: hidden;
}
.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16,185,129,.35);
}
.btn-emerald:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
  box-shadow: 0 1px 6px rgba(16,185,129,.2);
}
.btn-emerald:focus-visible {
  outline: 2px solid var(--hb-success);
  outline-offset: 2px;
}

.btn-rose {
  background: linear-gradient(135deg, var(--hb-btn-rose-bg-start) 0%, var(--hb-btn-rose-bg-end) 100%);
  color: var(--hb-btn-rose-text);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: .875rem;
  padding: .75rem 1.25rem;
  transition: all .25s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(239,68,68,.25);
  position: relative;
  overflow: hidden;
}
.btn-rose:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(239,68,68,.35);
}
.btn-rose:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
  box-shadow: 0 1px 6px rgba(239,68,68,.2);
}
.btn-rose:focus-visible {
  outline: 2px solid var(--hb-error);
  outline-offset: 2px;
}

.btn-ghost {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px;
  font-weight: 500;
  font-size: .875rem;
  padding: .6rem 1.1rem;
  transition: all .25s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.4);
  box-shadow: 0 0 20px rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.btn-ghost:active {
  transform: scale(0.97);
}
.btn-ghost:focus-visible {
  outline: 2px solid rgba(255,255,255,0.8);
  outline-offset: 2px;
}

/* 所有按钮统一:active + :focus-visible + disabled 行为 */
button:active:not(:disabled) {
  transform: scale(0.97);
}
button:focus-visible {
  outline: 2px solid var(--hb-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(20%);
}

/* ===== 主内容页全面优化 (v2) ===== */
/* ===== 输入框 ===== */
.hb-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--hb-border-medium);
  border-radius: var(--hb-radius);
  font-size: .875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--hb-surface);
  color: var(--hb-text);
  position: relative;
  caret-color: var(--hb-accent);
}
.hb-input:focus {
  outline: none;
  border-color: var(--hb-accent);
  box-shadow: 0 0 0 4px rgba(0,120,212,.12), 0 0 0 1px rgba(0,120,212,.1) inset;
}
[data-theme="dark"] .hb-input:focus {
  box-shadow: 0 0 0 4px rgba(96,165,250,.15), 0 0 0 1px rgba(96,165,250,.1) inset;
}
.hb-input::placeholder {
  color: var(--hb-text-placeholder);
  transition: opacity 0.2s ease;
}
.hb-input:focus::placeholder {
  opacity: .65;
}
.hb-input:not(:placeholder-shown):not(:focus) {
  border-color: var(--hb-border-medium2);
}

/* 表单容器动画 */
.auth-form-container {
  position: relative;
  width: 100%;
}

/* ===== 主内容页全面优化 (v2) ===== */
/* ===== 表格 ===== */
.hb-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--hb-border);
}
.hb-table-wrap::-webkit-scrollbar {
  height: 6px;
}
.hb-table-wrap::-webkit-scrollbar-thumb {
  background: var(--hb-scrollbar-thumb);
  border-radius: 9999px;
}
.hb-table {
  width: 100%;
  font-size: .875rem;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}
.hb-table thead {
  background: var(--hb-table-header-bg);
}
.hb-table thead th {
  padding: 1rem 1.1rem;
  font-weight: 600;
  color: var(--hb-table-header-text);
  text-align: left;
  border-bottom: 2px solid var(--hb-border-table);
  white-space: nowrap;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.hb-table tbody tr {
  transition: background 0.2s ease;
}
.hb-table tbody tr:hover {
  background: var(--hb-table-row-hover);
}
.hb-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.012);
}
.hb-table tbody tr:nth-child(even):hover {
  background: var(--hb-table-row-hover);
}
[data-theme="dark"] .hb-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.015);
}
.hb-table tbody td {
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--hb-border-light);
  white-space: nowrap;
}

/* ===== 主内容页全面优化 (v2) ===== */
/* ===== 市场商品卡片 ===== */
.market-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--hb-shadow-sm);
  transition: all 0.3s ease;
  position: relative;
}
.market-card:hover {
  box-shadow: var(--hb-shadow-lg);
  border-color: var(--hb-accent);
  transform: translateY(-4px);
}
.market-card:hover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--hb-accent), var(--hb-accent-dark));
  border-radius: var(--hb-radius-lg) 0 0 var(--hb-radius-lg);
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}
.market-card.sold-out {
  filter: grayscale(40%);
  opacity: 0.65;
  position: relative;
}
.market-card.sold-out::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.04) 2px,
    rgba(0,0,0,0.04) 4px
  );
  border-radius: var(--hb-radius-lg);
  pointer-events: none;
  z-index: 2;
}
[data-theme="dark"] .market-card.sold-out::after {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.03) 2px,
    rgba(255,255,255,0.03) 4px
  );
}

/* ===== 数字字体 ===== */
.font-mono {
  font-variant-numeric: tabular-nums;
}

/* ===== 限制描述文字最多两行 ===== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}



/* ===== Toast ===== */
#toast {
  animation: hb-toast-in .25s cubic-bezier(.2, .8, .2, 1);
  font-weight: 500;
  border-radius: var(--hb-radius-lg);
  box-shadow: var(--hb-shadow-xl);
}
@keyframes hb-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -18px) scale(.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

/* ===== 卡片入场动画 ===== */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-in {
  animation: cardIn .3s cubic-bezier(.2, .8, .2, 1) both;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--hb-scrollbar-thumb);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--hb-scrollbar-thumb-hover);
}

/* ===== 主内容页全面优化 (v2) ===== */
/* ===== 移动端全局响应式 (<=768px) ===== */
@media (max-width: 768px) {
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .hb-card {
    border-radius: 12px;
    padding: 1rem;
  }

  .asset-card {
    border-radius: 12px;
    padding: 1.1rem;
  }
  .asset-card .font-mono {
    font-size: 1.15rem;
  }

  .market-card {
    border-radius: 12px;
    padding: 1rem;
  }

  .hb-table-wrap {
    border-radius: 10px;
  }
  .hb-table thead th,
  .hb-table tbody td {
    padding: .65rem .75rem;
    font-size: .78rem;
  }

  button, .btn-primary, .btn-emerald, .btn-rose, .btn-ghost, .hb-btn-white {
    min-height: 44px;
    padding: .7rem 1.1rem;
    font-size: .85rem;
  }

  .hb-input, select, textarea {
    min-height: 44px;
    padding: .75rem .9rem;
    font-size: .875rem;
  }

  .tab-btn {
    min-height: 40px;
    padding: .5rem .85rem;
    font-size: .82rem;
  }

  .grid {
    grid-template-columns: 1fr !important;
  }

  section table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 小屏增强 (<=640px) */
@media (max-width: 640px) {
  .hb-card {
    padding: .85rem;
    animation-duration: 0.3s;
  }

  .market-card {
    animation-duration: 0.3s;
  }
  .market-card:hover {
    transform: translateY(-3px);
  }

  .asset-card {
    padding: 1rem;
    transition-duration: 0.22s;
  }

  .tab-btn::after {
    transition-duration: 0.2s;
  }

  .hb-input {
    padding: .7rem .85rem;
  }
}

/* ===== 登录/注册 Tab ===== */
.auth-tab {
  flex: 1;
  padding: .75rem;
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 600;
  transition: all .35s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;
  border: none;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  position: relative;
}
.auth-tab.active {
  background: var(--hb-surface);
  color: var(--hb-text);
  box-shadow: 0 6px 20px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.08);
  transform: translateY(-2px) scale(1.03);
}
[data-theme="dark"] .auth-tab.active {
  background: var(--hb-surface);
  color: var(--hb-text);
  box-shadow: 0 6px 20px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.2);
}
.auth-tab:not(.active):hover {
  background: rgba(255,255,255,.18);
  color: #fff;
  transform: translateY(-1px);
}

/* ===== 额外的动画 ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.fade-in-up { animation: fadeInUp .45s cubic-bezier(.2, .8, .2, 1) both; }
.fade-in   { animation: fadeIn .3s ease-out both; }


/* ================================================================
   用户下拉菜单动画与样式优化
   ================================================================ */

/* --- 1. 入场动画 --- */
#user-dropdown {
  position: fixed !important;
  z-index: 9999;
  top: -9999px;
  right: auto;
  left: auto;
  bottom: auto;
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.8) translateY(-8px);
  transition: opacity 250ms cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
#user-dropdown:not(.hidden) {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
#user-dropdown.hidden {
  opacity: 0;
  transform: scale(0.8) translateY(-8px);
  pointer-events: none;
}
#user-dropdown.closing {
  opacity: 0;
  transform: scale(0.8) translateY(-8px);
  pointer-events: none;
}

/* --- 2. 背景与质感：毛玻璃效果 --- */
#user-dropdown {
  background: var(--hb-dropdown-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--hb-dropdown-border);
  box-shadow: var(--hb-shadow-xl), 0 0 0 1px rgba(0,0,0,0.03);
  border-radius: 14px;
  overflow: hidden;
}

/* --- 3. 顶部彩色渐变条 --- */
#user-dropdown::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--hb-auth-bg-start) 0%, var(--hb-auth-bg-mid) 100%);
  z-index: 1;
}

/* --- 4. 三角指示符 --- */
#user-dropdown::after {
  content: "";
  position: absolute;
  top: -6px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: var(--hb-dropdown-bg);
  border-left: 1px solid var(--hb-dropdown-border);
  border-top: 1px solid var(--hb-dropdown-border);
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0,0,0,0.02);
  opacity: 0;
  transition: opacity 300ms 50ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
#user-dropdown:not(.hidden)::after {
  opacity: 1;
}

/* --- 5. 菜单项交互 --- */
#user-dropdown button {
  position: relative;
  transition: background 150ms ease, color 150ms ease;
  overflow: hidden;
}
#user-dropdown button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--hb-auth-bg-start);
  transform: scaleY(0);
  opacity: 0;
  transition: transform 150ms ease, opacity 150ms ease;
}
#user-dropdown button:hover::before {
  transform: scaleY(1);
  opacity: 1;
}
#user-dropdown button:hover {
  background: rgba(102, 126, 234, 0.04);
}
[data-theme="dark"] #user-dropdown button:hover {
  background: rgba(102, 126, 234, 0.08);
}

/* --- 6. 首个菜单项特殊样式 --- */
#user-dropdown > div:first-child {
  position: relative;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--hb-dropdown-divider);
  margin-bottom: 0.5rem;
}
#user-dropdown > div:first-child p:first-child {
  font-weight: 600;
  color: var(--hb-text-alt);
}

/* --- 7. 退出登录按钮 --- */
#user-dropdown button#menu-logout {
  color: var(--hb-error-text);
  margin-top: 0.25rem;
}
#user-dropdown button#menu-logout::before {
  background: var(--hb-error-text);
}
#user-dropdown button#menu-logout:hover {
  background: rgba(220, 38, 38, 0.06);
}
[data-theme="dark"] #user-dropdown button#menu-logout:hover {
  background: rgba(248, 113, 113, 0.1);
}

/* --- 8. 滚动条美化 --- */
#user-dropdown {
  max-height: 70vh;
  overflow-y: auto;
}
#user-dropdown::-webkit-scrollbar {
  width: 4px;
}
#user-dropdown::-webkit-scrollbar-track {
  background: transparent;
}
#user-dropdown::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.2);
  border-radius: 9999px;
}
#user-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.35);
}

/* --- 9. 触发按钮活跃态 --- */
#user-menu-btn {
  transition: background 200ms ease, transform 150ms ease;
}
#user-menu-btn.active,
#user-menu-btn:active {
  background: rgba(255, 255, 255, 0.15);
}
#user-menu-btn:focus-visible {
  outline: 2px solid var(--hb-auth-bg-start);
  outline-offset: 2px;
}

/* --- 10. 移动端适配 --- */
@media (max-width: 640px) {
  #user-dropdown {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0;
    transform-origin: bottom center;
    transform: translateY(100%) scale(0.95);
    max-height: 55vh;
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #user-dropdown:not(.hidden) {
    transform: translateY(0) scale(1);
  }
  #user-dropdown.hidden {
    transform: translateY(100%) scale(0.95);
  }
  #user-dropdown.closing {
    transform: translateY(100%) scale(0.95);
  }
  #user-dropdown::after { display: none; }
  #user-dropdown::before { border-radius: 20px 20px 0 0; }
  #user-dropdown .dropdown-handle {
    display: block;
    width: 36px;
    height: 4px;
    background: var(--hb-dropdown-handle, rgba(0,0,0,0.2));
    border-radius: 9999px;
    margin: 0.5rem auto 0.25rem;
  }
  #user-dropdown > div:first-child {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }
  #user-dropdown button {
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    min-height: 48px;
  }
}

/* --- 11. 移动端遮罩层 --- */
.dropdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
.dropdown-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- 12. 无障碍 --- */
@media (prefers-reduced-motion: reduce) {
  #user-dropdown,
  #user-dropdown::after,
  #user-dropdown button,
  #user-dropdown button::before,
  #user-menu-btn,
  .dropdown-overlay {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
  #user-dropdown:not(.hidden) { transform: scale(1) translateY(0); }
  #user-dropdown.hidden, #user-dropdown.closing { transform: scale(0.8) translateY(-8px); }
  @media (max-width: 640px) {
    #user-dropdown:not(.hidden) { transform: translateY(0) scale(1); }
    #user-dropdown.hidden, #user-dropdown.closing { transform: translateY(100%) scale(0.95); }
  }
}

/* ================================================================
   移动端全面优化
   ================================================================ */
@media (max-width: 640px) {
  .hb-topbar > div {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  .hb-topbar .flex.items-center.gap-4 {
    gap: 0.5rem;
  }
  #user-menu-btn {
    padding: 0.25rem;
    gap: 0.25rem;
  }
  #user-menu-btn span {
    display: none;
  }
  #user-menu-btn svg.w-4 {
    display: none;
  }
  #user-menu-btn .w-9 {
    width: 2.25rem;
    height: 2.25rem;
  }
  #theme-toggle-btn,
  #notification-bell-btn {
    padding: 0.35rem;
  }
  #theme-toggle-btn svg,
  #notification-bell-btn svg {
    width: 1.1rem;
    height: 1.1rem;
  }
  #btn-refresh {
    padding: 0.25rem 0.5rem;
  }
  #btn-refresh svg {
    width: 0.9rem;
    height: 0.9rem;
  }
  h1 {
    font-size: 1rem;
  }
  .hb-card {
    padding: 0.75rem;
    border-radius: 14px;
  }
  .hb-table thead th,
  .hb-table tbody td {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
  }
  .tab-scroll {
    gap: 0.25rem;
  }
  .tab-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
  }
  .settings-grid {
    display: block;
  }
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* ===== 平滑滚动 ===== */
html { scroll-behavior: smooth; }

/* ===== Logo ===== */
.hb-logo {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--hb-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
  flex-shrink: 0;
}
.hb-logo-accent {
  background: linear-gradient(135deg, var(--hb-accent) 0%, var(--hb-accent-dark) 100%);
  box-shadow: 0 4px 12px rgba(0,120,212,.3);
}
.hb-logo-dark {
  background: linear-gradient(135deg, var(--hb-btn-primary-bg-start) 0%, #111827 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

/* ===== 分隔线 ===== */
.hb-divider {
  border: none;
  border-top: 1px solid var(--hb-border);
  margin: 1.1rem 0;
}

/* ===== 徽章 ===== */
.hb-badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .6rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--hb-badge-bg);
  color: var(--hb-badge-text);
}

/* ===== Section 标题 ===== */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hb-text);
  margin-bottom: .85rem;
}

/* ===== 任务卡片 ===== */
.task-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  padding: 1.35rem;
  box-shadow: var(--hb-shadow-sm);
  transition: all .25s;
}
.task-card:hover {
  box-shadow: var(--hb-shadow-md);
  border-color: var(--hb-border-strong);
}

/* ===== 每日任务列表项 ===== */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  background: var(--hb-muted-bg);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  gap: 0.75rem;
}
.task-item:hover {
  background: var(--hb-surface-hover);
  border-color: var(--hb-border-light);
}
.task-item-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.task-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}
.task-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hb-text);
  margin: 0 0 0.15rem 0;
}
.task-desc {
  display: none;
}
.task-reward {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--hb-accent);
  margin: 0;
}
.task-done-badge {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--hb-text-muted);
  background: var(--hb-badge-bg);
  white-space: nowrap;
}
.task-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--hb-btn-emerald-bg-start) 0%, var(--hb-btn-emerald-bg-end) 100%);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.15);
}
.task-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
}
.task-btn:active {
  transform: scale(0.97);
}
.task-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== 每日任务移动端适配 ===== */
@media (max-width: 640px) {
  .task-item {
    padding: 0.7rem 0.85rem;
    gap: 0.5rem;
  }
  .task-item-left {
    gap: 0.5rem;
  }
  .task-icon {
    font-size: 1.2rem;
    width: 1.6rem;
  }
  .task-title {
    font-size: 0.82rem;
  }
  .task-desc {
    font-size: 0.72rem;
  }
  .task-reward {
    font-size: 0.7rem;
  }
  .task-btn,
  .task-done-badge {
    padding: 0.4rem 0.7rem;
    font-size: 0.72rem;
  }
}

/* ===== 标签页内容区 ===== */
#player-tab-content {
  animation: cardIn .25s cubic-bezier(.2, .8, .2, 1);
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--hb-text-secondary);
}

/* ===== 头部信息区 ===== */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem 0;
  border-bottom: 1px solid var(--hb-border-light);
}
.info-row:last-child { border-bottom: none; }


/* ================================================================
   全新动画与视觉增强方案
   ================================================================ */

/* ---------- 1. 卡片入场动画（增强版） ---------- */
@keyframes cardInEnhanced {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card {
  animation: cardInEnhanced 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
  background: var(--hb-auth-card-bg);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--hb-auth-card-border);
  border-top: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.15), 0 0 120px rgba(102,126,234,0.1);
}
.auth-form-container form {
  opacity: 0;
  animation: fadeInUpStagger 0.5s 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeInUpStagger {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-form-container form > * {
  opacity: 0;
  animation: fadeInUpItem 0.4s ease-out forwards;
}
.auth-form-container form > *:nth-child(1) { animation-delay: 0.3s; }
.auth-form-container form > *:nth-child(2) { animation-delay: 0.38s; }
.auth-form-container form > *:nth-child(3) { animation-delay: 0.46s; }
.auth-form-container form > *:nth-child(4) { animation-delay: 0.54s; }
.auth-form-container form > *:nth-child(5) { animation-delay: 0.62s; }
@keyframes fadeInUpItem {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 2. 浮动标签 ---------- */
.float-label {
  position: relative;
  margin-bottom: 0.25rem;
}
.float-label > .hb-input {
  width: 100%;
  padding: 1.25rem 1.1rem 0.55rem 1rem;
  font-size: 0.875rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.float-label > .hb-input:focus {
  border-bottom-color: rgba(255,255,255,0.7);
  box-shadow: 0 0 0 4px rgba(102,126,234,0.15), 0 0 20px rgba(102,126,234,0.08), 0 2px 16px rgba(102,126,234,0.18);
  transform: none;
}
.float-label > .hb-input::placeholder {
  color: transparent;
}
.float-label > .hb-input:focus::placeholder {
  color: rgba(148,163,184,0.5);
}
.float-label > label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: var(--hb-text-muted);
  font-weight: 400;
  pointer-events: none;
  transition: top 0.2s ease, transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
  padding: 0 3px;
  white-space: nowrap;
  z-index: 1;
}
.float-label > label::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  opacity: 0.55;
  background-repeat: no-repeat;
  background-size: contain;
}
.float-label.name-label > label::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}
.float-label.email-label > label::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E");
}
.float-label.pwd-label > label::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}
.float-label > .hb-input:focus + label::before,
.float-label > .hb-input:not(:placeholder-shown) + label::before,
.float-label > label.floating::before {
  opacity: 0.85;
}
.float-label > .hb-input:focus + label,
.float-label > .hb-input:not(:placeholder-shown) + label,
.float-label > label.floating {
  top: 0.45rem;
  transform: translateY(0);
  font-size: 0.7rem;
  color: var(--hb-auth-bg-start);
  font-weight: 500;
}

/* ===== 主内容页全面优化 (v2) ===== */
/* ---------- 3. 按钮微交互增强 ---------- */
.btn-primary, .btn-emerald, .btn-rose {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}
.btn-primary:not(.btn-loading)::after,
.btn-emerald:not(.btn-loading)::after,
.btn-rose:not(.btn-loading)::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-25deg);
  transition: left 0.65s ease;
  pointer-events: none;
}
.btn-primary:not(.btn-loading):hover::after,
.btn-emerald:not(.btn-loading):hover::after,
.btn-rose:not(.btn-loading):hover::after {
  left: 125%;
}

/* ---------- 3b. 按钮 Loading 状态 ---------- */
.btn-primary.btn-loading {
  pointer-events: none;
  color: transparent !important;
  position: relative;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
  overflow: hidden;
  transform: scale(0.97);
  transition: transform 0.15s ease;
}
.btn-primary.btn-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(255,255,255,0.12);
  border-top-color: rgba(255,255,255,0.9);
  border-right-color: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: btnSpin 0.65s linear infinite;
  box-shadow: 0 0 8px rgba(59,130,246,0.3);
}
.btn-primary.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255,255,255,0.08);
  border-bottom-color: rgba(255,255,255,0.55);
  border-radius: 50%;
  animation: btnSpinReverse 0.8s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }
@keyframes btnSpinReverse { to { transform: rotate(-360deg); } }

/* ===== 主内容页全面优化 (v2) ===== */
/* ---------- 4. 输入框焦点条 ---------- */
.hb-input {
  border-bottom: 2px solid transparent;
  transition: border-bottom-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              caret-color 0.25s ease;
}
.hb-input:focus {
  border-bottom-color: var(--hb-accent);
  box-shadow: 0 0 0 4px rgba(0,120,212,.12), 0 0 0 1px rgba(0,120,212,.1) inset;
  transform: translateY(-1px) scale(1.005);
}
[data-theme="dark"] .hb-input:focus {
  box-shadow: 0 0 0 4px rgba(96,165,250,.15), 0 0 0 1px rgba(96,165,250,.1) inset;
}

/* ---------- 5. 反馈消息动画 ---------- */
#message {
  padding: 0.8rem 1.1rem 0.8rem 2.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.3s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  margin-bottom: 0.75rem;
  position: relative;
}
#message::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  transition: background 0.3s ease;
}
#message.success { border-left: 3px solid var(--hb-success-border); }
#message.success::before {
  content: "\2714";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--hb-success-text);
  background: transparent;
  border-radius: 0;
}
#message.error { border-left: 3px solid var(--hb-error-border); }
#message.error::before {
  content: "\2716";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--hb-error-text);
  background: transparent;
  border-radius: 0;
}
#message.info { border-left: 3px solid var(--hb-info-border); }
#message.info::before {
  content: "\2139";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hb-info-text);
  background: transparent;
  border-radius: 0;
}
#message:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}
#message.hiding {
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.2s ease-in, transform 0.2s ease-in;
}
#message.success {
  background: var(--hb-success-bg);
  color: var(--hb-success-text);
  border: 1px solid var(--hb-success-border);
  background-image: radial-gradient(circle at 10% 50%, rgba(16,185,129,0.06) 0%, transparent 40%);
}
#message.error {
  background: var(--hb-error-bg);
  color: var(--hb-error-text);
  border: 1px solid var(--hb-error-border);
  background-image: radial-gradient(circle at 10% 50%, rgba(239,68,68,0.06) 0%, transparent 40%);
}
#message.info {
  background: var(--hb-info-bg);
  color: var(--hb-info-text);
  border: 1px solid var(--hb-info-border);
  background-image: radial-gradient(circle at 10% 50%, rgba(59,130,246,0.06) 0%, transparent 40%);
}

/* ---------- 6. 密码可见切换图标 ---------- */
.pwd-toggle-wrap { position: relative; }
.pwd-toggle-btn {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hb-text-muted);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
  outline: none;
}
.pwd-toggle-btn:focus {
  outline: none;
}
.pwd-toggle-btn:hover {
  color: var(--hb-auth-bg-start);
  background: rgba(102, 126, 234, 0.08);
}
.pwd-toggle-btn:active {
  transform: translateY(-50%) scale(0.95);
}
.pwd-toggle-btn .eye-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pwd-toggle-btn .eye-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.pwd-toggle-btn .eye-icon.eye-closed {
  opacity: 1;
  transform: scale(1);
}
.pwd-toggle-btn .eye-icon.eye-open {
  opacity: 0;
  transform: scale(0.6);
}
.pwd-toggle-btn.visible .eye-icon.eye-closed {
  opacity: 0;
  transform: scale(0.6);
}
.pwd-toggle-btn.visible .eye-icon.eye-open {
  opacity: 1;
  transform: scale(1);
}
.pwd-toggle-wrap > .hb-input { padding-right: 2.6rem; }
.hb-input.pwd-hidden {
  -webkit-text-security: disc;
}

/* ---------- 7. 背景动态装饰粒子 ---------- */
.auth-bg .bg-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  pointer-events: none;
  animation: particleFloat linear infinite;
}
[data-theme="dark"] .auth-bg .bg-particle {
  background: rgba(255,255,255,0.06);
}
@keyframes particleFloat {
  0%  { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-120px) translateX(60px) scale(0.3); opacity: 0; }
}

/* ---------- 8. 移动端响应式 ---------- */
@media (max-width: 640px) {
  .auth-card {
    animation-duration: 0.4s;
    margin: 0 0.75rem;
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12), 0 0 80px rgba(102,126,234,0.08);
  }
  .auth-bg {
    min-height: 100dvh;
  }
  .auth-tab {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }
  .auth-tab.active {
    transform: translateY(-1px) scale(1.02);
  }
  .float-label > .hb-input {
    padding: 1.15rem 0.9rem 0.5rem 0.85rem;
    font-size: 0.8rem;
  }
  .float-label > label {
    left: 0.85rem;
    font-size: 0.8rem;
  }
  .float-label > .hb-input:focus + label,
  .float-label > .hb-input:not(:placeholder-shown) + label,
  .float-label > label.floating {
    font-size: 0.65rem;
    top: 0.4rem;
  }
  .float-label > label::before {
    width: 12px;
    height: 12px;
    left: -18px;
  }
  .btn-primary {
    padding: 0.7rem 1rem;
    font-size: 0.825rem;
  }
  #message {
    padding: 0.6rem 0.85rem;
    font-size: 0.75rem;
    border-radius: 10px;
  }
  .auth-form-container form > * {
    animation-duration: 0.25s;
  }
  .auth-form-container form > *:nth-child(1) { animation-delay: 0.2s; }
  .auth-form-container form > *:nth-child(2) { animation-delay: 0.26s; }
  .auth-form-container form > *:nth-child(3) { animation-delay: 0.32s; }
  .auth-form-container form > *:nth-child(4) { animation-delay: 0.38s; }
  .auth-form-container form > *:nth-child(5) { animation-delay: 0.44s; }
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .auth-bg {
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}

/* ---------- 9. 无障碍 ---------- */
@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-form-container form, .auth-form-container form > *,
  .float-label > label, .float-label > .hb-input, .btn-primary,
  .btn-primary::after, .btn-primary.btn-loading::before,
  .pwd-toggle-btn .eye-icon, #message, .bg-particle {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ================================================================
   Part 1 — 主界面增强：顶栏 / 标签 / 资产卡 / 表格 / 按钮
   ================================================================ */

/* --- 顶栏毛玻璃 --- */
.hb-topbar {
  background: var(--hb-topbar-bg) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--hb-topbar-border);
  box-shadow: var(--hb-topbar-shadow);
  transition: box-shadow 0.3s ease, background 0.3s ease;
  height: auto;
}
.hb-topbar.sticky {
  box-shadow: var(--hb-topbar-sticky-shadow);
}
.hb-topbar-admin {
  background: linear-gradient(135deg, var(--hb-admin-topbar-start) 0%, var(--hb-admin-topbar-end) 100%);
  position: relative;
  overflow: hidden;
}
.hb-topbar-admin::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
  animation: adminShimmer 4s ease-in-out infinite;
}
@keyframes adminShimmer {
  0%, 100% { transform: translateX(-100%); }
  50%      { transform: translateX(100%); }
}

/* ===== 主内容页全面优化 (v2) ===== */
/* --- 标签导航底部指示条 --- */
.tab-btn {
  position: relative;
  padding: 0.5rem 1rem;
  border-radius: 0;
  transition: color 0.25s;
}

/* ===== 主内容页全面优化 (v2) ===== */
/* --- 资产卡片渐变背景 --- */
.asset-card {
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease, filter 0.35s ease;
}
.asset-card:hover {
  transform: translateY(-4px) scale(1.015);
  filter: brightness(1.06);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18), inset 0 0 60px rgba(255,255,255,0.15);
}
[data-theme="dark"] .asset-card:hover {
  box-shadow: 0 16px 40px rgba(0,0,0,0.4), inset 0 0 60px rgba(255,255,255,0.08);
  filter: brightness(1.1);
}
.asset-card .count-up {
  display: inline-block;
  animation: countPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes countPop {
  0%  { transform: scale(1); }
  50% { transform: scale(1.15); }
  100%{ transform: scale(1); }
}

/* ===== 主内容页全面优化 (v2) ===== */
/* --- 卡片入场交错 --- */
.hb-card {
  opacity: 0;
  animation: hbCardFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.hb-card:nth-child(1) { animation-delay: 0.05s; }
.hb-card:nth-child(2) { animation-delay: 0.13s; }
.hb-card:nth-child(3) { animation-delay: 0.21s; }
.hb-card:nth-child(4) { animation-delay: 0.29s; }
.hb-card:nth-child(5) { animation-delay: 0.37s; }
@keyframes hbCardFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hb-card:hover {
  border-color: var(--hb-border);
  background: var(--hb-surface-hover);
}
[data-theme="dark"] .hb-card:hover {
  background: var(--hb-surface-hover);
  border-color: var(--hb-border-strong);
}

/* ===== 主内容页全面优化 (v2) ===== */
/* --- 表格行悬停指示条 --- */
.hb-table tbody tr {
  position: relative;
  transition: background 0.25s ease;
}
.hb-table tbody tr::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 0;
  background: var(--hb-tab-table-indicator);
  border-radius: 0 4px 4px 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hb-table tbody tr:hover { background: var(--hb-table-row-hover); }
.hb-table tbody tr:hover::before { width: 3px; }

/* ===== 主内容页全面优化 (v2) ===== */




/* ================================================================
   Part 2 — 商品市场卡片增强
   ================================================================ */

/* ===== 主内容页全面优化 (v2) ===== */
.market-card {
  opacity: 0;
  animation: marketFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease, filter 0.3s ease, border-color 0.3s ease;
}
.market-card:nth-child(1)  { animation-delay: 0.05s; }
.market-card:nth-child(2)  { animation-delay: 0.13s; }
.market-card:nth-child(3)  { animation-delay: 0.21s; }
.market-card:nth-child(4)  { animation-delay: 0.29s; }
.market-card:nth-child(5)  { animation-delay: 0.37s; }
.market-card:nth-child(6)  { animation-delay: 0.45s; }
.market-card:nth-child(7)  { animation-delay: 0.53s; }
.market-card:nth-child(8)  { animation-delay: 0.61s; }
@keyframes marketFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.market-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hb-shadow-xl);
  border-color: var(--hb-accent);
}
.market-card .btn-emerald:hover,
.market-card .btn-primary:hover {
  filter: brightness(1.1);
}

/* 库存为 0 */
.market-card.sold-out button {
  background: #475569 !important;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
}

/* 购买成功闪烁绿框 */
.market-card.flash-success {
  animation: flashGreen 0.8s ease-out;
}
@keyframes flashGreen {
  0%   { border-color: var(--hb-success); box-shadow: 0 0 0 4px rgba(16,185,129,0.25); }
  50%  { border-color: var(--hb-success); box-shadow: 0 0 0 8px rgba(16,185,129,0.08); }
  100% { border-color: var(--hb-border); box-shadow: 0 0 0 0px transparent; }
}

/* 卖家头像悬停放大 */
.market-card img[alt="头像"],
.market-card .rounded-full {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
}
.market-card:hover img[alt="头像"],
.market-card:hover .rounded-full {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
}

/* ===== 主内容页全面优化 (v2) ===== */


/* ================================================================
   Part 3 — 转账页 + 银行服务增强
   ================================================================ */

/* 转账输入框 */
#transfer-form .hb-input,
.transfer-card .hb-input {
  position: relative;
  border-bottom: 2px solid var(--hb-border-medium);
  transition: border-bottom-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#transfer-form .hb-input:focus,
.transfer-card .hb-input:focus {
  border-bottom-color: var(--hb-tab-active-bg);
}

#transfer-form .btn-primary.success-flash,
.transfer-card .btn-primary.success-flash {
  background: linear-gradient(135deg, var(--hb-success) 0%, var(--hb-success-dark) 100%) !important;
  transition: background 0.3s ease;
}

/* --- 银行服务 --- */
.bank-section {
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: background 0.25s ease, transform 0.25s ease;
}
.bank-section-deposit  { background: var(--hb-bank-deposit-bg);  border: 1px solid var(--hb-bank-deposit-border); }
.bank-section-withdraw { background: var(--hb-bank-withdraw-bg); border: 1px solid var(--hb-bank-withdraw-border); }
.bank-section-loan     { background: var(--hb-bank-loan-bg);     border: 1px solid var(--hb-bank-loan-border); }
.bank-section-repay    { background: var(--hb-bank-repay-bg);    border: 1px solid var(--hb-bank-repay-border); }
.bank-section-deposit:hover  { background: var(--hb-bank-deposit-hover); }
.bank-section-withdraw:hover { background: var(--hb-bank-withdraw-hover); }
.bank-section-loan:hover     { background: var(--hb-bank-loan-hover); }
.bank-section-repay:hover    { background: var(--hb-bank-repay-hover); }

/* 金额不足 */
.bank-section .hb-input.insufficient {
  border-color: var(--hb-error) !important;
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}
.bank-section.flash-ok {
  animation: bankFlashGreen 0.5s ease-out;
}
@keyframes bankFlashGreen {
  0%  { border-color: var(--hb-success); box-shadow: 0 0 0 4px rgba(16,185,129,0.2); }
  100%{ border-color: transparent; box-shadow: none; }
}

@media (max-width: 640px) { .bank-section { padding: 1rem; } }


/* ================================================================
   Part 4 — 设置面板增强
   ================================================================ */

/* 头像光环 */
.avatar-glow {
  position: relative;
  display: inline-block;
  border-radius: 50%;
  padding: 3px;
}
.avatar-glow::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(#667eea, #764ba2, #f093fb, #4facfe, #667eea);
  animation: glowRotate 3s linear infinite;
  z-index: -1;
}
@keyframes glowRotate { to { transform: rotate(360deg); } }
.avatar-glow img {
  display: block;
  border-radius: 50%;
  border: 2px solid var(--hb-avatar-border);
}
.avatar-upload-btn {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease;
}
.avatar-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,120,212,0.25);
}

/* 删除头像按钮 */
.btn-delete-avatar {
  transition: background 0.25s, color 0.25s;
}
.btn-delete-avatar:hover {
  background: var(--hb-error-bg) !important;
  color: var(--hb-error-text) !important;
  border-color: var(--hb-error-border) !important;
}

/* 个人资料信息行 */
.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--hb-border-light);
}
.profile-info-row:last-child { border-bottom: none; }
.profile-info-row .label { color: var(--hb-text-secondary); font-size: 0.85rem; }
.profile-info-row .value { font-weight: 600; color: var(--hb-text-alt); font-size: 0.85rem; }
.profile-info-row .value.mono { font-family: "SF Mono", "Fira Code", "Consolas", monospace; font-size: 0.78rem; }

.pwd-form-row {
  opacity: 0;
  animation: pwdSlideIn 0.4s ease-out forwards;
}
.pwd-form-row:nth-child(1) { animation-delay: 0.05s; }
.pwd-form-row:nth-child(2) { animation-delay: 0.12s; }
.pwd-form-row:nth-child(3) { animation-delay: 0.19s; }
@keyframes pwdSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 密码强度 */
.pwd-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  height: 4px;
}
.pwd-strength .seg {
  flex: 1;
  border-radius: 9999px;
  background: var(--hb-border-medium);
  transition: background 0.3s ease;
}
.pwd-strength.weak   .seg:nth-child(1) { background: var(--hb-error); }
.pwd-strength.medium .seg:nth-child(1),
.pwd-strength.medium .seg:nth-child(2) { background: var(--hb-warn); }
.pwd-strength.strong .seg { background: var(--hb-success); }

.avatar-preview {
  animation: avatarPreviewIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes avatarPreviewIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

@media (min-width: 768px) {
  .settings-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
  }
}
@media (max-width: 767px) { .settings-grid { display: block; } }


/* ================================================================
   Part 5 — 全局通知 / Toast / 骨架屏 / 空状态
   ================================================================ */

/* --- Toast 增强 --- */
#toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.85rem 1.3rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--hb-shadow-xl);
  opacity: 0;
  transform: translateX(-50%) translateY(-18px) scale(0.94);
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  min-width: 220px;
  text-align: center;
}
#toast:not(.hidden) {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
#toast.hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(-14px) scale(0.95);
  transition: opacity 0.2s ease-in, transform 0.2s ease-in;
}
#toast .toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 12px 12px;
  background: rgba(255,255,255,0.5);
  animation: toastProgress 2.4s linear forwards;
}
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* --- #message --- */
#message.success { animation: msgGlow 2s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes msgGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
  50%      { box-shadow: 0 0 0 8px rgba(16,185,129,0.12), 0 0 30px rgba(16,185,129,0.08); }
}
#message.error { animation: msgShake 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes msgShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(2px); }
}

/* --- 模态弹窗 --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8888;
  background: var(--hb-modal-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayFadeIn 0.25s ease both;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-content {
  background: var(--hb-modal-bg);
  border-radius: 16px;
  padding: 1.75rem;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
  animation: modalPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modalPopIn {
  from { opacity: 0; transform: translateY(30px) scale(0.9); }
  60%  { transform: translateY(-3px) scale(1.02); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.modal-close:hover { transform: rotate(90deg); }

/* --- 空状态 --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--hb-text-muted);
}
.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  animation: emptyFloat 2.5s ease-in-out infinite;
}
@keyframes emptyFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ===== 加载动画全面优化 (v2) ===== */
/* --- 骨架屏 --- */
.skeleton {
  background: linear-gradient(110deg, var(--hb-skeleton-start) 8%, var(--hb-skeleton-mid) 18%, var(--hb-skeleton-end) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 10px;
}
@keyframes shimmer {
  0%  { background-position: 200% 0; opacity: 0.85; }
  50% { opacity: 1; }
  100%{ background-position: -200% 0; opacity: 0.85; }
}
.skeleton-text  { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.3rem; width: 60%; margin-bottom: 0.75rem; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card  { height: 120px; border-radius: 14px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.06); }

/* --- 全局 reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
  .market-card, .market-card:hover, .market-card img,
  .asset-card, .asset-card:hover, .hb-card, .tab-btn::after,
  .bank-section, .pwd-form-row, .modal-content, .modal-close,
  #toast, #toast .toast-progress, .empty-state .empty-icon,
  .skeleton, .avatar-glow::before, .avatar-preview,
  .hb-topbar-admin::after, .market-card.flash-success,
  .bank-section.flash-ok, #message.success, #message.error,
  .hb-full-loader, .hb-full-loader::before, .hb-full-loader::after,
  .hb-full-loader .hb-loader-content,
  .hb-full-loader .hb-loader-logo, .hb-full-loader .hb-loader-logo::before,
  .hb-full-loader .hb-loader-text, .hb-full-loader .hb-loader-text::after,
  .hb-full-loader .hb-loader-dots, .hb-full-loader .hb-loader-dots span,
  .hb-skeleton-item, .hb-number-animate {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ================================================================
   加载动画系统
   ================================================================ */

/* ===== 加载页面全面优化 (v3) ===== */

/* --- 全屏预加载 --- */
.hb-full-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 隐藏过渡：淡出+放大 */
.hb-full-loader.hiding {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

/* 内容容器 */
.hb-full-loader .hb-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: hbLoaderFadeIn 0.6s ease-out;
}

/* Logo 容器 */
.hb-full-loader .hb-loader-logo {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin-bottom: 1.5rem;
  position: relative;
  animation: hbLoaderPulse 2.5s ease-in-out infinite, hbLoaderGlow 2s ease-in-out infinite;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25), 0 0 40px rgba(102,126,234,0.35);
}

/* 脉冲环 */
.hb-full-loader .hb-loader-logo::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 28px;
  border: 2px solid rgba(255,255,255,0.35);
  animation: hbLoaderRipple 2s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

.hb-full-loader .hb-loader-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
}

/* 品牌名称 */
.hb-full-loader .hb-loader-brand {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* 状态文字 */
.hb-full-loader .hb-loader-status {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

/* 动态点点 */
.hb-full-loader .hb-loader-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hb-full-loader .hb-loader-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  animation: hbLoaderDotBounce 1.4s ease-in-out infinite;
}

.hb-full-loader .hb-loader-dots span:nth-child(1) { animation-delay: 0s; }
.hb-full-loader .hb-loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.hb-full-loader .hb-loader-dots span:nth-child(3) { animation-delay: 0.4s; }

/* 兼容旧版文字样式 */
.hb-full-loader .hb-loader-text {
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.hb-full-loader .hb-loader-text::after {
  content: "...";
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  width: 0;
  animation: hbLoaderDots 1.5s steps(4, end) infinite;
}

/* ---------- 关键帧 ---------- */

@keyframes hbLoaderFadeIn {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes hbLoaderRipple {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.45); opacity: 0; }
}

@keyframes hbLoaderGlow {
  0%, 100% { box-shadow: 0 16px 48px rgba(0,0,0,0.25), 0 0 40px rgba(102,126,234,0.35); }
  50%      { box-shadow: 0 16px 48px rgba(0,0,0,0.25), 0 0 60px rgba(102,126,234,0.55); }
}

@keyframes hbLoaderPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  30%      { transform: translateY(-6px) scale(1.02); }
  50%      { transform: translateY(-10px) scale(1.05); }
  70%      { transform: translateY(-4px) scale(1.02); }
}

@keyframes hbLoaderDots {
  0%   { width: 0; }
  25%  { width: 0.25em; }
  50%  { width: 0.55em; }
  75%  { width: 0.8em; }
  100% { width: 0.8em; }
}

@keyframes hbLoaderDotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1.2); opacity: 1; }
}

/* ===== 移动端适配 (<=640px) ===== */

@media (max-width: 640px) {
  .hb-full-loader .hb-loader-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin-bottom: 1rem;
  }
  .hb-full-loader .hb-loader-logo::before {
    inset: -10px;
    border-radius: 20px;
    border-width: 1.5px;
  }
  .hb-full-loader .hb-loader-logo img {
    border-radius: 14px;
  }
  .hb-full-loader .hb-loader-text {
    font-size: 0.82rem;
  }
}

/* ===== 加载动画全面优化 (v2) ===== */
/* --- 局部骨架屏 --- */
.hb-skeleton-wrap { padding: 1rem; }
.hb-skeleton-item {
  height: 1rem;
  margin-bottom: 0.625rem;
  border-radius: 6px;
  background: linear-gradient(110deg, var(--hb-skeleton-start) 8%, var(--hb-skeleton-mid) 18%, var(--hb-skeleton-end) 33%);
  background-size: 200% 100%;
  animation: hbShimmer 1.6s ease-in-out infinite;
  will-change: background-position, opacity;
}
.hb-skeleton-item:last-child { margin-bottom: 0; }
.hb-skeleton-item.hb-skeleton-card {
  height: 80px;
  border-radius: 14px;
  margin-bottom: 0.75rem;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.08);
}
.hb-skeleton-item.hb-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 0.75rem;
}
.hb-skeleton-item.hb-skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 0.75rem;
}
.hb-skeleton-item.hb-skeleton-btn {
  width: 100px;
  height: 36px;
  border-radius: 8px;
  margin-top: 0.5rem;
}
@keyframes hbShimmer {
  0%  { background-position: 200% 0; opacity: 0.85; }
  50% { opacity: 1; }
  100%{ background-position: -200% 0; opacity: 0.85; }
}
.hb-skeleton-wrap.fade-out {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* --- 骨架屏 → 实际内容过渡 --- */
.hb-content-reveal {
  animation: hbContentReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes hbContentReveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 加载动画全面优化 (v2) ===== */
/* --- 按钮加载状态 --- */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  overflow: hidden;
  transform: scale(0.97);
  transition: transform 0.15s ease;
}
.btn-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.9);
  border-right-color: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: hbBtnSpin 0.65s linear infinite;
  box-shadow: 0 0 6px rgba(255,255,255,0.15);
}
.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid rgba(255,255,255,0.1);
  border-bottom-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: hbBtnSpinReverse 0.8s linear infinite;
}
@keyframes hbBtnSpin { to { transform: rotate(360deg); } }
@keyframes hbBtnSpinReverse { to { transform: rotate(-360deg); } }

/* 所有按钮类型一致支持 .btn-loading */
.btn-emerald.btn-loading,
.btn-rose.btn-loading,
.btn-ghost.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  overflow: hidden;
  transform: scale(0.97);
  transition: transform 0.15s ease;
}
.btn-emerald.btn-loading::before,
.btn-rose.btn-loading::before,
.btn-ghost.btn-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.9);
  border-right-color: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: hbBtnSpin 0.65s linear infinite;
  box-shadow: 0 0 6px rgba(255,255,255,0.15);
}
.btn-emerald.btn-loading::after,
.btn-rose.btn-loading::after,
.btn-ghost.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid rgba(255,255,255,0.1);
  border-bottom-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: hbBtnSpinReverse 0.8s linear infinite;
}

/* --- 数字滚动动画 --- */
.hb-number-animate {
  display: inline-block;
  transition: transform 0.15s ease;
}
.hb-number-animate.pop { animation: hbNumPop 0.25s ease; }
@keyframes hbNumPop {
  0%  { transform: scale(1); }
  50% { transform: scale(1.08); }
  100%{ transform: scale(1); }
}

/* --- 空状态插画 --- */
.hb-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--hb-text-muted);
}
.hb-empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  animation: hbEmptyFloat 2.5s ease-in-out infinite;
}
.hb-empty-icon svg {
  width: 100%;
  height: 100%;
  stroke: #475569;
  fill: none;
}
[data-theme="dark"] .hb-empty-icon svg {
  stroke: #64748b;
}
@keyframes hbEmptyFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.hb-empty-text {
  font-size: 0.875rem;
  color: var(--hb-text-muted);
}


/* ================================================================
   夜间模式 — Tailwind 工具类覆盖
   覆盖 JS 生成的 Tailwind 颜色类，确保所有 UI 响应暗色模式
   ================================================================ */

/* --- 夜间模式 Tailwind 覆盖：背景 --- */
[data-theme="dark"] .bg-white { background-color: var(--hb-surface) !important; }
[data-theme="dark"] .bg-slate-50 { background-color: var(--hb-surface) !important; }
[data-theme="dark"] .bg-slate-100 { background-color: #334155 !important; }
[data-theme="dark"] .bg-gray-50 { background-color: var(--hb-surface) !important; }
[data-theme="dark"] .bg-amber-50 { background-color: #3d2e0a !important; }
[data-theme="dark"] .bg-emerald-50 { background-color: #0a3d2e !important; }
[data-theme="dark"] .bg-rose-50 { background-color: #3d0a0a !important; }
[data-theme="dark"] .bg-blue-50 { background-color: #0a1f3d !important; }
[data-theme="dark"] .bg-red-50 { background-color: #3d0a0a !important; }
[data-theme="dark"] .bg-emerald-100 { background-color: #064e3b !important; }
[data-theme="dark"] .bg-slate-200 { background-color: #475569 !important; }
[data-theme="dark"] .bg-slate-300 { background-color: #475569 !important; }
[data-theme="dark"] .bg-slate-400 { background-color: #64748b !important; }

/* --- 夜间模式 Tailwind 覆盖：悬停背景 --- */
[data-theme="dark"] .hover\:bg-slate-50:hover { background-color: #334155 !important; }
[data-theme="dark"] .hover\:bg-slate-100:hover { background-color: #334155 !important; }
[data-theme="dark"] .hover\:bg-slate-200:hover { background-color: #475569 !important; }
[data-theme="dark"] .hover\:bg-red-50:hover { background-color: #451a1a !important; }
[data-theme="dark"] .hover\:bg-rose-50:hover { background-color: #451a1a !important; }
[data-theme="dark"] .hover\:bg-rose-100:hover { background-color: #5c1a1a !important; }
[data-theme="dark"] .hover\:bg-emerald-50:hover { background-color: #064e3b !important; }
[data-theme="dark"] .hover\:bg-gray-50:hover { background-color: #334155 !important; }
[data-theme="dark"] .hover\:file\:bg-blue-100:hover::file-selector-button { background-color: #1e3a5f !important; }

/* --- 夜间模式 Tailwind 覆盖：文字 --- */
[data-theme="dark"] .text-slate-800 { color: var(--hb-text) !important; }
[data-theme="dark"] .text-slate-700 { color: #e2e8f0 !important; }
[data-theme="dark"] .text-slate-600 { color: #cbd5e1 !important; }
[data-theme="dark"] .text-slate-500 { color: var(--hb-text-secondary) !important; }
[data-theme="dark"] .text-slate-400 { color: var(--hb-text-muted) !important; }
[data-theme="dark"] .text-slate-300 { color: var(--hb-text-muted) !important; }
[data-theme="dark"] .text-gray-700 { color: #e2e8f0 !important; }

/* 状态文字：夜间微调亮度 */
[data-theme="dark"] .text-amber-600 { color: #fbbf24 !important; }
[data-theme="dark"] .text-emerald-600 { color: #34d399 !important; }
[data-theme="dark"] .text-rose-500 { color: #f87171 !important; }
[data-theme="dark"] .text-rose-600 { color: #f87171 !important; }
[data-theme="dark"] .text-red-500 { color: #f87171 !important; }
[data-theme="dark"] .text-red-600 { color: #f87171 !important; }
[data-theme="dark"] .text-blue-700 { color: #93c5fd !important; }

/* --- 夜间模式 Tailwind 覆盖：边框 --- */
[data-theme="dark"] .border-slate-200 { border-color: #334155 !important; }
[data-theme="dark"] .border-slate-100 { border-color: #1e293b !important; }
[data-theme="dark"] .border-slate-300 { border-color: #475569 !important; }
[data-theme="dark"] .border-amber-100 { border-color: #3d2e0a !important; }
[data-theme="dark"] .border-rose-300 { border-color: #5c1a1a !important; }
[data-theme="dark"] .border-emerald-300 { border-color: #064e3b !important; }
[data-theme="dark"] .border-gray-300 { border-color: #475569 !important; }

/* --- 夜间模式 Tailwind 覆盖：文件上传按钮 --- */
[data-theme="dark"] .file\:bg-blue-50::file-selector-button { background-color: #1e3a5f !important; }
[data-theme="dark"] .file\:text-blue-700::file-selector-button { color: #93c5fd !important; }

/* --- 夜间模式 Tailwind 覆盖：focus ring --- */
[data-theme="dark"] .focus\:ring-brand-500:focus { --tw-ring-color: var(--hb-accent); }
[data-theme="dark"] .focus\:ring-blue-400:focus { --tw-ring-color: var(--hb-accent); }
[data-theme="dark"] .focus\:ring-amber-400:focus { --tw-ring-color: #fbbf24; }


/* ================================================================
   夜间模式切换按钮
   ================================================================ */

#theme-toggle-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--hb-radius);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
  outline: none;
}
#theme-toggle-btn:hover {
  background: rgba(0,0,0,0.05);
  transform: scale(1.08);
}
[data-theme="dark"] #theme-toggle-btn:hover {
  background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .hb-topbar-admin #theme-toggle-btn:hover {
  background: rgba(255,255,255,0.12);
}
#theme-toggle-btn:active {
  transform: scale(0.95);
}
/* 管理员顶栏中的切换按钮 - 白色半透明 hover */
.hb-topbar-admin #theme-toggle-btn:hover {
  background: rgba(255,255,255,0.12);
}
/* 聚焦环 */
#theme-toggle-btn:focus-visible {
  outline: 2px solid var(--hb-accent);
  outline-offset: 2px;
}


/* ================================================================
   Tailwind CDN 补丁：确保 dark mode 下 placeholder 颜色也跟随
   ================================================================ */
[data-theme="dark"] .placeholder\:text-slate-400::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--hb-text-muted) !important;
}

/* 夜间模式：覆盖所有未设背景的 input / textarea / select */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: var(--hb-surface) !important;
  color: var(--hb-text) !important;
}


/* ================================================================
   排行榜样式
   ================================================================ */

/* --- 排名徽章 --- */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.rank-badge.gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  color: #7c5800;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
  font-size: 1.2rem;
}

.rank-badge.silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
  color: #4a4a4a;
  box-shadow: 0 2px 8px rgba(192, 192, 192, 0.3);
  font-size: 1.2rem;
}

.rank-badge.bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
  font-size: 1.2rem;
}

.rank-badge.normal {
  background: var(--hb-muted-bg);
  color: var(--hb-text-secondary);
}

[data-theme="dark"] .rank-badge.normal {
  background: #334155;
  color: #94a3b8;
}

/* --- 排行榜表格行高亮 --- */
[data-leaderboard-user] {
  transition: background 0.2s ease, transform 0.2s ease;
}

[data-leaderboard-user]:hover {
  transform: translateX(4px);
}

/* --- 排行榜统计卡片 --- */
.leaderboard-stats-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.leaderboard-stats-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hb-shadow-md);
}

/* --- 排行榜搜索框 --- */
#leaderboard-search {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#leaderboard-search:focus {
  border-color: var(--hb-accent);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}

/* --- 排行榜加载更多按钮 --- */
#leaderboard-load-more {
  transition: background 0.2s ease, transform 0.2s ease;
}

#leaderboard-load-more:hover {
  transform: translateY(-2px);
}

#leaderboard-load-more:active {
  transform: translateY(0);
}

/* --- 排行榜用户详情弹窗 --- */
#leaderboard-user-modal {
  animation: leaderboardModalFadeIn 0.25s ease;
}

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

#leaderboard-user-modal > div {
  animation: leaderboardModalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes leaderboardModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- 管理员排行榜表格 --- */
#admin-leaderboard-content table {
  border-collapse: collapse;
}

#admin-leaderboard-content th {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

#admin-leaderboard-content td,
#admin-leaderboard-content th {
  padding: 0.75rem 1rem;
}

/* --- 响应式调整 --- */
@media (max-width: 640px) {
  .rank-badge {
    min-width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }

  .rank-badge.gold,
  .rank-badge.silver,
  .rank-badge.bronze {
    font-size: 1rem;
  }

  #leaderboard-search {
    font-size: 0.875rem;
  }
}

/* ================================================================
   隐私设置 - 开关切换 (Toggle Switch)
   ================================================================ */
.hb-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.hb-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.hb-switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--hb-border-strong);
  border-radius: 26px;
  transition: background 0.25s ease;
}

.hb-switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.hb-switch input:checked + .hb-switch-slider {
  background: var(--hb-accent);
}

.hb-switch input:checked + .hb-switch-slider::before {
  transform: translateX(22px);
}

.hb-switch input:focus-visible + .hb-switch-slider {
  outline: 2px solid var(--hb-accent);
  outline-offset: 2px;
}

[data-theme="dark"] .hb-switch-slider {
  background: #475569;
}

[data-theme="dark"] .hb-switch input:checked + .hb-switch-slider {
  background: var(--hb-accent);
}

[data-theme="dark"] .hb-switch-slider::before {
  background: #f1f5f9;
}

/* 隐私弹窗入场动画 */
#privacy-ask-modal .animate-in {
  animation: privacySlideUp 0.3s ease-out;
}

@keyframes privacySlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ================================================================
   界面个性化设置 (v2)
   ================================================================ */

/* --- 主题色方案 --- */
[data-accent="emerald"] {
  --hb-accent: #10b981;
  --hb-accent-light: #ecfdf5;
  --hb-accent-dark: #059669;
  --hb-btn-primary-bg-start: #10b981;
  --hb-btn-primary-bg-end: #059669;
  --hb-tab-active-bg: #10b981;
  --hb-tab-indicator: #10b981;
  --hb-tab-table-indicator: #10b981;
}

[data-accent="gold"] {
  --hb-accent: #d4af37;
  --hb-accent-light: #fefce8;
  --hb-accent-dark: #b8860b;
  --hb-btn-primary-bg-start: #d4af37;
  --hb-btn-primary-bg-end: #b8860b;
  --hb-tab-active-bg: #b8860b;
  --hb-tab-indicator: #d4af37;
  --hb-tab-table-indicator: #d4af37;
}

[data-accent="rose"] {
  --hb-accent: #f43f5e;
  --hb-accent-light: #fff1f2;
  --hb-accent-dark: #e11d48;
  --hb-btn-primary-bg-start: #f43f5e;
  --hb-btn-primary-bg-end: #e11d48;
  --hb-tab-active-bg: #e11d48;
  --hb-tab-indicator: #f43f5e;
  --hb-tab-table-indicator: #f43f5e;
}

[data-accent="purple"] {
  --hb-accent: #8b5cf6;
  --hb-accent-light: #f5f3ff;
  --hb-accent-dark: #7c3aed;
  --hb-btn-primary-bg-start: #8b5cf6;
  --hb-btn-primary-bg-end: #7c3aed;
  --hb-tab-active-bg: #7c3aed;
  --hb-tab-indicator: #8b5cf6;
  --hb-tab-table-indicator: #8b5cf6;
}

/* --- 字体大小 --- */
[data-font-size="small"] { font-size: 13px; }
[data-font-size="large"] { font-size: 17px; }
html { font-size: var(--font-base, 15px); }

/* --- 布局模式 --- */
.layout-compact .hb-card { padding: 0.75rem !important; }
.layout-compact .p-6 { padding: 0.75rem !important; }
.layout-compact .py-6 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.layout-compact .my-6 { margin-top: 0.75rem !important; margin-bottom: 0.75rem !important; }
.layout-compact .gap-5 { gap: 0.75rem !important; }
.layout-compact .space-y-5 > * + * { margin-top: 0.75rem !important; }
.layout-compact .space-y-4 > * + * { margin-top: 0.5rem !important; }

.layout-spacious .hb-card { padding: 2rem !important; }
.layout-spacious .p-6 { padding: 2rem !important; }
.layout-spacious .py-6 { padding-top: 2rem !important; padding-bottom: 2rem !important; }

/* --- 卡片样式 --- */
.card-style-sharp .hb-card,
.card-style-sharp .asset-card,
.card-style-sharp .market-card,
.card-style-sharp .task-card,
.card-style-sharp .modal-content,
.card-style-sharp .leaderboard-stats-card {
  border-radius: 2px !important;
}

.card-style-glass .hb-card {
  background: rgba(255,255,255,0.65) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.3) !important;
}

[data-theme="dark"] .card-style-glass .hb-card {
  background: rgba(30,41,59,0.75) !important;
  border-color: rgba(51,65,85,0.5) !important;
}

/* --- 动画禁用 --- */
.no-animation *,
.no-animation *::before,
.no-animation *::after {
  transition: none !important;
  animation: none !important;
}

/* --- 背景图案 --- */
.bg-pattern-noise {
  position: relative;
}
.bg-pattern-noise::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
  z-index: -1;
}

.bg-pattern-grid {
  position: relative;
}
.bg-pattern-grid::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(100,116,139,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,116,139,0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -1;
}

[data-theme="dark"] .bg-pattern-grid::before {
  background-image:
    linear-gradient(rgba(148,163,184,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.1) 1px, transparent 1px);
}

.bg-pattern-gradient {
  position: relative;
}
.bg-pattern-gradient::before {
  content: "";
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(102,126,234,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(118,75,162,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(107,115,255,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

[data-theme="dark"] .bg-pattern-gradient::before {
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(96,165,250,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(99,102,241,0.06) 0%, transparent 70%);
}

/* --- 设置页色块选择器 --- */
.accent-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  flex-shrink: 0;
}
.accent-swatch:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.accent-swatch.active {
  border-color: var(--hb-text);
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(0,120,212,0.2);
}
.accent-swatch:focus-visible {
  outline: 2px solid var(--hb-accent);
  outline-offset: 2px;
}

/* --- 设置页通用选项按钮 --- */
.option-btn {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--hb-border);
  background: var(--hb-surface);
  color: var(--hb-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  flex-shrink: 0;
}
.option-btn:hover {
  background: var(--hb-muted-bg);
  color: var(--hb-text);
  border-color: var(--hb-border-strong);
}
.option-btn.active {
  background: var(--hb-accent);
  color: #fff;
  border-color: var(--hb-accent);
  box-shadow: 0 2px 8px rgba(0,120,212,0.25);
}
.option-btn:focus-visible {
  outline: 2px solid var(--hb-accent);
  outline-offset: 2px;
}

/* --- 设置页分类布局 --- */
.settings-mobile-select-wrap {
  display: none;
}

.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.settings-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}

.settings-content {
  min-height: 300px;
}

.settings-content > [data-settings-content] {
  display: none;
}

.settings-content > [data-settings-content].active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: settingsFadeIn 0.25s ease-out;
}

@keyframes settingsFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-cat-btn {
  background: transparent;
  color: var(--hb-text-secondary);
  border: none;
  cursor: pointer;
}

.settings-cat-btn:hover {
  background: var(--hb-muted-bg);
  color: var(--hb-text);
}

.settings-cat-btn.active {
  background: var(--hb-accent-light);
  color: var(--hb-accent);
  font-weight: 600;
}

.settings-cat-btn:focus-visible {
  outline: 2px solid var(--hb-accent);
  outline-offset: 2px;
}

#settings-search {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

#settings-search::placeholder {
  color: var(--hb-text-placeholder);
}

@media (max-width: 768px) {
  .settings-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .settings-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--hb-surface);
    margin: 0;
    padding: 0.75rem 0.75rem 0.65rem;
    border-bottom: 1px solid var(--hb-border);
  }
  /* PC版在移动端隐藏 */
  .settings-sidebar-pc {
    display: none;
  }
  /* 移动端下拉选择器显示 */
  .settings-mobile-select-wrap {
    display: flex;
    align-items: center;
    position: relative;
    background: var(--hb-muted-bg);
    border: 1px solid var(--hb-border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
  }
  .settings-mobile-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--hb-text);
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
  }
  .settings-mobile-select-arrow {
    position: absolute;
    right: 0.85rem;
    pointer-events: none;
    font-size: 0.7rem;
    color: var(--hb-text-secondary);
  }
  .settings-content {
    padding: 0.75rem 0.5rem;
    padding-bottom: 2rem;
  }
  .settings-content > [data-settings-content] {
    padding: 0;
  }
  .settings-content .hb-card {
    padding: 1rem;
    border-radius: 14px;
  }
  .settings-content h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  .settings-content .space-y-4 > * + * {
    margin-top: 0.75rem;
  }
  .settings-content .hb-input {
    padding: 0.7rem 0.85rem;
    font-size: 0.875rem;
    border-radius: 10px;
  }
  .settings-content button[type="submit"],
  .settings-content .btn-primary,
  .settings-content .hb-btn-white {
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    border-radius: 10px;
  }
  /* 隐私设置开关项紧凑布局 */
  .settings-content [data-settings-content="privacy"] .space-y-5 > * + * {
    margin-top: 0;
  }
  .settings-content [data-settings-content="privacy"] .border-t {
    padding-top: 0.75rem;
  }
  /* 开放平台卡片网格适配 */
  .settings-content [data-settings-content="openplatform"] .grid {
    grid-template-columns: 1fr;
  }
  .settings-content [data-settings-content="openplatform"] .grid > div {
    padding: 0.75rem;
  }
  /* 选项按钮组紧凑排列 */
  .settings-content .option-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }
  /* 界面个性化色块大小 */
  .settings-content .accent-swatch {
    width: 28px;
    height: 28px;
  }
  /* 表单标签紧凑 */
  .settings-content label {
    font-size: 0.82rem;
  }
  /* 工具栏拖拽项紧凑 */
  .settings-content .toolbar-order-item {
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .settings-layout {
    gap: 0;
  }
  .settings-sidebar {
    padding: 0.5rem 0.5rem 0.5rem;
  }
  .settings-mobile-select {
    font-size: 0.85rem;
    padding: 0.55rem 2.2rem 0.55rem 0.85rem;
  }
  .settings-content {
    padding: 0.6rem 0.4rem;
    padding-bottom: 2rem;
  }
  .settings-content .hb-card {
    padding: 0.85rem;
    border-radius: 12px;
  }
  .settings-content h3 {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
  }
  .settings-content .text-sm {
    font-size: 0.8rem;
  }
  .settings-content .text-xs {
    font-size: 0.72rem;
  }
  .settings-content .mb-4,
  .settings-content .mb-5 {
    margin-bottom: 0.6rem !important;
  }
  .settings-content .p-6 {
    padding: 0.85rem !important;
  }
  .settings-content .hb-input {
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
    border-radius: 8px;
  }
  .settings-content button[type="submit"],
  .settings-content .btn-primary,
  .settings-content .hb-btn-white {
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    border-radius: 8px;
  }
  .device-item {
    padding: 0.65rem !important;
  }
  .device-item .text-sm {
    font-size: 0.8rem;
  }
  .device-item .text-xs {
    font-size: 0.7rem;
  }
  .device-item button {
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
  }
  /* 隐私设置开关行更紧凑 */
  .settings-content [data-settings-content="privacy"] .flex.items-center.justify-between {
    gap: 0.5rem;
  }
  /* 反馈表单文本域 */
  .settings-content textarea.hb-input {
    font-size: 0.82rem;
  }
  /* 开放平台头部分散布局 */
  .settings-content [data-settings-content="openplatform"] .flex.items-center.gap-4 {
    gap: 0.75rem;
  }
  .settings-content [data-settings-content="openplatform"] .w-16 {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}

.rp-send-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: rpFadeIn 0.25s ease;
}
@keyframes rpFadeIn { from { opacity: 0; } to { opacity: 1; } }

.rp-send-modal {
  background: var(--hb-surface);
  border-radius: 20px;
  padding: 1.5rem;
  width: 400px; max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: rpSlideUp 0.35s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 90vh; overflow-y: auto;
}
@keyframes rpSlideUp { from { opacity: 0; transform: translateY(40px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.rp-segment { display: flex; background: rgba(0,0,0,0.05); border-radius: 12px; padding: 4px; }
[data-theme="dark"] .rp-segment { background: rgba(255,255,255,0.08); }
.rp-segment-btn { flex: 1; padding: 0.65rem 0.5rem; border: none; border-radius: 10px; font-size: 0.88rem; font-weight: 600; cursor: pointer; background: transparent; color: var(--hb-text); opacity: 0.55; transition: all 0.3s ease; }
.rp-segment-btn.active { opacity: 1; background: var(--hb-surface); box-shadow: 0 2px 8px rgba(0,0,0,0.1); transform: scale(1.02); }
[data-theme="dark"] .rp-segment-btn.active { background: #1e293b; }

.rp-slider-group { margin-bottom: 1rem; }
.rp-slider-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; font-size: 0.82rem; font-weight: 600; color: var(--hb-text-secondary); }
.rp-slider-row { display: flex; align-items: center; gap: 0.75rem; }
.rp-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #f5b642, #e74c3c); outline: none; }
.rp-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #f5b642; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.2); cursor: pointer; }
[data-theme="dark"] .rp-slider::-webkit-slider-thumb { border-color: #1e293b; }
.rp-slider-num { width: 60px; padding: 0.45rem 0.5rem; border: 1.5px solid var(--hb-border-medium); border-radius: 8px; text-align: center; font-size: 0.9rem; font-weight: 600; background: var(--hb-muted-bg2); color: var(--hb-text); }
[data-theme="dark"] .rp-slider-num { border-color: #334155; background: #1e293b; color: #f1f5f9; }

.rp-msg-input { width: 100%; padding: 0.7rem 0.8rem; border: 1.5px solid var(--hb-border-medium); border-radius: 10px; font-size: 0.9rem; background: var(--hb-muted-bg2); color: var(--hb-text); transition: border-color 0.25s; }
.rp-msg-input:focus { outline: none; border-color: #f5b642; box-shadow: 0 0 0 3px rgba(245,182,66,0.15); }

.rp-select { width: 100%; padding: 0.7rem 0.8rem; border: 1.5px solid var(--hb-border-medium); border-radius: 10px; font-size: 0.9rem; background: var(--hb-muted-bg2); color: var(--hb-text); cursor: pointer; }
[data-theme="dark"] .rp-select { border-color: #334155; background: #1e293b; color: #f1f5f9; }

.rp-preview { display: flex; gap: 0.75rem; margin: 1rem 0; }
.rp-preview-item { flex: 1; background: linear-gradient(135deg, rgba(245,182,66,0.1), rgba(231,76,60,0.1)); border-radius: 12px; padding: 0.75rem; text-align: center; }
[data-theme="dark"] .rp-preview-item { background: linear-gradient(135deg, rgba(245,182,66,0.08), rgba(231,76,60,0.08)); }
.rp-preview-val { font-size: 1.5rem; font-weight: 800; color: #e74c3c; }
.rp-preview-label { font-size: 0.75rem; color: var(--hb-text-secondary); margin-top: 0.2rem; }

.rp-submit-btn { width: 100%; padding: 0.85rem; border: none; border-radius: 14px; background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 4px 16px rgba(231,76,60,0.3); }
.rp-submit-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(231,76,60,0.4); }
.rp-submit-btn:active { transform: scale(0.97); }
.rp-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.rp-result-content { text-align: center; }
.rp-result-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.rp-result-link { display: block; padding: 0.75rem; background: var(--hb-muted-bg2); border: 1.5px solid var(--hb-border-medium); border-radius: 10px; font-size: 0.8rem; color: var(--hb-text); word-break: break-all; margin: 0.75rem 0; user-select: all; }
.rp-qr-wrap { display: flex; justify-content: center; margin: 1rem 0; }
.rp-qr-wrap canvas, .rp-qr-wrap img { border-radius: 12px; }
.rp-result-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.rp-copy-btn, .rp-share-btn { flex: 1; padding: 0.75rem; border-radius: 12px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; }
.rp-copy-btn { background: linear-gradient(135deg, #f5b642, #e09620); color: #7c3a00; }
.rp-share-btn { background: var(--hb-muted-bg2); color: var(--hb-text); border: 1.5px solid var(--hb-border-medium); }

.rp-list-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem; background: var(--hb-surface); border-radius: 14px; margin-bottom: 0.6rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.rp-list-item:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.rp-list-icon { font-size: 1.5rem; flex-shrink: 0; }
.rp-list-info { flex: 1; min-width: 0; }
.rp-list-title { font-weight: 600; font-size: 0.9rem; color: var(--hb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-list-meta { font-size: 0.78rem; color: var(--hb-text-secondary); margin-top: 0.15rem; }
.rp-list-status { font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 9999px; flex-shrink: 0; }
.rp-status-active { background: rgba(16,185,129,0.12); color: #10b981; }
.rp-status-finished { background: rgba(107,114,128,0.12); color: #6b7280; }
.rp-status-expired { background: rgba(239,68,68,0.12); color: #ef4444; }

.rp-pick-record { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0; border-bottom: 1px solid var(--hb-border-light); }
.rp-pick-record:last-child { border-bottom: none; }
.rp-pick-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #e5e7eb; }
.rp-pick-name { flex: 1; font-weight: 500; font-size: 0.85rem; }
.rp-pick-amount { font-weight: 700; color: #e74c3c; font-size: 0.9rem; }
.rp-pick-time { font-size: 0.72rem; color: var(--hb-text-muted); }

.rp-subtabs { display: flex; gap: 0; margin-bottom: 1rem; border-bottom: 2px solid var(--hb-border-medium); }
.rp-subtab { flex: 1; padding: 0.65rem; text-align: center; font-size: 0.9rem; font-weight: 600; cursor: pointer; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; color: var(--hb-text-secondary); transition: all 0.25s; }
.rp-subtab.active { color: #e74c3c; border-bottom-color: #e74c3c; }

@media (max-width: 480px) {
  .rp-send-modal { border-radius: 16px; padding: 1.25rem; }
  .rp-segment-btn { font-size: 0.8rem; padding: 0.55rem 0.4rem; }
}

/* ================================================================
   Stock Market Styles — 股票市场
   ================================================================ */

/* ---- A. Stock Card Grid ---- */
.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.stock-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.stock-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hb-shadow-md);
  border-color: var(--hb-accent);
}
.stock-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.stock-card-code, .stock-code-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hb-text-secondary);
  background: var(--hb-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.stock-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hb-text);
}
.stock-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--hb-text);
  margin: 0.25rem 0;
}
.stock-card-change {
  font-size: 0.85rem;
  font-weight: 600;
}
.stock-up { color: #ef4444; }
.stock-down { color: #10b981; }
.stock-flat { color: #6b7280; }
.stock-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.stock-card-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--hb-radius);
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.stock-btn-buy {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}
.stock-btn-buy:hover { background: rgba(239,68,68,0.2); }
.stock-btn-sell {
  background: rgba(16,185,129,0.1);
  color: #10b981;
}
.stock-btn-sell:hover { background: rgba(16,185,129,0.2); }
.stock-favorite-star, .stock-fav-star {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
  opacity: 0.6;
  transition: opacity 0.15s, transform 0.15s;
}
.stock-favorite-star:hover, .stock-fav-star:hover { opacity: 1; transform: scale(1.2); }
.stock-favorite-star.active, .stock-fav-star.fav-active { opacity: 1; color: #f59e0b; }
.stock-card-hold {
  font-size: 0.75rem;
  color: var(--hb-text-secondary);
  margin-top: 0.25rem;
}

/* ---- B. Asset Bar ---- */
.stock-asset-bar {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.stock-asset-item {
  display: flex;
  flex-direction: column;
  min-width: 100px;
}
.stock-asset-label {
  font-size: 0.75rem;
  color: var(--hb-text-secondary);
  margin-bottom: 0.15rem;
}
.stock-asset-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hb-text);
}
.stock-asset-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}
.stock-asset-btn {
  padding: 0.4rem 0.8rem;
  border-radius: var(--hb-radius);
  border: 1px solid var(--hb-border);
  background: transparent;
  color: var(--hb-text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.stock-asset-btn:hover {
  border-color: var(--hb-accent);
  color: var(--hb-accent);
  background: rgba(0,120,212,0.05);
}

/* ---- C. Subtab Navigation ---- */
.stock-subtab-nav {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--hb-border-light);
}
.stock-subtab-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--hb-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.stock-subtab-btn:hover { color: var(--hb-text); }
.stock-subtab-btn.active {
  color: var(--hb-accent);
  border-bottom-color: var(--hb-accent);
}

/* ---- D. Trade Modal ---- */
.stock-trade-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: stockFadeIn 0.2s ease;
}
@keyframes stockFadeIn { from { opacity: 0; } to { opacity: 1; } }
.stock-trade-modal {
  background: var(--hb-surface);
  border-radius: 16px;
  padding: 1.5rem;
  width: 420px;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: stockSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes stockSlideUp { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.stock-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--hb-text);
  margin-bottom: 0.75rem;
}
.stock-modal-price {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--hb-text-secondary);
}
.stock-modal-desc {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--hb-text-secondary);
  padding: 0.5rem 0.75rem;
  background: var(--hb-bg);
  border-radius: var(--hb-radius);
}
.stock-modal-hold {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--hb-text-secondary);
}
.stock-modal-field {
  margin-bottom: 1rem;
}
.stock-modal-label {
  display: block;
  font-size: 0.8rem;
  color: var(--hb-text-secondary);
  margin-bottom: 0.35rem;
  font-weight: 500;
}
.stock-modal-max {
  font-size: 0.75rem;
  color: var(--hb-text-muted);
  margin-left: 0.5rem;
}
.stock-modal-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  font-size: 0.95rem;
  background: var(--hb-bg);
  color: var(--hb-text);
  outline: none;
  transition: border-color 0.15s;
}
.stock-modal-input:focus { border-color: var(--hb-accent); }
.stock-modal-calc {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border-radius: var(--hb-radius);
  background: var(--hb-bg);
  font-size: 0.85rem;
  color: var(--hb-text-secondary);
}
.stock-modal-actions {
  display: flex;
  gap: 0.5rem;
}
.stock-modal-btn {
  flex: 1;
  padding: 0.65rem;
  border: none;
  border-radius: var(--hb-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.stock-modal-btn-cancel {
  background: var(--hb-bg);
  color: var(--hb-text-secondary);
  border: 1px solid var(--hb-border);
}
.stock-modal-btn-cancel:hover { background: var(--hb-border); color: var(--hb-text); }
.stock-modal-btn-confirm {
  color: #fff;
}
.stock-modal-btn-confirm.stock-btn-buy { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stock-modal-btn-confirm.stock-btn-buy:hover { opacity: 0.9; }
.stock-modal-btn-confirm.stock-btn-sell { background: linear-gradient(135deg, #10b981, #059669); }
.stock-modal-btn-confirm.stock-btn-sell:hover { opacity: 0.9; }

/* ---- E. Position Table ---- */
.stock-positions-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.stock-positions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.stock-positions-table th,
.stock-positions-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--hb-border-light);
  white-space: nowrap;
}
.stock-positions-table th {
  font-weight: 600;
  color: var(--hb-text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.stock-positions-table tbody tr:hover {
  background: rgba(0,120,212,0.03);
}

/* ---- F. Stock Detail View ---- */
.stock-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--hb-text-secondary);
  cursor: pointer;
  margin-bottom: 0.75rem;
  padding: 0.3rem 0;
  border: none;
  background: transparent;
}
.stock-detail-back:hover { color: var(--hb-accent); }
.stock-back-btn {
  font-size: 0.85rem;
  color: var(--hb-text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0.3rem 0;
}
.stock-back-btn:hover { color: var(--hb-accent); }
.stock-detail-header {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  margin-bottom: 1rem;
  gap: 0.5rem;
}
.stock-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.stock-detail-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--hb-text);
  margin: 0;
}
.stock-detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.stock-detail-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--hb-text);
}
.stock-detail-change {
  font-size: 1rem;
  font-weight: 600;
}
.stock-detail-actions {
  display: flex;
  gap: 0.5rem;
}
.stock-action-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--hb-radius);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* ---- G. Chart Container ---- */
.stock-chart-wrap {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  padding: 1rem;
  margin: 1rem 0;
}
.stock-chart-wrap canvas {
  width: 100% !important;
  height: auto !important;
}
.stock-chart-container {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  padding: 1rem;
  margin: 1rem 0;
}
.stock-chart-container canvas {
  width: 100% !important;
  height: auto !important;
}

/* ---- H. Favorite Quick Access ---- */
.stock-fav-area {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.stock-fav-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  background: var(--hb-bg);
  border: 1px solid var(--hb-border-light);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--hb-text);
  cursor: pointer;
  transition: all 0.15s;
}
.stock-fav-chip:hover {
  border-color: var(--hb-accent);
  color: var(--hb-accent);
}

/* ---- 认证功能限制样式 ---- */
.verify-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 0 1rem 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #92400e;
}
.verify-banner-close {
  cursor: pointer;
  font-size: 1.25rem;
  color: #92400e;
  padding: 0 0.25rem;
  line-height: 1;
}
.verify-banner-close:hover {
  color: #78350f;
}

.test-account-banner {
  background: linear-gradient(135deg, #fed7aa, #fdba74);
  border: 1px solid #f97316;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 0 1rem 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: #9a3412;
}

.test-account-label {
  color: #f97316;
  font-weight: 500;
  margin-left: 0.25rem;
}

/* 暗色模式适配 */
[data-theme="dark"] .test-account-banner {
  background: linear-gradient(135deg, #7c2d12, #9a3412);
  border-color: #ea580c;
  color: #fed7aa;
}

[data-theme="dark"] .test-account-label {
  color: #fb923c;
}

.transfer-limit-hint {
  background: #fff7ed;
  border: 1px solid #f97316;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #9a3412;
  margin-bottom: 0.75rem;
}

.recipient-unverified-warn {
  background: #fff7ed;
  border: 1px solid #f97316;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #9a3412;
  margin-top: 0.5rem;
}

/* ---- I. Transaction List Items ---- */
.stock-tx-list {
  border: 1px solid var(--hb-border-light);
  border-radius: var(--hb-radius-lg);
  overflow: hidden;
}
.stock-tx-item {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--hb-border-light);
  gap: 0.75rem;
  flex-wrap: wrap;
}
.stock-tx-item:last-child { border-bottom: none; }
.stock-tx-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stock-tx-right {
  margin-left: auto;
  text-align: right;
}
.stock-tx-label, .stock-tx-type {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.stock-tx-badge, .stock-tx-type { font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 4px; }
.stock-tx-badge.stock-tx-buy, .stock-tx-type.buy { background: rgba(239,68,68,0.1); color: #ef4444; }
.stock-tx-badge.stock-tx-sell, .stock-tx-type.sell { background: rgba(16,185,129,0.1); color: #10b981; }
.stock-tx-stock { font-weight: 600; font-size: 0.85rem; color: var(--hb-text); min-width: 60px; }
.stock-tx-name { font-weight: 600; font-size: 0.85rem; color: var(--hb-text); }
.stock-tx-detail { font-size: 0.8rem; color: var(--hb-text-secondary); }
.stock-tx-amount { font-size: 0.85rem; font-weight: 600; color: var(--hb-text); }
.stock-tx-time { font-size: 0.75rem; color: var(--hb-text-muted); margin-left: auto; }

/* ---- J. Dark Mode Overrides ---- */
[data-theme="dark"] .stock-trade-modal-overlay { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .stock-card:hover { border-color: var(--hb-accent-light); }

/* ---- 天气股样式 ---- */
.stock-weather-badge {
  font-size: 0.7rem;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.5rem;
}
.stock-weather-info {
  font-size: 0.85rem;
  color: var(--hb-text-secondary);
  margin: 0.25rem 0;
}
.weather-desc-text {
  font-weight: 600;
  color: #3b82f6;
}
.weather-desc-detail {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}
.stock-card.weather-stock {
  border-left: 3px solid #3b82f6;
}
[data-theme="dark"] .weather-desc-text {
  color: #60a5fa;
}
[data-theme="dark"] .weather-desc-detail {
  color: #64748b;
}

/* ---- K. Mobile Responsive ---- */
@media (max-width: 640px) {
  .stock-grid { grid-template-columns: 1fr; }
  .stock-asset-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .stock-asset-actions { margin-left: 0; width: 100%; }
  .stock-asset-btn { flex: 1; text-align: center; }
  .stock-trade-modal { margin: 0.5rem; }
  .stock-positions-table { font-size: 0.75rem; }
  .stock-positions-table th, .stock-positions-table td { padding: 0.5rem; }
  .stock-subtab-btn { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
  .stock-card-btn { padding: 0.5rem; font-size: 0.8rem; }
}

/* ---- L. Empty State ---- */
.stock-empty { text-align: center; padding: 2rem; color: var(--hb-text-secondary); font-size: 0.9rem; }

/* ================================================================
   M. 身份认证徽章 & 转账风险提示弹窗
   ================================================================ */

/* 认证徽章 - 已认证（绿色） */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid #a7f3d0;
}
[data-theme="dark"] .verified-badge {
  color: #34d399;
  background: rgba(5, 150, 105, 0.15);
  border-color: rgba(5, 150, 105, 0.3);
}

.verified-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 1px 8px;
  border-radius: 12px;
  border: 1px solid #a7f3d0;
}
[data-theme="dark"] .verified-badge-sm {
  color: #34d399;
  background: rgba(5, 150, 105, 0.15);
  border-color: rgba(5, 150, 105, 0.3);
}

.verified-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #059669;
  border-radius: 50%;
}

/* 认证徽章 - 未认证（红色/灰色） */
.unverified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid #fecaca;
}
[data-theme="dark"] .unverified-badge {
  color: #f87171;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
}

.unverified-badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  padding: 1px 8px;
  border-radius: 12px;
  border: 1px solid #fecaca;
}
[data-theme="dark"] .unverified-badge-sm {
  color: #f87171;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
}

.unverified-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #dc2626;
  border-radius: 50%;
}

.unverified-badge-hint {
  font-weight: 400;
  opacity: 0.7;
}

/* 转账风险提示弹窗遮罩 */
.verify-warning-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: verifyFadeIn 0.2s ease;
}
@keyframes verifyFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 转账风险提示弹窗主体 */
.verify-warning-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 20px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: verifySlideUp 0.25s ease;
}
[data-theme="dark"] .verify-warning-dialog {
  background: #1e293b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
@keyframes verifySlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.verify-warning-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #fef3c7;
  color: #d97706;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fcd34d;
}
[data-theme="dark"] .verify-warning-icon {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

.verify-warning-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}
[data-theme="dark"] .verify-warning-title {
  color: #f1f5f9;
}

.verify-warning-msg {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 4px;
}
[data-theme="dark"] .verify-warning-msg {
  color: #94a3b8;
}

.verify-warning-sub {
  font-size: 0.875rem;
  color: #374151;
  font-weight: 500;
  margin-bottom: 20px;
}
[data-theme="dark"] .verify-warning-sub {
  color: #e2e8f0;
}

.verify-warning-actions {
  display: flex;
  gap: 10px;
}
.verify-warning-actions button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}
.verify-warning-cancel {
  background: #f3f4f6;
  color: #6b7280;
}
.verify-warning-cancel:hover {
  background: #e5e7eb;
}
[data-theme="dark"] .verify-warning-cancel {
  background: #334155;
  color: #94a3b8;
}
[data-theme="dark"] .verify-warning-cancel:hover {
  background: #475569;
}

.verify-warning-confirm {
  background: #ef4444;
  color: #fff;
}
.verify-warning-confirm:hover {
  background: #dc2626;
}
[data-theme="dark"] .verify-warning-confirm {
  background: #dc2626;
}
[data-theme="dark"] .verify-warning-confirm:hover {
  background: #b91c1c;
}

/* ================================================================
   设备管理样式
   ================================================================ */

.device-item {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.device-item:hover {
  border-color: var(--hb-border-strong);
  box-shadow: var(--hb-shadow-sm);
}

.device-item.current-device {
  background: var(--hb-accent-light);
  border-color: var(--hb-accent);
}

[data-theme="dark"] .device-item.current-device {
  background: rgba(96, 165, 250, 0.1);
  border-color: var(--hb-accent);
}

.device-item .device-info {
  flex: 1;
  min-width: 0;
}

.device-item .device-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.device-item .edit-device-name-btn,
.device-item .logout-device-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.device-item .edit-device-name-btn {
  background: transparent;
  color: var(--hb-accent);
}

.device-item .edit-device-name-btn:hover {
  background: var(--hb-accent-light);
}

.device-item .logout-device-btn {
  background: transparent;
  color: var(--hb-error-text);
}

.device-item .logout-device-btn:hover {
  background: var(--hb-error-bg);
}

#btn-refresh-devices {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--hb-border);
  color: var(--hb-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

#btn-refresh-devices:hover {
  background: var(--hb-muted-bg);
  border-color: var(--hb-border-strong);
}

#btn-logout-all-devices {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* 设备管理移动端适配 */
@media (max-width: 640px) {
  .device-item {
    padding: 0.85rem;
    border-radius: 10px;
  }
  
  .device-item .flex.items-start.justify-between {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .device-item .device-actions {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
  }
  
  .device-item .edit-device-name-btn,
  .device-item .logout-device-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }
  
  #devices-list {
    gap: 0.5rem;
  }
  
  #devices-actions {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
  }
  
  #btn-logout-all-devices {
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 400px) {
  .device-item {
    padding: 0.75rem;
  }
  
  .device-item .text-sm {
    font-size: 0.8rem;
  }
  
  .device-item .text-xs {
    font-size: 0.7rem;
  }
  
  .device-item .space-y-0\.5 > * + * {
    margin-top: 0.15rem;
  }
}

/* 新设备登录提示弹窗 */
#new-device-alert-modal .modal-content {
  max-width: 380px;
}

@media (max-width: 480px) {
  #new-device-alert-modal .modal-content {
    max-width: 100%;
    margin: 0.5rem;
    padding: 1.25rem;
    border-radius: 16px;
  }
  
  #new-device-alert-modal .w-10 {
    width: 2.25rem;
    height: 2.25rem;
  }
  
  #new-device-alert-modal .text-lg {
    font-size: 1rem;
  }
  
  #new-device-alert-modal .text-sm {
    font-size: 0.82rem;
  }
  
  #new-device-alert-modal .bg-slate-50 {
    padding: 0.6rem;
  }
  
  #new-device-alert-modal button {
    padding: 0.65rem;
    font-size: 0.85rem;
  }
}

/* 编辑设备名称弹窗 */
#edit-device-name-modal .modal-content {
  max-width: 360px;
}

@media (max-width: 480px) {
  #edit-device-name-modal .modal-content {
    max-width: 100%;
    margin: 0.5rem;
    padding: 1.25rem;
  }
  
  #edit-device-name-modal input {
    font-size: 0.875rem;
  }
  
  #edit-device-name-modal button {
    padding: 0.65rem;
    font-size: 0.85rem;
  }
}

/* ================================================================
   快捷导航侧边栏
   ================================================================ */

.quick-nav-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
}

[data-theme="dark"] .quick-nav-card {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(51, 65, 85, 0.5);
}

.quick-nav-title {
  color: var(--hb-text-muted);
}

[data-theme="dark"] .quick-nav-title {
  color: #94a3b8;
}

.quick-nav-divider {
  border-top: 1px solid var(--hb-border-light);
}

[data-theme="dark"] .quick-nav-divider {
  border-top-color: rgba(51, 65, 85, 0.5);
}

.quick-nav-link {
  color: var(--hb-text-secondary);
}

.quick-nav-link:hover {
  background: var(--hb-muted-bg);
  color: var(--hb-text);
}

[data-theme="dark"] .quick-nav-link:hover {
  background: rgba(51, 65, 85, 0.5);
  color: #f1f5f9;
}

.quick-nav-link-sm {
  color: var(--hb-text-muted);
}

.quick-nav-link-sm:hover {
  color: var(--hb-text-secondary);
}

#quick-nav-toggle {
  color: var(--hb-text);
}

#quick-nav-toggle:hover {
  background: var(--hb-muted-bg);
}

[data-theme="dark"] #quick-nav-toggle:hover {
  background: rgba(51, 65, 85, 0.5);
}

#quick-nav-arrow {
  color: var(--hb-text-muted);
}

#quick-nav-arrow.open {
  transform: rotate(180deg);
}

/* ================================================================
   管理员页面动画效果
   ================================================================ */

/* 管理员标签页切换动画 */
.admin-tab-btn {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-tab-btn:hover {
  transform: translateX(2px);
}

.admin-tab-btn.active {
  animation: adminTabPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes adminTabPop {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* 管理员内容区域淡入动画 */
.animate-fade-in {
  animation: adminFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes adminFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 管理员卡片悬停效果 */
.admin-card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 管理员统计卡片动画 */
.admin-stat-card {
  animation: adminStatCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.admin-stat-card:nth-child(1) { animation-delay: 0.05s; }
.admin-stat-card:nth-child(2) { animation-delay: 0.12s; }
.admin-stat-card:nth-child(3) { animation-delay: 0.19s; }
.admin-stat-card:nth-child(4) { animation-delay: 0.26s; }

@keyframes adminStatCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 管理员表格行动画 */
.admin-table-row {
  animation: adminTableRowIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes adminTableRowIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 管理员按钮点击效果 */
.admin-btn-click {
  transition: all 0.15s ease;
}

.admin-btn-click:active {
  transform: scale(0.95);
}

/* 管理员侧边栏动画 */
.admin-sidebar {
  animation: adminSidebarIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes adminSidebarIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 管理员内容区域滑入动画 */
.admin-content {
  animation: adminContentIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes adminContentIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 封禁用户行高亮动画 */
.banned-user-row {
  animation: bannedRowPulse 2s ease-in-out infinite;
}

@keyframes bannedRowPulse {
  0%, 100% { background-color: rgba(244, 63, 94, 0.05); }
  50% { background-color: rgba(244, 63, 94, 0.1); }
}

/* 管理员操作成功反馈动画 */
.admin-success-flash {
  animation: adminSuccessFlash 0.6s ease-out;
}

@keyframes adminSuccessFlash {
  0% { background-color: rgba(16, 185, 129, 0.3); }
  100% { background-color: transparent; }
}

/* 管理员加载骨架屏 */
.admin-skeleton {
  background: linear-gradient(90deg, 
    var(--hb-surface) 25%, 
    var(--hb-muted-bg) 50%, 
    var(--hb-surface) 75%
  );
  background-size: 200% 100%;
  animation: adminSkeleton 1.5s ease-in-out infinite;
}

@keyframes adminSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 管理员页面响应式动画调整 */
@media (max-width: 768px) {
  .admin-sidebar {
    animation: adminSidebarMobileIn 0.3s ease-out both;
  }
  
  @keyframes adminSidebarMobileIn {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .admin-content {
    animation: adminContentMobileIn 0.35s ease-out both;
  }
  
  @keyframes adminContentMobileIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ===== 仪表盘资产概览卡片 ===== */
.dashboard-asset-card {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
  border-radius: 20px;
  padding: 1.5rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.25);
}
[data-theme="dark"] .dashboard-asset-card {
  background: linear-gradient(135deg, #3730a3 0%, #5b21b6 50%, #4f46e5 100%);
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.15);
}
.dashboard-asset-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
}
.dashboard-asset-card > * {
  position: relative;
  z-index: 1;
}
.dashboard-stat-item {
  text-align: center;
}
.dashboard-stat-label {
  font-size: 0.7rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
}
.dashboard-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dashboard-stat-value.net-worth {
  font-size: 1.5rem;
  font-weight: 800;
}

/* ===== 信用分环形进度条 ===== */
.credit-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.credit-ring svg {
  transform: rotate(-90deg);
  width: 64px;
  height: 64px;
}
.credit-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.2);
  stroke-width: 5;
}
.credit-ring-progress {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.3s ease;
}
.credit-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}
.credit-ring-text span {
  font-size: 0.55rem;
  opacity: 0.7;
  margin-left: 1px;
}

/* ===== 仪表盘每日任务区域 ===== */
.dashboard-tasks-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border-light);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dashboard-tasks-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hb-text);
  margin-bottom: 0.75rem;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .admin-tab-btn,
  .admin-card-hover,
  .admin-stat-card,
  .admin-table-row,
  .admin-sidebar,
  .admin-content,
  .banned-user-row,
  .admin-skeleton {
    animation: none !important;
    transition: none !important;
  }
}