/* 晶体矿物学习平台 - 首页样式 */

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Source Han Sans CN", "PingFang SC", sans-serif;
  font-size: 14px;
  color: #333333;
  background-color: #F5F8FC;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: #2A5DAA;
}



button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* 顶部导航栏 */
.main-header {
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  height: 40px;
}

.logo img {
  height: 100%;
}

.nav-menu {
  display: flex;
  gap: 32px;
}

.nav-menu a {
  color: #666666;
  font-size: 16px;
  transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #2A5DAA;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}



.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
}

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

/* 主要内容区 */
.main-content {
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

/* 轮播图区域 */
.hero-section {
  position: relative;
  margin-bottom: 48px;
  border-radius: 12px;
  overflow: hidden;
}

.hero-slider {
  position: relative;
  height: 480px;
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s;
}

.slide.active {
  opacity: 1;
}

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

.slide-content {
  position: absolute;
  left: 64px;
  bottom: 64px;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slide-content h2 {
  font-size: 36px;
  margin-bottom: 16px;
}

.slide-content p {
  font-size: 18px;
  margin-bottom: 24px;
}

.cta-button {
  display: inline-block;
  padding: 12px 32px;
  background: #2A5DAA;
  color: #FFFFFF;
  border-radius: 24px;
  font-size: 16px;
  transition: background-color 0.3s;
}

.cta-button:hover {
  background: #4B8CD7;
}

.slider-controls button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.3);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 24px;
  transition: background-color 0.3s;
}

.slider-controls button:hover {
  background: rgba(0, 0, 0, 0.5);
}

.prev-btn {
  left: 24px;
}

.next-btn {
  right: 24px;
}

/* 功能模块导航 */
.features-section {
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.feature-card i {
  font-size: 36px;
  color: #2A5DAA;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #333333;
}

.feature-card p {
  color: #666666;
  font-size: 14px;
}

/* 热门实验 */
.popular-section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  color: #333333;
}

.more-link {
  color: #2A5DAA;
  font-size: 14px;
}

.more-link i {
  margin-left: 4px;
}

.experiment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.experiment-card {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.experiment-preview {
  position: relative;
  height: 200px;
}

.experiment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.difficulty {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #FFFFFF;
  border-radius: 12px;
  font-size: 12px;
}

.experiment-info {
  padding: 16px;
}

.experiment-info h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: #333333;
}

.experiment-info p {
  color: #666666;
  margin-bottom: 16px;
  font-size: 14px;
}

.experiment-meta {
  display: flex;
  gap: 16px;
  color: #999999;
  font-size: 12px;
}

.experiment-meta i {
  margin-right: 4px;
}

/* 学习资源 */
.resources-section {
  margin-bottom: 48px;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.resource-card {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.resource-preview {
  position: relative;
  height: 160px;
}

.resource-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-type {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #FFFFFF;
  border-radius: 12px;
  font-size: 12px;
}

.resource-info {
  padding: 16px;
}

.resource-info h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: #333333;
}

.resource-info p {
  color: #666666;
  margin-bottom: 16px;
  font-size: 14px;
}

.resource-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price {
  color: #FF6B6B;
  font-size: 16px;
  font-weight: bold;
}

/* 社区动态 */
.community-section {
  margin-bottom: 48px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.post-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 16px;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
}

.post-meta h3 {
  font-size: 14px;
  margin-bottom: 4px;
}

.post-meta span {
  color: #999999;
  font-size: 12px;
}

.post-content {
  margin-bottom: 16px;
  color: #333333;
  font-size: 14px;
}

.post-footer {
  display: flex;
  gap: 24px;
  color: #999999;
  font-size: 12px;
}

.post-footer i {
  margin-right: 4px;
}

/* 页脚 */
.main-footer {
  background: #FFFFFF;
  padding: 48px 0 24px;
}

/* 首页特定样式的注释 */
/* 搜索结果页相关样式已移至search.css */

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
  margin-bottom: 24px;
}

.footer-section h4 {
  font-size: 16px;
  margin-bottom: 16px;
  color: #333333;
}

.footer-section p,
.footer-section li {
  color: #666666;
  font-size: 14px;
  margin-bottom: 8px;
}

.footer-section a {
  color: #666666;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: #2A5DAA;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666666;
  font-size: 18px;
  transition: all 0.3s;
}

.social-links a:hover {
  background: #2A5DAA;
  color: #FFFFFF;
}

.footer-bottom {
  text-align: center;
  padding: 24px;
  color: #999999;
  font-size: 12px;
  border-top: 1px solid #EEEEEE;
}