/* 懂懂日记自定义样式 */

/* 专题页面样式 */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.topic-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--entry);
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.topic-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.topic-card .topic-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

/* 金句页面样式 */
.quote-section {
  padding: 1.5rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  border-radius: 8px;
  margin-bottom: 2rem;
}

.quote-text {
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 0;
  padding: 0.5rem 0;
}

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.quote-card {
  background: var(--entry);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quote-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.15);
}

.quote-card::before {
  content: '"';
  font-size: 3rem;
  color: var(--primary-color);
  opacity: 0.3;
  position: absolute;
  top: -0.5rem;
  left: 0.5rem;
}

/* 相关文章推荐样式 */
.related-posts-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.related-post-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--entry);
}

.related-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 目录导航样式增强 */
.toc-enhanced {
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.toc-enhanced ul {
  list-style: none;
  padding-left: 0;
}

.toc-enhanced li {
  margin-bottom: 0.5rem;
}

.toc-enhanced a {
  display: block;
  padding: 0.4rem 0.8rem;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  font-size: 0.9rem;
}

.toc-enhanced a:hover,
.toc-enhanced a.active {
  border-left-color: var(--primary-color);
  background: rgba(var(--primary-rgb), 0.05);
}

/* 阅读进度条样式 */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-color-hover) 100%);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* 回到顶部按钮样式 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-color-hover);
  transform: translateY(-2px);
}

/* 分享按钮样式增强 */
.share-buttons-enhanced {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.share-btn-wechat {
  background: #07c160;
  color: white;
}

.share-btn-weibo {
  background: #e6162d;
  color: white;
}

.share-btn-qq {
  background: #12b7f5;
  color: white;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* FAQ样式增强 */
.faq-section {
  margin: 2rem 0;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--entry);
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: rgba(var(--primary-rgb), 0.05);
}

.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 1rem 1.5rem 1.5rem;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .quote-section {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  }
  
  .quote-card {
    background: var(--entry);
  }
  
  .topic-card,
  .related-post-card {
    background: var(--entry);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .topic-grid,
  .quotes-grid,
  .related-posts-grid {
    grid-template-columns: 1fr !important;
  }
  
  .share-buttons-enhanced {
    flex-direction: column;
  }
  
  .share-btn {
    width: 100%;
    justify-content: center;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* 打印样式 */
@media print {
  .back-to-top,
  .share-buttons-enhanced,
  .reading-progress,
  .faq-section {
    display: none;
  }
  
  .post-content-body {
    max-width: 100%;
  }
}

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

.topic-card,
.quote-card,
.related-post-card {
  animation: fadeInUp 0.5s ease-out;
}