/* 每日大赛官网 - 全局样式 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1e3a8a;
  --secondary-color: #f59e0b;
  --text-color: #333333;
  --light-text: #666666;
  --border-color: #e5e7eb;
  --bg-light: #f9fafb;
  --white: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--white);
}

/* 头部导航 */
.header {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 18px;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-menu a:hover {
  color: var(--primary-color);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-color);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after {
  width: 100%;
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-light);
  border-radius: 20px;
  padding: 8px 15px;
  gap: 10px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 150px;
  font-size: 14px;
  color: var(--text-color);
}

.search-box input::placeholder {
  color: var(--light-text);
}

.search-box button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--light-text);
  font-size: 16px;
}

/* 搜索框下方的导航栏 */
.nav-bar {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
}

.nav-bar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 40px;
  overflow-x: auto;
}

.nav-bar a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-bar a:hover {
  color: var(--primary-color);
}

/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 页面标题 */
.page-title {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--light-text);
  margin-bottom: 20px;
}

/* 模块 */
.module {
  margin-bottom: 40px;
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 15px;
}

.module-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color);
}

.module-subtitle {
  font-size: 12px;
  color: var(--light-text);
  margin-top: 5px;
}

.module-more {
  text-decoration: none;
  color: var(--secondary-color);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.module-more:hover {
  color: var(--primary-color);
}

/* 内容列表 */
.content-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.content-card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.content-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.content-card-image {
  width: 100%;
  height: 180px;
  background-color: var(--bg-light);
  overflow: hidden;
  position: relative;
}

.content-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.content-card:hover .content-card-image img {
  transform: scale(1.05);
}

/* 视频卡片特殊样式 */
.video-card .content-card-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play-button {
  position: absolute;
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.video-play-button::after {
  content: '▶';
  color: var(--primary-color);
  font-size: 20px;
  margin-left: 3px;
}

.video-card:hover .video-play-button {
  opacity: 1;
}

.video-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--secondary-color);
  color: var(--white);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  z-index: 5;
}

.content-card-body {
  padding: 15px;
}

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

.content-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--light-text);
}

.content-card-stats {
  display: flex;
  gap: 10px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* 作者卡片 */
.author-card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.author-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 15px;
  overflow: hidden;
  background-color: var(--bg-light);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 5px;
}

.author-desc {
  font-size: 12px;
  color: var(--light-text);
  margin-bottom: 15px;
  line-height: 1.4;
}

.author-stats {
  display: flex;
  justify-content: space-around;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

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

.author-stat-value {
  font-size: 16px;
  font-weight: bold;
  color: var(--primary-color);
}

.author-stat-label {
  font-size: 12px;
  color: var(--light-text);
}

/* FAQ 部分 */
.faq-item {
  background-color: var(--bg-light);
  border-left: 4px solid var(--secondary-color);
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.faq-item:hover {
  background-color: #f3f4f6;
}

.faq-question {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-toggle {
  font-size: 16px;
  color: var(--secondary-color);
}

.faq-answer {
  font-size: 13px;
  color: var(--light-text);
  line-height: 1.6;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* 评论部分 */
.comment-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--bg-light);
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-body {
  flex: 1;
}

.comment-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 5px;
}

.comment-text {
  font-size: 13px;
  color: var(--light-text);
  line-height: 1.6;
  margin-bottom: 8px;
}

.comment-time {
  font-size: 12px;
  color: #999999;
}

/* 页脚 */
.footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.footer-section h3 {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--secondary-color);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.footer-logo img {
  height: 40px;
  width: auto;
}

.footer-logo-text {
  font-size: 16px;
  font-weight: bold;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom p {
  margin-bottom: 10px;
}

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--light-text);
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: var(--secondary-color);
}

.breadcrumb span {
  color: var(--light-text);
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background-color: #1e40af;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: #d97706;
}

.btn-outline {
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  background-color: transparent;
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

/* 标签 */
.tag {
  display: inline-block;
  background-color: var(--bg-light);
  color: var(--text-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  margin-right: 5px;
  margin-bottom: 5px;
}

.tag:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-container {
    height: 60px;
  }

  .nav-menu {
    gap: 15px;
  }

  .search-box {
    display: none;
  }

  .nav-bar-container {
    gap: 20px;
  }

  .content-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }

  .content-card-image {
    height: 140px;
  }

  .module-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .module-more {
    margin-top: 10px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-title {
    font-size: 24px;
  }

  .module-title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .header-container {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 20px;
  }

  .nav-menu {
    display: none;
  }

  .content-list {
    grid-template-columns: 1fr;
  }

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

  .module-title {
    font-size: 16px;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 懒加载占位符 */
.lazy-load-placeholder {
  background-color: var(--bg-light);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
