/* ===================================================
   RunningData Theme - Blue White Athletic Style
   =================================================== */

:root {
  /* Colors */
  --blue-50:  #e8f0fe;
  --blue-100: #c8d9fb;
  --blue-200: #a4c1f8;
  --blue-400: #5a9bf5;
  --blue-600: #1e88e5;
  --blue-700: #1565c0;
  --blue-800: #0d47a1;

  --bg-page:       #f0f4ff;
  --bg-card:       #ffffff;
  --bg-header:     #0d47a1;
  --bg-hero:       linear-gradient(135deg, #0d47a1 0%, #1e88e5 60%, #42a5f5 100%);
  --bg-stats:      #e8f0fe;
  --bg-section:    #ffffff;
  --bg-wave:       #f0f4ff;

  --text-primary:  #0d47a1;
  --text-body:    #333333;
  --text-muted:   #666666;
  --text-light:   #ffffff;

  --border:       #e3f2fd;
  --shadow-sm:    0 2px 8px rgba(13,71,161,0.08);
  --shadow-md:    0 4px 20px rgba(13,71,161,0.12);
  --shadow-lg:    0 8px 40px rgba(13,71,161,0.16);

  --radius-sm:    8px;
  --radius-md:    16px;
  --radius-lg:    24px;

  --font-body:    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Hero ── */
.hero {
  background: var(--bg-hero);
  position: relative;
  padding: 0;
  overflow: hidden;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

/* Site Nav */
.site-nav {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { opacity: 0.75; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: white; }

/* Hero Content */
.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.hero-content p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 32px;
}

.btn-primary {
  display: inline-block;
  background: white;
  color: var(--blue-700);
  padding: 14px 32px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Hero Visual - Track Animation */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 280px;
}

.running-illustration {
  position: relative;
  width: 280px;
  height: 280px;
}

.track-rings {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.25);
  animation: rotate-rings 20s linear infinite;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.ring-1 { width: 200px; height: 200px; }
.ring-2 { width: 240px; height: 240px; }
.ring-3 { width: 280px; height: 280px; animation-direction: reverse; animation-duration: 30s; }

@keyframes rotate-rings {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}

.runner-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #ffd54f;
  border-radius: 50%;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 20px 6px rgba(255,213,79,0.4);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 20px 6px rgba(255,213,79,0.4); }
  50%       { box-shadow: 0 0 30px 12px rgba(255,213,79,0.6); }
}

/* Wave Divider */
.hero-wave {
  position: relative;
  height: 80px;
  margin-top: -2px;
}
.hero-wave svg { display: block; width: 100%; height: 100%; }

/* ── Stats Section ── */
.section-stats {
  background: var(--bg-stats);
  padding: 48px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-icon { font-size: 2rem; margin-bottom: 8px; }
.stat-value {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--blue-700);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Section List ── */
.section-list {
  padding: 64px 0;
  background: var(--bg-section);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.list-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

#search-input {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 220px;
  background: var(--bg-page);
}
#search-input:focus { border-color: var(--blue-400); }

#filter-sort {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  background: var(--bg-page);
  cursor: pointer;
  color: var(--text-body);
}

/* ── Table ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.run-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  min-width: 900px;
}

.run-table thead th {
  background: var(--blue-700);
  color: white;
  padding: 14px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.run-table thead th:first-child { border-radius: var(--radius-md) 0 0 0; }
.run-table thead th:last-child  { border-radius: 0 var(--radius-md) 0 0; }

.run-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.run-table tbody tr:last-child { border-bottom: none; }
.run-table tbody tr:hover { background: var(--blue-50); }

.run-table td {
  padding: 14px 12px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-body);
}

.run-table td:nth-child(1) { font-weight: 600; color: var(--blue-700); }
.run-table td:nth-child(2) { font-weight: 700; color: var(--blue-600); }
.run-table td:nth-child(4) { color: #e65100; font-weight: 600; }

.weather-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
}
.weather-sunny  { background: #fff8e1; color: #f57f17; }
.weather-cloudy { background: #e3f2fd; color: #1565c0; }
.weather-rainy  { background: #e3f2fd; color: #0277bd; }
.weather-cold   { background: #e8f5e9; color: #2e7d32; }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}
.page-btn {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-body);
  transition: all 0.2s;
}
.page-btn:hover, .page-btn.active {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Charts ── */
.section-trends {
  padding: 64px 0;
  background: var(--bg-page);
}

.chart-range-btns {
  display: flex;
  gap: 8px;
}
.btn-range {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
.btn-range.active, .btn-range:hover {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.chart-canvas-wrap {
  height: 220px;
  position: relative;
}

/* ── Footer ── */
.site-footer {
  background: var(--blue-800);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 32px 0;
}
.site-footer p { font-size: 0.9rem; }
.footer-note { margin-top: 6px; font-size: 0.8rem !important; opacity: 0.6; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px 24px 60px;
  }
  .hero-content h1 { font-size: 2rem; }
  .site-nav { flex-direction: column; gap: 16px; }
  .nav-links { gap: 20px; }
  .hero-visual { height: 200px; }
  .running-illustration { width: 200px; height: 200px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-value { font-size: 1.8rem; }
}