/* 全局样式文件 - 长裤展示网站 */
/* 现代极简主义设计，中性色调，响应式布局 */

/* 基础重置和变量定义 */
:root {
  /* 中性色调 */
  --color-white: #ffffff;
  --color-off-white: #f8f8f8;
  --color-light-gray: #f0f0f0;
  --color-medium-gray: #e0e0e0;
  --color-dark-gray: #333333;
  --color-charcoal: #2a2a2a;
  
  /* 强调色 */
  --color-accent-blue: #1a365d;
  --color-accent-red: #8b0000;
  
  /* 间距 */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 4rem;
  
  /* 字体大小 */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--color-dark-gray);
  background-color: var(--color-off-white);
}

/* 容器布局 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--color-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: var(--space-sm) 0;
}

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

.logo {
  font-size: var(--text-xl);
  font-weight: 300;
  color: var(--color-dark-gray);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--space-md);
}

.nav-link {
  text-decoration: none;
  color: var(--color-dark-gray);
  font-weight: 400;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent-blue);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-accent-blue);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: var(--text-xl);
  cursor: pointer;
  color: var(--color-dark-gray);
}

/* 英雄区域样式 */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: var(--color-light-gray);
  margin-top: 60px; /* 为固定导航栏留出空间 */
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--color-white);
  max-width: 600px;
  padding: var(--space-md);
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 300;
  margin-bottom: var(--space-sm);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: var(--text-lg);
  font-weight: 300;
  opacity: 0.9;
}

/* 网格布局样式 */
.grid-section {
  padding: var(--space-xl) 0;
}

.section-title {
  text-align: center;
  font-size: var(--text-3xl);
  font-weight: 300;
  margin-bottom: var(--space-lg);
  color: var(--color-dark-gray);
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.grid-item {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.grid-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.grid-content {
  padding: var(--space-md);
}

.grid-title {
  font-size: var(--text-lg);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-dark-gray);
}

.grid-description {
  font-size: var(--text-sm);
  color: var(--color-dark-gray);
  opacity: 0.8;
}

/* 图文交替布局样式 */
.alternating-section {
  padding: var(--space-xl) 0;
}

.alternating-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
  margin-bottom: var(--space-xl);
}

.alternating-item:nth-child(even) .alternating-content {
  order: 2;
}

.alternating-item:nth-child(even) .alternating-image {
  order: 1;
}

.alternating-content {
  padding: var(--space-md);
}

.alternating-title {
  font-size: var(--text-2xl);
  font-weight: 400;
  margin-bottom: var(--space-sm);
  color: var(--color-dark-gray);
}

.alternating-description {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-dark-gray);
  opacity: 0.9;
}

.alternating-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

/* 卡片布局样式 */
.cards-section {
  padding: var(--space-xl) 0;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-lg);
}

.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.card-content {
  padding: var(--space-md);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--color-dark-gray);
}

.card-description {
  font-size: var(--text-base);
  color: var(--color-dark-gray);
  opacity: 0.8;
}

/* 页脚样式 */
.footer {
  background-color: var(--color-charcoal);
  color: var(--color-light-gray);
  text-align: center;
  padding: var(--space-md) 0;
  margin-top: var(--space-xl);
}

.footer-text {
  font-size: var(--text-sm);
  opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 100%;
    flex-direction: column;
    background-color: var(--color-white);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    padding: var(--space-md);
    transition: left 0.3s ease;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .hero-title {
    font-size: var(--text-3xl);
  }
  
  .alternating-item {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .alternating-item:nth-child(even) .alternating-content,
  .alternating-item:nth-child(even) .alternating-image {
    order: unset;
  }
  
  .alternating-image {
    height: 300px;
  }
  
  .cards-container {
    grid-template-columns: 1fr;
  }
  
  .grid-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-xs);
  }
  
  .hero-title {
    font-size: var(--text-2xl);
  }
  
  .section-title {
    font-size: var(--text-2xl);
  }
  
  .grid-container {
    grid-template-columns: 1fr;
  }
}

/* 工具类 */
.text-center {
  text-align: center;
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.p-sm {
  padding: var(--space-sm);
}

.p-md {
  padding: var(--space-md);
}

.p-lg {
  padding: var(--space-lg);
}

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

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-light-gray);
  border-top: 4px solid var(--color-accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 无障碍支持 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 焦点样式 */
button:focus,
a:focus {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 2px;
}