:root {
  --bg-primary: #f5f7fa;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border-color: #e5e7eb;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #eff6ff;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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.6;
  padding: 24px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.header {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.controls label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.days-input {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  width: 80px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.days-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.load-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.load-btn:hover {
  background: var(--accent-hover);
}

.load-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-value#genTime {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-primary);
}

td {
  color: var(--text-primary);
  font-size: 14px;
}

tr:hover {
  background: var(--bg-primary);
}

tr:last-child td {
  border-bottom: none;
}

.page-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  margin: 2px;
}

.date-group {
  margin-bottom: 24px;
}

.date-group:last-child {
  margin-bottom: 0;
}

.date-header {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border-color);
}

.no-data {
  text-align: center;
  padding: 48px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.loading {
  text-align: center;
  padding: 64px;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .header {
    padding: 20px;
  }

  .header h1 {
    font-size: 20px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    padding: 16px;
  }

  table {
    font-size: 13px;
  }

  th, td {
    padding: 10px 12px;
  }
}
