/* Bootstrap定制样式 */
:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --border-radius: .375rem;
}

/* 全局样式 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-top: 56px;
  background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

/* 导航栏样式 */
.navbar {
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  transition: transform 0.3s ease;
  color: #fff !important;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-brand i {
  font-size: 1.5rem;
}

.nav-link {
  font-weight: 500;
  transition: all 0.3s;
  position: relative;
  color: rgba(255,255,255,0.9) !important;
  padding: 0.5rem 1rem !important;
}

.nav-link:hover {
  color: #fff !important;
  transform: translateY(-2px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #ffd700;
  transition: all 0.3s;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 70%;
}

.nav-item {
  margin: 0 0.25rem;
}

/* 卡片样式 */
.card-hover {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-hover:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.card {
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 2px solid #dee2e6;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
}

.card-header h2,
.card-header h3 {
  font-weight: 600;
  color: #2c3e50;
}

.card-header i {
  font-size: 1.2rem;
}

/* 渐变背景卡片头 */
.bg-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
}

.bg-gradient-primary h2,
.bg-gradient-primary h3 {
  color: white !important;
}

.bg-gradient-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
  color: white !important;
}

.bg-gradient-success h2,
.bg-gradient-success h3 {
  color: white !important;
}

.bg-gradient-danger {
  background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%) !important;
  color: white !important;
}

.bg-gradient-danger h2,
.bg-gradient-danger h3 {
  color: white !important;
}

.bg-gradient-warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
  color: white !important;
}

.bg-gradient-warning h2,
.bg-gradient-warning h3 {
  color: white !important;
}

.bg-gradient-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
  color: white !important;
}

.bg-gradient-info h2,
.bg-gradient-info h3 {
  color: white !important;
}

.card-body {
  padding: 1.5rem;
}

/* 列表项样式 */
.list-item {
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem 0;
  transition: all 0.3s ease;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background-color: rgba(102, 126, 234, 0.05);
  padding-left: 1rem;
}

/* 列表组美化 */
.list-group-item {
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  border-right: none;
  border-top: none;
  padding: 1rem 1.25rem;
  position: relative;
}

.list-group-item:hover {
  border-left-color: #667eea;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
  transform: translateX(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.list-group-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  background: #667eea;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.list-group-item:hover::before {
  width: 6px;
  height: 6px;
  left: -3px;
}

/* 页脚样式 */
.footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

.footer-brand i {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.footer h5 {
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.footer p {
  opacity: 0.9;
  margin: 0.5rem 0;
  line-height: 1.8;
}

.footer-links a {
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: #ffd700 !important;
  transform: translateY(-2px);
}

.footer-links i {
  margin-right: 0.25rem;
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--border-radius);
}

/* 最佳回答标记 */
.best-answer {
  border-left: 4px solid var(--warning-color) !important;
  position: relative;
}

.best-answer::before {
  content: '最佳回答';
  position: absolute;
  top: -12px;
  left: 16px;
  background: var(--warning-color);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

/* 面包屑导航 */
.breadcrumb-item + .breadcrumb-item::before {
  content: ">";
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar-nav {
    margin-top: 0.5rem;
  }
  
  .nav-item {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  
  .nav-item:last-child {
    margin-bottom: 0;
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 列表无项目符号 */
ul, ol {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* 内容溢出处理 */
.article-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

.article-content p {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card-title {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}


/* 额外美化效果 */
.list-group-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.list-group-item:hover {
    border-left-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
    transform: translateX(5px);
}

/* 面包屑导航美化 */
.breadcrumb {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 0;
}

.breadcrumb-item a {
  color: #667eea;
  text-decoration: none;
  transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
  color: #764ba2;
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #6c757d;
  font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: #6c757d;
}

/* 文章标题美化 */
.card-title {
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

.card-title i {
  color: #667eea;
}

/* 元信息美化 */
.text-muted {
  font-size: 0.9rem;
}

.text-muted i {
  color: #667eea;
  margin-right: 0.25rem;
}

/* 动画延迟 */
.animate__animated {
  animation-duration: 0.8s;
}

.animate__fadeInUp {
  animation-delay: 0.1s;
}

.animate__fadeInRight {
  animation-delay: 0.2s;
}

/* 响应式间距 */
/* Bootstrap默认的row已经有负margin来抵消col的padding */

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 按钮美化 */
.btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* 图片加载效果 */
img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

img:hover {
  transform: scale(1.02);
}

img:not([src]) {
    opacity: 0;
}

/* 加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.6s ease-out;
}

/* 标签徽章美化 */
.badge {
  padding: 0.4em 0.8em;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85em;
}

/* 阴影效果 */
.shadow-sm {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

/* 文本选择颜色 */
::selection {
  background: #667eea;
  color: white;
}

::-moz-selection {
  background: #667eea;
  color: white;
}
