/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 根变量定义 */
:root {
  --primary-color: #333;
  --secondary-color: #666;
  --background-color: #fafafa;
  --text-color: #333;
  --accent-color: #8b7355;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* 基础排版 */
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
}

/* 导航栏样式 */
nav {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
}

nav li {
  margin: 0 2rem;
}

nav a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

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

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

/* 页面容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* 轮播图样式 */
.carousel {
  position: relative;
  width: 100%;
  height: 60vh;
  overflow: hidden;
  border-radius: var(--border-radius);
  margin-bottom: 3rem;
}

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

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

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

/* 网格布局 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.grid-item {
  background-color: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  cursor: pointer;
}

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

.grid-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.grid-item-content {
  padding: 1.5rem;
}

.grid-item h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.grid-item p {
  color: var(--secondary-color);
  font-size: 0.9rem;
}

/* 材质板块样式 */
.material-section {
  margin-bottom: 3rem;
}

.material-header {
  text-align: center;
  margin-bottom: 2rem;
}

.material-header h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.material-header p {
  color: var(--secondary-color);
  max-width: 600px;
  margin: 0 auto;
}

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

.material-card {
  background-color: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  padding: 2rem 1.5rem;
}

.material-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
}

.material-card h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.material-card p {
  color: var(--secondary-color);
  line-height: 1.8;
}

/* 系法展示样式 */
.tying-method {
  display: flex;
  align-items: center;
  margin-bottom: 3rem;
  background-color: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tying-method:nth-child(even) {
  flex-direction: row-reverse;
}

.tying-method img {
  width: 50%;
  height: 300px;
  object-fit: cover;
}

.tying-method-content {
  padding: 2rem;
  flex: 1;
}

.tying-method-content h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.tying-method-content p {
  color: var(--secondary-color);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.tying-method-content .steps {
  list-style: none;
  counter-reset: step-counter;
}

.tying-method-content .steps li {
  counter-increment: step-counter;
  margin-bottom: 0.8rem;
  position: relative;
  padding-left: 2.5rem;
}

.tying-method-content .steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.8rem;
  height: 1.8rem;
  background-color: var(--accent-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* 灵感故事样式 */
.inspiration-story {
  background-color: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 3rem;
}

.inspiration-story img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.inspiration-content {
  padding: 2rem;
}

.inspiration-content h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.8rem;
}

.inspiration-content .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.inspiration-content .tag {
  background-color: #f0f0f0;
  color: var(--secondary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.inspiration-content p {
  color: var(--secondary-color);
  line-height: 1.8;
  font-size: 1.05rem;
}

/* 页脚样式 */
footer {
  background-color: #fff;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid #eee;
  margin-top: 4rem;
}

footer p {
  color: var(--secondary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    padding: 1rem;
  }
  
  nav li {
    margin: 0.5rem 0;
  }
  
  .container {
    padding: 1rem;
  }
  
  .carousel {
    height: 40vh;
  }
  
  .tying-method,
  .tying-method:nth-child(even) {
    flex-direction: column;
  }
  
  .tying-method img {
    width: 100%;
  }
  
  .material-header h2 {
    font-size: 2rem;
  }
}

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

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

/* 页面标题样式 */
.page-title {
  text-align: center;
  margin-bottom: 3rem;
}

.page-title h1 {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.page-title p {
  color: var(--secondary-color);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.1rem;
}