/* Vue.js模板样式 - 针对百度/搜狗SEO优化 */
:root {
  --primary-color: #1890ff;
  --secondary-color: #2c3e50;
  --success-color: #52c41a;
  --info-color: #13c2c2;
  --warning-color: #faad14;
  --danger-color: #f5222d;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --border-radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局样式 */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.8;
  color: #333;
  background-color: #f5f7fa;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 容器样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 导航栏样式 - 增强可读性 */
.navbar {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 12px rgba(24, 144, 255, 0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.navbar-brand:hover {
  transform: translateY(-2px);
}

.navbar-brand img {
  height: 40px;
  margin-right: 10px;
  border-radius: 4px;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-menu li {
  margin-left: 2rem;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu a:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.nav-menu a i {
  font-size: 1.1rem;
}

.hamburger {
  display: none;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: var(--transition);
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 主要内容区域 */
.main-content {
  padding: 2rem 0;
  min-height: calc(100vh - 300px);
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
}

/* 左侧内容区 */
.left-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* 卡片样式 - 增强层次感 */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid #e8e8e8;
  margin-bottom: 0;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid #f0f0f0;
  background: linear-gradient(to right, #fafafa, #ffffff);
}

.card-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--secondary-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header h2 i {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e9ecef;
  background-color: #fafafa;
}

/* 列表项样式 - 优化可读性 */
.list-item {
  display: flex;
  padding: 1.25rem 0;
  border-bottom: 1px solid #f0f0f0;
  transition: var(--transition);
}

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

.list-item:hover {
  background-color: rgba(24, 144, 255, 0.03);
  border-left: 3px solid var(--primary-color);
  padding-left: calc(1rem - 3px);
  border-radius: 4px;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.list-item-title a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  display: inline-block;
}

.list-item-title a:hover {
  color: var(--primary-color);
  transform: translateX(4px);
}

.list-item-summary {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-item-meta {
  display: flex;
  font-size: 0.85rem;
  color: #999;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.list-item-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.list-item-meta i {
  color: var(--primary-color);
}

/* 右侧边栏 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar .card {
  position: sticky;
  top: 90px;
}

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

.footer-content {
  text-align: center;
}

.footer h5 {
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
}

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

/* 面包屑导航 - SEO优化 */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.9rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.breadcrumb a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.breadcrumb span {
  color: #666;
  font-weight: 500;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: "/";
  margin: 0 0.75rem;
  color: #d9d9d9;
  font-weight: normal;
}

.breadcrumb i {
  font-size: 0.9rem;
}

/* 文章内容样式 - 增强可读性 */
.article-title {
  font-size: 2rem;
  margin-bottom: 1.25rem;
  color: var(--secondary-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
  font-weight: 700;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #f0f0f0;
  color: #666;
  font-size: 0.95rem;
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-meta i {
  color: var(--primary-color);
  font-size: 1rem;
}

.article-content {
  font-size: 1.05rem;
  line-height: 2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: #333;
}

.article-content p {
  margin-bottom: 1.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: justify;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--secondary-color);
  font-weight: 600;
}

.article-content h2 {
  font-size: 1.75rem;
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
}

.article-content h3 {
  font-size: 1.5rem;
}

.article-content h4 {
  font-size: 1.25rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  height: 40px;
}

.article-content ul,
.article-content ol {
  padding-left: 2rem;
  margin-bottom: 1.5rem;
}

.article-content li {
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

.article-content a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.article-content a:hover {
  border-bottom-color: var(--primary-color);
}

.article-content code {
  background: #f5f5f5;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
  color: #e83e8c;
}

.article-content pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: #666;
  font-style: italic;
  background: #f9f9f9;
  padding: 1rem 1rem 1rem 1.5rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

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

.best-answer::before {
  content: "✓ 最佳回答";
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--warning-color);
  color: white;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 992px) {
  .grid-container {
    grid-template-columns: 1fr;
  }
  
  .sidebar .card {
    position: static;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
    z-index: 1001;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    transition: left 0.3s ease;
    overflow-y: auto;
    z-index: 999;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-menu li {
    margin: 0.75rem 0;
    margin-left: 0;
    width: 80%;
    list-style: none;
  }
  
  .nav-menu a {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1.1rem;
  }
  
  .main-content {
    padding: 1rem 0;
  }
  
  .article-title {
    font-size: 1.5rem;
  }
  
  .article-content {
    font-size: 1rem;
  }
  
  .container {
    padding: 0 15px;
  }
}

/* 动画效果 */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(24, 144, 255, 0.3);
}

.btn:hover {
  background: #096dd9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(24, 144, 255, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* 标签样式 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.8rem;
  background: linear-gradient(135deg, var(--primary-color), #40a9ff);
  color: white;
  border-radius: 16px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
}

/* 图片样式 */
.img-responsive {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), #40a9ff);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #096dd9, var(--primary-color));
}

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

/* 加载动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* 焦点样式 - 提升可访问性 */
a:focus,
button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 打印样式优化 */
@media print {
  .navbar,
  .sidebar,
  .footer {
    display: none;
  }
  
  .grid-container {
    grid-template-columns: 1fr;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* 回答/评论样式 */
.answer-item {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid #e9ecef;
  border-radius: var(--border-radius);
  background: white;
  transition: var(--transition);
}

.answer-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.answer-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.answer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid #e9ecef;
}

.answer-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.answer-user-info strong {
  color: var(--secondary-color);
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.answer-user-info .text-lighter {
  color: #999;
  font-size: 0.85rem;
  white-space: nowrap;
}

.answer-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #666;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.answer-meta i {
  color: var(--primary-color);
}

.answer-content {
  width: 100%;
  line-height: 1.8;
  color: #333;
  font-size: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.answer-content p {
  margin-bottom: 1rem;
}

.answer-content p:last-child {
  margin-bottom: 0;
}

/* 移动端回答样式优化 */
@media (max-width: 768px) {
  .answer-header {
    flex-wrap: wrap;
  }
  
  .answer-user-info {
    flex-wrap: wrap;
  }
  
  .answer-meta {
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
  }
}
