/* ============================================
   components.css — All UI Components
   卡丁车赛事资讯平台 - Header, Hero, Cards, Modals, Footer, Toast
   包含 Hero AI Chat (合并自 hero-ai.css)
   ============================================ */

/* ===== HEADER - 玻璃态导航 (升级版) ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10,10,10,0.82);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
  transition: background 0.3s ease;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--racing-red) 20%, var(--flame-orange) 50%, var(--racing-red) 80%, transparent 100%);
  animation: flagWave 3s ease-in-out infinite;
}

/* 光带动画装饰 */
.header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: btnShine 4s ease-in-out infinite;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-red-glow);
  position: relative;
  overflow: hidden;
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
  animation: logoShine 3s ease-in-out infinite;
}

.logo-text {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--text-white) 0%, var(--racing-red-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--card-dark);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-gray);
  letter-spacing: 1px;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 14px;
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-link:hover {
  color: var(--text-white);
  background: rgba(232,0,45,0.1);
}

.nav-link.active {
  color: var(--text-white);
  background: linear-gradient(135deg, rgba(232,0,45,0.2), rgba(155,0,30,0.2));
  border: 1px solid rgba(232,0,45,0.3);
}

/* Admin Button - 渐变红 */
.admin-btn {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim)) !important;
  color: var(--text-white) !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: var(--shadow-red-glow);
  position: relative;
  overflow: hidden;
}

.admin-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.admin-btn:hover::before {
  left: 100%;
}

.admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(232,0,45,0.5);
}

/* ===== HERO SECTION - A1全屏视频风格 (升级版) ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 120px 24px 80px;
  /* 升级: 更丰富的背景渐变 */
  background:
    radial-gradient(ellipse at 20% 50%, rgba(232,0,45,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(255,107,0,0.05) 0%, transparent 50%),
    var(--asphalt-black);
}

/* Hero Background */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4) contrast(1.1);
}

/* Gradient Overlay */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at center, transparent 0%, var(--asphalt-black) 70%),
    linear-gradient(180deg, rgba(10,10,10,0.8) 0%, rgba(10,10,10,0.3) 50%, var(--asphalt-black) 100%);
}

/* Speed Lines Animation */
.speed-lines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.speed-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--racing-red-light), transparent);
  opacity: 0.3;
  animation: speedLine 2s linear infinite;
}

.speed-line:nth-child(1) { top: 20%; width: 200px; animation-delay: 0s; }
.speed-line:nth-child(2) { top: 35%; width: 150px; animation-delay: 0.3s; }
.speed-line:nth-child(3) { top: 50%; width: 180px; animation-delay: 0.6s; }
.speed-line:nth-child(4) { top: 65%; width: 120px; animation-delay: 0.9s; }
.speed-line:nth-child(5) { top: 80%; width: 160px; animation-delay: 1.2s; }

/* Top Racing Stripes */
.racing-stripe-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--racing-red) 0px,
    var(--racing-red) 40px,
    var(--text-white) 40px,
    var(--text-white) 80px
  );
}

/* Bottom Racing Stripes */
.racing-stripe-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--text-white) 0px,
    var(--text-white) 40px,
    var(--racing-red) 40px,
    var(--racing-red) 80px
  );
}

/* Hero Content */
.hero-inner {
  position: relative;
  z-index: 10;
  max-width: 900px;
  text-align: center;
}

/* Title (升级版) */
.hero-title {
  font-size: var(--text-hero);
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1.1;
  margin-bottom: 20px;

  /* 升级: 更丰富的渐变 */
  background: linear-gradient(135deg, var(--text-white) 0%, var(--racing-red-light) 40%, var(--flame-orange) 70%, var(--gold-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  /* 升级: 更强烈的光晕效果 */
  filter: drop-shadow(0 0 30px rgba(232,0,45,0.4)) drop-shadow(0 0 60px rgba(232,0,45,0.2));
  animation: titleGlow 3s ease-in-out infinite alternate;
  position: relative;
}

/* 标题下方装饰线 */
.hero-title::after {
  content: '';
  display: block;
  width: 120px;
  height: 3px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, transparent, var(--racing-red), var(--flame-orange), var(--racing-red), transparent);
  border-radius: 2px;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 40px;
  letter-spacing: 2px;
  font-weight: 500;
}

/* Racing Flag Decorations */
.flag-decor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.flag-icon {
  font-size: 24px;
}

.flag-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--racing-red), transparent);
}

