/* 主样式文件 */

/* 首页卡片分区和分割线的通用样式 */

/* 小学竞赛一级页面整体布局 */
.contest-layout {
  display: flex;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}
.contest-filter {
  width: 260px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(44,62,80,0.07);
  padding: 28px 22px 24px 22px;
  margin-top: 0;
  position: sticky;
  top: 32px;
  height: fit-content;
}
#competition-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

/* Unified competition card styles for elementary page */
.competition-item.card {
  width: 100%;
  max-width: 800px;
  min-width: 280px;
  height: auto;
  display: flex;
  align-items: stretch;
  margin: 0 auto 20px;
  box-sizing: border-box;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(44,62,80,0.08);
  background: #fff;
  overflow: hidden;
  transition: all 0.2s ease;
  border: 1px solid rgba(0,0,0,0.05);
  padding: 0;
}

.competition-item.card:hover {
  box-shadow: 0 8px 32px rgba(44,62,80,0.18);
  transform: translateY(-3px) scale(1.01); /* Adjusted scale for subtlety */
}

.competition-item.card .card-left {
  width: 90px; /* Consistent width */
  min-width: 90px;
  background: linear-gradient(120deg, #36c6ff 0%, #3fd6b6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.2rem; /* Consistent font size */
  font-weight: 700;
  letter-spacing: 2px;
  flex-shrink: 0;
  /* height: 100%; Removed, as align-items: stretch on parent handles this */
  border-top-left-radius: 18px; /* Match parent's border-radius */
  border-bottom-left-radius: 18px; /* Match parent's border-radius */
}

.competition-item.card .card-right {
  flex: 1;
  padding: 16px 20px; /* 减少内边距 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
}

.competition-item.card .card-title {
  font-size: 22px; /* Consistent title font size */
  font-weight: 700;
  margin-bottom: 12px; /* Consistent margin */
  color: #222;
  line-height: 1.4;
  white-space: normal; /* Allow title to wrap */
  word-break: break-word; /* Prefer break-word over break-all for better readability */
  display: block;
}

.card-info-row {
  display: flex;
  align-items: flex-start; /* Align items to the start for multi-line values */
  font-size: 16px; /* Adjusted font size */
  margin-bottom: 8px; /* Adjusted margin */
  line-height: 1.6;
  flex-wrap: wrap; /* Allow content to wrap */
  /* word-break: break-all; Removed, let .card-value handle it */
}

.card-label {
  font-weight: 600;
  color: #333; /* Slightly adjusted color */
  min-width: 80px; /* Adjusted min-width */
  display: inline-block;
  margin-right: 8px; /* Add some space between label and value */
}

.card-value {
  color: #555; /* Slightly adjusted color */
  font-weight: 400;
  word-break: break-word; /* Prefer break-word */
  white-space: normal; /* Allow multi-line values */
  flex: 1;
  min-width: 0;
}

.competition-item.card .card-left {
  width: 110px;
  min-width: 90px;
  background: linear-gradient(120deg, #36c6ff 0%, #3fd6b6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  flex-shrink: 0;
  height: 100%;
}
.competition-item.card .card-right {
  flex: 1;
  padding: 56px 80px 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
}
.competition-item.card .card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #222;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  padding-right: 10px;
}
/* 卡片头部样式 */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

/* 卡片标题 */
.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
  margin: 0;
  flex: 1;
  min-width: 0;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 状态标签 */
.card-status {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  padding: 4px 12px;
  border-radius: 14px;
  min-width: 70px;
  text-align: center;
  margin-left: 12px;
  flex-shrink: 0;
}

/* 信息容器 */
.card-info-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* 每个信息项 */
.info-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  width: 100%;
}

/* 信息标签 */
.card-label {
  font-weight: 600;
  color: #666;
  margin-right: 6px;
  white-space: nowrap;
}

