/* JPress Template Custom Styles */

/* 基础样式重置 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

/* 头部样式 */
.header {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand h2 {
  color: #007bff;
  font-weight: 700;
}

/* Breadcrumb */
.breadcrumb-section {
  background: #f8f9fa;
  padding: 1rem 0;
}

.breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
}

.breadcrumb-item a {
  color: #6c757d;
  text-decoration: none;
}

.breadcrumb-item.active {
  color: #333;
}

/* Header styles */
.main-header {
  background: #fff;
  padding: 1rem 0 51px;
}

.logo {
  height: 45px;
}

/* 响应式：小于等于1200px时调整logo高度 */
@media (max-width: 1200px) {
  .navbar-brand img.logo {
    height: 32px;
  }
}

/* Main Navigation */
.main-nav .navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

.main-nav .navbar-toggler:focus {
  box-shadow: none;
}

.main-nav .nav-link {
  color: #333 !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  padding: 0.5rem 1.2rem;
  position: relative;
  transition: all 0.3s ease;
  border: none;
  background: none;
}

/* Main Navigation spacing via padding: 52px -> 3.25rem */
.main-nav .nav-item {
  padding-right: 0.5rem;
}

.main-nav .nav-item:last-child {
  padding-right: 0;
}

/* 搜索按钮样式 */
.btn-search-icon {
  background: none;
  border: none;
  color: #333;
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-search-icon:hover {
  color: #32b8fe;
  transform: translateY(-1px);
}

.btn-search-icon:focus {
  outline: none;
  box-shadow: none;
}

/* 移动端按钮组 */
.navbar-mobile-buttons {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

/* 移动端搜索按钮 */
.btn-search-icon-mobile {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  font-size: 1.1rem;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 38px;
}

.btn-search-icon-mobile:hover {
  color: #32b8fe;
  border-color: #32b8fe;
  background-color: #f8f9fa;
}

.btn-search-icon-mobile:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(50, 184, 254, 0.25);
}

.main-nav .nav-link:hover {
  transform: translateY(-1px);
}

.main-nav .nav-link.active {
  border-radius: 4px;
}

.main-nav .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1rem);
  height: 2px;
  background: #333333;
}

/* Sub Navigation */
.sub-nav {
  background: #fff;
  padding: 1.5rem 0;
  margin-top: -51px;
}

.sub-nav .navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

.sub-nav .navbar-toggler:focus {
  box-shadow: none;
}

.sub-nav .nav-tabs {
  border-bottom: none;
}

.sub-nav .nav-link {
  border: none;
  color: #999999 !important;
  font-weight: 500;
  font-size: 1rem; /* 16px -> 1rem */
  padding: 0.5rem 1.5rem;
  position: relative;
  transition: all 0.3s ease;
  background: none;
}

.sub-nav .nav-link:hover {
  background: none;
  transform: translateY(-1px);
}

.sub-nav .nav-link.active {
  color: #333 !important;
  background: none;
}

.sub-nav .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1rem);
  height: 2px;
  background: #333333;
}

.sub-nav .nav-link:hover::after {
  display: none;
}

/* Keep underline when active item is hovered (match main-nav) */
.sub-nav .nav-link.active:hover::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1rem);
  height: 2px;
  background: #333333;
  display: block;
}

/* Third Navigation */
.third-nav {
  background: #fff;
  padding: 0;
  font-size: 1.2rem;
}

.third-nav .container {
  padding-left: 0;
}

.third-nav .navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

.third-nav .navbar-toggler:focus {
  box-shadow: none;
}

.third-nav .nav-tabs {
  border-bottom: none;
}

.third-nav .nav-link {
  border: none;
  color: #999999 !important;
  font-weight: 500;
  font-size: 1.25rem;
  padding: 0.5rem 1.5rem;
  position: relative;
  transition: all 0.3s ease;
  background: none;
}

/* Spacing via padding for sub-nav and third-nav (match main-nav approach) */
.sub-nav .nav-item {
  padding-right: 0.5rem;
}
.sub-nav .nav-item:last-child {
  padding-right: 0;
}
.third-nav .nav-item {
  padding-right: 1rem;
}
.third-nav .nav-item:last-child {
  padding-right: 0;
}

.third-nav .nav-link:hover {
  background: none;
  transform: translateY(-1px);
}

