/* 全局样式变量 */
:root {
  --color-primary: #2C3E50;
  --color-secondary: #95A5A6;
  --color-accent: #BDC3C7;
  --color-background: #ECF0F1;
  --color-text: #333333;
  --font-family-zh: "Source Han Sans", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-family-en: "Montserrat", "Helvetica Neue", sans-serif;
  --transition-speed: 0.3s;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-zh), var(--font-family-en);
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
}

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

/* 导航样式 */
.nav {
  background-color: var(--color-primary);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-placeholder {
  width: 150px;
  height: 50px;
  background-color: var(--color-accent);
  opacity: 0.3;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 40px;
}

.nav-menu a {
  color: var(--color-background);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: var(--transition-speed);
  position: relative;
}

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

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

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

/* 主视觉区 */
.hero {
  position: relative;
  height: 800px;
  overflow: hidden;
}

.hero-slider {
  display: flex;
  transition: transform 1s ease-in-out;
  height: 100%;
}

.hero-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

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

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(44, 62, 80, 0.4), rgba(44, 62, 80, 0.6));
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-text {
  text-align: center;
  color: white;
  font-size: 48px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* 内容分区 */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
  font-size: 36px;
  color: var(--color-primary);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
}

/* 卡片布局 */
.card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform var(--transition-speed);
}

.card:hover .card-img {
  transform: scale(1.08);
}

.card-content {
  padding: 25px;
}

.card-title {
  font-size: 20px;
  margin-bottom: 15px;
  color: var(--color-primary);
}

.card-text {
  color: var(--color-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.card-btn {
  display: inline-block;
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 10px 25px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all var(--transition-speed);
}

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

/* 网格布局 */
.grid {
  display: grid;
  gap: 30px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* 页脚 */
.footer {
  background-color: var(--color-primary);
  padding: 30px 0;
  text-align: center;
  color: var(--color-accent);
  font-size: 14px;
}

.footer::before {
  content: '';
  display: block;
  width: 80%;
  max-width: 800px;
  height: 1px;
  background-color: var(--color-accent);
  margin: 0 auto 20px;
}

/* 瀑布流布局 */
.gallery {
  column-count: 4;
  column-gap: 20px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-speed);
}

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

/* 标签筛选 */
.filter-tags {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.tag {
  background-color: white;
  border: 1px solid var(--color-secondary);
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-speed);
  font-size: 14px;
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
  
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .gallery {
    column-count: 3;
  }
}

@media (max-width: 768px) {
  .hero-text {
    font-size: 32px;
  }
  
  .nav-menu {
    flex-direction: column;
    gap: 20px;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery {
    column-count: 2;
  }
  
  .section-title {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .gallery {
    column-count: 1;
  }
  
  .hero {
    height: 500px;
  }
  
  .section {
    padding: 50px 0;
  }
  
  .filter-tags {
    gap: 10px;
  }
  
  .tag {
    padding: 6px 15px;
    font-size: 13px;
  }
}

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* 加载动画 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-accent);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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