/* ==========================================================================
   countup.css - 数字滚动 + 交易类仪表盘样式
   ========================================================================== */

/* --------------------------------------------------------------------------
   数字滚动动画
   -------------------------------------------------------------------------- */
[data-child-theme="binance"] .countup {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  transition: color 0.2s ease;
}

/* 数字闪烁效果（更新时短暂高亮） */
[data-child-theme="binance"] .countup.flash-up {
  animation: countup-flash-up 0.6s ease;
}
[data-child-theme="binance"] .countup.flash-down {
  animation: countup-flash-down 0.6s ease;
}
@keyframes countup-flash-up {
  0% { color: var(--ri-success); transform: scale(1.1); }
  100% { color: inherit; transform: scale(1); }
}
@keyframes countup-flash-down {
  0% { color: var(--ri-danger); transform: scale(1.1); }
  100% { color: inherit; transform: scale(1); }
}

/* --------------------------------------------------------------------------
   涨跌色：金融数据专用
   -------------------------------------------------------------------------- */
[data-child-theme="binance"] .price-up {
  color: var(--ri-success) !important;
}
[data-child-theme="binance"] .price-down {
  color: var(--ri-danger) !important;
}
[data-child-theme="binance"] .price-neutral {
  color: var(--ri-secondary-color) !important;
}

/* --------------------------------------------------------------------------
   市场仪表盘（首页） - Market Dashboard
   -------------------------------------------------------------------------- */
[data-child-theme="binance"] .market-dashboard {
  background: var(--ri-secondary-bg);
  border-radius: var(--ri-border-radius-xl);
  padding: 1.5rem;
  box-shadow: var(--ri-box-shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--ri-border-color);
}

[data-child-theme="binance"] .market-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--ri-border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

[data-child-theme="binance"] .market-dashboard-title {
  font-family: var(--ri-heading-font-family);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--ri-emphasis-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
[data-child-theme="binance"] .market-dashboard-title::before {
  content: '\f201';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: var(--ri-primary);
  font-size: 1rem;
}

[data-child-theme="binance"] .market-dashboard-actions {
  display: flex;
  gap: 0.35rem;
}
[data-child-theme="binance"] .market-dashboard-actions .market-tab {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  background: var(--ri-tertiary-bg);
  border: 1px solid transparent;
  color: var(--ri-body-color);
  border-radius: var(--ri-border-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
[data-child-theme="binance"] .market-dashboard-actions .market-tab:hover {
  color: var(--ri-primary);
}
[data-child-theme="binance"] .market-dashboard-actions .market-tab.active {
  background: var(--ri-primary-soft);
  color: var(--ri-primary);
  border-color: var(--ri-primary-soft-2);
}

/* 市场概览 - 关键数据条 */
[data-child-theme="binance"] .market-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ri-border-color);
}
[data-child-theme="binance"] .market-stat-item {
  padding: 0.85rem 1rem;
  background: var(--ri-tertiary-bg);
  border-radius: var(--ri-border-radius);
  border: 1px solid var(--ri-border-color);
  transition: all 0.2s ease;
}
[data-child-theme="binance"] .market-stat-item:hover {
  border-color: var(--ri-primary-soft-2);
  background: rgba(252, 213, 53, 0.04);
}
[data-child-theme="binance"] .market-stat-label {
  font-size: 0.75rem;
  color: var(--ri-tertiary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}
[data-child-theme="binance"] .market-stat-value {
  font-family: var(--ri-heading-font-family);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ri-emphasis-color);
  line-height: 1.2;
}
[data-child-theme="binance"] .market-stat-change {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* 货币列表表格 */
[data-child-theme="binance"] .market-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
[data-child-theme="binance"] .market-table thead th {
  padding: 0.75rem 0.85rem;
  text-align: left;
  font-weight: 500;
  color: var(--ri-tertiary-color);
  border-bottom: 1px solid var(--ri-border-color);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
[data-child-theme="binance"] .market-table thead th.text-right {
  text-align: right;
}
[data-child-theme="binance"] .market-table thead th.text-center {
  text-align: center;
}

[data-child-theme="binance"] .market-table tbody td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--ri-border-color);
  vertical-align: middle;
}
[data-child-theme="binance"] .market-table tbody tr {
  transition: background-color 0.15s ease;
}
[data-child-theme="binance"] .market-table tbody tr:hover {
  background: var(--ri-tertiary-bg);
}
[data-child-theme="binance"] .market-table tbody tr:last-child td {
  border-bottom: none;
}

/* 币种单元格 */
[data-child-theme="binance"] .market-coin {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
[data-child-theme="binance"] .market-coin-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ri-tertiary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ri-primary);
  flex-shrink: 0;
  border: 1px solid var(--ri-border-color);
}
[data-child-theme="binance"] .market-coin-name {
  font-weight: 600;
  color: var(--ri-emphasis-color);
}
[data-child-theme="binance"] .market-coin-fullname {
  font-size: 0.75rem;
  color: var(--ri-tertiary-color);
  margin-top: 0.1rem;
}