/* Search Bar - 赛车风格 */
.search-bar {
  display: flex;
  align-items: center;
  background: rgba(18,18,18,0.9);
  border: 2px solid var(--border-gray);
  border-radius: 50px;
  padding: 0 8px 0 24px;
  height: 56px;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.search-bar:focus-within {
  border-color: var(--racing-red);
  box-shadow: 0 0 0 4px rgba(232,0,45,0.15), var(--shadow-red-glow);
}

.search-icon {
  font-size: 18px;
  color: var(--racing-red);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-white);
  font-size: 16px;
  font-weight: 500;
}

.search-bar input::placeholder {
  color: var(--text-dim);
}

.search-btn {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  border: none;
  color: var(--text-white);
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  letter-spacing: 1px;
}

.search-btn:hover {
  background: linear-gradient(135deg, var(--racing-red-light), var(--racing-red));
  transform: scale(1.02);
}

.search-clear {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 8px;
  transition: var(--transition-fast);
}

.search-clear:hover {
  color: var(--racing-red);
}

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 50px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 900;
  color: var(--text-white);
  background: linear-gradient(135deg, var(--text-white), var(--racing-red-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-top: 4px;
  text-transform: uppercase;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 2px;
  animation: bounce 2s ease-in-out infinite;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--racing-red);
  border-bottom: 2px solid var(--racing-red);
  transform: rotate(45deg);
}

/* ══════════════════════════════════════════════════════════════
   Hero AI Chat (合并自 hero-ai.css)
   ══════════════════════════════════════════════════════════════ */

/* AI 对话容器 */
.hero-ai-chat {
  width: 100%;
  max-width: 700px;
  background: rgba(26, 26, 46, 0.95);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 标题 */
.hero-ai-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
  text-align: center;
}

/* 消息区域 */
.hero-ai-messages {
  height: 280px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(45, 45, 68, 0.5);
  border-radius: 12px;
  margin-bottom: 16px;
}

/* 欢迎语 */
.hero-ai-welcome {
  color: #aaa;
  font-size: 14px;
  line-height: 1.8;
}

/* 单条消息 */
.hero-ai-msg {
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
}

.hero-ai-msg.user {
  flex-direction: row-reverse;
}

.hero-ai-msg .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.hero-ai-msg.user .avatar {
  background: #E8002D;
}

.hero-ai-msg.assistant .avatar {
  background: #667eea;
}

