/**
 * Bootstrap Blog Theme Custom Styles
 */

/* 导航栏样式 */
.navbar-brand img {
  max-height: 50px;
  width: auto;
}

.navbar-brand-text {
  font-size: 1.5rem;
  font-weight: 700;
}

.navbar-nav .nav-link {
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Hero 区域 */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.hero-section h1 {
  color: white;
}

/* 文章卡片 */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  border-top-left-radius: calc(0.375rem - 1px);
  border-top-right-radius: calc(0.375rem - 1px);
}

.card-title a {
  transition: color 0.3s ease;
}

.card-title a:hover {
  color: var(--bs-primary) !important;
}

/* 文章页面 */
.post-content,
.page-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* 强制覆盖内联样式中的 nowrap */
.post-content span,
.page-content span,
.post-content p span,
.page-content p span {
  white-space: normal !important;
  text-wrap: wrap !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

.post-content img,
.page-content img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 0.375rem;
}

.post-content blockquote,
.page-content blockquote {
  border-left: 4px solid var(--bs-primary);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: #6c757d;
  font-style: italic;
}

.post-content pre,
.page-content pre {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
  padding: 1rem;
  overflow-x: auto;
}

.post-content code,
.page-content code {
  background-color: #f8f9fa;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  white-space: normal !important;
  word-break: break-word !important;
}

/* 分页样式 */
.pagination .page-link {
  color: var(--bs-primary);
  border: none;
  margin: 0 0.2rem;
  border-radius: 0.25rem !important;
}

.pagination .page-link:hover {
  background-color: #e9ecef;
  color: var(--bs-primary);
}

.pagination .page-item.active .page-link {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

/* 小工具样式 */
.widget {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.widget-title,
.card-header {
  background-color: #fff;
  border-bottom: 2px solid var(--bs-primary) !important;
}

/* 标签云 */
.tagcloud a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin: 0.2rem;
  background-color: #f8f9fa;
  color: #495057;
  text-decoration: none;
  border-radius: 0.25rem;
  font-size: 0.875rem !important;
  transition: all 0.3s ease;
}

.tagcloud a:hover {
  background-color: var(--bs-primary);
  color: white;
  transform: scale(1.05);
}

/* 评论区域 */
.comment-list {
  list-style: none;
  padding: 0;
}

.comment-list li {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 0.375rem;
}

.comment-author {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.comment-metadata {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 1rem;
}

.comment-form input,
.comment-form textarea {
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 页脚样式 */
.site-footer a {
  transition: color 0.3s ease;
}

.site-footer a:hover {
  color: white !important;
}

.social-links a {
  color: rgba(255, 255, 255, 0.7);
}

.social-links a:hover {
  color: white !important;
  transform: scale(1.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0 !important;
  }

  .hero-section h1 {
    font-size: 1.75rem;
  }

  .card-img-top {
    height: 150px;
  }

  .post-content {
    font-size: 1rem;
  }
}

/* 页面加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.5s ease-out;
}

/* 滚动到顶部按钮 */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--bs-primary);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.scroll-to-top:hover {
  background-color: #0b5ed7;
  transform: translateY(-3px);
}

.scroll-to-top.show {
  display: flex;
}

/* 搜索框样式 */
.navbar .form-control {
  border-radius: 0.25rem;
  border: none;
}

.navbar .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.5);
}

/* 文章元数据 */
.post-meta .badge {
  font-weight: 500;
}

.post-meta span,
.post-meta-item {
  white-space: normal !important;
  text-wrap: wrap !important;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  display: inline-block;
}

.post-meta .row {
  flex-wrap: wrap;
}

.post-meta .d-flex {
  flex-wrap: wrap;
  align-items: center;
}

.post-meta-left,
.post-meta-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.post-meta-right {
  margin-left: auto;
}

@media (max-width: 767.98px) {
  .post-meta .d-flex {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .post-meta-right {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* 文章导航 */
.post-navigation a {
  transition: all 0.3s ease;
}

.post-navigation a:hover {
  opacity: 0.8;
}

/* 社交分享按钮 */
.social-share button {
  transition: all 0.3s ease;
}

.social-share button:hover {
  transform: scale(1.1);
}
