﻿/* ========================================
   全局公共样式 - 现代化设计系统
   ======================================== */

/* 基础变量 */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --text-color: #333;
  --text-muted: #999;
  --border-color: #eee;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 12px 24px rgba(0,0,0,0.15);
}

/* 内容图片自适应 */
.content img,
.markdown img {
  max-width: 100% !important;
  height: auto !important;
  margin: 10px auto !important;
}

/* ========================================
   5列布局系统
   ======================================== */
@media (min-width: 992px) {
  .row > .col-lg-fifth {
    flex: 0 0 20% !important;
    max-width: 20% !important;
    width: 20% !important;
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  .row > .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}
@media (max-width: 767px) {
  .row > .col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}

/* ========================================
   通用卡片样式
   ======================================== */
.book-card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  height: 100%;
  background: #fff;
}
.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}
.book-card .img-wrapper {
  overflow: hidden;
  position: relative;
  aspect-ratio: 3 / 4;
}
.book-card .card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.book-card:hover .card-img-top {
  transform: scale(1.05);
}
.book-card .price-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}
.book-card .card-body {
  padding: 12px;
}
.book-card .book-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}
.book-card .book-title:hover {
  color: #667eea;
}
.book-card .book-meta {
  font-size: 11px;
  color: #999;
}
.book-card .book-meta .icon {
  width: 14px;
  height: 14px;
}

/* ========================================
   页面标题区域
   ======================================== */
.page-header-modern {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  border-radius: 12px;
  padding: 25px 30px;
  margin-bottom: 25px;
}
.page-header-modern .page-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

/* ========================================
   分页美化
   ======================================== */
.pagination {
  justify-content: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
.pagination .page-link {
  border-radius: 8px;
  margin: 0 3px;
  border: none;
  color: #666;
}
.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

/* ========================================
   现代卡片容器
   ======================================== */
.modern-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* ========================================
   首页样式
   ======================================== */
.carousel-modern {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.carousel-modern .carousel-inner {
  border-radius: 16px;
}
.carousel-modern .carousel-item img {
  height: 320px;
  object-fit: cover;
}
.carousel-modern .carousel-caption {
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 30px 30px;
}

.welcome-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 25px 30px;
  color: white;
  margin: 25px 0;
}
.welcome-banner h2 {
  color: white;
  margin-bottom: 8px;
}
.welcome-banner p {
  opacity: 0.9;
  margin: 0;
}
.welcome-banner .btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
}
.welcome-banner .btn:hover {
  background: white;
  color: #667eea;
}

.category-section {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.category-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}
.category-section .section-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
  display: flex;
  align-items: center;
}
.category-section .section-title .icon {
  margin-right: 8px;
  color: #667eea;
}
.category-section .more-btn {
  font-size: 13px;
  color: #667eea;
  text-decoration: none;
}
.category-section .more-btn:hover {
  color: #764ba2;
}

.hot-section {
  background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
  border-left: 4px solid #ff6b6b;
}
.hot-section .section-title {
  color: #ff6b6b;
}

/* ========================================
   列表页样式
   ======================================== */
.recommend-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 30px;
}
.recommend-section .section-title {
  color: white;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}
.recommend-section .book-card {
  background: rgba(255,255,255,0.95);
}

.list-section {
  background: #fff;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.list-section .section-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

/* ========================================
   搜索页样式
   ======================================== */
.filter-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ========================================
   联系页样式
   ======================================== */
.modern-card .card-header {
  background: transparent;
  border-bottom: 1px solid #f0f0f0;
  padding: 18px 20px;
}
.modern-card .card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.modern-card .card-body {
  padding: 20px;
}
.form-card .card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
.form-card .card-header h3 {
  color: #fff;
}

/* ========================================
   订单查询页样式
   ======================================== */
.query-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
}
.query-card .card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 20px;
  border: none;
}
.query-card .card-header h3 {
  color: #fff;
  margin: 0;
  font-size: 18px;
}
.query-card .card-body {
  padding: 25px;
}

.order-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eee;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s;
}
.order-card:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border-color: #667eea;
}

/* ========================================
   详情页样式
   ======================================== */
.detail-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}
.detail-card .card-body {
  padding: 30px;
}
.detail-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
  margin-bottom: 15px;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}
.detail-meta .meta-item {
  display: flex;
  align-items: center;
  color: #666;
  font-size: 14px;
}
.detail-meta .meta-item .icon {
  margin-right: 5px;
  color: #999;
}

.seo-summary {
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid #667eea;
}
.seo-summary h4 {
  color: #667eea;
  font-size: 16px;
  margin-bottom: 12px;
}
.seo-summary p {
  color: #555;
  line-height: 1.8;
  margin-bottom: 10px;
}

.tag-list .btn {
  border-radius: 20px;
  padding: 5px 15px;
  margin: 3px;
  font-size: 12px;
  background: #f0f0f0;
  border: none;
  color: #666;
  transition: all 0.2s;
}
.tag-list .btn:hover {
  background: #667eea;
  color: white;
}

