/* ========== 基础样式 ========== */
body {
  margin: 0;
  font-family: 'Fredoka', 'Poppins', sans-serif;
  background-color: #ffffff;
  color: #333;
  padding: 0;
  animation: fadeIn 0.6s ease-in-out;

  display: flex;              
  flex-direction: column;
  min-height: 100vh;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== 顶部导航 ========== */
header {
  position: sticky;       
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 40px;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
}

.logo img {
  height: 40px;
  width: auto;
}

nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 30px;
}

nav a {
  text-decoration: none;
  font-weight: 500;
  color: #444;
  font-size: 1rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: #000;
}

/* 搜索框 */
.nav-right {
  display: flex;
  align-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 20px;
  padding: 4px 10px;
  transition: background-color 0.3s ease;
}

.search-box input {
  border: none;
  outline: none;
  background: none;
  font-size: 0.9rem;
  color: #333;
  padding: 6px 8px;
}

.search-box input::placeholder {
  color: #999;
}

.search-box:hover,
.search-box:focus-within {
  background-color: #eaeaea;
}

.search-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  color: #777;
  flex-shrink: 0;
}

/* ========== 欢迎区域 ========== */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 40px;
  flex-wrap: wrap;
  flex-direction: row;   /* ✅ 大屏幕：狗在左，文字在右 */
}

.hero-text {
  max-width: 480px;
}

.hero-text h1 {
  font-size: 2.3rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.hero-text h1 span {
  color: #000;
}

.hero-text p {
  font-size: 1rem;
  color: #666;
  margin-top: 12px;
  margin-bottom: 20px;
}

.btn {
  background-color: #ddd;
  color: #333;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #bbb;
}

.hero-img img {
  max-width: 280px;
  height: auto;
}

/* ========== 分类区域 ========== */
.categories {
  text-align: center;
  padding: 30px 20px;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr); 
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.category {
  background-color: white;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.3s ease, transform 0.2s ease;
}

.category:hover {
  border-color: #bbb;
  transform: translateY(-3px);
}

.category img {
  height: 70px;
}

.category h3 {
  margin: 10px 0;
  font-size: 1rem;
  color: #333;
}

.price {
  font-size: 0.95rem;
  color: #555;
  margin: 6px 0 12px;
}

.category button {
  background-color: #ddd;
  color: #333;
  padding: 7px 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 0.9rem;
}

.category button:hover {
  background-color: #bbb;
}

.contact-btn {
  background-color: #eee;
}

.contact-btn:hover {
  background-color: #ccc;
}

/* ========== footer 样式 ========== */
footer {
  text-align: center;
  padding: 15px 0;
  background: #f9f9f9;
  border-top: 1px solid #e5e5e5;
  color: #666;
  font-size: 0.9rem;
  margin-top: auto;
}

/* ========== 响应式优化 ========== */

/* 平板 (768px 以下) */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  nav {
    justify-content: center;
    width: 100%;
    gap: 20px;
    margin-top: 5px;
  }

  .nav-right {
    width: 100%;
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
  }

  .search-box {
    width: 100%;
    max-width: 300px;
  }

  .hero {
    flex-direction: column;   /* ✅ 平板及以下：狗在上，文字在下 */
    padding: 30px 20px;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 1.6rem;
  }

  .hero-img img {
    max-width: 200px;
  }

  .category-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 手机 (480px 以下) */
@media (max-width: 480px) {
  header {
    padding: 8px 15px;
  }

  nav {
    gap: 10px;
  }

  nav a {
    font-size: 0.9rem;
  }

  .hero-text h1 {
    font-size: 1.3rem;
  }

  .hero-text p {
    font-size: 0.9rem;
  }

  .btn {
    padding: 8px 18px;
    font-size: 0.9rem;
  }

  .category-list {
    grid-template-columns: 1fr;
  }
}

