/* 全局样式 */
html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 滚动动画 */
.section-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.logo-image {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: #0f172a;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #2563eb;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #06b6d4;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #0f172a;
}

.mobile-menu {
  display: none;
}

/* 英雄区域 */
.hero {
  padding: 8rem 0 4rem;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  background-color: white;
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 波浪装饰 */
.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
}

/* 章节样式 */
.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #0f172a;
}

.section-divider {
  width: 80px;
  height: 4px;
  background-color: #2563eb;
  margin: 0 auto;
  border-radius: 2px;
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-image {
  height: 200px;
  background: linear-gradient(45deg, #eff6ff, #dbeafe);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-weight: 600;
  gap: 0.5rem;
  padding: 0.5rem;
  overflow: hidden;
  position: relative;
}

.card-image img {
  max-width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease;
  z-index: 1;
  position: relative;
}

.card-image img:hover {
  transform: scale(1.1);
  z-index: 10;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 当卡片中有两张图片时的特殊处理 */
.card-image img:nth-child(1),
.card-image img:nth-child(2) {
  max-width: calc(50% - 0.25rem);
}

/* 新闻区域：支持两张并排大图 */
.news-grid .card-image {
  height: auto;
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.news-grid .card-image img {
  max-width: calc(50% - 0.25rem);
  max-height: 220px;
  object-fit: cover;
  border-radius: 0.5rem;
}

@media (max-width: 768px) {
  .news-grid .card-image {
    flex-direction: column;
    gap: 0.5rem;
  }
  .news-grid .card-image img {
    max-width: 100%;
    width: 100%;
    max-height: 180px;
  }
}

/* 确保单张图片能完整显示 */
.card-image img:only-child {
  max-width: 100%;
  max-height: 180px;
}

/* 图片模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;
  width: 30px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  line-height: 28px;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close:hover, .close:focus {
  background-color: rgba(255, 255, 255, 0.4);
  color: white;
  text-decoration: none;
  cursor: pointer;
  transform: scale(1.1);
}

.card-content {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #0f172a;
}

/* 网格布局 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* 实验室简介卡片 */
.intro-card {
  padding: 2rem;
}

.intro-card p {
  font-size: 1.125rem;
  color: #475569;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* 软件介绍卡片 */
.software-card {
  display: flex;
  flex-direction: column;
}

.software-card .card-image {
  height: 250px;
}

.software-info {
  flex: 1;
}

.software-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.meta-tag {
  padding: 0.5rem 1rem;
  background-color: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* 穿戴设备部分 */
.wearable-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.wearable-text {
  flex: 1;
}

.wearable-text p {
  font-size: 1.125rem;
  color: #475569;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.data-list {
  background-color: #f1f5f9;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.data-list h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #0f172a;
}

.data-items {
  list-style: none;
}

.data-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.data-item::before {
  content: '✓';
  color: #06b6d4;
  font-weight: 700;
  font-size: 1.25rem;
  margin-top: 0.125rem;
}

/* 页脚 */
.footer {
  background-color: #0f172a;
  color: white;
  padding: 3rem 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.footer-logo .logo-icon {
  background-color: #2563eb;
}

.footer-text {
  max-width: 500px;
  color: #94a3b8;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
}

.social-link:hover {
  background-color: #2563eb;
}

.copyright {
  color: #64748b;
  margin-top: 2rem;
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #1d4ed8;
  transform: translateY(-3px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: white;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
  }
  
  .mobile-menu.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  
  .mobile-menu .nav-link {
    color: #0f172a;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .section-title h2 {
    font-size: 2rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .software-card {
    flex-direction: column;
  }
  
  .software-card .card-image {
    height: 200px;
  }
  
  .card-image {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .wearable-content {
    flex-direction: column;
  }
}

@media (min-width: 769px) {
  .software-card {
    flex-direction: row;
  }
  
  .software-card .card-image {
    width: 30%;
    height: auto;
  }
  
  .software-info {
    width: 70%;
  }
  
  .wearable-content {
    flex-direction: row;
  }
  
  .wearable-image {
    width: 30%;
  }
  
  .wearable-text {
    width: 70%;
  }
}