* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}
a {
  text-emphasis: none;
  text-decoration: none;
}
a:link {
  color: #007ebe;
  font-size: 14px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 顶部导航 */
.top-bar {
  background-color: #f8f9fa;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #eee;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-nav a {
  color: #666;
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.3s;
}

.top-nav a:hover {
  color: #ff6a00;
}

/* 主导航 */
.header {
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-m {
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-nav {
  display: flex;
  align-items: center;
  padding: 15px 0;
}

.logo {
  font-size: 2rem;
  font-weight: bold;
  color: #ff6a00;
  margin-right: 30px;
}

.logo span {
  color: #333;
}

.search-bar {
  flex: 1;
  display: flex;
  max-width: 600px;
}

.search-bar input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #575757;
  border-radius: 4px 0 0 4px;
  font-size: 1rem;
  outline: none;
}

.search-bar button {
  background: #575757;
  color: white;
  border: none;
  padding: 0 20px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 1rem;
}

.nav-icons {
  display: flex;
  margin-left: 20px;
}

.nav-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 15px;
  color: #555;
  cursor: pointer;
  transition: color 0.3s;
}

.nav-icon:hover {
  color: #ff6a00;
}

.nav-icon i {
  font-size: 1.4rem;
  margin-bottom: 5px;
}

/* 分类导航 */
.category-nav {
  background-color: #575757;
  padding: 12px 0;
}

.category-nav ul {
  display: flex;
  list-style: none;
}

.category-nav li {
  margin-right: 25px;
}

.category-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 5px 0;
  position: relative;
}

.category-nav a:hover::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: white;
}

.category-item-pc {
  display: block;
}

.category-item-m {
  display: none;
}

