/* 🎨 轻量悬浮代码块 */

/* 代码块容器 - 轻量渐变效果 */
figure.highlight {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(248, 250, 252, 0.98) 100%) !important;
  border: 1px solid rgba(200, 200, 200, 0.3) !important;
  border-radius: 16px !important;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 1) !important;
  overflow: hidden !important;
  transition: all 0.3s ease !important;
}

figure.highlight:hover {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 1) 0%, 
    rgba(250, 251, 253, 1) 100%) !important;
  box-shadow: 
    0 8px 28px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1) !important;
  transform: translateY(-1px);
}

/* 工具栏 - 更轻盈 */
.highlight-tools {
  background: rgba(255, 255, 255, 0.4) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
  padding: 10px 16px !important;
}

.highlight-tools .code-lang {
  color: #64748B !important;
  font-weight: 600 !important;
  font-size: 0.78em !important;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* 代码区域 - 透明背景 */
figure.highlight pre {
  background: transparent !important;
  padding: 16px 0 !important;
}

figure.highlight table {
  margin: 0 !important;
  background: transparent !important;
}

figure.highlight td {
  background: transparent !important;
}

/* 行号 - 无背景，自然融合 */
figure.highlight .gutter {
  background: transparent !important;
  border-right: none !important;
}

figure.highlight .gutter pre {
  padding: 16px 14px 16px 18px !important;
  color: #94A3B8 !important;
  font-size: 0.82em !important;
  text-align: right;
  background: transparent !important;
}

/* 代码内容 */
figure.highlight .code pre {
  padding: 16px 20px 16px 16px !important;
  color: #334155 !important;
  background: transparent !important;
}

/* 语法高亮 - 柔和清新 */
figure.highlight .comment { color: #94A3B8 !important; font-style: italic; }
figure.highlight .keyword { color: #8B5CF6 !important; }
figure.highlight .string { color: #059669 !important; }
figure.highlight .number { color: #D97706 !important; }
figure.highlight .function { color: #3B82F6 !important; }
figure.highlight .title { color: #EA580C !important; }
figure.highlight .class { color: #EA580C !important; }
figure.highlight .params { color: #475569 !important; }
figure.highlight .built_in { color: #0891B2 !important; }
figure.highlight .literal { color: #0891B2 !important; }
figure.highlight .attr { color: #D97706 !important; }
figure.highlight .variable { color: #DC2626 !important; }
figure.highlight .operator { color: #0891B2 !important; }
figure.highlight .tag { color: #DC2626 !important; }
figure.highlight .name { color: #DC2626 !important; }
figure.highlight .attribute { color: #D97706 !important; }
figure.highlight .selector-tag { color: #DC2626 !important; }
figure.highlight .selector-class { color: #EA580C !important; }
figure.highlight .selector-id { color: #3B82F6 !important; }

/* 行内代码 - 轻盈胶囊 */
.container code:not(figure code) {
  background: rgba(99, 102, 241, 0.1) !important;
  color: #6366F1 !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  font-size: 0.88em !important;
  border: none !important;
  font-weight: 500;
}

/* macStyle 小圆点 */
.highlight-tools .mac-close { background: #FF5F57 !important; }
.highlight-tools .mac-minimize { background: #FFBD2E !important; }
.highlight-tools .mac-maximize { background: #28CA42 !important; }

/* 滚动条 - 极简 */
figure.highlight pre::-webkit-scrollbar {
  height: 4px;
  background: transparent;
}

figure.highlight pre::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

figure.highlight pre::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ===== 暗色模式 ===== */
[data-theme='dark'] figure.highlight {
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.95) 0%, 
    rgba(15, 23, 42, 0.98) 100%) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

[data-theme='dark'] figure.highlight:hover {
  background: linear-gradient(135deg, 
    rgba(39, 52, 74, 0.98) 0%, 
    rgba(22, 33, 54, 1) 100%) !important;
}

[data-theme='dark'] .highlight-tools {
  background: rgba(255, 255, 255, 0.03) !important;
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

[data-theme='dark'] .highlight-tools .code-lang {
  color: #94A3B8 !important;
}

[data-theme='dark'] figure.highlight .gutter pre {
  color: #64748B !important;
}

[data-theme='dark'] figure.highlight .code pre {
  color: #E2E8F0 !important;
}

[data-theme='dark'] .container code:not(figure code) {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #A78BFA !important;
}

/* 暗色语法高亮 */
[data-theme='dark'] figure.highlight .comment { color: #64748B !important; }
[data-theme='dark'] figure.highlight .keyword { color: #A78BFA !important; }
[data-theme='dark'] figure.highlight .string { color: #34D399 !important; }
[data-theme='dark'] figure.highlight .number { color: #FBBF24 !important; }
[data-theme='dark'] figure.highlight .function { color: #60A5FA !important; }
[data-theme='dark'] figure.highlight .title { color: #FB923C !important; }
[data-theme='dark'] figure.highlight .built_in { color: #22D3EE !important; }
[data-theme='dark'] figure.highlight .variable { color: #F87171 !important; }
[data-theme='dark'] figure.highlight .tag { color: #F87171 !important; }
[data-theme='dark'] figure.highlight .attr { color: #FBBF24 !important; }

/* ===== 隐藏标题锚点 # ===== */
#article-container h1 a.markdownIt-Anchor,
#article-container h2 a.markdownIt-Anchor,
#article-container h3 a.markdownIt-Anchor,
#article-container h4 a.markdownIt-Anchor,
#article-container h5 a.markdownIt-Anchor,
#article-container h6 a.markdownIt-Anchor {
  display: none !important;
}

/* ============================================
   加密文章密码输入框美化
   覆盖 hexo-blog-encrypt 插件的默认样式
   ============================================ */

/* --- 外层容器 --- */
.hbe.hbe-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  min-height: 180px;
  padding: 30px 20px;
  text-align: center;
}

/* 标题提示 */
.hbe.hbe-content::before {
  content: "🔐 此文章已加密";
  display: block;
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 600;
  color: #6366F1;
  letter-spacing: 1px;
}

/* --- 输入框容器 --- */
.hbe.hbe-input.hbe-input-default {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  max-width: 360px;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
  z-index: 1;
}

/* --- 输入框 --- */
.hbe.hbe-input-field.hbe-input-field-default {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 16px 20px !important;
  margin: 0 !important;
  font-size: 16px !important;
  font-family: inherit !important;
  color: #334155 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border: 2px solid rgba(99, 102, 241, 0.25) !important;
  border-radius: 12px !important;
  outline: none !important;
  opacity: 1 !important;
  float: none !important;
  z-index: 1 !important;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s !important;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08), 0 1px 3px rgba(0,0,0,0.04) !important;
}

.hbe.hbe-input-field.hbe-input-field-default:focus {
  border-color: #6366F1 !important;
  background: #fff !important;
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.15), 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
}

/* --- 标签作为 placeholder --- */
.hbe.hbe-input-label.hbe-input-label-default {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 20px !important;
  margin: 0 !important;
  float: none !important;
  pointer-events: none !important;
  z-index: 2 !important;
  background: transparent !important;
  transform: none !important;
  transition: opacity 0.2s ease !important;
}

/* 隐藏标签的伪元素（原主题的动画线条） */
.hbe.hbe-input-label.hbe-input-label-default::before,
.hbe.hbe-input-label.hbe-input-label-default::after {
  display: none !important;
  content: none !important;
}

/* 标签文字样式 */
.hbe-input-label-content.hbe-input-label-content-default {
  display: block !important;
  padding: 0 !important;
  color: #9CA3AF !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  transform: none !important;
  transition: none !important;
}

/* 聚焦时隐藏标签 */
.hbe.hbe-input-field.hbe-input-field-default:focus ~ .hbe.hbe-input-label.hbe-input-label-default,
.hbe-input--filled .hbe.hbe-input-label.hbe-input-label-default {
  opacity: 0 !important;
}

/* ============================================
   暗色模式
   ============================================ */
[data-theme='dark'] .hbe.hbe-content::before {
  color: #A78BFA;
}

[data-theme='dark'] .hbe.hbe-input-field.hbe-input-field-default {
  color: #E2E8F0 !important;
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.15) !important;
}

[data-theme='dark'] .hbe.hbe-input-field.hbe-input-field-default:focus {
  border-color: #A78BFA !important;
  background: rgba(30, 41, 59, 0.98) !important;
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.2), 0 0 0 4px rgba(139, 92, 246, 0.15) !important;
}

[data-theme='dark'] .hbe-input-label-content.hbe-input-label-content-default {
  color: #64748B !important;
}

/* ============================================
   文章底部导航卡片（上一篇/下一篇）美化
   ============================================ */

/* 父容器 - 允许溢出显示浮动效果 */
.pagination-post {
  overflow: visible !important;
  padding: 6px 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* --- 日间模式 - 轻量浅色卡片 --- */
.pagination-post .pagination-related {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(248, 250, 252, 0.98) 100%) !important;
  border: 1px solid rgba(200, 200, 200, 0.3) !important;
  border-radius: 16px !important;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 1) !important;
  overflow: hidden !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.pagination-post .pagination-related:hover {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 1) 0%, 
    rgba(250, 251, 253, 1) 100%) !important;
  box-shadow: 
    0 8px 28px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1) !important;
  transform: translateY(-2px) !important;
}

/* 封面背景 */
.pagination-post .cover {
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%) !important;
  opacity: 0.6 !important;
  transition: opacity 0.3s ease !important;
}

.pagination-post .pagination-related:hover .cover {
  opacity: 0.8 !important;
}

/* 信息区域 */
.pagination-post .info {
  background: transparent !important;
}

/* 标签文字（上一篇/下一篇） */
.pagination-post .info-item-1 {
  color: #64748B !important;
  font-size: 0.85em !important;
  font-weight: 500 !important;
  letter-spacing: 0.5px !important;
}

/* 文章标题 */
.pagination-post .info-item-2 {
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 1.05em !important;
  transition: color 0.2s ease !important;
}

.pagination-post .pagination-related:hover .info-item-2 {
  color: #6366F1 !important;
}

/* --- 夜间模式 - 轻量深色卡片 --- */
[data-theme='dark'] .pagination-post .pagination-related {
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.95) 0%, 
    rgba(15, 23, 42, 0.98) 100%) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

[data-theme='dark'] .pagination-post .pagination-related:hover {
  background: linear-gradient(135deg, 
    rgba(39, 52, 74, 0.98) 0%, 
    rgba(22, 33, 54, 1) 100%) !important;
  box-shadow: 
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

[data-theme='dark'] .pagination-post .cover {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
}

[data-theme='dark'] .pagination-post .info-item-1 {
  color: #94A3B8 !important;
}

[data-theme='dark'] .pagination-post .info-item-2 {
  color: #E2E8F0 !important;
}

[data-theme='dark'] .pagination-post .pagination-related:hover .info-item-2 {
  color: #A78BFA !important;
}

/* ============================================
   页脚 (Footer) 美化
   ============================================ */

/* --- 日间模式 --- */
#footer {
  background: linear-gradient(135deg, 
    rgba(248, 250, 252, 0.95) 0%, 
    rgba(241, 245, 249, 0.98) 100%) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03) !important;
}

#footer .footer-other {
  padding: 2rem 0 !important;
}

/* 版权文字 */
#footer .copyright {
  color: #64748B !important;
  font-size: 0.9em !important;
}

/* 框架信息 */
#footer .framework-info {
  color: #94A3B8 !important;
  font-size: 0.85em !important;
}

#footer .framework-info a {
  color: #6366F1 !important;
  transition: color 0.2s ease !important;
}

#footer .framework-info a:hover {
  color: #4F46E5 !important;
}

/* 自定义文字（备案号等） */
#footer .footer_custom_text {
  margin-top: 0.5rem !important;
}

#footer .footer_custom_text a {
  color: #94A3B8 !important;
  font-size: 0.85em !important;
  transition: color 0.2s ease !important;
}

#footer .footer_custom_text a:hover {
  color: #6366F1 !important;
}

/* --- 夜间模式 --- */
[data-theme='dark'] #footer {
  background: linear-gradient(135deg, 
    rgba(15, 23, 42, 0.95) 0%, 
    rgba(10, 15, 30, 0.98) 100%) !important;
  border-top-color: rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
}

[data-theme='dark'] #footer .copyright {
  color: #94A3B8 !important;
}

[data-theme='dark'] #footer .framework-info {
  color: #64748B !important;
}

[data-theme='dark'] #footer .framework-info a {
  color: #A78BFA !important;
}

[data-theme='dark'] #footer .framework-info a:hover {
  color: #C4B5FD !important;
}

[data-theme='dark'] #footer .footer_custom_text a {
  color: #64748B !important;
}

[data-theme='dark'] #footer .footer_custom_text a:hover {
  color: #A78BFA !important;
}