/* 信息值 */
.card-value {
  color: #444;
  font-weight: 400;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.competition-item.card .card-left {
  width: 60px; /* 减小左侧图标区域宽度 */
  min-width: 60px;
  background: linear-gradient(120deg, #36c6ff 0%, #3fd6b6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.8rem; /* 减小图标大小 */
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
  height: 100%;
}
.competition-item.card .card-right {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 顶部对齐 */
  min-width: 0;
  box-sizing: border-box;
}
.competition-item.card .card-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 18px;
  color: #222;
  line-height: 1.4;
  white-space: normal;
  word-break: break-all;
  display: block;
  overflow: visible;
}
.card-info-row {
  display: flex;
  align-items: center;
  font-size: 20px;
  margin-bottom: 13px;
  line-height: 2.1;
}
.card-label {
  font-weight: 600;
  color: #222;
  min-width: 106px;
  display: inline-block;
}
.card-value {
  color: #444;
  font-weight: 400;
  word-break: break-all;
}
.competition-item.card .card-left {
  width: 90px;
  min-width: 70px;
  background: linear-gradient(120deg, #36c6ff 0%, #3fd6b6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  flex-shrink: 0;
  height: 100%;
}
.competition-item.card .card-right {
  flex: 1;
  padding: 36px 48px 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
}
.competition-item.card .card-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #222;
  line-height: 1.4;
  white-space: normal;
  word-break: break-all;
  display: block;
  overflow: visible;
}

.competition-item.card .card-left {
  width: 110px;
  min-width: 90px;
  background: linear-gradient(120deg, #36c6ff 0%, #3fd6b6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  flex-shrink: 0;
  height: 100%;
}
.competition-item.card .card-right {
  flex: 1;
  padding: 28px 36px 22px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
}
.competition-item.card .card-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #222;
  line-height: 1.4;
  white-space: normal;
  word-break: break-all;
  display: block;
  overflow: visible;
}

.competition-item.card .card-left {
  width: 92px;
  min-width: 72px;
  background: linear-gradient(120deg, #36c6ff 0%, #3fd6b6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  flex-shrink: 0;
  height: 100%;
}
.competition-item.card .card-right {
  flex: 1;
  padding: 22px 28px 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
}

.competition-item.card .card-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #222;
}
.card-info-row {
  display: flex;
  align-items: center;
  font-size: 17px;
  margin-bottom: 7px;
  line-height: 1.7;
}
.card-label {
  font-weight: 600;
  color: #222;
  min-width: 86px;
  display: inline-block;
}
.card-value {
  color: #444;
  font-weight: 400;
  word-break: break-all;
}
.competition-item.card .card-meta {
  font-size: 16px;
  color: #666;
  margin-bottom: 6px;
}
.competition-item.card .card-tags {
  margin-top: 8px;
}
.competition-item.card .card-tag {
  font-size: 14px;
  padding: 4px 14px;
}
#active-filters {
  font-size: 18px;
}
#pagination button, #pagination .page-btn {
  font-size: 18px;
  border-radius: 8px;
}