[data-child-theme="binance"] .market-price {
  font-family: var(--ri-heading-font-family);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
[data-child-theme="binance"] .market-change {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.15rem 0.5rem;
  border-radius: var(--ri-border-radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.82rem;
}
[data-child-theme="binance"] .market-change.up {
  background: rgba(14, 203, 129, 0.12);
  color: var(--ri-success);
}
[data-child-theme="binance"] .market-change.down {
  background: rgba(246, 70, 93, 0.12);
  color: var(--ri-danger);
}
[data-child-theme="binance"] .market-change.neutral {
  background: var(--ri-tertiary-bg);
  color: var(--ri-secondary-color);
}

/* 迷你图表单元格 */
[data-child-theme="binance"] .market-sparkline {
  width: 110px;
  height: 36px;
  display: block;
}

/* 涨跌图标 */
[data-child-theme="binance"] .market-change::before {
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  font-size: 0.7rem;
}
[data-child-theme="binance"] .market-change.up::before {
  content: '\f062';
}
[data-child-theme="binance"] .market-change.down::before {
  content: '\f063';
}

/* 加载占位 */
[data-child-theme="binance"] .market-loading {
  padding: 2.5rem 0;
  text-align: center;
  color: var(--ri-tertiary-color);
  font-size: 0.88rem;
}
[data-child-theme="binance"] .market-loading i {
  margin-right: 0.4rem;
  color: var(--ri-primary);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 错误状态 */
[data-child-theme="binance"] .market-error {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ri-tertiary-color);
  font-size: 0.88rem;
}
[data-child-theme="binance"] .market-error i {
  color: var(--ri-danger);
  margin-right: 0.3rem;
}

/* --------------------------------------------------------------------------
   Hero 区主图风格（专业交易）
   -------------------------------------------------------------------------- */
[data-child-theme="binance"] .market-hero {
  position: relative;
  border-radius: var(--ri-border-radius-xxl);
  overflow: hidden;
  background: linear-gradient(135deg, #181A20 0%, #0B0E11 100%);
  padding: 2rem;
  margin-bottom: 1.5rem;
  color: #fff;
  border: 1px solid var(--ri-border-color);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
}
[data-child-theme="binance"] .market-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(252, 213, 53, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(14, 203, 129, 0.06) 0%, transparent 50%);
  pointer-events: none;
}
[data-child-theme="binance"] .market-hero > * {
  position: relative;
}

[data-child-theme="binance"] .market-hero-left h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  font-family: var(--ri-heading-font-family);
}
[data-child-theme="binance"] .market-hero-left p {
  color: var(--ri-secondary-color);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
[data-child-theme="binance"] .market-hero-features {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
}
[data-child-theme="binance"] .market-hero-features li {
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ri-secondary-color);
  font-size: 0.88rem;
}
[data-child-theme="binance"] .market-hero-features li i {
  color: var(--ri-primary);
  font-size: 0.85rem;
  width: 16px;
}

[data-child-theme="binance"] .market-hero-chart {
  background: rgba(11, 14, 17, 0.6);
  border-radius: var(--ri-border-radius-lg);
  padding: 1rem;
  border: 1px solid var(--ri-border-color);
}
[data-child-theme="binance"] .market-hero-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
[data-child-theme="binance"] .market-hero-chart-pair {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
[data-child-theme="binance"] .market-hero-chart-price {
  font-family: var(--ri-heading-font-family);
  font-size: 1.5rem;
  font-weight: 700;
}
[data-child-theme="binance"] .market-hero-chart-canvas {
  width: 100%;
  height: 200px;
  background: transparent;
}

@media (max-width: 991.98px) {
  [data-child-theme="binance"] .market-hero {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  [data-child-theme="binance"] .market-hero-left h2 {
    font-size: 1.4rem;
  }
}

@media (max-width: 575.98px) {
  [data-child-theme="binance"] .market-dashboard {
    padding: 1rem;
  }
  [data-child-theme="binance"] .market-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  [data-child-theme="binance"] .market-stat-item {
    padding: 0.65rem 0.85rem;
  }
  [data-child-theme="binance"] .market-stat-value {
    font-size: 1rem;
  }
  [data-child-theme="binance"] .market-table {
    font-size: 0.78rem;
  }
  [data-child-theme="binance"] .market-table thead th,
  [data-child-theme="binance"] .market-table tbody td {
    padding: 0.65rem 0.5rem;
  }
  [data-child-theme="binance"] .market-sparkline {
    width: 70px;
    height: 30px;
  }
}

/* --------------------------------------------------------------------------
   主数据卡升级版（替代 home-overview 卡片）
   -------------------------------------------------------------------------- */
[data-child-theme="binance"] .stat-card-upgrade {
  background: var(--ri-secondary-bg);
  border: 1px solid var(--ri-border-color);
  border-radius: var(--ri-border-radius-lg);
  padding: 1.1rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}
[data-child-theme="binance"] .stat-card-upgrade::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ri-gold-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
[data-child-theme="binance"] .stat-card-upgrade:hover {
  border-color: var(--ri-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
[data-child-theme="binance"] .stat-card-upgrade:hover::before {
  transform: scaleX(1);
}
[data-child-theme="binance"] .stat-card-upgrade .stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--ri-border-radius);
  background: var(--ri-primary-soft);
  color: var(--ri-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}
[data-child-theme="binance"] .stat-card-upgrade .stat-label {
  font-size: 0.78rem;
  color: var(--ri-tertiary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
[data-child-theme="binance"] .stat-card-upgrade .stat-num {
  font-family: var(--ri-heading-font-family);
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--ri-gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  line-height: 1.1;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}
[data-child-theme="binance"] .stat-card-upgrade .stat-num-suffix {
  font-size: 0.85rem;
  color: var(--ri-tertiary-color);
  margin-left: 0.25rem;
  -webkit-text-fill-color: var(--ri-tertiary-color);
}