/* 晶体视界 - 主页样式 */

/* 图片占位符和延迟加载样式 */
.img-placeholder {
  background-color: #f0f0f0;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 0;
  padding-top: 56.25%; /* 16:9的宽高比 */
}

.img-placeholder img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.img-placeholder:hover img {
  transform: scale(1.05);
}

/* 离线提示样式 */
.offline-message {
  display: none;
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 4px;
  text-align: center;
}

/* 页面标题区域 */
.page-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px 0;
}

.page-title {
  font-size: 36px;
  font-weight: 700;
  color: #2A5DAA;
  margin-bottom: 12px;
}

.page-description {
  font-size: 16px;
  color: #666666;
  max-width: 600px;
  margin: 0 auto;
}

/* 功能导航区域 */
.feature-navigation {
  margin-bottom: 48px;
}

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

.feature-card {
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #F0F4F9;
  border-radius: 50%;
  margin-bottom: 16px;
  font-size: 24px;
  color: #2A5DAA;
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
}

/* 晶体展示区域 */
.crystal-showcase {
  margin-bottom: 48px;
}

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

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: #333333;
}

.view-all {
  font-size: 14px;
  font-weight: 600;
  color: #2A5DAA;
  transition: all 0.3s ease;
}

.view-all:hover {
  color: #1E4785;
}

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

/* 研究工具区域 */
.research-tools {
  margin-bottom: 48px;
}

.section-header {
  margin-bottom: 24px;
}

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

/* 最新资讯区域 */
.latest-news {
  margin-bottom: 48px;
}

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

.news-card {
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.news-image {
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.news-card:hover .news-image img {
  transform: scale(1.1);
}

.news-content {
  padding: 16px;
}

.news-title {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2; /* 标准属性，增强兼容性 */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.news-date {
  font-size: 12px;
  color: #666666;
}

.news-category {
  font-size: 12px;
  color: #2A5DAA;
}

.news-excerpt {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  font-size: 14px;
  font-weight: 600;
  color: #2A5DAA;
  transition: all 0.3s ease;
}

.read-more:hover {
  color: #1E4785;
}

/* 合作伙伴区域 */
.partners {
  margin-bottom: 48px;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  align-items: center;
}

.partner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 16px;
  transition: all 0.3s ease;
}

.partner-logo:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.partner-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.partner-logo:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

/* 学习资源区域样式 */
.resource-card {
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.resource-preview {
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.resource-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.resource-card:hover .resource-preview img {
  transform: scale(1.05);
}

.resource-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resource-title {
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
}

.resource-desc {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.resource-link {
  font-size: 14px;
  font-weight: 600;
  color: #2A5DAA;
  transition: color 0.3s ease;
  align-self: flex-start;
}

.resource-link:hover {
  color: #1E4785;
}

/* 晶体列表区域样式 */
.crystal-card {
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.crystal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.crystal-preview {
  width: 100%;
  height: 180px;
  overflow: hidden;
  position: relative;
  background-color: #f5f8fc;
}

.crystal-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.02), rgba(0,0,0,0.1));
  z-index: 1;
}

.crystal-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.crystal-card:hover .crystal-preview img {
  transform: scale(1.05);
}

.crystal-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.crystal-name {
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
}

.crystal-meta {
  font-size: 14px;
  color: #666666;
  margin-bottom: 12px;
}

.crystal-brief {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3; /* 标准属性，增强兼容性 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.detail-link {
  font-size: 14px;
  font-weight: 600;
  color: #2A5DAA;
  transition: color 0.3s ease;
  align-self: flex-end;
}

.detail-link:hover {
  color: #1E4785;
}

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

/* 3D模型展示区域 */
.showcase-section {
  margin-bottom: 48px;
}

.section-desc {
  font-size: 16px;
  color: #666666;
  margin-top: 8px;
}

.showcase-container {
  display: grid;

  gap: 24px;
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  padding: 24px;
}

.model-viewer {
  height: 400px;
  background-color: #F5F8FC;
  border-radius: 8px;
  position: relative;
}

.showcase-controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.crystal-selector, .model-controls, .display-options {
  background-color: #F5F8FC;
  border-radius: 8px;
  padding: 16px;
}

.crystal-selector h3, .model-controls h3, .display-options h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333333;
}

.selector-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selector-btn {
  padding: 8px 12px;
  border-radius: 4px;
  background-color: #FFFFFF;
  color: #666666;
  border: 1px solid #DDDDDD;
  cursor: pointer;
  transition: all 0.3s ease;
}

.selector-btn:hover, .selector-btn.active {
  background-color: #2A5DAA;
  color: #FFFFFF;
  border-color: #2A5DAA;
}

.control-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-btn {
  padding: 8px 12px;
  border-radius: 4px;
  background-color: #FFFFFF;
  color: #666666;
  border: 1px solid #DDDDDD;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.control-btn:hover {
  background-color: #F0F4F9;
  color: #2A5DAA;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #666666;
  cursor: pointer;
}

.option-item input[type="checkbox"] {
  margin-right: 8px;
}

.view-more {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.more-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  background-color: #2A5DAA;
  color: #FFFFFF;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

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

.more-link:hover {
  background-color: #1E4785;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(42, 93, 170, 0.2);
}