/* 热门竞赛推荐区块卡片排列和按钮美化 (Styles for index.html cards, ensure they don't conflict with elementary.html) */
.index-competition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
}
.btn-discover-more {
  display: inline-block;
  padding: 14px 48px;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(90deg, #36c6ff 0%, #3fd6b6 100%);
  border-radius: 32px;
  font-weight: 600;
  letter-spacing: 2px;
  box-shadow: 0 2px 12px rgba(52,152,219,0.10);
  border: none;
  text-align: center;
  transition: background .2s;
  margin: 0 auto;
}
.btn-discover-more:hover {
  background: linear-gradient(90deg, #3fd6b6 0%, #36c6ff 100%);
  color: #fff;
}

/* Specific styles for competition cards on the index page if needed */
/* To avoid conflict, consider prefixing these or using a more specific selector if they are only for index.html */
.index-competition-item.card {
  width: 380px;
  height: auto; /* Allow height to adjust */
  display: flex;
  align-items: stretch;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(44,62,80,0.10);
  background: #fff;
  margin-bottom: 32px;
  transition: box-shadow .18s, transform .18s;
  overflow: hidden;
  border: none;
  padding: 0;
}
.index-competition-item.card:hover {
  box-shadow: 0 8px 32px rgba(44,62,80,0.18);
  transform: translateY(-3px) scale(1.02);
}
.index-competition-item.card .card-left {
  width: 90px;
  background: linear-gradient(120deg, #36c6ff 0%, #3fd6b6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 2px;
}
.index-competition-item.card .card-right {
  flex: 1;
  padding: 18px 24px 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.index-competition-item.card .card-title {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}
.index-competition-item.card .card-meta {
  font-size: 14px;
  color: #888;
  margin-bottom: 2px;
}
.index-competition-item.card .card-tags {
  margin-top: 4px;
}
.index-competition-item.card .card-tag {
  display: inline-block;
  font-size: 12px;
  color: #fff;
  background: #27ae60;
  border-radius: 12px;
  padding: 2px 10px;
  margin-right: 7px;
  margin-bottom: 2px;
}

/* The following seems to be a broken or misplaced rule, commenting out */
/*
  flex: 0 1 calc(33.333% - 32px);
  min-width: 280px;
  max-width: 340px;
  box-sizing: border-box;
}
*/

.card-section {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(44,62,80,0.12);
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 36px 48px 36px;
}

.card-section {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(44,62,80,0.12);
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 36px 48px 36px;
}
/* Stray CSS properties and brace, commenting out:
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(44,62,80,0.12);
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 36px 48px 36px;
}
*/
.section-divider {
  height: 2px;
  background: #e0e0e0;
  margin-bottom: 36px;
}

/* 导入基础样式和组件样式 */
@import 'base.css';
@import 'components.css';

/* 首页特定样式 */
.navbar {
  background: #1976d2;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.07);
  padding: 0 0 0 0;
  margin-bottom: 0;
}

.navbar-brand {
  font-size: 1.5rem;
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 2px;
}

.navbar-menu {
  position: relative;
  display: flex;
  gap: 24px;
  list-style: none;
}
.navbar-menu > li {
  position: relative;
}
.navbar-menu > li > a {
  display: block;
  padding: 14px 18px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.dropdown-menu a {
  display: block;
  padding: 10px 24px;
  color: #333;
  text-decoration: none;
  font-size: 15px;
  background: #fff;
  transition: color 0.2s, background 0.2s;
}

.dropdown-menu a:hover {
  background: #f2f8f3;
  color: #27ae60;
}

.navbar-menu > li > a:hover, .navbar-menu > li > a.active {
  color: #27ae60;
  background: #f5f5f5;
  border-radius: 6px;
}

.hero {
  background-color: #3498db;
  color: white;
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 30px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.feature {
  text-align: center;
  padding: 20px;
}

.feature i {
  font-size: 3rem;
  color: #3498db;
  margin-bottom: 20px;
}

/* 竞赛详情页样式 */
.competition-detail h2 {
  color: #2c3e50;
  margin-bottom: 20px;
}

.competition-meta {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.competition-meta-item {
  margin-right: 30px;
  margin-bottom: 10px;
}

.competition-meta-item strong {
  display: block;
  font-size: 0.9rem;
  color: #7f8c8d;
}

.competition-meta-item span {
  font-size: 1.1rem;
  color: #2c3e50;
}

.competition-description {
  line-height: 1.8;
  margin-bottom: 30px;
}

:root {
  --primary-color: #ff6b1a;
  --secondary-color: #2c3e50;
  --text-color: #333;
  --light-bg: #f4f6fa;
  --card-bg: #fff;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* banner 轮播样式 */
.hero {
  padding: 40px 0 0;
}

.hero .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

#banner-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 40px;
  border-radius: 14px;
  overflow: hidden;
}

.banner-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#banner-carousel.loading .banner-loading {
  opacity: 1;
}

#banner-link {
  display: block;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

#banner-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

#banner-img:hover {
  box-shadow: var(--shadow-lg);
}

#banner-prev, #banner-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(44,62,80,0.5);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease;
}

#banner-prev {
  left: 12px;
}

#banner-next {
  right: 12px;
}

#banner-prev:hover, #banner-next:hover {
  background: rgba(44,62,80,0.7);
}

.dropdown-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 140px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-radius: 6px;
  z-index: 100;
  list-style: none;
  padding-left: 0;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
  }
  
  .navbar-menu {
    margin-top: 15px;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .competition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
}
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
    margin: 5% auto;
  }
}