/* 骑遇 PedalAI — Redesigned Design System */
:root {
  --brand-red: #f33622;
  --brand-orange: #f28b0b;
  --brand-gradient: linear-gradient(135deg, #f33622, #f28b0b);
  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F5F5F5;
  --text: #1A1A1A;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #E8E8E8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(243,54,34,0.12);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'PingFang SC', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-red); text-decoration: none; }
a:hover { opacity: 0.8; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--brand-gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(243,54,34,0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(243,54,34,0.35);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--brand-red);
  color: var(--brand-red);
}
.btn-sm { padding: 8px 20px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }

/* Landing Page */
.landing {
  min-height: 100vh;
}
.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}
.brand-mark {
  width: 32px; height: 32px;
  background: var(--brand-gradient);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; font-weight: 800;
}

/* Hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero h1 .highlight {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 480px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.hero-visual {
  position: relative;
}
.hero-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(243,54,34,0.08);
}
.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.hero-card-header span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hero-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.hero-stat {
  background: #FAFAFA;
  padding: 14px;
  border-radius: 12px;
  text-align: center;
}
.hero-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.hero-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.hero-zone-bar {
  height: 20px;
  border-radius: 10px;
  display: flex;
  overflow: hidden;
  margin: 12px 0;
}
.hero-zone {
  height: 100%;
  transition: var(--transition);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 50px;
  background: rgba(243,54,34,0.06);
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(243,54,34,0.1);
}
.hero-device-bar {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.hero-device {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: #F5F5F5;
  border-radius: 6px;
}

/* Sections */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 40px;
}
.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.section-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.feature-icon {
  width: 48px; height: 48px;
  background: rgba(243,54,34,0.06);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 60px;
  padding: 40px;
  background: var(--brand-gradient);
  border-radius: var(--radius);
  margin: 0 auto;
  max-width: 900px;
}
.stats-bar-item {
  text-align: center;
  color: white;
}
.stats-bar-value {
  font-size: 32px;
  font-weight: 800;
}
.stats-bar-label {
  font-size: 14px;
  opacity: 0.8;
  margin-top: 4px;
}

/* How it works */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  counter-reset: step;
}
.step-card {
  text-align: center;
  padding: 32px;
}
.step-number {
  width: 48px; height: 48px;
  background: var(--brand-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 800;
  margin: 0 auto 16px;
}
.step-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.footer a {
  color: var(--text-secondary);
}
.footer a:hover {
  color: var(--brand-red);
}

/* Dashboard sidebar */
.sidebar {
  width: 240px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; height: 100vh;
  z-index: 100;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.sidebar-logo .brand-mark { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-logo h1 { font-size: 16px; font-weight: 700; }
.sidebar-logo span { font-size: 11px; color: var(--text-muted); }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-card-hover); color: var(--text); }
.nav-item.active { background: rgba(243,54,34,0.06); color: var(--brand-red); font-weight: 600; }
.nav-item .icon { width: 20px; height: 20px; flex-shrink: 0; font-size: 16px; }
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Main content area */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px 40px;
  max-width: 1200px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.page-header h2 { font-size: 24px; font-weight: 700; }
.page-header p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* Cards */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; }
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { text-align: center; padding: 20px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
}
.tag-red { background: rgba(243,54,34,0.08); color: var(--brand-red); }
.tag-orange { background: rgba(242,139,11,0.08); color: var(--brand-orange); }

/* Activity list */
.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.activity-item:hover { border-color: rgba(243,54,34,0.2); box-shadow: var(--shadow); }
.activity-info { flex: 1; }
.activity-name { font-size: 15px; font-weight: 600; }
.activity-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.activity-stats { display: flex; gap: 16px; }
.activity-stat { text-align: center; }
.activity-stat-value { font-size: 14px; font-weight: 600; }
.activity-stat-label { font-size: 11px; color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--brand-red); box-shadow: 0 0 0 3px rgba(243,54,34,0.08); }

/* Auth page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #FAFAFA;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h1 { font-size: 22px; font-weight: 700; }
.auth-header p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0; color: var(--text-muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-secondary); }

/* Connected badge */
.connected-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 10px; font-size: 11px;
}
.connected-badge.ok { background: rgba(34,197,94,0.08); color: #16A34A; }
.connected-badge.no { background: rgba(239,68,68,0.08); color: #DC2626; }

/* Toggle */
.toggle {
  position: relative;
  width: 44px; height: 24px;
  background: #ddd;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.toggle.active { background: var(--brand-red); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle.active::after { left: 22px; }

/* Metric chip */
.metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #F5F5F5;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.metric strong { color: var(--text); }

/* Bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 16px 0; }
.bar {
  flex: 1;
  background: var(--brand-gradient);
  border-radius: 4px 4px 0 0;
  min-height: 8px;
  transition: var(--transition);
  opacity: 0.7;
}
.bar:hover { opacity: 1; }
.bar-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* Zone bar */
.zone-bar { height: 24px; border-radius: 12px; display: flex; overflow: hidden; margin: 12px 0; }
.zone-segment { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: rgba(0,0,0,0.6); }
.zone-z1 { background: #3B82F6; }
.zone-z2 { background: #22C55E; }
.zone-z3 { background: #EAB308; }
.zone-z4 { background: #F97316; }
.zone-z5 { background: #EF4444; }

/* OAuth buttons */
.btn-strava { background: #FC4C02; color: white; width: 100%; justify-content: center; }
.btn-igpsport { background: #1E40AF; color: white; width: 100%; justify-content: center; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 20px; }
  .grid-2, .grid-3, .grid-4, .features-grid, .steps-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 40px 20px; gap: 32px; }
  .hero h1 { font-size: 36px; }
  .stats-bar { flex-direction: column; gap: 24px; padding: 24px; }
  .landing-header { padding: 16px 20px; }
  .section { padding: 48px 20px; }
}

/* User card */
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition);
}
.user-card:hover { background: var(--bg-card-hover); }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: white;
}
.user-info { flex: 1; }
.user-name { font-size: 14px; font-weight: 600; }
.user-email { font-size: 12px; color: var(--text-muted); }