/* ========================================
   移动端适配
   ======================================== */
@media (max-width: 767px) {
  /* 页面标题 */
  .page-header-modern {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
  }
  .page-header-modern .page-title {
    font-size: 18px;
  }
  
  /* 卡片 */
  .book-card {
    border-radius: 8px;
  }
  .book-card .card-body {
    padding: 8px;
  }
  .book-card .book-title {
    font-size: 12px;
    height: 32px;
    margin-bottom: 5px;
  }
  .book-card .book-meta {
    font-size: 10px;
  }
  .book-card .price-tag {
    padding: 2px 6px;
    font-size: 10px;
    top: 5px;
    right: 5px;
  }
  
  /* 轮播图 */
  .carousel-modern .carousel-item img {
    height: 180px;
  }
  .carousel-modern .carousel-caption {
    padding: 20px 15px 15px;
  }
  .carousel-modern .carousel-caption h3 {
    font-size: 16px;
  }
  .carousel-modern .carousel-caption p {
    display: none;
  }
  
  /* 欢迎横幅 */
  .welcome-banner {
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
  }
  .welcome-banner h2 {
    font-size: 16px;
  }
  .welcome-banner p {
    font-size: 12px;
  }
  .welcome-banner .btn {
    display: none;
  }
  
  /* 分类区块 */
  .category-section {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
  }
  .category-section .section-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
  .category-section .section-title {
    font-size: 15px;
  }
  
  /* 热门排行 */
  .hot-section .list-group-item {
    padding: 10px 0 !important;
  }
  .hot-section .rank-num {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
    margin-right: 10px !important;
  }
  
  /* 推荐区域 */
  .recommend-section {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
  }
  .recommend-section .section-title {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  /* 列表区域 */
  .list-section {
    padding: 15px;
    border-radius: 10px;
  }
  .list-section .section-title {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  /* 筛选面板 */
  .filter-card {
    padding: 15px;
  }
  
  /* 联系页 */
  .modern-card .card-body {
    padding: 15px;
  }
  
  /* 订单查询 */
  .query-card .card-body {
    padding: 15px;
  }
  
  /* 详情页 */
  .detail-card .card-body {
    padding: 15px;
  }
  .detail-title {
    font-size: 18px;
  }
  .detail-meta {
    gap: 12px;
    font-size: 12px;
  }
  .seo-summary {
    padding: 15px;
  }
  .seo-summary h4 {
    font-size: 14px;
  }
  .accordion-button {
    font-size: 14px;
    padding: 12px 15px;
  }
}


/* ========================================
   导航栏样式
   ======================================== */
.navbar-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  box-shadow: 0 2px 15px rgba(102,126,234,0.3);
}
.navbar-modern .navbar-brand a {
  font-size: 22px;
  font-weight: 700;
  color: #fff !important;
  text-decoration: none;
  letter-spacing: 1px;
}
.navbar-modern .navbar-toggler {
  border-color: rgba(255,255,255,0.3);
}
.navbar-modern .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-menu-modern {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.navbar-menu-modern .nav-link {
  color: #333 !important;
  font-weight: 500;
  padding: 12px 16px !important;
  border-radius: 8px;
  margin: 0 2px;
  transition: all 0.2s;
}
.navbar-menu-modern .nav-link:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff !important;
}
.navbar-menu-modern .nav-link .icon {
  color: #667eea;
}
.navbar-menu-modern .nav-link:hover .icon {
  color: #fff;
}

.search-box-modern .form-control {
  border-radius: 25px;
  padding-left: 40px;
  border: 2px solid #eee;
  transition: all 0.3s;
}
.search-box-modern .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}
.search-box-modern .input-icon-addon {
  left: 12px;
  color: #999;
}

.dropdown-menu {
  border: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border-radius: 12px;
  padding: 8px;
}
.dropdown-item {
  border-radius: 8px;
  padding: 10px 15px;
  transition: all 0.2s;
}
.dropdown-item:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

@media (max-width: 767px) {
  .navbar-modern .navbar-brand a {
    font-size: 18px;
  }
  .navbar-menu-modern .nav-link {
    padding: 10px 12px !important;
  }
  .search-box-modern {
    margin: 10px 0;
  }
}

/* ========================================
   页脚样式
   ======================================== */
.footer-modern {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 40px;
}
.footer-modern a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-modern a:hover {
  color: #667eea;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-links .icon {
  width: 18px;
  height: 18px;
}
.footer-copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
}
.footer-brand {
  text-align: center;
  margin-bottom: 20px;
}
.footer-brand a {
  font-size: 22px;
  font-weight: 700;
  color: #fff !important;
}

@media (max-width: 767px) {
  .footer-modern {
    padding: 25px 0 15px;
    margin-top: 25px;
  }
  .footer-links {
    gap: 15px;
    font-size: 13px;
  }
}