/* 面包屑导航 */
.breadcrumb {
  padding: 15px 0;
  background: white;
  margin: 20px 0;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.breadcrumb ul {
  display: flex;
  list-style: none;
}

.breadcrumb li {
  margin-right: 10px;
  font-size: 0.9rem;
  color: #666;
}

.breadcrumb li:after {
  content: ">";
  margin-left: 10px;
  color: #999;
}

.breadcrumb li:last-child:after {
  content: "";
}

.breadcrumb li a {
  color: #666;
  text-decoration: none;
}

.breadcrumb li a:hover {
  color: #ff6a00;
}

/* 主要内容布局 - 左右分栏 */
.main-content {
  display: flex;
  margin: 20px 0 40px;
  gap: 20px;
}

/* 左侧分类导航 */
.category-sidebar {
  width: 250px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  padding: 20px 0;
  align-self: flex-start;
  /* position: sticky; */
  top: 140px;
}

.sidebar-title-m {
  font-size: 1.3rem;
  padding: 0 20px 15px;
  border-bottom: 1px solid #eee;
  margin-bottom: 15px;
  align-items: center;
}
.sidebar-title-m i {
  color: #ff6a00;
  margin-right: 10px;
  font-size: 1.2rem;
}

.sidebar-title {
  font-size: 1.3rem;
  padding: 0 20px 15px;
  border-bottom: 1px solid #eee;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.sidebar-title i {
  color: #ff6a00;
  margin-right: 10px;
  font-size: 1.2rem;
}

.category-list {
  list-style: none;
}

.category-list a {
  color: #2d2d2d;
}

.category-list li {
  padding: 12px 20px;
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  position: relative;
  z-index: auto;
}

.category-list li:hover {
  background: #fff9f5;
  color: #ff6a00;
}

.category-list li.active {
  background: #fff0e6;
  color: #ff6a00;
  border-left: 3px solid #ff6a00;
  font-weight: 500;
}

.category-list li span.count {
  background: #f5f5f5;
  color: #999;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 10px;
}

.category-list li:hover span.count {
  background: #ff6a00;
  color: white;
}

.brand {
  border-top: 1px solid #2d2d2d;
  padding: 20px;
}
.brand-info {
  margin-bottom: 20px;
}
.brand-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand-list a {
  color: #2d2d2d;
}
.brand-list a:hover {
  color: #007ebe;
  text-decoration: underline;
}
.brand-list .count {
  display: inline-block;
  text-align: center;
  border-radius: 50%;
  border: 1px solid #dedede;
  width: 22px;
  height: 22px;
  line-height: 17px;
}
.iconSet1 {
  background: #d9b340;
  border-color: #d9b340;
  color: #ffffff;
}
.iconSet2 {
  background: #6f7b83;
  border-color: #6f7b83;
  color: #ffffff;
}
.iconSet3 {
  background: #a15326;
  border-color: #a15326;
  color: #ffffff;
}

/* 二级分类面板 */
.subcategory-panel {
  position: absolute;
  z-index: 121;
  left: calc(60% + 20px);
  top: -10px;
  width: 800px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(61, 60, 60, 0.15);
  padding: 25px;
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.subcategory-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subcategory-header {
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.subcategory-title {
  font-size: 1.5rem;
  color: #ff6a00;
  display: flex;
  align-items: center;
}

.subcategory-title i {
  margin-right: 10px;
}

.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.subcategory-card {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s;
  text-align: center;
  cursor: pointer;
}

.subcategory-card:hover {
  background: #fff0e6;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(255, 106, 0, 0.1);
}

.subcategory-icon {
  width: 50px;
  height: 50px;
  background: #ff6a00;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  color: white;
  font-size: 1.5rem;
}

.subcategory-name {
  font-weight: 500;
  margin-bottom: 8px;
  color: #333;
}

.subcategory-count {
  color: #ff6a00;
  font-size: 0.9rem;
}

.subcategory-view-all {
  display: block;
  text-align: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  color: #ff6a00;
  font-weight: 500;
}

.subcategory-view-all:hover {
  text-decoration: underline;
}

.subcategory-content a {
  display: inline-block;
  width: 24%;
  height: 35px;
  line-height: 35px;
  overflow: hidden;
  padding: 5px 10px;
}

.subcategory-content a:hover {
  color: #007ebe;
  text-decoration: underline;
}

.subcategory-content.active {
  display: grid; /* 或 flex/block 根据布局 */
  grid-template-columns: repeat(3, 1fr);
}

/* 移动端关闭按钮 */
.subcategory-close {
  display: none;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 24px;
}

/* 遮罩层 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1099;
  display: none;
}

#menuToggle {
  float: left;
  padding-left: 20px;
  margin-top: 0px;
  display: none;
}

@media (max-width: 767.98px) {
  .nav-toggle {
    display: inline-block;
  }
  .overlay.show {
    display: block;
  }
  #sidebar {
    transform: translateX(-100%);
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    background-color: #ffffff;
    width: 75%;
  }

  #sidebar .category-nav {
    padding-left: 0px !important;
    padding-right: 0px !important;
  }

  #sidebar.show {
    display: block;
    transform: translateX(0);
    border-radius: 0;
  }
  #menuToggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .category-sidebar {
    display: none;
  }

  .subcategory-close {
    display: block;
  }
  .subcategory-panel {
    left: 0px;
    top: 90px;
    width: 400%;
  }
  .subcategory-content a {
    width: 48%;
    border: 1px solid #e7e7e8;
    line-height: 26px;
  }

  /** 左侧边框*/
  .category-item-m {
    display: block;
  }
  .category-item-pc {
    display: none !important;
  }
  .sidebar-title-m input,
  button {
    padding: 5px 10px !important;
    font-size: 0.8rem !important;
  }
  .nav-icons {
    margin: 0px;
  }
  .nav-icon {
    margin: 0 5px;
  }

  .category-list {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
  .category-list li.active {
    border-left: 0px;
  }
  .category-list li {
    padding: 5px;
  }
  .category-list li p {
    text-align: center;
    overflow: hidden;
    height: 40px;
    line-height: 38px;
    font-size: 0.9rem;
  }
  .brand {
    clear: both;
  }
  .brand-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 右侧内容区 */
.content-area {
  flex: 1;
}

/* 轮播图 */
.slider {
  /* height: 400px; */
  background: linear-gradient(135deg, #ff9d6c, #ff6a00);
  border-radius: 8px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.slider-content {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  color: white;
  max-width: 500px;
  z-index: 2;
}

.slider-content h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.slider-content p {
  font-size: 1.1rem;
  margin-bottom: 30px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn {
  display: inline-block;
  background: white;
  color: #ff6a00;
  padding: 12px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.slider-image {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 60%;
  /* background: url('https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80') no-repeat center center/cover; */
  border-radius: 0 8px 8px 0;
}

/* 功能区 */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 30px 0;
}

.feature-box {
  background: white;
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s;
}

.feature-box:hover {
  transform: translateY(-5px);
}

.feature-box i {
  font-size: 2.5rem;
  color: #ff6a00;
  margin-bottom: 15px;
}

.feature-box h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

/* 热门商品 */
.products {
  margin: 40px 0;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #333;
  position: relative;
  /* padding-bottom: 10px; */
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: #ff6a00;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

.product-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-img {
  max-height: 200px;
  background-color: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-img img {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.3s;
}

.product-card:hover .product-img img {
  transform: scale(1.1);
}

.product-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ff6a00;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.product-info {
  padding: 20px;
}

.product-name {
  font-size: 1.1rem;
  margin-bottom: 10px;
  height: 50px;
  overflow: hidden;
}

.product-price {
  color: #ff6a00;
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.product-price .old-price {
  color: #999;
  text-decoration: line-through;
  font-size: 0.7rem;
  margin-left: 10px;
  font-weight: normal;
}

.product-actions {
  display: flex;
  justify-content: space-between;
}

.add-to-cart {
  background: #ff6a00;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
  flex: 1;
  margin-right: 10px;
}

.add-to-cart:hover {
  background: #e55e00;
}

.add-to-fav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.add-to-fav:hover {
  background: #ffebee;
  color: #f44336;
}

/* 促销区 */
.promo-banner {
  background: linear-gradient(to right, #4facfe, #00f2fe);
  border-radius: 8px;
  padding: 40px;
  margin: 40px 0;
  color: white;
  position: relative;
  overflow: hidden;
}

.promo-content {
  position: relative;
  z-index: 2;
  max-width: 60%;
}

.promo-content h2 {
  font-size: 2.2rem;
  margin-bottom: 15px;
}

.promo-content p {
  margin-bottom: 25px;
  font-size: 1.1rem;
}

.promo-image {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40%;
  background: url("https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80")
    no-repeat center center/cover;
}

/* 店长日记模块 */
.diary-section {
  margin: 50px 0;
}

.diary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.diary-title {
  display: flex;
  align-items: center;
}

.diary-title i {
  color: #ff6a00;
  font-size: 1.8rem;
  margin-right: 10px;
}

.diary-grid {
  display: grid;
  gap: 25px;
}

.diary-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  /* flex-direction: column; */
  height: 100%;
}

.diary-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

.diary-image {
  width: 20%;
  height: 180px;
  overflow: hidden;
}

.diary-image img {
  width: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.diary-card:hover .diary-image img {
  transform: scale(1.05);
}

.diary-content {
  width: 80%;
  max-height: 190px;
  padding: 0 20px 20px 20px;
  flex: 3;
  display: flex;
  flex-direction: column;
}

.diary-meta {
  display: flex;
  align-items: center;
  /* margin-bottom: 15px; */
}

.diary-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 10px;
  border: 2px solid #ff6a00;
}

.diary-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.diary-author {
  font-weight: bold;
  color: #333;
}

.diary-date {
  color: #999;
  font-size: 0.9rem;
  margin-top: 3px;
}

.diary-title-text {
  /* font-size: 1.3rem;
  margin-bottom: 12px; */
  color: #333;
  transition: color 0.3s;
}

.diary-card:hover .diary-title-text {
  color: #ff6a00;
}

.diary-excerpt {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.6;
  flex: 1;
}

.diary-stats {
  display: flex;
  justify-content: space-between;
  color: #999;
  font-size: 0.9rem;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.diary-stats span {
  display: flex;
  align-items: center;
}

.diary-stats i {
  margin-right: 5px;
}

.view-all-btn {
  background: #f8f9fa;
  color: #666;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
}

.view-all-btn:hover {
  background: #ff6a00;
  color: white;
}

.view-all-btn i {
  margin-left: 5px;
  transition: transform 0.3s;
}

.view-all-btn:hover i {
  transform: translateX(3px);
}

/* 分页组件 */
.pagination {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.pagination ul {
  display: flex;
  list-style: none;
  background: white;
  padding: 5px;
  border-radius: 50px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pagination li {
  margin: 0 5px;
}

.pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  color: #666;
  font-weight: 500;
  transition: all 0.3s;
}

.pagination a:hover,
.pagination a.active {
  background: #ff6a00;
  color: white;
}

/* 页脚 */
.footer {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 50px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.footer-col h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: #ff6a00;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul li a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col ul li a:hover {
  color: #ff6a00;
}

.social-links {
  display: flex;
  margin-top: 20px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #34495e;
  color: white;
  border-radius: 50%;
  margin-right: 10px;
  transition: background 0.3s;
}

.social-links a:hover {
  background: #ff6a00;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #34495e;
  color: #95a5a6;
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .main-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .logo {
    margin-bottom: 15px;
    text-align: center;
  }

  .search-bar {
    max-width: 100%;
    margin-bottom: 15px;
  }

  .nav-icons {
    justify-content: center;
  }

  .main-content {
    flex-direction: column;
  }

  .category-sidebar {
    width: 100%;
    position: relative;
    top: 0;
  }

  .slider-content {
    left: 5%;
    max-width: 90%;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .product-info {
    padding: 0px 5px;
  }
  .product-name {
    font-size: 0.9rem;
    margin-bottom: 3px;
  }

  .promo-content {
    max-width: 100%;
    text-align: center;
  }

  .promo-image {
    display: none;
  }
}

@media (max-width: 576px) {
  .features,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .category-nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  .category-nav li {
    margin: 5px 10px;
  }

  .slider-content h1 {
    font-size: 2rem;
  }
}