.third-nav .nav-link.active {
  color: inherit !important;
  background: none;
}

.third-nav .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1rem);
  height: 2px;
  background: #333333;
}

.third-nav .nav-link:hover::after {
  display: none;
}

/* Keep underline when active item is hovered (match main-nav) */
.third-nav .nav-link.active:hover::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1rem);
  height: 2px;
  background: #333333;
  display: block;
}

/* Breadcrumb */
.breadcrumb-section {
  background: #f8f9fa;
  padding: 1rem 0;
}

.breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
}

.breadcrumb-item a {
  color: #6c757d;
  text-decoration: none;
}

.breadcrumb-item.active {
  color: #333;
}

/* Page Header */
.page-header {
  padding: 1rem 0 2rem 0;
  background: #fff;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: #999;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Search Form */
.search-container {
  position: relative;
  max-width: 280px;
}

.search-form {
  position: relative;
}

.search-form .form-control {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  font-size: 0.9rem;
}

.search-form .btn-search {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  border: none;
  background: #f8f9fa;
  border-radius: 0 4px 4px 0;
  color: #666;
}

.search-form .btn-clear {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: 12px;
  padding: 0;
  width: 16px;
  height: 16px;
  display: none;
  cursor: pointer;
}

.search-form .btn-clear:hover {
  color: #666;
}

/* Responsive */
@media (max-width: 991.98px) {
  .main-header {
    padding: 1rem 0 25px;
  }

  .sub-nav {
    margin-top: -25px;
    padding: 0.5rem 0;
  }

  .page-header {
    padding: 0.5rem 0;
  }

  .main-nav .navbar-nav,
  .sub-nav .navbar-nav,
  .third-nav .navbar-nav {
    padding: 0;
  }

  /* Center third-nav items on mobile */
  .third-nav .container {
    padding-left: 0;
    padding-right: 0;
  }

  .third-nav .navbar-collapse.show {
    display: flex;
    justify-content: center;
  }

  .third-nav .navbar-nav {
    align-items: center !important;
  }

  .third-nav .nav-link {
    text-align: center !important;
  }

  /* 移动端二三级菜单不折叠，直接展示 */
  .sub-nav .navbar-collapse,
  .third-nav .navbar-collapse {
    display: flex !important;
  }

  .sub-nav .navbar-toggler,
  .third-nav .navbar-toggler {
    display: none !important;
  }

  /* Remove horizontal padding on stacked (mobile) layout */
  .main-nav .nav-item {
    padding-right: 0;
  }
  .sub-nav .nav-item,
  .third-nav .nav-item {
    padding-right: 0;
  }

  .main-nav .nav-link,
  .sub-nav .nav-link,
  .third-nav .nav-link {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
  }

  .main-nav .nav-link:last-child,
  .sub-nav .nav-link:last-child,
  .third-nav .nav-link:last-child {
    border-bottom: none;
  }

  .main-nav .nav-link.active {
    background-color: #f8f9fa;
    color: #32b8fe !important;
    border-radius: 4px;
  }

  /* 移动端显示按钮组，隐藏桌面端搜索按钮 */
  .navbar-mobile-buttons {
    display: flex !important;
  }

  .btn-search-icon {
    display: none !important;
  }

  .main-nav .nav-link.active::after,
  .main-nav .nav-link:hover::after,
  .main-nav .nav-link.active:hover::after {
    display: none;
  }

  /* 小于等于991.98px时，二三级菜单激活项显示下划线 */
  .sub-nav .nav-link.active::after,
  .sub-nav .nav-link.active:hover::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1rem);
    height: 2px;
    background: #333333;
    display: block !important;
  }

  .third-nav .nav-link.active::after,
  .third-nav .nav-link.active:hover::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1rem);
    height: 2px;
    background: #333333;
    display: block !important;
  }

  .sub-nav .nav-link:hover::after,
  .third-nav .nav-link:hover::after {
    display: none;
  }

  .search-container {
    margin-top: 1rem;
    max-width: 100%;
  }
}

