/* ============================================
   beautify.css — UI美化补丁样式
   卡丁车赛事资讯平台 - v20260629v4 大量美观优化
   请将此文件放在 /css/ 目录下
   ============================================ */

/* ============================================
   Hero 区域升级
   ============================================ */

/* Hero 底部渐变遮罩 (升级) */
.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.7) 0%, rgba(10,10,10,0.2) 40%, var(--asphalt-black) 100%);
  z-index: 2;
}

/* Speed Lines 升级 - 更流畅的动画 */
.speed-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--racing-red-light) 30%, var(--flame-orange) 50%, var(--racing-red-light) 70%, transparent);
  opacity: 0.4;
  animation: speedLine 2.5s linear infinite;
  box-shadow: 0 0 8px rgba(232,0,45,0.3);
}

.speed-line:nth-child(1) { top: 15%; width: 250px; animation-delay: 0s; height: 1px; }
.speed-line:nth-child(2) { top: 30%; width: 180px; animation-delay: 0.4s; }
.speed-line:nth-child(3) { top: 50%; width: 220px; animation-delay: 0.8s; height: 3px; }
.speed-line:nth-child(4) { top: 65%; width: 150px; animation-delay: 1.2s; }
.speed-line:nth-child(5) { top: 80%; width: 190px; animation-delay: 1.6s; height: 1px; }

/* Hero AI Chat 升级 */
.hero-ai-chat {
  width: 100%;
  max-width: 720px;
  background: rgba(22, 22, 46, 0.92);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.08),
    var(--shadow-neon);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

/* AI Chat 顶部光效装饰 */
.hero-ai-chat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--racing-red), var(--neon-purple), var(--racing-red));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

/* AI Chat 标题升级 */
.hero-ai-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hero-ai-title::before {
  content: '🤖';
  font-size: 24px;
  animation: float 3s ease-in-out infinite;
}

/* AI 消息区域升级 */
.hero-ai-messages {
  height: 300px;
  overflow-y: auto;
  padding: 18px;
  background: rgba(30, 30, 50, 0.6);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,0.05);
  scroll-behavior: smooth;
}

/* 消息气泡升级 */
.hero-ai-msg {
  margin-bottom: 14px;
  display: flex;
  gap: 12px;
  animation: fadeUp 0.3s ease both;
}

.hero-ai-msg .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-ai-msg.user .avatar {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
}

.hero-ai-msg.assistant .avatar {
  background: linear-gradient(135deg, var(--neon-purple), #764ba2);
}

.hero-ai-msg .content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero-ai-msg.user .content {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.hero-ai-msg.assistant .content {
  background: rgba(45, 45, 68, 0.9);
  color: #e0e0e0;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}

/* 打字动画升级 */
.hero-ai-loading {
  display: flex;
  gap: 6px;
  padding: 10px 0;
  align-items: center;
}

.hero-ai-loading .dot {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, var(--neon-purple), #764ba2);
  border-radius: 50%;
  animation: dotBounce 1.4s infinite ease-in-out both;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

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

.hero-ai-input-row input {
  flex: 1;
  padding: 16px 20px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 30px;
  background: rgba(30, 30, 50, 0.8);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.hero-ai-input-row input:focus {
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15), inset 0 2px 4px rgba(0,0,0,0.2);
}

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

.hero-ai-send {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-purple), #764ba2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(139,92,246,0.3);
  position: relative;
  overflow: hidden;
}

.hero-ai-send::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 ease;
}

.hero-ai-send:hover:not(:disabled) {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 24px rgba(139,92,246,0.5);
}

.hero-ai-send:hover:not(:disabled)::before {
  left: 100%;
}

/* ============================================
   通用按钮样式 — 提交赛事弹窗等
   ============================================ */

/* 取消按钮 */
.btn-secondary {
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border-gray);
  background: var(--surface-1);
  color: var(--text-light);
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

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

.btn-secondary:hover {
  border-color: var(--border-light);
  background: var(--surface-2);
  transform: translateY(-2px);
}

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

/* 确认/提交按钮 */
.btn-primary {
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: var(--text-white);
  box-shadow: var(--shadow-red-glow);
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

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

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

.btn-primary:hover:not(:disabled)::before {
  left: 100%;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   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: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation: fadeUp 0.5s ease both;
  position: relative;
  box-shadow: var(--shadow-card);
}

/* 卡片霓虹光晕 */
.race-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.05),
    0 0 0 1px rgba(232,0,45,0);
  transition: all 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.race-card:hover::after {
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.08),
    0 0 20px rgba(232,0,45,0.15);
}

/* 卡片顶部赛车方格旗装饰 */
.race-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, transparent 50%, var(--racing-red) 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  border-radius: 0 var(--radius-lg) 0 0;
}

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

/* 卡片悬停效果升级 */
.race-card:hover {
  background: var(--card-hover);
  border-color: rgba(232,0,45,0.4);
  transform: translateY(-8px) scale(1.015);
  box-shadow:
    var(--shadow-card-hover),
    0 20px 60px rgba(0,0,0,0.3);
}

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

