/* =========================================
   全局炫酷增强 — 赛博朋克特效
   ========================================= */

/* ====== 侧边栏增强 ====== */
/* 侧边栏底部发光效果 */
.l_sidebar {
  position: relative;
}

/* ====== 滚动条美化 ====== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #ec4899);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8b5cf6, #f472b6);
}

/* ====== 选中文字样式 ====== */
::selection {
  background: rgba(124, 58, 237, 0.3);
  color: #f0eaff;
}

/* ====== 链接悬停光效 ====== */
a {
  transition: all 0.3s ease;
}

/* ====== 全局卡片悬浮效果增强 ====== */
.tag-plugin,
.md-text .tag-plugin {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ====== 渐变分割线 ====== */
hr,
.lately .lately-title::after {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--block-border), transparent);
}

/* ====== 按钮增强 ====== */
.btn,
button,
input[type="submit"],
input[type="button"] {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ====== 图片全局效果 ====== */
.md-text img:not(.error) {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 8px;
}

.md-text img:not(.error):hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.2);
}

/* ====== 页脚增强 ====== */
#footer {
  position: relative;
}

/* ====== 加载动画 ====== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ====== 侧边栏 widget 增强 ====== */
.widget {
  transition: all 0.3s ease;
}

.widget:hover {
  border-color: rgba(124, 58, 237, 0.3) !important;
}

/* ====== 暗色模式下的增强 ====== */
#ZYDark ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #ec4899);
}

#ZYDark ::selection {
  background: rgba(124, 58, 237, 0.4);
  color: #f0eaff;
}

/* ====== 键盘焦点样式 ====== */
*:focus-visible {
  outline: 2px solid rgba(124, 58, 237, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ====== 标签 hover 增强 ====== */
.tag,
.category-list a,
.tag-list a {
  transition: all 0.3s ease !important;
}

/* ====== 头像/图标悬浮 ====== */
.avatar,
.social-wrap .social {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.social-wrap .social:hover {
  transform: translateY(-3px) scale(1.1);
}

/* ====== 代码块美化 ====== */
pre,
code {
  border-radius: 8px !important;
}

/* ====== 引用块赛博朋克边框 ====== */
blockquote {
  position: relative;
  border-left: 3px solid transparent !important;
  background-image: linear-gradient(var(--block), var(--block)),
                    linear-gradient(180deg, #7c3aed, #ec4899) !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
  border-radius: 0 8px 8px 0 !important;
}

#ZYDark blockquote {
  background-image: linear-gradient(#141829, #141829),
                    linear-gradient(180deg, #7c3aed, #ec4899) !important;
}

/* ====== 表格美化 ====== */
table {
  border-radius: 8px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

/* ====== 页面过渡效果 ====== */
.l_main .md-content {
  animation: contentFadeIn 0.4s ease;
}

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

/* ====== 响应式 ====== */
@media screen and (max-width: 667px) {
  ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
}

/* ====== 文章详情页增强 ====== */
/* 文章元数据栏 */
#article-meta-bar {
  animation: contentFadeIn 0.3s ease;
}

#article-meta-bar span {
  white-space: nowrap;
  transition: color 0.3s;
}

#article-meta-bar span:hover {
  color: var(--theme);
}

/* 阅读进度条 */
#reading-progress {
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

/* 文章标题增强 */
.article-title {
  position: relative;
  padding-bottom: 12px !important;
}

.article-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #ec4899);
  border-radius: 2px;
}

/* 文章底部增强 */
#read-next .body,
#related-posts {
  border-radius: 12px !important;
}

/* read-next 样式 */
#read-next .item a {
  transition: all 0.3s ease !important;
}

#read-next .item a:hover {
  color: var(--theme) !important;
}

/* related-posts 卡片增强 */
.related-posts .related-post-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 12px !important;
}

.related-posts .related-post-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.15) !important;
  border-color: rgba(124, 58, 237, 0.3) !important;
}

/* 文章许可协议 & 分享区域增强 */
.article-footer {
  border-radius: 12px !important;
}

.article-footer .header {
  position: relative;
}

.article-footer section {
  transition: all 0.3s ease;
}

.article-footer section:hover {
  background: rgba(124, 58, 237, 0.03);
}

/* 评论区增强 */
#waline_container,
.tk-comments,
#waline-comment {
  border-radius: 12px !important;
}

/* 文章内容区域增强 */
article.content.post,
article.content.wiki {
  position: relative;
}

/* 侧边栏 TOC 增强 */
.widget-wrapper.toc .widget-body {
  max-height: 50vh;
  overflow-y: auto;
}

.widget-wrapper.toc .toc-link {
  transition: all 0.3s ease !important;
  border-left: 2px solid transparent !important;
}

.widget-wrapper.toc .toc-link.active,
.widget-wrapper.toc .toc-link:hover {
  border-left-color: #7c3aed !important;
  color: var(--theme) !important;
}

/* 侧边栏 recent 增强 */
.widget-wrapper.recent .lately .lately-item {
  transition: all 0.3s ease;
}

.widget-wrapper.recent .lately .lately-item:hover {
  transform: translateX(4px);
}

/* ====== AI 摘要标签 ====== */
.ai-summary-tag {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0 4px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(236,72,153,0.04));
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, #7c3aed, #ec4899) 1;
  animation: contentFadeIn 0.4s ease;
  overflow: hidden;
}

.ai-summary-tag .ai-icon {
  color: #7c3aed;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  text-shadow: 0 0 6px rgba(124,58,237,0.4);
}

.ai-summary-tag .ai-text {
  color: var(--color-p);
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 文章详情页的摘要样式调整 */
article.content.post .ai-summary-tag {
  margin: 10px 0 16px;
  padding: 10px 14px;
  font-size: 13.5px;
}

/* ====== 博客统计 widget 样式 ====== */
.widget-wrapper.markdown .md-text:has(#blog-stats-panel),
.widget-wrapper.blog_stats .md-text {
  padding: 12px !important;
}

#blog-stats-panel .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

#blog-stats-panel .stat-card {
  text-align: center;
  padding: 10px 4px 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(236,72,153,0.04));
  border: 1px solid rgba(124,58,237,0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#blog-stats-panel .stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #7c3aed, #ec4899, transparent);
  animation: statShimmer 3s infinite;
}

@keyframes statShimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

#blog-stats-panel .stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124,58,237,0.25);
  box-shadow: 0 4px 15px rgba(124,58,237,0.12);
}

#blog-stats-panel .stat-icon {
  font-size: 16px;
  margin-bottom: 4px;
}

#blog-stats-panel .stat-value {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

#blog-stats-panel .stat-label {
  font-size: 11px;
  color: var(--text-p3);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

#blog-stats-panel .stats-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

#blog-stats-panel .focus-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(236,72,153,0.08));
  color: var(--text-p2);
  border: 1px solid rgba(124,58,237,0.12);
  transition: all 0.3s ease;
}

#blog-stats-panel .focus-tag:hover {
  border-color: rgba(124,58,237,0.3);
  color: var(--theme);
}

/* 暗色模式适配 */
#ZYDark #blog-stats-panel .stat-card {
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(236,72,153,0.06));
  border-color: rgba(124,58,237,0.15);
}

#ZYDark #blog-stats-panel .focus-tag {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(236,72,153,0.1));
  border-color: rgba(124,58,237,0.2);
}
