/* ============================================
   base.css — CSS Variables, Reset, Typography, Utilities, Animations
   卡丁车赛事资讯平台 - 基础样式与设计令牌 (v20260629v4 美化升级版)
   ============================================ */

/* ===== CSS VARIABLES - F1配色系统 (升级版) ===== */
:root {
  /* 核心赛车色 */
  --racing-red: #E8002D;
  --racing-red-light: #FF1A44;
  --racing-red-dim: #9B001E;
  --flame-orange: #FF6B00;
  --gold-accent: #FFD700;
  --neon-pink: #FF2D95;
  --neon-purple: #8B5CF6;
  --electric-blue: #3B82F6;

  /* 背景色 (更丰富的层次) */
  --asphalt-black: #0A0A0A;
  --carbon-dark: #0D0D0D;
  --card-dark: #121212;
  --card-hover: #1A1A1A;
  --surface-1: #16161E;
  --surface-2: #1E1E2E;
  --border-gray: #2A2A2A;
  --border-light: #3A3A3A;

  /* 文字色 */
  --text-white: #FFFFFF;
  --text-light: #F0F0F0;
  --text-muted: #888888;
  --text-dim: #555555;
  --text-heading: #E8E8E8;

  /* 状态色 */
  --status-green: #00C853;
  --status-green-dim: #00A844;
  --status-gold: #FFB300;
  --status-gold-dim: #E6A000;

  /* 渐变 */
  --gradient-red: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  --gradient-red-glow: linear-gradient(135deg, var(--racing-red-light), var(--racing-red));
  --gradient-gold: linear-gradient(135deg, var(--flame-orange), var(--gold-accent));
  --gradient-purple: linear-gradient(135deg, var(--neon-purple), #764ba2);
  --gradient-hero: linear-gradient(135deg, var(--text-white) 0%, var(--racing-red-light) 50%, var(--flame-orange) 100%);

  /* 圆角 (比例系统) */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* 阴影 (更丰富的层次) */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-card-hover: 0 12px 40px rgba(232,0,45,0.2);
  --shadow-red-glow: 0 8px 32px rgba(232,0,45,0.3);
  --shadow-red-glow-strong: 0 8px 32px rgba(232,0,45,0.5);
  --shadow-neon: 0 0 20px rgba(232,0,45,0.4), 0 0 40px rgba(232,0,45,0.2);
  --shadow-soft: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.2);

  /* 间距 (比例系统) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* 字体大小 (比例系统) */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-4xl: 48px;
  --text-hero: clamp(36px, 8vw, 72px);

  /* 动画 */
  --transition-fast: all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-smooth: all 0.35s cubic-bezier(0.4,0,0.2,1);
  --transition-bounce: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
  --transition-spring: all 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--asphalt-black);
  color: var(--text-light);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== SCROLLBAR - 赛车风格 (升级版) ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }

::-webkit-scrollbar-track {
  background: var(--carbon-dark);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--racing-red), var(--racing-red-dim));
  border-radius: 4px;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--racing-red-light), var(--racing-red));
  box-shadow: 0 0 8px rgba(232,0,45,0.4);
}

/* ===== UTILITY: CARBON FIBER PATTERN ===== */
.carbon-bg {
  background-image:
    linear-gradient(27deg, #151515 5px, transparent 5px),
    linear-gradient(207deg, #151515 5px, transparent 5px),
    linear-gradient(27deg, #1a1a1a 5px, transparent 5px),
    linear-gradient(207deg, #1a1a1a 5px, transparent 5px),
    linear-gradient(90deg, #1a1a1a 10px, transparent 10px),
    linear-gradient(#1a1a1a 25%, #141414 25%, #141414 50%, transparent 50%, transparent 75%, #111 75%);
  background-size: 20px 20px;
  background-color: var(--carbon-dark);
}

/* ===== UTILITY: CHECKERED FLAG PATTERN ===== */
.checkered-border {
  position: relative;
}

.checkered-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--text-white) 0px,
    var(--text-white) 16px,
    var(--asphalt-black) 16px,
    var(--asphalt-black) 32px
  );
}

/* ============================================
   @KEYFRAMES — All Animations
   卡丁车赛事资讯平台 - 升级版动画库
   ============================================ */

/* Logo shine sweep */
@keyframes logoShine {
  0%, 100% { transform: translateX(-100%) rotate(45deg); }
  50% { transform: translateX(100%) rotate(45deg); }
}

/* Hero speed lines */
@keyframes speedLine {
  0% { left: -200px; opacity: 0; }
  20% { opacity: 0.5; }
  80% { opacity: 0.5; }
  100% { left: 110%; opacity: 0; }
}

/* Hero title glow pulse (升级版) */
@keyframes titleGlow {
  0% { filter: drop-shadow(0 0 20px rgba(232,0,45,0.3)); }
  100% { filter: drop-shadow(0 0 40px rgba(232,0,45,0.6)); }
}

/* Scroll indicator bounce (升级版) */
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(12px); }
}

/* Card fade-up entrance (升级版) */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal pop-in (升级版) */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(40px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Toast slide-up (升级版) */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* Hot flag pulse (升级版) */
@keyframes hotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* AI chat loading dot bounce */
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== 新增动画 (v20260629v4) ===== */

/* Neon glow pulse for cards */
@keyframes neonPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(232,0,45,0.3), 0 0 20px rgba(232,0,45,0.1); }
  50% { box-shadow: 0 0 20px rgba(232,0,45,0.5), 0 0 40px rgba(232,0,45,0.2); }
}

/* Shimmer loading effect */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Rotate animation */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Racing flag wave */
@keyframes flagWave {
  0%, 100% { transform: skewY(0deg); }
  25% { transform: skewY(2deg); }
  75% { transform: skewY(-2deg); }
}

/* Button shine sweep */
@keyframes btnShine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Countdown urgent blink */
@keyframes urgentBlink {
  0%, 100% { background: rgba(232,0,45,0.1); }
  50% { background: rgba(232,0,45,0.25); }
}

/* Fade in + scale for modals */
@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Slide up for toasts/mobile panels */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

/* Float animation for decorative elements */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Pulse glow for CTA buttons */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,0,45,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(232,0,45,0); }
}

/*.Typewriter effect caret */
@keyframes caretBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
