/* ===== 公共样式 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif; color: #222; background: #f5f6fa; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== 顶部导航 ===== */
.header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: #e53935;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.logo-icon { font-size: 24px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-item {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 15px;
  color: #555;
  transition: all .2s;
}
.nav-item:hover, .nav-item.active {
  background: #fff0f0;
  color: #e53935;
  font-weight: 600;
}

/* ===== 移动端导航 ===== */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  color: #333;
}
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 998;
}
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 999;
  transition: right .3s ease;
  padding-top: 60px;
  box-shadow: -4px 0 20px rgba(0,0,0,.15);
}
.mobile-nav.open { right: 0; }
.mobile-nav-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #eee;
}
.mobile-nav-header .logo { font-size: 18px; }
.mobile-nav-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
}
.mobile-nav-items { padding: 20px 0; }
.mobile-nav-item {
  display: block;
  padding: 14px 24px;
  font-size: 16px;
  color: #333;
  border-left: 3px solid transparent;
  transition: all .2s;
}
.mobile-nav-item:hover, .mobile-nav-item.active {
  background: #fff5f5;
  color: #e53935;
  border-left-color: #e53935;
}
.search-bar { display: flex; gap: 0; }
.search-input {
  width: 200px;
  padding: 8px 14px;
  border: 1.5px solid #ddd;
  border-radius: 20px 0 0 20px;
  outline: none;
  font-size: 14px;
  transition: border-color .2s;
}
.search-input:focus { border-color: #e53935; }
.search-btn {
  padding: 8px 16px;
  background: #e53935;
  border: none;
  border-radius: 0 20px 20px 0;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

/* ===== 容器 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main-content { padding: 32px 20px; }
.section { padding: 40px 0; }

/* ===== 标签/徽章 ===== */
.cat-badge {
  display: inline-block;
  background: #fff0f0;
  color: #e53935;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #ffd0d0;
}
.tag-top {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e53935;
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}
.tag-fee {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 4px;
}
.tag-status {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}
.status-1 { background: #e8f5e9; color: #2e7d32; }
.status-2 { background: #f5f5f5; color: #9e9e9e; }
.status-3 { background: #ffebee; color: #c62828; }

/* ===== 赛事卡片 ===== */
.events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
.event-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}
.event-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.event-cover { position: relative; width: 100%; padding-top: 56.25%; overflow: hidden; background: #f0f0f0; flex-shrink: 0; }
.event-cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-default {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  display: flex; align-items: center; justify-content: center;
}
.cover-default span { font-size: 48px; opacity: .5; }
.event-info { padding: 14px 16px; flex: 1; min-height: 140px; display: flex; flex-direction: column; }
.event-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 44px;
  line-height: 1.4;
}
.event-meta { font-size: 13px; color: #888; margin-bottom: 4px; height: 20px; line-height: 20px; overflow: hidden; }
.event-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.participants { font-size: 12px; color: #999; }

/* 封面标签位置 */
.event-cover .tag-top {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e53935;
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 2;
}
.event-cover .tag-top.has-status { top: 30px; }
.event-cover .tag-fee {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 4px;
  z-index: 2;
}
.event-cover .tag-status {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 2;
}

/* ===== 段落标题 ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.section-title { font-size: 22px; font-weight: 700; color: #222; }
.more-link { color: #e53935; font-size: 14px; }
.more-link:hover { text-decoration: underline; }

/* ===== 新闻 ===== */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-item {
  display: flex;
  gap: 14px;
  background: #fff;
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: transform .2s;
}
.news-item:hover { transform: translateX(4px); }
.news-thumb { width: 90px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.news-thumb-default { width: 90px; height: 64px; background: #f5f5f5; display:flex; align-items:center; justify-content:center; font-size: 28px; border-radius: 8px; flex-shrink: 0; }
.news-content h4 { font-size: 14px; color: #222; font-weight: 600; margin-bottom: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-content p { font-size: 12px; color: #999; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.news-date { font-size: 12px; color: #bbb; }

/* ===== 筛选栏 ===== */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-item {
  padding: 6px 18px;
  border-radius: 20px;
  border: 1.5px solid #e0e0e0;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.filter-item.active, .filter-item:hover {
  border-color: #e53935;
  background: #e53935;
  color: #fff;
}

/* ===== 分页 ===== */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 24px 0; flex-wrap: wrap; align-items: center; }
.page-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1.5px solid #ddd;
  font-size: 14px;
  color: #555;
  transition: all .2s;
  min-width: 40px;
  text-align: center;
}
.page-btn.active, .page-btn:hover { border-color: #e53935; background: #e53935; color: #fff; }
.page-btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.page-ellipsis { color: #999; padding: 0 4px; }

/* ===== Banner ===== */
.banner-section { width: 100%; overflow: hidden; }
.swiper-container { width: 100%; height: 400px; }
.swiper-slide { width: 100%; height: 100%; position: relative; }
.banner-img { width: 100%; height: 100%; object-fit: cover; }
.banner-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
  display: flex; align-items: center; justify-content: center;
}
.banner-placeholder-content { text-align: center; color: #fff; }
.banner-icon { font-size: 64px; }
.banner-placeholder-content h2 { font-size: 28px; margin-top: 12px; }
.banner-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  padding: 40px 24px 16px;
  color: #fff;
}
.banner-info h3 { font-size: 20px; font-weight: 700; }
.banner-info p { font-size: 14px; opacity: .85; margin-top: 4px; }

/* ===== 分类快捷 ===== */
.cats-section { padding: 20px 0; background: #fff; border-bottom: 1px solid #f0f0f0; }
.cats-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px;
  border-radius: 10px;
  transition: all .2s;
  cursor: pointer;
}
.cat-item:hover { background: #fff0f0; }
.cat-emoji { font-size: 28px; }
.cat-item span:last-child { font-size: 12px; color: #555; }
.all-cat { background: #fff0f0; }
.all-cat span:last-child { color: #e53935; font-weight: 600; }

/* ===== 页面Banner ===== */
.page-banner {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  color: #fff;
  text-align: center;
  padding: 48px 20px;
}
.page-banner h1 { font-size: 32px; font-weight: 700; }
.page-banner p { opacity: .85; margin-top: 8px; }

/* ===== 搜索提示 ===== */
.search-tip { color: #666; margin-bottom: 16px; font-size: 14px; }
.search-tip b { color: #e53935; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; margin-bottom: 16px; }
.empty-state .empty-action { display: inline-block; background: #e53935; color: #fff; padding: 10px 24px; border-radius: 20px; font-size: 14px; transition: background .2s; }
.empty-state .empty-action:hover { background: #c62828; text-decoration: none; }

/* ===== 404页面 ===== */
.error-page { text-align: center; padding: 100px 20px; }
.error-page .error-code { font-size: 120px; font-weight: 700; color: #e53935; opacity: .2; line-height: 1; }
.error-page .error-icon { font-size: 64px; margin-bottom: 16px; }
.error-page h2 { font-size: 24px; color: #333; margin-bottom: 8px; }
.error-page p { color: #999; margin-bottom: 24px; }
.error-page .error-btn { display: inline-block; background: #e53935; color: #fff; padding: 12px 32px; border-radius: 24px; font-size: 15px; transition: background .2s; }
.error-page .error-btn:hover { background: #c62828; text-decoration: none; }

/* ===== 图片懒加载 ===== */
img[data-src] { opacity: 0; transition: opacity .3s; }
img.loaded { opacity: 1; }
.img-placeholder { background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%); background-size: 200% 100%; animation: img-loading 1.5s infinite; border-radius: 8px; }
@keyframes img-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== 标签重叠修复 ===== */
.tag-status { right: 8px !important; }
.tag-top.has-status { top: 30px !important; }

/* ===== 新闻布局 ===== */
.news-layout { display: grid; grid-template-columns: 1fr 260px; gap: 24px; }
.news-card {
  display: flex; gap: 16px; background: #fff;
  padding: 16px; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  margin-bottom: 12px;
  transition: transform .2s;
}
.news-card:hover { transform: translateX(4px); }
.news-card-img { width: 140px; height: 96px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.news-card-img-default { width: 140px; height: 96px; background: #f5f5f5; display:flex; align-items:center; justify-content:center; font-size: 36px; border-radius: 8px; flex-shrink: 0; }
.news-card-body { flex: 1; }
.news-card-body h3 { font-size: 15px; color: #222; font-weight: 600; margin-bottom: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-card-body p { font-size: 13px; color: #888; margin-bottom: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-date { font-size: 12px; color: #bbb; }
.sidebar-card { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.sidebar-title { font-size: 15px; font-weight: 700; padding-bottom: 10px; border-bottom: 2px solid #e53935; margin-bottom: 12px; }
.hot-list { list-style: none; padding: 0; }
.hot-list li { padding: 8px 0; border-bottom: 1px dashed #f0f0f0; font-size: 14px; }
.hot-list li a { color: #444; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hot-list li a:hover { color: #e53935; }

/* ===== 底部 ===== */
.footer { background: #222; color: #aaa; text-align: center; padding: 24px; font-size: 13px; margin-top: 40px; }
.footer-icp { margin-top: 6px; }
.footer-icp a { color: #888; text-decoration: none; }
.footer-icp a:hover { color: #ccc; }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.modal-box {
  background: #fff; border-radius: 16px;
  padding: 40px 32px; text-align: center;
  max-width: 360px; width: 90%;
}
.modal-icon { font-size: 56px; margin-bottom: 16px; }
.modal-box h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.modal-box p { color: #666; margin-bottom: 24px; }
.btn-primary {
  display: inline-block;
  background: #e53935;
  color: #fff;
  padding: 10px 32px;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background .2s;
}
.btn-primary:hover { background: #c62828; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .events-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cats-grid { grid-template-columns: repeat(4, 1fr); }
  .swiper-container { height: 220px; }
  .news-layout { grid-template-columns: 1fr; }
  .news-sidebar { display: none; }
  .nav { display: none; }
  .mobile-menu-btn { display: block; }
  .search-input { width: 140px; }
  .header-inner { gap: 12px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-meta-grid { grid-template-columns: 1fr; }
  .reg-card { position: static; }
  .detail-title { font-size: 20px; }
}
@media (max-width: 480px) {
  .events-grid { grid-template-columns: 1fr; }
  .cats-grid { grid-template-columns: repeat(4, 1fr); }
  .logo .logo-text { display: none; }
  .search-bar { display: none; }
  .mobile-nav { display: block; }
  .mobile-nav-overlay { display: none; }
  .mobile-nav-overlay.show { display: block; }
}
