/**
 * 主样式文件
 * 简洁现代的设计风格
 */

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

:root {
  /* 主色调 */
  --color-primary: #6366f1;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  
  /* 中性色 */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  
  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-gray-900);
  background: var(--color-gray-50);
  min-height: 100vh;
}

/* ========== Header ========== */
.site-header {
  background: white;
  border-bottom: 1px solid var(--color-gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.logo a {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.nav-sources {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}

.nav-sources::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-tab:hover {
  background: var(--color-gray-200);
}

.nav-tab.active {
  background: var(--color-primary);
  color: white;
}

/* ========== 容器 ========== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

/* ========== Hero Cards ========== */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

/* 确保Hero Cards不显示骨架屏样式 */
.hero-cards .skeleton-wrapper,
.hero-cards .skeleton-row,
.hero-cards .skeleton-cell {
  display: none !important;
}

.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: var(--spacing-lg) var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: center;
  min-height: 100px;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

/* 移除Hero卡片悬浮效果 */
/* .hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
} */

.hero-label {
  font-size: 13px;
  color: var(--color-gray-500);
  margin-bottom: var(--spacing-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-gray-900);
  line-height: 1.2;
}

.hero-value .formula {
  font-family: 'Courier New', monospace;
  color: var(--color-primary);
  font-weight: 700;
}

.hero-value.countdown {
  color: var(--color-success);
  font-family: 'Courier New', monospace;
  font-weight: 700;
}

.shape-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-top: 0;
}

/* ========== 徽章系统 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
  white-space: nowrap;
}

/* 移除徽章悬浮效果 */
/* .badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
} */

.badge-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
}

.badge-success {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: white;
}

.badge-danger {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: white;
}

.badge-info {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: white;
}

.badge-special {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
  color: white;
}

.badge-extreme {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
  color: white;
}

.badge-primary {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  color: white;
}

.badge-secondary {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  color: white;
}

/* ========== 子导航 ========== */
.sub-nav {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-md);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.sub-nav::-webkit-scrollbar {
  display: none;
}

.sub-nav-item {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--color-gray-50);
  color: var(--color-gray-700);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  border: 1px solid transparent;
}

/* 移除子导航悬浮效果 */
/* .sub-nav-item:hover {
  background: var(--color-gray-100);
  transform: translateY(-1px);
  border-color: var(--color-gray-200);
} */

.sub-nav-item.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, #5558e8 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ========== 表格 ========== */
.table-wrap {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 2px solid var(--color-gray-100);
  background: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);
}

.table-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-gray-900);
}

.update-time {
  font-size: 13px;
  color: var(--color-gray-500);
  font-weight: 500;
}

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

thead {
  background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
}

th {
  padding: 16px 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-gray-700);
  border-bottom: 2px solid var(--color-gray-200);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 期号列左对齐 */
th:first-child {
  text-align: left;
}

/* 开奖结果列居中 */
th:nth-child(2) {
  text-align: center;
  padding-left: 40px;
  padding-right: 40px;
}

/* 时间列右对齐 */
th:last-child {
  text-align: right;
}

td {
  padding: 20px;
  border-bottom: 1px solid var(--color-gray-100);
  font-size: 14px;
  text-align: center;
  vertical-align: middle;
}

/* 期号列左对齐 */
td:first-child {
  text-align: left;
}

/* 开奖结果列居中 */
td:nth-child(2) {
  text-align: center;
  padding-left: 40px;
  padding-right: 40px;
}

/* 时间列右对齐 */
td:last-child {
  text-align: right;
}

tbody tr {
  /* 移除过渡效果 */
}

/* 移除悬浮效果 */
/* tbody tr:hover {
  background: linear-gradient(to right, #f8fafc 0%, #ffffff 100%);
  box-shadow: inset 3px 0 0 var(--color-primary);
} */

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

/* 表格列样式 */
.col-period {
  font-weight: 700;
  color: var(--color-primary);
  font-family: 'Courier New', monospace;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.col-numbers {
  text-align: center !important;
  padding-left: 60px !important;
  padding-right: 60px !important;
}

/* 数字球容器 - 水平排列，居中 */
.numbers-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 0;
}

.number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, #5558e8 100%);
  color: white;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
  font-size: 15px;
}

.plus, .equal {
  color: var(--color-gray-400);
  font-weight: 700;
  font-size: 16px;
}

.total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
  color: white;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
  font-size: 16px;
}

.col-time {
  text-align: right;
  color: var(--color-gray-500);
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: 500;
}

