/* 现代化网站样式优化方案 */

/* ==========================
 * CSS Reset 和基础样式
 * ========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font: 14px/1.6 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #333;
  background-color: #f8f9fa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================
 * 布局组件
 * ========================== */
.wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部样式优化 */
.header {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-scrolled {
  padding: 10px 0;
}

/* 导航菜单优化 */
.nav-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
}

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

.nav-links li a {
  color: #333;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: #082d8a;
}

.nav-links li a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #082d8a;
  transition: width 0.3s ease;
}

.nav-links li a:hover:after,
.nav-links li a.active:after {
  width: 100%;
}

/* 搜索框优化 */
.search-box {
  position: relative;
  max-width: 400px;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 30px;
  font-size: 14px;
  transition: all 0.3s ease;
  outline: none;
}

.search-box input:focus {
  border-color: #082d8a;
  box-shadow: 0 0 0 3px rgba(8,45,138,0.1);
}

.search-box button {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  padding: 0 20px;
  background-color: #082d8a;
  color: white;
  border: none;
  border-radius: 28px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-box button:hover {
  background-color: #06246d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(8,45,138,0.2);
}

/* ==========================
 * 焦点图区域优化
 * ========================== */
.home-focus-layout {
  position: relative;
  height: 500px;
  overflow: hidden;
  margin-bottom: 40px;
}

.banner-carousel {
  height: 100%;
}

.banner-wrapper {
  height: 100%;
}

.banner-inner {
  height: 100%;
}

.banner-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.banner-item.active {
  opacity: 1;
  z-index: 10;
}

.banner-item a {
  display: block;
  width: 100%;
  height: 100%;
}

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

.banner-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: rgba(0,0,0,0.3);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  opacity: 0;
}

.home-focus-layout:hover .banner-btn {
  opacity: 1;
}

.banner-prev {
  left: 20px;
}

.banner-next {
  right: 20px;
}

.banner-btn:hover {
  background-color: rgba(0,0,0,0.6);
  transform: translateY(-50%) scale(1.1);
}

.banner-indicator {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 20;
}

.indicator-item {
  width: 12px;
  height: 12px;
  background-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator-item.active,
.indicator-item:hover {
  background-color: white;
  width: 30px;
  border-radius: 6px;
}

/* ==========================
 * 商品展示区域优化
 * ========================== */
.product-section {
  padding: 40px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: 28px;
  color: #333;
  font-weight: 600;
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
}

.section-title h2:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #082d8a, #3a80e6);
}

/* 商品卡片优化 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.product-card {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.product-image {
  height: 220px;
  overflow: hidden;
  position: relative;
}

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

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: #ff4040;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  z-index: 10;
}

.product-info {
  padding: 20px;
}

.product-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 10px;
  height: 48px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.product-title a:hover {
  color: #082d8a;
}

.product-price {
  margin: 15px 0;
}

.price-current {
  font-size: 22px;
  font-weight: 600;
  color: #ff4040;
}

.price-original {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
  margin-left: 10px;
}

.product-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
  font-size: 14px;
  color: #666;
}

.sales-count {
  display: flex;
  align-items: center;
}

.product-rating {
  display: flex;
  align-items: center;
  color: #ffb400;
}

.product-rating i {
  margin-right: 2px;
}

/* ==========================
 * 分类导航优化
 * ========================== */
.category-section {
  background-color: white;
  padding: 40px 0;
  margin-bottom: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.category-item {
  text-align: center;
  padding: 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.category-item:hover {
  background-color: #f8f9fa;
  transform: translateY(-4px);
}

.category-icon {
  width: 60px;
  height: 60px;
  background-color: #e8f4fd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  color: #082d8a;
  font-size: 24px;
  transition: all 0.3s ease;
}

.category-item:hover .category-icon {
  background-color: #082d8a;
  color: white;
  transform: scale(1.1);
}

.category-name {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

/* ==========================
 * 侧边栏优化
 * ========================== */
.side-bar {
  background-color: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin-bottom: 30px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.article-list {
  list-style: none;
}

.article-item {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f5f5f5;
}

.article-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.article-item a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-item a:hover {
  color: #082d8a;
}

/* ==========================
 * 页脚优化
 * ========================== */
.footer {
  background-color: #1a1a1a;
  color: #888;
  padding: 60px 0 30px;
}

.footer-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-column h4 {
  font-size: 16px;
  color: white;
  font-weight: 500;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-column h4:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: #082d8a;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #888;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 14px;
}

.footer-links a:hover {
  color: white;
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid #333;
  font-size: 14px;
}

/* ==========================
 * 动画和交互效果
 * ========================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* 骨架屏加载效果 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: #082d8a;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(8,45,138,0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #06246d;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(8,45,138,0.4);
}

/* ==========================
 * 响应式设计优化
 * ========================== */
@media (max-width: 1200px) {
  .home-focus-layout {
    height: 400px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
  }
}

@media (max-width: 992px) {
  .home-focus-layout {
    height: 350px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }
  
  .nav-links {
    gap: 15px;
  }
  
  .footer-top {
    gap: 30px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .home-focus-layout {
    height: 280px;
    margin-bottom: 30px;
  }
  
  .product-section {
    padding: 30px 0;
  }
  
  .section-title h2 {
    font-size: 24px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }
  
  .product-image {
    height: 180px;
  }
  
  .nav-links {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .footer-top {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
  }
  
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 576px) {
  .wrapper {
    padding: 0 15px;
  }
  
  .home-focus-layout {
    height: 220px;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .banner-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .category-list {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-column h4:after {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 480px) {
  .search-box {
    max-width: 100%;
  }
  
  .category-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .section-title h2 {
    font-size: 22px;
  }
}

/* ==========================
 * 主题配色定义
 * ========================== */
:root {
  --primary-color: #082d8a;
  --primary-hover: #06246d;
  --secondary-color: #3a80e6;
  --accent-color: #ff4040;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --background-light: #f8f9fa;
  --background-white: #ffffff;
  --border-color: #e0e0e0;
  --success-color: #52c41a;
  --warning-color: #faad14;
  --danger-color: #ff4d4f;
  --shadow-light: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-medium: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-heavy: 0 8px 24px rgba(0,0,0,0.16);
}

/* ==========================
 * 工具类
 * ========================== */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }
.p-40 { padding: 40px; }

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.flex-wrap {
  flex-wrap: wrap;
}

.hide {
  display: none;
}

.show {
  display: block;
}

.overflow-hidden {
  overflow: hidden;
}

.position-relative {
  position: relative;
}

.position-absolute {
  position: absolute;
}

.position-fixed {
  position: fixed;
}