/* ===================== 全局基础样式 ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft Yahei", "PingFang SC", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #fff;
  overflow-x: hidden;
  background: linear-gradient(135deg, #1a2a6c 0%, #2c3e50 50%, #202020 100%);
  padding-top: 90px; /* 适配导航栏初始高度（16px*2 + logo高度） */
  transition: padding-top 0.3s ease; /* 跟随导航栏过渡 */
}

/* 滚动后body内边距适配导航栏缩小 */
body.scrolled {
  padding-top: 70px;
}

.container {
  max-width: 1200px;
  width: 90%;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

/* ===================== 导航栏样式（核心修复） ===================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 0; /* 初始上下内边距 */
  background-color: rgba(0, 0, 0, 0.7);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: all 0.3s ease; /* 所有属性平滑过渡 */
}

/* 滚动后导航栏缩小样式（三页统一） */
.navbar.scrolled {
  padding: 8px 0; /* 缩小内边距 */
  background-color: rgba(0, 0, 0, 0.85); /* 背景更深 */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); /* 阴影更明显 */
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  transition: font-size 0.3s ease; /* logo大小过渡 */
}

/* 滚动后logo缩小 */
.navbar.scrolled .logo {
  font-size: 1.6rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.main-nav-link {
  color: #ffffff;
  text-decoration: none !important; /* 强制移除默认下划线 */
  font-size: 1.1rem;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: color 0.3s ease;
  background: transparent;
}

.main-nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #ffd700;
  transition: width 0.3s ease;
}

.main-nav-link:hover,
.main-nav-link.active {
  color: #ffd700;
}

.main-nav-link:hover::after,
.main-nav-link.active::after {
  width: 100%;
}

/* ===================== 首页横幅样式 ===================== */
.hero {
  height: calc(100vh - 90px); /* 适配初始body内边距 */
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 2;
  transition: height 0.3s ease; /* 跟随body内边距过渡 */
}

/* 滚动后hero高度适配 */
body.scrolled .hero {
  height: calc(100vh - 70px);
}

.hero .container {
  max-width: 800px;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 215, 0, 0.2);
  padding: 3rem 2rem;
}

.hero-title {
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-title span {
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 140px;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  border: none;
}

.btn-equip {
  background: linear-gradient(45deg, #ffd700, #ffb800);
  color: #222;
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.btn-equip:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.6);
}

.btn-pet {
  background: linear-gradient(45deg, #4169e1, #1e90ff);
  color: #fff;
  box-shadow: 0 5px 15px rgba(65, 105, 225, 0.4);
}

.btn-pet:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(65, 105, 225, 0.6);
}

/* ===================== 商品列表区域样式 ===================== */
.products {
  padding: 60px 0;
  position: relative;
  z-index: 2;
}

.products .container {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 215, 0, 0.2);
  padding: 40px 20px;
}

.products h2 {
  font-size: 32px;
  font-weight: 600;
  text-align: left;
  margin-bottom: 40px;
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  grid-auto-rows: 1fr;
}

.no-data {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 0;
  color: #ccc;
  font-size: 1.2rem;
}

.product-card {
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 215, 0, 0.5);
}

.product-image {
  width: 100%;
  height: 220px;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.product-image img.error,
.product-image img[src=""] {
  display: none;
}

.product-image::after {
  content: "暂无图片";
  position: absolute;
  color: #ccc;
  font-size: 1rem;
  display: none;
}

.product-image:empty::after,
.product-image img[src=""] + ::after,
.product-image img.error + ::after {
  display: block;
}

.product-info {
  padding: 20px;
}

.product-name {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #ffd700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-desc {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 20px;
  font-weight: 600;
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* ===================== 页脚样式（修复备案链接双下划线） ===================== */
.footer {
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  color: #ffffff;
  text-align: center;
  padding: 24px 0;
  margin-top: 40px;
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  opacity: 0.8;
}

/* 修复备案链接双下划线问题 */
.beian-link {
  color: inherit;
  font-size: inherit;
  text-decoration: none !important; /* 强制移除默认下划线 */
  opacity: inherit;
  position: relative;
  transition: color 0.3s ease !important;
}

/* 用伪元素实现单下划线，替代text-decoration */
.beian-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #ffd700;
  transition: width 0.3s ease-in-out;
  z-index: 1;
}

.beian-link:hover {
  color: #ffd700 !important;
  opacity: 1;
}

.beian-link:hover::after {
  width: 100%;
}

/* ===================== 回到顶部按钮 ===================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(45deg, #ffd700, #ffb800);
  color: #222;
  border: none;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
  z-index: 998;
  display: none;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

/* ===================== 响应式适配 ===================== */
@media (max-width: 768px) {
  .nav-links {
    gap: 16px;
  }
  .logo {
    font-size: 20px;
  }
  .navbar.scrolled .logo {
    font-size: 18px;
  }
  .main-nav-link {
    font-size: 14px;
  }

  .hero-title {
    font-size: 28px;
  }
  .hero .container {
    padding: 2rem 1.5rem;
  }

  .products {
    padding: 40px 0;
  }
  .products .container {
    padding: 30px 15px;
  }
  .products h2 {
    font-size: 28px;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 10px 0;
  }
  .navbar.scrolled {
    padding: 5px 0;
  }
  body {
    padding-top: 70px;
  }
  body.scrolled {
    padding-top: 60px;
  }

  .hero {
    height: calc(100vh - 70px);
    min-height: 400px;
  }
  body.scrolled .hero {
    height: calc(100vh - 60px);
  }
  .hero-title {
    font-size: 24px;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  .btn {
    width: 90%;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    gap: 10px;
    font-size: 12px;
    flex-direction: column;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
  }
}