/* 时间两行展示（时:分:秒 + 日期） */
.col-time .time-main {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-gray-700);
}

.col-time .time-sub {
  font-size: 12px;
  color: var(--color-gray-400);
}

/* ========== 历史查询表格专用样式 ========== */

/* 历史表格的列对齐 */
#historyTable th:nth-child(1),
#historyTable td:nth-child(1) {
  text-align: left;
  width: 15%;
}

#historyTable th:nth-child(2),
#historyTable th:nth-child(3),
#historyTable th:nth-child(4),
#historyTable td:nth-child(2),
#historyTable td:nth-child(3),
#historyTable td:nth-child(4) {
  text-align: center;
  width: 10%;
}

#historyTable th:nth-child(5),
#historyTable td:nth-child(5) {
  text-align: left;
  width: 35%;
  padding-left: 30px !important;
}

#historyTable th:nth-child(6),
#historyTable td:nth-child(6) {
  text-align: right;
  width: 20%;
}

/* 单个数字列样式 */
.col-num {
  font-weight: 700;
  color: var(--color-primary);
  font-family: 'Courier New', monospace;
  font-size: 18px;
}

/* 和值+形态列 */
.col-total {
  text-align: left !important;
}

/* 历史页面的小号和值球 */
.total-small {
  min-width: 40px;
  height: 28px;
  padding: 0 12px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
  color: white;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.25);
  margin-right: 10px;
}

/* 历史页面的水平排列徽章 */
.shape-badges-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
  height: auto;
  flex-wrap: wrap;
}

.shape-badges-inline .badge {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* 走势图表格的迷你徽章 */
.badge-mini {
  height: 24px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ========== 工具栏 ========== */
.toolbar {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  padding: var(--spacing-lg);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-lg);
}

.toolbar select,
.toolbar input,
.toolbar button {
  padding: 10px 16px;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.toolbar select:focus,
.toolbar input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.toolbar button {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  cursor: pointer;
  font-weight: 600;
}

.toolbar button:hover {
  background: #5558e8;
}

.toolbar button:disabled {
  background: var(--color-gray-300);
  border-color: var(--color-gray-300);
  cursor: not-allowed;
}

/* ========== 分页器 ========== */
#pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: var(--spacing-lg);
}

#pager button {
  padding: 8px 16px;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  background: white;
  color: var(--color-gray-700);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

#pager button:hover:not(:disabled) {
  background: var(--color-gray-50);
  border-color: var(--color-primary);
}

#pager button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pageInfo {
  font-size: 14px;
  color: var(--color-gray-600);
}

/* ========== Footer美化 ========== */
.site-footer {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  margin-top: 80px;
  padding: 48px 0 24px 0;
  border-top: 4px solid var(--color-primary);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 32px;
}

.footer-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: white;
  position: relative;
  padding-bottom: 12px;
}

.footer-section h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
}

.footer-section p {
  font-size: 14px;
  line-height: 1.8;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  margin-bottom: 10px;
}

.footer-section a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
  display: inline-block;
}

.footer-section a:hover {
  color: var(--color-primary);
  transform: translateX(5px);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

/* ========== 骨架屏 ========== */
/* 骨架屏tr样式 */
tr.skeleton-row {
  /* tr默认样式即可 */
}

tr.skeleton-row td {
  padding: 16px;
  border-bottom: 1px solid var(--color-gray-200);
}

.skeleton-cell {
  height: 20px;
  background: #e5e7eb;  /* 移除闪动，使用纯色 */
  border-radius: var(--radius-sm);
}

/* 移除闪动动画 */
/* @keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
} */

/* ========== 空状态 ========== */
.empty-state,
.error-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  color: var(--color-gray-500);
}

.empty-state svg,
.error-state svg {
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.btn-retry {
  margin-top: var(--spacing-md);
  padding: 10px 24px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-retry:hover {
  background: #5558e8;
  transform: translateY(-1px);
}

/* ========== 加载动画 ========== */
.loading-spinner {
  text-align: center;
  padding: var(--spacing-xl);
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--spacing-md);
  border: 4px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========== 响应式断点 ========== */
@media (max-width: 1024px) {
  .hero-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding: var(--spacing-md);
  }
  
  .hero-cards {
    gap: var(--spacing-sm);
  }
  
  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
  
  .toolbar {
    flex-direction: column;
  }
  
  .toolbar select,
  .toolbar input,
  .toolbar button {
    width: 100%;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-cards {
    grid-template-columns: 1fr;
  }
  
  .hero-value {
    font-size: 20px;
  }
}