/* 小于等于768px时，二三级菜单字号改为14px (0.875rem) 并横向展示 */
@media (max-width: 768px) {
  .sub-nav .nav-link {
    font-size: 0.875rem; /* 14px */
  }

  .third-nav .nav-link {
    font-size: 0.875rem; /* 14px */
  }

  /* 二三级菜单横向展示 */
  .sub-nav .navbar-nav,
  .third-nav .navbar-nav {
    flex-direction: row !important;
    flex-wrap: wrap;
  }

  .sub-nav .nav-item,
  .third-nav .nav-item {
    padding-right: 0.5rem;
    border-bottom: none;
  }

  .sub-nav .nav-link,
  .third-nav .nav-link {
    padding: 0.5rem 0.25rem;
    border-bottom: none;
    white-space: nowrap;
  }
}

/* Footer */
.main-footer {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-contact h6 {
  font-weight: 600;
  color: #333;
  margin-bottom: 1.2rem;
  font-size: 1rem;
}

.footer-contact .contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}

.footer-icon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  margin-right: 0.5rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.footer-nav {
  margin-bottom: 2rem;
}

.footer-nav h6 {
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.footer-nav h6 a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-nav h6 a:hover {
  color: #32b8fe;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav ul li {
  margin-bottom: 0.4rem;
}

.footer-nav ul li a {
  color: #666;
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.3s;
}

.footer-nav ul li a:hover {
  color: #32b8fe;
}

.qr-code {
  width: 118px;
  height: 118px;
  margin-top: 1rem;
  border-radius: 4px;
}

.footer-bottom {
  border-top: 1px solid #ddd;
  padding-top: 1.2rem;
  font-size: 0.8rem;
  color: #666;
}

.footer-bottom a {
  color: #666;
  text-decoration: none;
  margin: 0 0.5rem;
}

.footer-bottom a:hover {
  color: #32b8fe;
}

/* 主要内容区域 */
.main-content {
  min-height: calc(100vh - 200px);
}

/* 文章卡片样式 */
.card {
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 按钮样式 */
.btn {
  border-radius: 25px;
  padding: 8px 24px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(45deg, #007bff, #0056b3);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(45deg, #0056b3, #004085);
}

/* 评论区域 */
.comments-section {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 10px;
  margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hero-banner .jumbotron {
    padding: 30px 20px;
  }

  .card-body {
    padding: 15px;
  }

  .btn {
    font-size: 14px;
    padding: 6px 16px;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 辅助类 */
.text-primary-custom {
  color: #007bff !important;
}

.bg-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.shadow-custom {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.pagination-container .pagination {
  margin: 0;
}

.pagination-container .pagination .page-item .page-link {
  border-radius: 50%;
  background: #f8f9fa;
  color: #666;
  border: 1px solid transparent;
  margin: 0 0.2rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  transition: all 0.3s;
  text-decoration: none;
}

.pagination-container .pagination .page-item:first-child .page-link,
.pagination-container .pagination .page-item:last-child .page-link {
  border-radius: 50%;
}

.pagination-container .pagination .page-item.active .page-link {
  background: #333;
  color: #fff;
  border-color: #333;
}

.pagination-container .pagination .page-item .page-link:hover {
  background: #666;
  color: #fff;
  transform: translateY(-1px);
  border-color: #666;
}

.pagination-container .pagination .page-item .page-link:focus {
  background: #666;
  color: #fff;
  border-color: #666;
  box-shadow: 0 0 0 0.2rem rgba(102, 102, 102, 0.25);
}

/* Support for Bootstrap margin-left calculation */
.pagination-container .pagination .page-item:not(:first-child) .page-link {
  margin-left: calc(var(--bs-border-width) * -1);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .pagination-container .pagination .page-item .page-link {
    width: 35px;
    height: 35px;
    font-size: 0.875rem;
    margin: 0 0.1rem;
  }
}

/* Tab Content */
.tab-content {
  border: none;
  padding: 0;
}

.tab-pane {
  border: none;
  padding: 0;
}

/* error */
#error-page {
  text-align: center;
  max-width: 500px;
  margin: 50px auto;
  background: #fff;
  padding: 30px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#error-page .error-code {
  font-size: 72px;
  color: #e74c3c;
  margin-bottom: 10px;
}

#error-page .error-message {
  font-size: 18px;
  color: #333;
  margin-bottom: 20px;
}

#error-page a {
  color: #3498db;
  text-decoration: none;
}

/* 暂无文章数据 */
.empty-text {
  color: #999;
  font-size: 1.1rem;
}