/* 覆盖层动画 */
.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
    );
  animation: shimmer 3s linear infinite;
  background-size: 200% 200%;
}

/* 图标浮动动画 */
.cover-icon {
  font-size: 52px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  animation: float 4s ease-in-out infinite;
}

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

/* 卡片封面城市徽章 */
.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-img-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
  z-index: 3;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* 卡片标签 - 修复中文排版 */
.tag-city {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: var(--text-white);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(232,0,45,0.25);
  transition: all 0.3s ease;
}

.race-card:hover .tag-city {
  box-shadow: 0 4px 16px rgba(232,0,45,0.4);
  transform: scale(1.04);
}

.tag-category {
  background: var(--surface-1);
  color: var(--text-muted);
  border: 1px solid var(--border-gray);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  transition: all 0.3s ease;
}

.race-card:hover .tag-category {
  border-color: rgba(232,0,45,0.25);
  color: var(--text-light);
}

.tag-status {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.3px;
}

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

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

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

/* 卡片标签容器 */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

/* Card Body 升级 */
.card-body {
  padding: 20px 20px 18px;
  position: relative;
}

/* 红色装饰线动画 */
.card-body::before {
  content: '';
  position: absolute;
  top: 0; left: 20px; right: 20px;
  height: 2px;
  background: linear-gradient(90deg, var(--racing-red), var(--flame-orange), transparent);
  opacity: 0;
  transition: all 0.3s ease;
  border-radius: 1px;
}

.race-card:hover .card-body::before {
  opacity: 1;
  left: 16px; right: 16px;
}

/* 城市/类别标签升级 */
.card-city {
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: var(--text-white);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(232,0,45,0.3);
  transition: all 0.3s ease;
}

.race-card:hover .card-city {
  box-shadow: 0 4px 16px rgba(232,0,45,0.5);
  transform: scale(1.05);
}

.card-category {
  background: var(--surface-1);
  color: var(--text-muted);
  border: 1px solid var(--border-gray);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  transition: all 0.3s ease;
}

.race-card:hover .card-category {
  border-color: rgba(232,0,45,0.3);
  color: var(--text-light);
}

/* 卡片标题升级 */
.card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.3px;
  transition: color 0.3s ease;
}

.race-card:hover .card-title {
  color: var(--racing-red-light);
}

/* 倒计时升级 */
.card-countdown {
  background: rgba(232,0,45,0.08);
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: inline-block;
  border: 1px solid rgba(232,0,45,0.12);
  transition: all 0.3s ease;
}

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

.card-countdown.urgent {
  background: linear-gradient(135deg, rgba(232,0,45,0.15), rgba(255,107,0,0.1));
  color: var(--flame-orange);
  animation: urgentBlink 2s ease-in-out infinite;
  border-color: rgba(255,107,0,0.2);
}

/* 卡片底部元信息升级 */
.card-meta {
  border-top: 1px solid var(--border-gray);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-base);
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.race-card:hover .card-meta-row {
  color: var(--text-light);
}

.card-meta-icon {
  font-size: 15px;
  flex-shrink: 0;
  color: var(--racing-red);
  width: 20px;
  text-align: center;
}

/* 费用显示升级 */
.card-fee {
  font-size: 22px;
  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;
}

.card-fee-free {
  background: linear-gradient(135deg, var(--status-green), var(--status-green-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 操作按钮升级 */
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-gray);
}

.card-fav-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 6px 10px;
  border-radius: 50%;
  position: relative;
}

.card-fav-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  background: rgba(232,0,45,0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.card-fav-btn:hover::before {
  opacity: 1;
}

.card-learn-more {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(232,0,45,0.3);
  position: relative;
  overflow: hidden;
}

.card-learn-more::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 ease;
}

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

.card-learn-more:hover::before {
  left: 100%;
}

/* ============================================
   Modal 升级 - 毛玻璃效果
   ============================================ */

.modal {
  background: rgba(18,18,18,0.95);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 40px 80px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.06),
    var(--shadow-red-glow-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Modal 顶部光效 */
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--racing-red), var(--flame-orange), var(--neon-pink), var(--racing-red));
  background-size: 200% 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  animation: shimmer 3s linear infinite;
}

/* Modal Header 升级 */
.modal-header {
  padding: 36px 36px 28px;
  background: linear-gradient(160deg, rgba(232,0,45,0.06) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-gray);
}

.modal-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 12px;
  line-height: 1.3;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, var(--text-white), var(--racing-red-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Modal Body 升级 */
.modal-body {
  padding: 28px 36px;
}

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

.modal-info-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--surface-1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.04);
  transition: all 0.3s ease;
}

.modal-info-item:hover {
  border-color: rgba(232,0,45,0.2);
  background: var(--surface-2);
}

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

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

