/* 全局样式与变量定义 */
:root {
  --primary-bg: #f8f8f8;
  --secondary-bg: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --accent-color: #a0826d;
  --border-color: #e0e0e0;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
  --transition-speed: 0.3s;
}

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

body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--primary-bg);
  overflow-x: hidden;
}

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

/* 导航栏样式 */
nav {
  background: var(--secondary-bg);
  box-shadow: var(--shadow-light);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-speed);
}

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

.nav-logo {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: color var(--transition-speed);
  position: relative;
}

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

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

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

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

/* 图片网格样式 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.image-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow-light);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.image-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

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

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

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  padding: 2rem 1rem 1rem;
  color: white;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

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

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--secondary-bg);
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: all var(--transition-speed);
  font-size: 0.9rem;
  letter-spacing: 1px;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent-color);
}

/* 页脚样式 */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 标题样式 */
h1 {
  font-family: "Noto Serif SC", serif;
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 1.8rem;
  font-weight: 300;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

h3 {
  font-family: "Noto Serif SC", serif;
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

/* 文本样式 */
.text-center {
  text-align: center;
}

.text-secondary {
  color: var(--text-secondary);
}

/* 间距工具类 */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }
.p-3 { padding: 3rem; }

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

.carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

.carousel-item {
  min-width: 100%;
  position: relative;
}

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

.carousel-caption {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: white;
  z-index: 2;
}

.carousel-caption h1 {
  color: white;
  margin-bottom: 1rem;
}

.carousel-caption p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* 分类展示样式 */
.category-section {
  margin: 4rem 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.category-card {
  background: var(--secondary-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: transform var(--transition-speed);
}

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

.category-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.category-content {
  padding: 1.5rem;
}

.category-content h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.category-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 细节展示样式 */
.detail-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.detail-item {
  text-align: center;
}

.detail-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .nav-links a {
    font-size: 0.8rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .carousel {
    height: 50vh;
  }
  
  .carousel-caption {
    bottom: 15%;
  }
  
  .image-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .category-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .carousel-caption h1 {
    font-size: 1.5rem;
  }
  
  .carousel-caption p {
    font-size: 1rem;
  }
  
  .btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.8rem;
  }
}

/* 页面切换动画 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

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

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