/* 全局样式 */
:root {
  --primary-color: #1a1a1a;
  --secondary-color: #f8f8f8;
  --accent-color: #d4d4d4;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--secondary-color);
  overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 2rem;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.logo:hover {
  opacity: 0.8;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
  padding: 0.5rem 0;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

/* 汉堡菜单 */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.menu-toggle span {
  width: 25px;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

/* 主内容区域 */
main {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* 轮播图样式 */
.carousel {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

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

.carousel-content {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
}

.carousel-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 300;
  letter-spacing: 2px;
}

.carousel-content p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: var(--transition);
  font-weight: 500;
  letter-spacing: 1px;
}

.btn:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 2rem;
  margin: 4rem 0;
}

.grid-cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  cursor: pointer;
}

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

.card-image {
  position: relative;
  overflow: hidden;
  height: 300px;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.card:hover .card-overlay {
  opacity: 1;
}

.card-overlay p {
  color: white;
  font-size: 1.1rem;
  text-align: center;
  padding: 0 1rem;
}

.card-content {
  padding: 1.5rem;
}

.card-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
}

.card-content p {
  color: var(--text-light);
  line-height: 1.6;
}

/* 分类标题 */
.section-title {
  text-align: center;
  margin: 4rem 0 2rem;
}

.section-title h2 {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 1rem;
  color: var(--primary-color);
  letter-spacing: 1px;
}

.section-title p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

/* 面料特写 */
.fabric-showcase {
  margin: 4rem 0;
}

.fabric-hero {
  height: 500px;
  margin-bottom: 3rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

/* 图片墙 */
.masonry {
  columns: 4 320px;
  column-gap: 1rem;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.masonry-item:hover {
  transform: scale(1.02);
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.modal-content img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  opacity: 0.7;
}

/* 页脚 */
footer {
  background: var(--primary-color);
  color: var(--accent-color);
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

footer p {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .carousel-content {
    bottom: 5%;
    padding: 1.5rem;
  }

  .carousel-content h1 {
    font-size: 1.8rem;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .masonry {
    columns: 2 160px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .navbar {
    padding: 1rem;
  }

  .carousel-content {
    padding: 1rem;
  }

  .carousel-content h1 {
    font-size: 1.5rem;
  }

  .section-title h2 {
    font-size: 1.8rem;
  }

  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }

  .masonry {
    columns: 1;
  }
}

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

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

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

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