/* ============================================
   Game Portal Theme - 主题自定义样式
   ============================================ */

/* 滚动条隐藏 */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* 文章内容排版优化 */
.article-content img,
.game-content img {
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
}

.article-content h2,
.game-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}
.dark .article-content h2,
.dark .game-content h2 {
  border-bottom-color: #374151;
}

.article-content h3,
.game-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.article-content p,
.game-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.article-content blockquote,
.game-content blockquote {
  border-left: 4px solid #3b82f6;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: #f9fafb;
  border-radius: 0 0.5rem 0.5rem 0;
}
.dark .article-content blockquote,
.dark .game-content blockquote {
  background: #1f2937;
  border-left-color: #60a5fa;
}

.article-content ul,
.article-content ol,
.game-content ul,
.game-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-content li,
.game-content li {
  margin-bottom: 0.25rem;
  line-height: 1.8;
}

.article-content table,
.game-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.875rem;
}

.article-content th,
.article-content td,
.game-content th,
.game-content td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.dark .article-content th,
.dark .article-content td,
.dark .game-content th,
.dark .game-content td {
  border-color: #374151;
}

.article-content th,
.game-content th {
  background: #f9fafb;
  font-weight: 600;
}
.dark .article-content th,
.dark .game-content th {
  background: #1f2937;
}

.article-content code,
.game-content code {
  background: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}
.dark .article-content code,
.dark .game-content code {
  background: #374151;
}

.article-content pre,
.game-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.article-content pre code,
.game-content pre code {
  background: none;
  padding: 0;
}

/* 行数限制 */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 回到顶部按钮动画 */
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* 评论者头像尺寸限制 */
.comment-body .avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  object-fit: cover;
}

/* 评论内容中的图片 */
.comment-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
}

/* 回复链接样式 */
.comment-reply-link a {
  font-size: 0.75rem;
  line-height: 1rem;
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
}
.comment-reply-link a:hover {
  color: #2563eb;
}

/* 取消回复链接 */
#cancel-comment-reply-link {
  font-size: 0.75rem;
  color: #ef4444;
  text-decoration: none;
  transition: color 0.2s;
}
#cancel-comment-reply-link:hover {
  color: #dc2626;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 选中文本颜色 */
::selection {
  background-color: #3b82f6;
  color: white;
}

/* 加载动画 */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}
.dark .skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}

/* 文章目录导航 */
.toc-nav a {
  display: block;
  padding: 0.25rem 0;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s;
}
.dark .toc-nav a {
  color: #9ca3af;
}
.toc-nav a:hover,
.toc-nav a.active {
  color: #3b82f6;
}
.toc-nav a.toc-h3 {
  padding-left: 1rem;
  font-size: 0.85em;
}

/* ============================================
   折叠按钮共用
   ============================================ */
.comment-fold-toggle,
.reply-fold-toggle {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
  background: transparent;
  border: 1px dashed #d1d5db;
  border-radius: 0.5rem;
  color: #6b7280;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.comment-fold-toggle:hover,
.reply-fold-toggle:hover {
  background: #f3f4f6;
  color: #3b82f6;
  border-color: #3b82f6;
}
.dark .comment-fold-toggle,
.dark .reply-fold-toggle {
  border-color: #4b5563;
  color: #9ca3af;
}
.dark .comment-fold-toggle:hover,
.dark .reply-fold-toggle:hover {
  background: #374151;
  color: #60a5fa;
  border-color: #60a5fa;
}

/* 首层折叠按钮稍大 */
.comment-fold-toggle {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 0.75rem;
  background: #f9fafb;
}
.dark .comment-fold-toggle {
  background: #1f2937;
}

/* 折叠数字 */
.fold-count {
  color: #9ca3af;
  font-size: 0.75rem;
}
.dark .fold-count {
  color: #6b7280;
}

/* 折叠状态 */
.comment-folded,
.reply-folded {
  transition: opacity 0.3s;
}

/* 子评论展开动画 */
@keyframes replySlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.comment-body.reply-folded,
.comment-body.comment-folded {
  animation: none;
}

/* ============================================
   浮动评论按钮
   ============================================ */
.comment-float-btn {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  z-index: 39;
  display: flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  transition: all 0.25s ease;
  transform: translateY(0);
  opacity: 1;
}
.comment-float-btn:hover {
  background: #2563eb;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.55);
  transform: translateY(-2px);
}
.comment-float-btn.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
.dark .comment-float-btn {
  background: #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
}
.dark .comment-float-btn:hover {
  background: #1d4ed8;
}

/* 移动端隐藏浮动按钮 */
@media (max-width: 640px) {
  .comment-float-btn {
    display: none;
  }
}
