* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  padding: 0;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: #0a0e17;
  color: #e5e7eb;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #111827;
}

::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* ==================== 容器 ==================== */
.container {
  max-width: 100%;
  padding-bottom: 20px;
}

/* ==================== 头部 ==================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #0a0e17;
  padding: 12px 16px;
  border-bottom: 1px solid #1f2937;
}

header h1 {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 12px;
}

/* ==================== Tab 导航 ==================== */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #374151;
  background-color: #111827;
  color: #9ca3af;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  border-color: #4b5563;
}

.tab.active {
  border-color: #3b82f6;
  background-color: #1e3a5f;
  color: #60a5fa;
}

/* ==================== 卡片网格 ==================== */
.grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ==================== 品种卡片 ==================== */
.futures-card {
  background-color: #111827;
  border-radius: 8px;
  padding: 14px;
  border: 1px solid #1f2937;
  transition: background-color 0.3s;
}

.futures-card:hover {
  background-color: #1a2332;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 4px;
}

.futures-name {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 2px;
}

.futures-code {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
}

.futures-tag {
  font-size: 10px;
  background-color: #1f2937;
  color: #9ca3af;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.card-body {
  width: 100%;
}

.price-display {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.price-display.up {
  color: #ef4444;
}

.price-display.down {
  color: #10b981;
}

.change-display {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.change-display.up {
  color: #ef4444;
}

.change-display.down {
  color: #10b981;
}

.detail-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #1f2937;
  font-size: 11px;
  color: #6b7280;
}

.detail-row span {
  font-variant-numeric: tabular-nums;
}

.detail-row span span {
  color: #9ca3af;
  margin-left: 4px;
}

/* ==================== 响应式布局 ==================== */
@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
    max-width: 1400px;
    margin: 0 auto;
  }
}
