/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --border: #e1e8ed;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --accent: #3b82f6;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;
  --yellow: #fbbf24;
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
}

.app {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
}

/* 头部 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 4px;
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btc-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-primary);
  border-radius: 4px;
  font-size: 13px;
}

.btc-label {
  font-weight: 700;
  color: var(--text-primary);
}

.btc-direction {
  font-weight: 600;
}

.btc-direction.bullish { color: var(--green); }
.btc-direction.bearish { color: var(--red); }
.btc-direction.neutral { color: var(--text-secondary); }

.update-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-refresh:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-refresh:active {
  transform: translateY(0);
}

/* 统计栏 */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-item {
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

/* 导航标签 */
.nav-tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.tab:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.tab-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
}

.tab-link:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* 视图标题 */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.view-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.view-count {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 卡片容器 */
.cards-container {
  position: relative;
  min-height: 400px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

/* 卡片样式 */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* 卡片顶部色条 */
.card-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}

.card-accent.bullish {
  background: linear-gradient(90deg, var(--green), #34d399);
}

.card-accent.bearish {
  background: linear-gradient(90deg, var(--red), #f87171);
}

/* 卡片头部 */
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-symbol {
  display: flex;
  align-items: center;
  gap: 8px;
}

.symbol-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.liquidity-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.liquidity-badge.high { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.liquidity-badge.medium { background: rgba(245, 158, 11, 0.1); color: var(--orange); }
.liquidity-badge.low { background: rgba(239, 68, 68, 0.1); color: var(--red); }

.card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.strict { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.status-badge.first { background: rgba(59, 130, 246, 0.1); color: var(--blue); }
.status-badge.early { background: rgba(245, 158, 11, 0.1); color: var(--orange); }
.status-badge.watch { background: rgba(139, 92, 246, 0.1); color: var(--purple); }

.risk-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.risk-badge.warning { background: rgba(239, 68, 68, 0.1); color: var(--red); }
.risk-badge.hot { background: rgba(245, 158, 11, 0.1); color: var(--orange); }

/* 价格区域 */
.card-price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.price-main {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'SF Mono', Consolas, monospace;
}

.price-change {
  font-size: 18px;
  font-weight: 700;
}

.price-change.positive { color: var(--green); }
.price-change.negative { color: var(--red); }

/* 卡片主体 */
.card-body {
  padding: 20px;
}

/* 分数圆环 */
.scores-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 20px;
}

.score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.circle-svg {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.circle-progress {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.circle-progress.opportunity { stroke: var(--green); }
.circle-progress.risk { stroke: var(--red); }

.circle-text {
  position: absolute;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.score-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* 价格对比 */
.price-compare {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: 8px;
  margin-bottom: 16px;
}

.price-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-item-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.price-item-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'SF Mono', Consolas, monospace;
}

/* 指标行 */
.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.metric-item {
  padding: 10px 12px;
  background: var(--bg-primary);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 14px;
  font-weight: 700;
}

.metric-value.bullish { color: var(--green); }
.metric-value.bearish { color: var(--red); }
.metric-value.buy { 
  background: var(--green);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.metric-value.sell { 
  background: var(--red);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

/* 触发理由 */
.reasons-section {
  margin-bottom: 16px;
}

.reasons-title {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

.reasons-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reason-tag {
  padding: 4px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* 外部链接 */
.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.external-link {
  padding: 6px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
}

.external-link:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* 卡片底部操作 */
.card-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-action:hover {
  background: var(--bg-primary);
  border-color: var(--accent);
  color: var(--accent);
}

/* 加载状态 */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

.loading p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* 空状态 */
.empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
}

/* 资金工具表格 */
.funding-tables {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  grid-column: 1 / -1;
}

.funding-table-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.funding-table-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.funding-table-header.positive {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.02) 100%);
}

.funding-table-header.negative {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.funding-icon {
  font-size: 24px;
}

.funding-table-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.funding-table-header p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.funding-table {
  width: 100%;
  border-collapse: collapse;
}

.funding-table thead {
  background: var(--bg-primary);
}

.funding-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.funding-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.funding-table tbody tr:last-child td {
  border-bottom: none;
}

.funding-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

.funding-table tbody tr:hover {
  background: var(--bg-primary);
}

.rank {
  font-weight: 600;
  color: var(--text-secondary);
}

.symbol-name {
  font-weight: 600;
  color: var(--text-primary);
}

.funding-positive {
  color: var(--red);
  font-weight: 700;
  font-family: 'SF Mono', Consolas, monospace;
}

.funding-negative {
  color: var(--green);
  font-weight: 700;
  font-family: 'SF Mono', Consolas, monospace;
}

/* 响应式 */
@media (max-width: 768px) {
  .app {
    padding: 12px;
  }
  
  .header {
    flex-direction: column;
    gap: 12px;
  }
  
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-tabs {
    overflow-x: auto;
  }
  
  /* 资金工具移动端 */
  .funding-tables {
    grid-template-columns: 1fr;
  }
  
  .funding-table th,
  .funding-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .funding-table-header {
    padding: 16px;
  }
}

/* Hyperliquid 大单表格 */
.orders-table-wrapper {
  grid-column: 1 / -1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table thead {
  background: var(--bg-primary);
}

.orders-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

.orders-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.orders-table tbody tr:last-child td {
  border-bottom: none;
}

.orders-table tbody tr:hover {
  background: var(--bg-primary);
}

.order-time {
  color: var(--text-secondary);
  font-size: 13px;
}

.order-amount {
  font-weight: 700;
  font-family: 'SF Mono', Consolas, monospace;
  color: var(--text-primary);
}

.direction-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.direction-badge.long {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.direction-badge.short {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

/* 清算地图 */
.liquidation-map-wrapper {
  grid-column: 1 / -1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.map-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.map-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.liquidation-iframe {
  width: 100%;
  height: 800px;
  border: none;
  display: block;
}

.map-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  text-align: center;
}

.map-footer .external-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.map-footer .external-link:hover {
  opacity: 0.7;
}

.info-message {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==================== Bxinhao 信号横条纹样式 ==================== */
.signals-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.signal-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  border-left: 5px solid;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.signal-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.signal-row.bullish {
  border-left-color: #10b981;
}

.signal-row.bearish {
  border-left-color: #ef4444;
}

.signal-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.signal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.signal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.signal-symbol {
  font-size: 20px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0.5px;
}

.signal-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  display: inline-block;
}

.signal-badge.bullish {
  background: #10b981;
  color: #ffffff;
}

.signal-badge.bearish {
  background: #ef4444;
  color: #ffffff;
}

.signal-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}

.signal-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.signal-label {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.signal-value {
  font-size: 15px;
  font-weight: 600;
  color: #000000;
}

.signal-current {
  color: #fbbf24;
  font-weight: 700;
}

.signal-change {
  font-size: 16px;
  font-weight: 700;
}

.signal-change.positive {
  color: #10b981;
}

.signal-change.negative {
  color: #ef4444;
}

/* 响应式布局 */
@media (max-width: 1400px) {
  .signals-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .signals-list {
    grid-template-columns: 1fr;
  }
  
  .signal-details {
    grid-template-columns: 1fr;
  }
}
