/* 涟源市乐德社会工作发展中心 - 自定义样式 */

:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --accent-color: #f8f9fa;
  --text-dark: #212529;
  --text-muted: #6c757d;
}

/* 基础样式 */
body {
  font-family: 'Microsoft YaHei', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
}

/* 导航栏 */
.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary-color) !important;
}

/* 首页横幅 */
.hero-section {
  background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
  padding: 4rem 0;
  margin-top: -1rem;
}

.min-vh-75 {
  min-height: 75vh;
}

/* 卡片悬停效果 */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

/* 特色图标 */
.feature-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%; /* 修复：改为圆形，与 rounded-circle 保持一致 */
}

/* 页面标题 */
.page-title {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
}

/* 按钮样式 */
.btn {
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-lg {
  padding: 0.75rem 2rem;
  border-radius: 10px;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

/* 列表组样式 */
.list-group-item {
  border-left: none;
  border-right: none;
  padding: 1.25rem 0;
  transition: background-color 0.3s ease;
}

.list-group-item:hover {
  background-color: #f8f9fa;
}

/* 卡片样式 */
.card {
  border-radius: 12px;
  overflow: hidden;
}

.card-img-top {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* 徽章样式 */
.badge {
  font-weight: 500;
  padding: 0.35rem 0.75rem;
}

/* 下拉菜单 */
.dropdown-menu {
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: background-color 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #e3f2fd;
  color: var(--primary-color);
}

/* 表单样式 */
.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* 表格样式 */
.table > :not(caption) > * > * {
  padding: 1rem;
}

.table-hover > tbody > tr:hover {
  background-color: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .display-5 {
    font-size: 1.75rem;
  }
  
  .min-vh-75 {
    min-height: auto;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* 加载动画 */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* 页脚样式 */
footer a {
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #fff !important;
  text-decoration: underline;
}

/* 文字截断 */
.text-truncate-multiline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 打印样式 */
@media print {
  .navbar,
  footer,
  .btn {
    display: none !important;
  }
}

/* 无障碍样式 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 焦点样式 */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 成功和错误提示 */
.alert {
  border-radius: 10px;
  border: none;
  padding: 1rem 1.5rem;
}

.alert-success {
  background-color: #d1e7dd;
  color: #0f5132;
}

.alert-danger {
  background-color: #f8d7da;
  color: #842029;
}

.alert-warning {
  background-color: #fff3cd;
  color: #664d03;
}

.alert-info {
  background-color: #cff4fc;
  color: #055160;
}

/* ===== 新增优质增强样式 ===== */

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 分类筛选按钮激活状态 */
#category-tabs .btn.active {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* 返回顶部按钮 */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: translateY(-3px);
  background-color: #0b5ed7;
}

/* 面包屑导航 */
.breadcrumb {
  background: transparent;
  padding: 0.5rem 0;
  margin-bottom: 0;
  font-size: 0.875rem;
}

.breadcrumb-item a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: #fff;
}

.breadcrumb-item.active {
  color: rgba(255,255,255,0.7);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255,255,255,0.5);
}

/* 文章内容样式 */
#news-content,
#activity-content {
  line-height: 1.9;
  font-size: 1.05rem;
  color: #333;
}

#news-content h1, #news-content h2, #news-content h3,
#activity-content h1, #activity-content h2, #activity-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #212529;
  font-weight: 600;
}

#news-content p,
#activity-content p {
  margin-bottom: 1.25rem;
}

#news-content img,
#activity-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* 阅读进度条 */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0d6efd, #0dcaf0);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* 卡片优化 */
.card {
  transition: box-shadow 0.3s ease;
}

.news-card:hover,
.activity-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

/* 加载骨架屏效果 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 图片加载失败占位 */
img.img-error {
  background-color: #e9ecef;
  min-height: 200px;
  object-fit: cover;
}

/* 页面入场动画 */
.page-enter {
  animation: pageEnter 0.4s ease forwards;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 徽章颜色增强 */
.badge.bg-light.text-primary {
  background-color: #e8f0fe !important;
  border: 1px solid rgba(13,110,253,0.15);
}

.badge.bg-light.text-success {
  background-color: #e8f5e9 !important;
  border: 1px solid rgba(25,135,84,0.15);
}

.badge.bg-light.text-muted {
  background-color: #f8f9fa !important;
  border: 1px solid rgba(0,0,0,0.08);
}

/* 新闻列表项优化 */
.list-group-item-action {
  border-radius: 8px !important;
  margin-bottom: 4px;
}

.list-group-item-action:hover h5,
.list-group-item-action:hover h6 {
  color: var(--primary-color);
  transition: color 0.2s ease;
}

/* 侧边栏卡片优化 */
.card-header {
  border-bottom: none;
  padding: 1rem 1.25rem;
  border-radius: 12px 12px 0 0 !important;
}

/* 响应式增强 */
@media (max-width: 576px) {
  .hero-section {
    padding: 1.5rem 0;
  }

  .display-4 {
    font-size: 1.75rem;
  }

  .btn-lg {
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
  }

  .card-body.p-5 {
    padding: 1.5rem !important;
  }

  #back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .page-title {
    padding: 2rem 0;
  }

  .page-title .display-4 {
    font-size: 1.85rem;
  }

  footer .col-lg-4 {
    margin-bottom: 1.5rem;
  }
}