.hero-ai-msg .content {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.hero-ai-msg.user .content {
  background: #E8002D;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.hero-ai-msg.assistant .content {
  background: #2d2d44;
  color: #e0e0e0;
  border-bottom-left-radius: 4px;
}

/* 加载动画 */
.hero-ai-loading {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.hero-ai-loading .dot {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: heroBounce 1.4s infinite ease-in-out both;
}

.hero-ai-loading .dot:nth-child(1) { animation-delay: -0.32s; }
.hero-ai-loading .dot:nth-child(2) { animation-delay: -0.16s; }

/* 输入区域 */
.hero-ai-input-row {
  display: flex;
  gap: 10px;
}

.hero-ai-input-row input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  background: rgba(45, 45, 68, 0.8);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.hero-ai-input-row input:focus {
  border-color: #667eea;
}

.hero-ai-input-row input::placeholder {
  color: #666;
}

.hero-ai-send {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.hero-ai-send:hover:not(:disabled) {
  transform: scale(1.1);
}

.hero-ai-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* AI Chat scrollbar */
.hero-ai-messages::-webkit-scrollbar {
  width: 6px;
}

.hero-ai-messages::-webkit-scrollbar-track {
  background: transparent;
}

.hero-ai-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* ===== CATEGORY TABS ===== */
.category-tabs {
  background: var(--carbon-dark);
  border-bottom: 1px solid var(--border-gray);
  position: sticky;
  top: 70px;
  z-index: 99;
}

.category-tabs-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.category-tabs-inner::-webkit-scrollbar { height: 0; }

.category-tab {
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
  white-space: nowrap;
}

.category-tab:hover {
  border-color: var(--racing-red-dim);
  color: var(--text-light);
  background: rgba(232,0,45,0.1);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  border-color: var(--racing-red);
  color: var(--text-white);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(232,0,45,0.3);
}

/* ===== FILTER BAR - 城市筛选 ===== */
.filter-bar {
  background: var(--carbon-dark);
  border-bottom: 1px solid var(--border-gray);
  position: sticky;
  top: 70px;
  z-index: 100;
  overflow-x: auto;
}

.filter-bar::-webkit-scrollbar { height: 0; }

.filter-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.filter-btn {
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.filter-btn:hover {
  border-color: var(--racing-red-dim);
  color: var(--text-light);
  background: rgba(232,0,45,0.1);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  border-color: var(--racing-red);
  color: var(--text-white);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(232,0,45,0.3);
}

/* ===== STATS BAR ===== */
.stats-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stats-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.stats-divider {
  color: var(--border-gray);
}

.stats-tag {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stats-tag.upcoming {
  background: rgba(255,179,0,0.15);
  color: var(--status-gold);
  border: 1px solid rgba(255,179,0,0.3);
}

.stats-tag.open {
  background: rgba(0,200,83,0.12);
  color: var(--status-green);
  border: 1px solid rgba(0,200,83,0.25);
}

.stats-tag.ended {
  background: rgba(85,85,85,0.15);
  color: var(--text-dim);
  border: 1px solid var(--border-gray);
}

/* ===== HOT RACES SECTION ===== */
.hot-races-section {
  background: linear-gradient(135deg, rgba(232,0,45,0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-gray);
  padding: 20px 0;
}

.hot-races-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.hot-races-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.hot-badge {
  background: linear-gradient(135deg, var(--racing-red), var(--flame-orange));
  color: var(--text-white);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hot-count {
  font-size: 12px;
  color: var(--text-muted);
}

.hot-races-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.hot-races-scroll::-webkit-scrollbar { height: 4px; }

.hot-race-card {
  flex-shrink: 0;
  width: 220px;
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.hot-race-card:hover {
  border-color: var(--racing-red);
  transform: translateY(-4px);
  box-shadow: var(--shadow-red-glow);
}

.hot-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}

.hot-card-city {
  font-size: 12px;
  color: var(--racing-red-light);
  font-weight: 700;
  margin-bottom: 6px;
}

.hot-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.3;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-card-countdown {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(232,0,45,0.1);
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-block;
}

.hot-card-countdown strong {
  color: var(--racing-red-light);
}

/* ===== MAIN / WATERFALL - A3杂志风 ===== */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.waterfall {
  columns: 4 260px;
  column-gap: 20px;
  padding-top: 24px;
}

/* ===== RACE CARD - 杂志风 ===== */
.race-card {
  break-inside: avoid;
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  animation: fadeUp 0.5s ease both;
  position: relative;
}

/* Checker flag corner decoration */
.race-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, transparent 50%, var(--racing-red) 50%);
  opacity: 0;
  transition: var(--transition-fast);
  z-index: 2;
}

.race-card:hover {
  background: var(--card-hover);
  border-color: var(--racing-red-dim);
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-card-hover);
}

.race-card:hover::before {
  opacity: 1;
}

/* Card Cover */
.card-cover {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: linear-gradient(135deg, #1a0008 0%, var(--asphalt-black) 100%);
}

.card-cover-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1a0008 0%, #0e0e0e 50%, #140a00 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

/* Racing texture overlay */
.card-cover-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(232,0,45,0.03) 10px,
      rgba(232,0,45,0.03) 20px
    );
}

.cover-icon {
  font-size: 48px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.cover-city-big {
  font-size: 14px;
  font-weight: 800;
  color: rgba(255,255,255,0.25);
  letter-spacing: 4px;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
}

/* Status Badge */
.card-status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  z-index: 5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-open {
  background: linear-gradient(135deg, var(--status-green), #00a854);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(0,200,83,0.4);
}

.badge-upcoming {
  background: linear-gradient(135deg, var(--status-gold), #ff8c00);
  color: var(--asphalt-black);
  box-shadow: 0 4px 12px rgba(255,179,0,0.4);
}

.badge-ended {
  background: rgba(60,60,60,0.9);
  color: var(--text-dim);
}

/* Card Body - 杂志风 */
.card-body {
  padding: 18px 18px 16px;
  position: relative;
}

/* Red accent line */
.card-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, var(--racing-red), transparent);
  opacity: 0;
  transition: var(--transition-fast);
}

.race-card:hover .card-body::before {
  opacity: 1;
}

.card-city-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.card-city {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: var(--text-white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.card-category {
  background: var(--carbon-dark);
  color: var(--text-muted);
  border: 1px solid var(--border-gray);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.card-venue {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-venue::before {
  content: '📍';
  font-size: 12px;
}

/* Card Countdown */
.card-countdown {
  background: rgba(232,0,45,0.1);
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: inline-block;
}

.card-countdown strong {
  color: var(--racing-red-light);
  font-weight: 700;
}

.card-countdown.urgent {
  background: linear-gradient(135deg, rgba(232,0,45,0.2), rgba(255,107,0,0.2));
  color: var(--flame-orange);
}

.card-countdown.urgent strong {
  color: var(--flame-orange);
}

/* Hot Flag */
.hot-flag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  animation: hotPulse 2s ease-in-out infinite;
}

.card-meta {
  border-top: 1px solid var(--border-gray);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.card-meta-icon {
  font-size: 14px;
  flex-shrink: 0;
  color: var(--racing-red);
}

.card-fee {
  font-size: 20px;
  font-weight: 900;
  color: var(--racing-red-light);
}

.card-fee-free {
  color: var(--status-green);
}

/* Source Tags */
.card-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  margin-top: 12px;
  font-weight: 600;
}

.source-weixin {
  background: rgba(7,193,96,0.12);
  color: #07c160;
  border: 1px solid rgba(7,193,96,0.2);
}

.source-xiaohongshu {
  background: rgba(255,69,80,0.12);
  color: #ff4550;
  border: 1px solid rgba(255,69,80,0.2);
}

.source-weibo {
  background: rgba(230,22,45,0.12);
  color: #e6162d;
  border: 1px solid rgba(230,22,45,0.2);
}

.source-official {
  background: rgba(100,149,237,0.12);
  color: #6495ed;
  border: 1px solid rgba(100,149,237,0.2);
}

.source-manual {
  background: rgba(136,136,136,0.12);
  color: #888;
  border: 1px solid rgba(136,136,136,0.2);
}

/* Card Actions */
.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.card-fav-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.card-fav-btn:hover {
  background: rgba(232,0,45,0.15);
  border-color: var(--racing-red);
  color: var(--racing-red-light);
}

/* Card Learn More Button */
.card-learn-more {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: #fff;
  text-decoration: none;
  transition: var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(232,0,45,0.3);
}

.card-learn-more:hover {
  background: linear-gradient(135deg, var(--racing-red-light), var(--racing-red));
  box-shadow: 0 4px 10px rgba(232,0,45,0.4);
  transform: translateY(-1px);
}

.card-learn-more:active {
  transform: translateY(0);
}

/* Card Actions — override (expanded layout with border-top) */
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-gray);
}

/* Card Fav Button — override (larger icon-style) */
.card-fav-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 4px 8px;
}

.card-fav-btn:hover {
  transform: scale(1.2);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 100px 24px;
  color: var(--text-dim);
}

.empty-icon {
  font-size: 72px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.empty-state a {
  color: var(--racing-red-light);
  text-decoration: underline;
  font-weight: 600;
}

/* ===== MODAL - 详情弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

/* Modal top accent */
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--racing-red), var(--flame-orange), var(--racing-red));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--carbon-dark);
  border: 1px solid var(--border-gray);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  z-index: 10;
}

.modal-close:hover {
  background: var(--racing-red);
  color: var(--text-white);
  border-color: var(--racing-red);
}

.modal-header {
  padding: 32px 32px 24px;
  background: linear-gradient(160deg, rgba(232,0,45,0.08) 0%, var(--card-dark) 100%);
  border-bottom: 1px solid var(--border-gray);
}

.modal-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-city {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: var(--text-white);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.modal-status {
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.modal-status.open {
  background: rgba(0,200,83,0.15);
  color: var(--status-green);
}

.modal-status.upcoming {
  background: rgba(255,179,0,0.15);
  color: var(--status-gold);
}

.modal-status.ended {
  background: rgba(85,85,85,0.2);
  color: var(--text-dim);
}

.modal-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 10px;
  line-height: 1.3;
  letter-spacing: 0.5px;
}

.modal-venue {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-venue::before {
  content: '📍';
}

.modal-body {
  padding: 24px 32px;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-info-item.full {
  grid-column: 1 / -1;
}

.minfo-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.minfo-val {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.5;
}

.minfo-val.fee {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--racing-red-light), var(--flame-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Modal Countdown */
.modal-countdown {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(232,0,45,0.15), rgba(255,107,0,0.1));
  border: 1px solid rgba(232,0,45,0.3);
  border-radius: var(--radius-sm);
}

.countdown-label {
  font-size: 12px;
  color: var(--text-muted);
}

.countdown-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--racing-red-light);
}

.countdown-value strong {
  font-size: 24px;
}

/* Modal Fav Button */
.modal-fav-btn {
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-fav-btn:hover {
  border-color: var(--racing-red);
  color: var(--racing-red-light);
}

.modal-contact,
.modal-source {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 16px;
  background: var(--carbon-dark);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.modal-footer {
  padding: 20px 32px 32px;
  border-top: 1px solid var(--border-gray);
  display: flex;
  gap: 16px;
}

.modal-btn-share,
.modal-btn-reg {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  letter-spacing: 1px;
}

.modal-btn-share {
  background: var(--carbon-dark);
  color: var(--text-light);
  border: 1px solid var(--border-gray);
}

.modal-btn-share:hover {
  border-color: var(--racing-red-dim);
  background: rgba(232,0,45,0.1);
}

.modal-btn-reg {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: var(--text-white);
  box-shadow: var(--shadow-red-glow);
}

.modal-btn-reg:hover {
  background: linear-gradient(135deg, var(--racing-red-light), var(--racing-red));
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(232,0,45,0.5);
}

/* ===== POSTER MODAL ===== */
.poster-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.poster-overlay.open {
  display: flex;
}

.poster-modal {
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 700px;
  width: 100%;
  text-align: center;
  position: relative;
}

.poster-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--carbon-dark);
  border: 1px solid var(--border-gray);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-fast);
}

.poster-close:hover {
  background: var(--racing-red);
  color: var(--text-white);
}

.poster-modal h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-light);
}