.minfo-val.fee {
  font-size: 32px;
  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 Footer 升级 */
.modal-footer {
  padding: 24px 36px 36px;
  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: all 0.3s ease;
  border: none;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

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

.modal-btn-share::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(232,0,45,0.08), transparent);
  transition: left 0.5s ease;
}

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

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

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

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

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

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

/* ============================================
   Form 表单升级
   ============================================ */

.form-modal {
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  padding: 40px;
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: auto;
  position: relative;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.06);
}

.form-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;
}

.form-modal h2 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--text-white), var(--racing-red-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--carbon-dark);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  padding: 14px 16px;
  font-size: var(--text-base);
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--border-light);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--racing-red);
  box-shadow: 0 0 0 3px rgba(232,0,45,0.12), inset 0 2px 4px rgba(0,0,0,0.2);
}

.form-group select option {
  background: var(--card-dark);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin-top: 36px;
}

/* ============================================
   Empty State 升级
   ============================================ */

.empty-state {
  text-align: center;
  padding: 120px 24px;
  color: var(--text-dim);
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 28px;
  opacity: 0.6;
  animation: float 4s ease-in-out infinite;
}

.empty-state p {
  font-size: 20px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

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

.empty-state a:hover {
  color: var(--racing-red);
}

/* ============================================
   Toast 升级
   ============================================ */

.toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-dark);
  border: 1px solid var(--racing-red);
  color: var(--text-light);
  padding: 16px 32px;
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  z-index: 3000;
  box-shadow:
    var(--shadow-red-glow),
    0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.toast.show {
  display: block;
}

/* ============================================
   Back to Top 升级
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: 48px;
  right: 48px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--racing-red), var(--racing-red-dim));
  color: var(--text-white);
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-red-glow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.back-to-top::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.back-to-top:hover {
  background: linear-gradient(135deg, var(--racing-red-light), var(--racing-red));
  transform: translateY(-6px) scale(1.08);
  box-shadow: 0 8px 32px rgba(232,0,45,0.5);
}

.back-to-top:hover::before {
  opacity: 1;
}

/* ============================================
   Category Tabs / Filter Bar 升级
   ============================================ */

.category-tabs {
  background: rgba(13,13,13,0.92);
  border-bottom: 1px solid var(--border-gray);
  position: sticky;
  top: 70px;
  z-index: 99;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

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

.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 24px;
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.category-tab::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(232,0,45,0.1), transparent);
  transition: left 0.5s ease;
}

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

.category-tab:hover::before {
  left: 100%;
}

.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.35);
}

.filter-bar {
  background: rgba(13,13,13,0.92);
  border-bottom: 1px solid var(--border-gray);
  position: sticky;
  top: 116px;
  z-index: 98;
  overflow-x: auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  scrollbar-width: none;
}

.filter-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}

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

.filter-btn {
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  color: var(--text-muted);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

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

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

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

.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.35);
}

/* ============================================
   Stats Bar 升级
   ============================================ */

.stats-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: rgba(13,13,13,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.stats-tag {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.5px;
}

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

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

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

/* ============================================
   Hot Races 升级
   ============================================ */

.hot-races-section {
  background: linear-gradient(135deg, rgba(232,0,45,0.06) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-gray);
  padding: 24px 0;
}

.hot-badge {
  background: linear-gradient(135deg, var(--racing-red), var(--flame-orange));
  color: var(--text-white);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(232,0,45,0.3);
  animation: hotPulse 2s ease-in-out infinite;
}

.hot-race-card {
  flex-shrink: 0;
  width: 240px;
  background: var(--card-dark);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.hot-race-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--racing-red), var(--flame-orange));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hot-race-card:hover {
  border-color: rgba(232,0,45,0.5);
  transform: translateY(-6px);
  box-shadow: var(--shadow-red-glow);
}

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

/* ============================================
   Footer 升级
   ============================================ */

.footer {
  text-align: center;
  padding: 40px 24px;
  font-size: var(--text-base);
  color: var(--text-dim);
  border-top: 1px solid var(--border-gray);
  background: linear-gradient(180deg, var(--carbon-dark), var(--asphalt-black));
}

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

/* ============================================
   响应式微调 (补充 responsive.css)
   ============================================ */

@media (max-width: 500px) {
  .hero-ai-chat {
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .hero-ai-messages {
    height: 240px;
    padding: 14px;
  }

  .hero-ai-input-row input {
    padding: 14px 16px;
    font-size: 14px;
  }

  .hero-ai-send {
    width: 48px;
    height: 48px;
  }

  .race-card:hover {
    transform: translateY(-4px) scale(1.01);
  }

  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .modal-title {
    font-size: 20px;
  }

  .form-modal {
    padding: 24px 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .back-to-top {
    width: 48px;
    height: 48px;
    bottom: 24px;
    right: 18px;
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  .hero-title {
    font-size: 20px !important;
  }

  .hero-ai-chat {
    padding: 14px;
  }

  .hero-ai-messages {
    height: 200px;
  }

  .card-body {
    padding: 14px;
  }

  .card-title {
    font-size: 14px;
  }
}
