/* 全局样式 */
:root {
  --primary-color: #0088cc;
  --secondary-color: #005580;
  --accent-color: #00aaff;
  --text-color: #333333;
  --light-text: #ffffff;
  --dark-bg: #1a1a1a;
  --light-bg: #f5f9fc;
  --gray-bg: #f0f0f0;
  --border-color: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--light-bg);
}

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

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: var(--light-text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  text-align: center;
}

.btn:hover {
  background-color: var(--secondary-color);
  color: var(--light-text);
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 32px;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.section-header p {
  font-size: 18px;
  color: #666;
}

/* 导航栏样式 */
.header {
  background-color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  color: var(--primary-color);
  font-size: 24px;
  font-weight: bold;
}

.logo-icon {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  fill: var(--primary-color);
}

.main-nav ul {
  display: flex;
}

.main-nav li {
  margin-left: 25px;
}

.main-nav a {
  color: var(--text-color);
  font-weight: 500;
  padding: 5px 0;
  position: relative;
}

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

.main-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: var(--transition);
}

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

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
}

.mobile-menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--text-color);
  transition: var(--transition);
}

/* 轮播图样式 */
.hero-slider {
  position: relative;
  overflow: hidden;
  height: 600px;
}

.slider-container {
  position: relative;
  height: 100%;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
  background-color: var(--dark-bg);
}

.slide.active {
  opacity: 1;
}

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

.slide-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--light-text);
  max-width: 800px;
  width: 90%;
}

.slide-content h1 {
  font-size: 48px;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.slide-content p {
  font-size: 20px;
  margin-bottom: 30px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.slide-content .btn {
  font-size: 18px;
  padding: 12px 30px;
}

.slide-title {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.slider-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.prev-slide,
.next-slide {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  margin: 0 10px;
  transition: var(--transition);
}

.prev-slide:hover,
.next-slide:hover {
  background: rgba(0, 0, 0, 0.8);
}

.slider-dots {
  display: flex;
  justify-content: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  margin: 0 5px;
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background-color: var(--light-text);
}

/* 特色内容模块样式 */
.features {
  padding: 80px 0;
  background-color: #fff;
}

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

.feature-card {
  text-align: center;
  padding: 30px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  background-color: #fff;
}

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

.feature-icon {
  margin-bottom: 20px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon img {
  max-height: 100%;
  border-radius: 8px;
}

.feature-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.feature-card p {
  color: #666;
}

/* 热门视频模块样式 */
.popular-videos {
  padding: 80px 0;
  background-color: var(--light-bg);
}

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

.video-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.video-thumbnail {
  position: relative;
  height: 200px;
}

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

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.play-button::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-left: 25px solid white;
  border-bottom: 15px solid transparent;
  margin-left: 5px;
}

.video-card:hover .play-button {
  background-color: var(--primary-color);
}

.video-info {
  padding: 20px;
}

.video-info h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text-color);
}

.video-info p {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  color: #999;
  font-size: 12px;
}

/* 科普文章模块样式 */
.articles {
  padding: 80px 0;
  background-color: #fff;
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.article-card {
  display: flex;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-image {
  flex: 0 0 300px;
}

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

.article-content {
  padding: 30px;
  flex: 1;
}

.article-content h3 {
  font-size: 22px;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.article-content p {
  margin-bottom: 20px;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  color: var(--primary-color);
  font-weight: 500;
  display: inline-block;
  position: relative;
}

.read-more::after {
  content: '→';
  margin-left: 5px;
  transition: var(--transition);
}

.read-more:hover::after {
  margin-left: 10px;
}

/* 科学实验模块样式 */
.experiments {
  padding: 80px 0;
  background-color: var(--light-bg);
}

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

.experiment-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.experiment-image {
  height: 200px;
}

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

.experiment-content {
  padding: 20px;
}

.experiment-content h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.experiment-content p {
  color: #666;
  margin-bottom: 15px;
}

.experiment-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 14px;
  color: #888;
}

/* APP下载模块样式 */
.app-download {
  padding: 80px 0;
  background-color: #fff;
}

.app-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--light-text);
}

.app-info {
  flex: 1;
  padding: 50px;
}

.app-info h2 {
  font-size: 36px;
  margin-bottom: 15px;
}

.app-info p {
  font-size: 18px;
  margin-bottom: 30px;
  opacity: 0.9;
}

.app-features {
  margin-bottom: 30px;
}

.app-features li {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.feature-icon {
  width: 24px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}

.download-buttons {
  display: flex;
  gap: 15px;
}

.download-btn {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 12px 20px;
  border-radius: 8px;
  transition: var(--transition);
  color: var(--light-text);
}

.download-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--light-text);
}

.btn-icon {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  fill: currentColor;
}

.btn-text {
  display: flex;
  flex-direction: column;
}

.btn-text small {
  font-size: 12px;
  opacity: 0.8;
}

.btn-text strong {
  font-size: 16px;
}

.app-image {
  flex: 0 0 40%;
  height: 400px;
  position: relative;
}

.app-image img {
  height: 100%;
  object-fit: cover;
  border-radius: 12px 0 0 12px;
}

/* 订阅模块样式 */
.subscribe {
  padding: 80px 0;
  background-color: var(--light-bg);
}

