/* =============================================================================
   首页侧边栏区域
============================================================================= */
.sidebar {
  width: 320px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* 搜索框 */
.search-box {
  padding: 20px;
  border-bottom: 1px solid #f3f3f3;
}

.search-input {
  width: 100%;
  height: 40px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 16px;
  background: #fff;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  border-color: #1890ff;
}

/* 分类列表 */
.category-list {
  padding: 16px 0;
}

.category-item {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 48px;
  cursor: pointer;
  font-size: 17px;
  color: #222;
  transition: all 0.3s ease;
}

.category-item:hover {
  background: #f8f9ff;
}

/* 分类图标容器 */
.category-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 12px;
  flex-shrink: 0;
  position: relative;
  background: #f5f5f5;
  border-radius: 3px;
  overflow: hidden;
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 分类图标加载动画 */
.category-icon.lazy-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border: 2px solid #e5e5e5;
  border-top-color: #1890ff;
  border-radius: 50%;
  animation: category-icon-spin 0.8s linear infinite;
}

@keyframes category-icon-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.category-item i {
  width: 22px;
  height: 22px;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.category-item .category-count {
  margin-left: auto;
  background: #e6f4ea;
  color: #3bb07b;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 3px;
  font-weight: 500;
}

.category-item.selected {
  color: #1890ff;
  background: #f8f9ff;
}

.category-item.selected .category-count {
  background: #1890ff20;
  color: #1890ff;
}

.category-item:not(:last-child) {
  border-bottom: 1px solid #f3f3f3;
}

/* =============================================================================
   首页产品内容区域
============================================================================= */
.content {
  flex: 1;
}

/* 公告区域 - 默认隐藏，只在移动端显示 */
.announcement-section {
  display: none;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
  overflow: hidden;
}

.announcement-header {
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.announcement-header span::before {
  content: "#";
  color: #1890ff;
  font-weight: bold;
  margin-right: 8px;
}

.announcement-content {
  padding: 16px 20px;
}

.announcement-content p {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

.announcement-content p:last-child {
  margin-bottom: 0;
}

.announcement-content strong {
  color: #333;
  font-weight: 600;
}

.announcement-content a {
  color: #1890ff;
  text-decoration: none;
  font-weight: 500;
}

.announcement-content a:hover {
  color: #40a9ff;
}

.announcement-content .announcement-time {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

/* 内容区搜索框 */
.content-search-box {
  padding: 16px 20px 20px 20px;
  border-top: 1px solid #f0f0f0;
}

.content-search-input {
  width: 100%;
  height: 40px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 0 16px;
  font-size: 16px;
  background: #fff;
  outline: none;
  transition: border-color 0.3s ease;
}

.content-search-input:focus {
  border-color: #1890ff;
}

/* 产品系列 */
.series-block {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
  overflow: hidden;
}

.series-header {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  padding: 20px 24px;
  border-bottom: 1px solid #f3f3f3;
  background: #fafbff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.series-count {
  background: #e6f4ea;
  color: #3bb07b;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 3px;
  font-weight: 500;
}

/* 产品列表 */
.product-list {
  background: #fff;
}

.product-item {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid #f3f3f3;
  transition: background-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.product-item:hover {
  background-color: #FBFBFB;
}

.product-item:last-child {
  border-bottom: none;
}

/* 涟漪动画效果 */
.product-item .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(24, 144, 255, 0.2);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
}

@keyframes ripple-animation {
  to {
    transform: scale(40);
    opacity: 0;
  }
}

.product-icon {
  width: 85px;
  height: 85px;
  background: #f5f5f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 24px;
  overflow: hidden;
}

.product-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  flex: 1;
}

.product-title {
  font-size: 17px;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  line-height: 1.4;
}

.product-desc {
  font-size: 15px;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.5;
}

.product-meta {
  font-size: 15px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.product-price {
  font-size: 18px;
  color: #ef4444;
  font-weight: 700;
}

.product-link {
  font-size: 12px;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.3s ease;
  font-weight: 500;
}

/* 自动发货 - 绿色 */
.product-link.auto-delivery {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.product-link.auto-delivery:hover {
  background: rgba(16, 185, 129, 0.2);
}

/* 人工处理 - 橙色 */
.product-link.manual-processing {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.product-link.manual-processing:hover {
  background: rgba(245, 158, 11, 0.2);
}

.product-stock {
  font-size: 16px;
  color: #888;
}

/* =============================================================================
   首页响应式设计
============================================================================= */
@media (max-width: 1024px) {

  /* 移动端布局调整 */
  .main .container {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  /* 移动端隐藏侧边栏 */
  .sidebar {
    display: none;
  }

  /* 产品区域移动端优化 */
  .content {
    width: 100%;
    margin-bottom: 30px;
  }

  .series-block {
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  }

  .series-header {
    padding: 20px;
    font-size: 17px;
  }

  .series-count {
    font-size: 13px;
    padding: 4px 10px;
  }

  /* 产品项移动端优化 */
  .product-item {
    padding: 24px;
    align-items: flex-start;
  }

  .product-item:hover {
    background-color: #f5f5f5;
  }

  /* 产品图标适中大小 */
  .product-icon {
    width: 80px;
    height: 80px;
    margin-right: 20px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .product-title {
    font-size: 17px;
    margin-bottom: 8px;
    line-height: 1.4;
    font-weight: 600;
  }

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

  .product-meta {
    font-size: 13px;
    gap: 14px;
  }

  .product-price {
    font-size: 16px;
    font-weight: 700;
  }

  .product-link {
    font-size: 11px;
    padding: 3px 6px;
  }

  .product-stock {
    font-size: 12px;
  }


}

/* 平板和中等屏幕优化 */
@media (max-width: 768px) {

  /* 在移动端显示公告区域 */
  .announcement-section {
    display: block;
    margin: 0 0 16px 0;
    border-radius: 6px;
  }

  .announcement-header {
    padding: 14px 16px;
    font-size: 16px;
  }

  .announcement-content {
    padding: 16px;
  }

  .announcement-content p {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .content-search-box {
    padding: 16px;
  }

  .content-search-input {
    height: 44px;
    font-size: 16px;
    border-radius: 6px;
  }

  .product-item {
    padding: 20px;
  }

  .product-icon {
    width: 70px;
    height: 70px;
    margin-right: 18px;
  }

  .product-title {
    font-size: 16px;
    margin-bottom: 7px;
  }

  .product-desc {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .product-meta {
    font-size: 12px;
    gap: 12px;
  }

  .product-price {
    font-size: 18px;
  }

  .series-block {
    margin-bottom: 18px;
  }

  .series-header {
    padding: 18px;
  }
}

/* 小屏幕移动端进一步优化 */
@media (max-width: 480px) {
  .main .container {
    padding: 12px;
    gap: 12px;
  }

  /* 小屏幕公告样式调整 */
  .announcement-section {
    margin-bottom: 12px;
  }

  .series-header {
    padding: 16px;
    font-size: 16px;
  }

  .series-block {
    margin-bottom: 16px;
  }

  .product-item {
    padding: 18px;
  }

  .product-icon {
    width: 65px;
    height: 65px;
    margin-right: 16px;
  }

  .product-title {
    font-size: 15px;
    margin-bottom: 6px;
  }

  .product-desc {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .product-meta {
    font-size: 12px;
    gap: 10px;
  }

  .product-price {
    font-size: 16px;
  }
}