:root {
  --bg-dark:#0b1220; --panel-dark:#0e1629; --border-dark:#1f2937; --text-dark:#e5e7eb;
  --bg-light:#f8fafc; --panel-light:#ffffff; --border-light:#e5e7eb; --text-light:#111827;
  --primary-color: #3b82f6; --primary-hover: #2563eb;
  --success-color: #22c55e; --danger-color: #ef4444;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: var(--transition);
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(6px);
  transition: var(--transition);
}

.spacer {
  flex: 1;
}

/* 改进的交易对选择器样式 */
.symbol-selector {
  display: flex;
  gap: 4px;
  background: var(--panel);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.symbol-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.symbol-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

.symbol-btn.active {
  background: var(--primary-color);
  color: white;
}

.symbol-btn.active:hover {
  background: var(--primary-hover);
}

/* 图标主题切换按钮样式 */
.theme-btn {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 18px;
}

.theme-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

#chart {
  height: calc(100vh - 60px);
  width: 100%;
  margin-bottom: 20px;
}

/* 等比两列表格样式 */
.market-info {
  padding: 0 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.two-column-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

.grid-column {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 300px;
  transition: var(--transition);
}

.tradingview-widget-container {
  width: 100%;
  height: 100%;
}

.tradingview-widget-container__widget {
  width: 100%;
  height: 100%;
}

/* Dark主题样式 */
.dark {
  --bg: var(--bg-dark); --panel: var(--panel-dark); --border: var(--border-dark); --text: var(--text-dark);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(59,130,246,.08), transparent),
    radial-gradient(800px 400px at 10% -20%, rgba(14,165,233,.08), transparent),
    var(--bg);
  color: var(--text);
}

.dark .top {
  background: linear-gradient(180deg, rgba(14,22,41,.88), rgba(14,22,41,.60));
  border-color: #1f2937;
}

/* Light主题样式 */
.light {
  --bg: var(--bg-light); --panel: var(--panel-light); --border: var(--border-light); --text: var(--text-light);
  background: var(--bg);
  color: var(--text);
}

.light .top {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.75));
  border-color: #e5e7eb;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .top {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
  }
  
  .symbol-selector {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  #chart {
    height: calc(100vh - 110px);
  }
  
  .two-column-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .market-info {
    padding: 0 16px 30px;
  }
  
  .grid-column {
    padding: 16px;
    min-height: 250px;
  }
}