.subscribe-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.subscribe-content h2 {
  font-size: 32px;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.subscribe-content p {
  font-size: 18px;
  margin-bottom: 30px;
  color: #666;
}

.subscribe-form {
  display: flex;
  margin-bottom: 15px;
}

.subscribe-form input {
  flex: 1;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px 0 0 4px;
  font-size: 16px;
}

.subscribe-form .btn {
  border-radius: 0 4px 4px 0;
  padding: 15px 30px;
  font-size: 16px;
}

.privacy-note {
  font-size: 14px;
  color: #888;
}

/* 页脚样式 */
.footer {
  background-color: var(--dark-bg);
  color: #ccc;
  padding-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

.footer-column h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-column h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
}

.footer-logo {
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
}

.footer-logo .logo-icon {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  fill: var(--primary-color);
}

.footer-column p {
  margin-bottom: 20px;
}

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

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: var(--transition);
}

.social-link:hover {
  background-color: var(--primary-color);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

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

.footer-links a {
  color: #ccc;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-color);
  padding-left: 5px;
}

.contact-info li {
  display: flex;
  margin-bottom: 15px;
}

.contact-info svg {
  width: 20px;
  height: 20px;
  fill: var(--primary-color);
  margin-right: 10px;
  flex-shrink: 0;
}

.friend-links {
  margin-bottom: 40px;
}

.friend-links h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.friend-links h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
}

.friend-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.friend-links a {
  color: #ccc;
  transition: var(--transition);
}

.friend-links a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
  text-align: center;
}

.copyright p {
  margin-bottom: 5px;
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .experiments-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  
  .main-nav.active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
  }
  
  .main-nav.active ul {
    flex-direction: column;
  }
  
  .main-nav.active li {
    margin: 0 0 15px 0;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  
  .hero-slider {
    height: 450px;
  }
  
  .slide-content h1 {
    font-size: 32px;
  }
  
  .slide-content p {
    font-size: 16px;
  }
  
  .slide-title {
    font-size: 28px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .article-card {
    flex-direction: column;
  }
  
  .article-image {
    flex: 0 0 200px;
  }
  
  .experiments-grid {
    grid-template-columns: 1fr;
  }
  
  .app-content {
    flex-direction: column;
  }
  
  .app-info {
    padding: 30px;
  }
  
  .app-image {
    width: 100%;
    height: 300px;
  }
  
  .app-image img {
    border-radius: 0;
  }
  
  .subscribe-form {
    flex-direction: column;
  }
  
  .subscribe-form input {
    border-radius: 4px;
    margin-bottom: 10px;
  }
  
  .subscribe-form .btn {
    border-radius: 4px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-slider {
    height: 350px;
  }
  
  .slide-content h1 {
    font-size: 24px;
  }
  
  .slide-content p {
    font-size: 14px;
  }
  
  .slide-title {
    font-size: 22px;
  }
  
  .section-header h2 {
    font-size: 24px;
  }
  
  .section-header p {
    font-size: 16px;
  }
  
  .download-buttons {
    flex-direction: column;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-card, .video-card, .article-card, .experiment-card {
  animation: fadeIn 0.6s ease-out forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

.video-card:nth-child(1) { animation-delay: 0.1s; }
.video-card:nth-child(2) { animation-delay: 0.2s; }
.video-card:nth-child(3) { animation-delay: 0.3s; }
.video-card:nth-child(4) { animation-delay: 0.4s; }
.video-card:nth-child(5) { animation-delay: 0.5s; }
.video-card:nth-child(6) { animation-delay: 0.6s; }

/* 悬浮效果 */
.btn, .feature-card, .video-card, .article-card, .experiment-card, .social-link, .download-btn {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover, .feature-card:hover, .video-card:hover, .article-card:hover, .experiment-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 透明背景轮播 */
.hero-slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.6) 100%);
  z-index: 1;
}

.slide-content {
  z-index: 2;
}

/* 卡片悬停效果增强 */
.video-card::before, .experiment-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(var(--primary-color-rgb), 0) 0%, rgba(var(--primary-color-rgb), 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.video-card:hover::before, .experiment-card:hover::before {
  opacity: 1;
}

/* 友情链接样式增强 */
.friend-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.friend-links li {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 5px 12px;
  border-radius: 4px;
  transition: var(--transition);
}

.friend-links li:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 滚动到顶部按钮 */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  font-size: 24px;
  border: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background-color: var(--secondary-color);
}

/* 增加页面整体动效 */
.container {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}

header .container {
  animation-delay: 0.1s;
}

.hero-slider {
  animation-delay: 0.2s;
}

section:nth-of-type(1) .container {
  animation-delay: 0.3s;
}

section:nth-of-type(2) .container {
  animation-delay: 0.4s;
}

section:nth-of-type(3) .container {
  animation-delay: 0.5s;
}

section:nth-of-type(4) .container {
  animation-delay: 0.6s;
}

section:nth-of-type(5) .container {
  animation-delay: 0.7s;
}

section:nth-of-type(6) .container {
  animation-delay: 0.8s;
}

footer .container {
  animation-delay: 0.9s;
}

/* 增强表单样式 */
input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.2);
}

/* 增强可访问性 */
.btn:focus, a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 增强移动端导航体验 */
@media (max-width: 768px) {
  .main-nav.active {
    animation: slideDown 0.3s ease forwards;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* 增加图片加载效果 */
img {
  opacity: 0;
  transition: opacity 0.5s ease;
}

img.loaded {
  opacity: 1;
}

/* 优化打印样式 */
@media print {
  .header, .hero-slider, .app-download, .subscribe, .footer {
    display: none;
  }
  
  .container {
    width: 100%;
    max-width: none;
    padding: 0;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  .section-header h2 {
    font-size: 18pt;
    color: #000;
  }
  
  .feature-card, .video-card, .article-card, .experiment-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