.poster-preview {
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.poster-preview canvas {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

.poster-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ===== FAVORITES MODAL ===== */
.favorites-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.favorites-overlay.open {
  display: flex;
}

.favorites-modal {
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  margin: auto;
  position: relative;
}

.favorites-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--carbon-dark);
  border: 1px solid var(--border-gray);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-fast);
  z-index: 10;
}

.favorites-close:hover {
  background: var(--racing-red);
  color: var(--text-white);
}

.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border-gray);
}

.favorites-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
}

.favorites-count {
  background: rgba(232,0,45,0.15);
  color: var(--racing-red-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.favorites-list {
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.fav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--carbon-dark);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.fav-item:hover {
  border-color: var(--racing-red-dim);
  background: rgba(232,0,45,0.05);
}

.fav-item-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.fav-item-info {
  flex: 1;
  min-width: 0;
}

.fav-item-city {
  font-size: 11px;
  color: var(--racing-red-light);
  font-weight: 700;
  margin-bottom: 2px;
}

.fav-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-item-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.fav-item-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 8px;
  transition: var(--transition-fast);
}

.fav-item-remove:hover {
  color: var(--racing-red);
}

.favorites-empty {
  text-align: center;
  padding: 60px 24px;
  display: none;
}

.favorites-empty .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.favorites-empty p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.favorites-empty small {
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: var(--text-white);
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-red-glow);
  transition: var(--transition-fast);
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  background: linear-gradient(135deg, var(--racing-red-light), var(--racing-red));
  transform: translateY(-4px) scale(1.05);
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-gray);
  background: var(--carbon-dark);
}

.footer p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-dark);
  border: 1px solid var(--racing-red);
  color: var(--text-light);
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 14px;
  z-index: 3000;
  box-shadow: var(--shadow-red-glow);
  animation: toastIn 0.3s ease;
  display: none;
}

.toast.show {
  display: block;
}
