/* ===== 全局优化 ===== */

/* 全站字体 */
body,
.article-container,
#article-container,
p, li, blockquote, td, th {
  font-family: 'LXGW WenKai', 'Noto Serif JP', 'Crimson Pro', 'PingFang SC', 'Hiragino Sans GB', serif !important;
  font-size: 15px;
  line-height: 1.8;
}

/* 英文/数字用 Crimson Pro */
:lang(en),
.post-content:lang(en),
[lang="en"] body {
  font-family: 'Crimson Pro', 'LXGW WenKai', serif !important;
  font-size: 17px;
  line-height: 1.85;
}

/* 日文用 Noto Serif JP */
:lang(ja),
[lang="ja"] body {
  font-family: 'Noto Serif JP', 'LXGW WenKai', serif !important;
  line-height: 2;
}

/* 标题字体 */
h1, h2, h3, h4, h5, h6,
#article-container h1,
#article-container h2,
#article-container h3 {
  font-family: 'LXGW WenKai', 'Noto Serif JP', 'Crimson Pro', serif !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 导航栏保持 Poppins */
#nav .site-name {
  font-family: 'Poppins', -apple-system, sans-serif !important;
}

/* 代码块用等宽字体，不受影响 */
code, pre, kbd, samp,
#article-container code,
#article-container pre {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Menlo', monospace !important;
}

/* 全站背景 — 米白纸质感 */
:root {
  --global-bg: #faf8f4;
  --main-bg: #faf8f4;
  --card-bg: #ffffff;
  --site-bg: #faf8f4;
}

body {
  background-color: #faf8f4 !important;
}

#body-wrap {
  background-color: #faf8f4 !important;
}

/* 暗色模式全站背景 */
[data-theme="dark"] {
  --global-bg: #1a1814;
  --main-bg: #1a1814;
  --card-bg: #242220;
  --site-bg: #1a1814;
}

[data-theme="dark"] body,
[data-theme="dark"] #body-wrap {
  background-color: #1a1814 !important;
}

/* 导航栏 — 米白纸质感 */
#nav {
  background: #faf8f4 !important;
  border-bottom: 1px solid #e8e4dc !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06) !important;
}

#nav.nav-fixed {
  background: rgba(250, 248, 244, 0.96) !important;
  backdrop-filter: blur(8px) !important;
  border-bottom: 1px solid #e8e4dc !important;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08) !important;
}

/* 导航栏链接颜色 */
#nav a,
#nav .site-name,
#nav .menus_items .menus_item a {
  color: #3a3128 !important;
}

#nav .menus_items .menus_item a:hover {
  color: #8b6f47 !important;
}

/* 暗色模式导航栏 */
[data-theme="dark"] #nav {
  background: #1e1c19 !important;
  border-bottom: 1px solid #2e2b26 !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] #nav a,
[data-theme="dark"] #nav .site-name,
[data-theme="dark"] #nav .menus_items .menus_item a {
  color: #d4cfc8 !important;
}

[data-theme="dark"] #nav .menus_items .menus_item a:hover {
  color: #c4a882 !important;
}

/* 禁用 top_img 后的页面顶部间距 */
#page-header {
  background: transparent !important;
}

/* 文章卡片美化 */
#recent-posts > .recent-post-item {
  border-radius: 12px !important;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
}

#recent-posts > .recent-post-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-2px);
}

/* 侧边栏卡片美化 */
#aside-content .card-widget {
  border-radius: 12px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
}

/* 页脚统计数字样式 */
#footer .footer-wrap .busuanzi {
  font-size: 0.9rem;
}

/* 标签云美化 */
.card-tag-cloud a {
  border-radius: 6px !important;
  padding: 4px 10px !important;
}

/* 页脚配色 — 米白纸质感呼应 */
#footer {
  background: #f0ece4 !important;
  color: #6b5e4e !important;
  border-top: 1px solid #e8e4dc !important;
}

#footer a,
#footer .copyright,
#footer .footer-copyright span {
  color: #8b6f47 !important;
}

#footer #busuanzi_container_site_pv,
#footer #busuanzi_container_site_uv {
  color: #a08060 !important;
}

/* 暗色模式适配 */
[data-theme="dark"] #footer {
  background: #161410 !important;
  border-top: 1px solid #2e2b26 !important;
  color: #a09888 !important;
}

[data-theme="dark"] #recent-posts > .recent-post-item {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] #aside-content .card-widget {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

/* 文章内容美化 */
#article-container h2 {
  border-bottom: 2px solid #49B1F5;
  padding-bottom: 0.3em;
}

/* 代码块圆角 */
#article-container figure.highlight {
  border-radius: 10px !important;
}

/* 导航栏 Logo 头像 — 始终显示，不随滚动消失 */
#site-name::before {
  content: none;
}

/* 覆盖主题 nav-fixed 状态下隐藏头像的逻辑 */
#page-header.nav-fixed #nav #blog-info > a.nav-site-title {
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
}

#page-header.nav-fixed #nav #blog-info > a.nav-page-title {
  display: none !important;
}

/* blog-info 垂直居中 */
#nav #blog-info {
  display: inline-flex !important;
  align-items: center !important;
}

/* nav-page-title 默认隐藏，只在主题需要时显示 */
#nav #blog-info a.nav-site-title {
  display: inline-flex !important;
  align-items: center !important;
}

#nav #blog-info a.nav-page-title {
  display: none !important;
}
#nav .site-page:first-child img,
/* 导航栏头像 - 圆框包裹（高优先级覆盖 Butterfly 默认样式） */
#nav #blog-info .site-icon {
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  object-fit: cover !important;
  border: 2px solid #c4a882 !important;
  box-shadow: 0 2px 8px rgba(139, 111, 71, 0.2) !important;
  margin-right: 8px;
  vertical-align: middle;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#nav #blog-info .site-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(139, 111, 71, 0.35) !important;
}

/* 关于页头像 — 与导航栏同风格，只是尺寸更大 */
.avatar-circle {
  border-radius: 50% !important;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 3px solid #c4a882;
  box-shadow: 0 4px 12px rgba(139, 111, 71, 0.2);
  display: block;
  margin: 0 auto 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(139, 111, 71, 0.3);
}

/* 站点标题字体美化 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;1,400&family=Noto+Serif+JP:wght@400;600&display=swap');
@import url('https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@1.7.0/style.css');

#nav .site-name {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  color: #3a3128 !important;
  -webkit-text-fill-color: #3a3128 !important;
}

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

::-webkit-scrollbar-thumb {
  background: #49B1F5;
  border-radius: 4px;
}

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

/* ===== 打赏区域重构 ===== */

/* 打赏容器 */
.post-reward.reward-panel-rebuilt {
  position: relative;
  margin-top: 60px;
  margin-bottom: 40px;
  width: 100%;
  text-align: center;
}

/* 触发按钮 */
.reward-trigger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  background: var(--btn-bg);
  color: var(--btn-color);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  user-select: none;
}

.reward-trigger-button:hover {
  background: var(--btn-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.reward-trigger-button i {
  margin-right: 6px;
  font-size: 16px;
}

/* 打赏面板 */
.reward-panel {
  position: absolute;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  max-width: 360px;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  padding: 18px;
  z-index: 100;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* 面板小箭头 */
.reward-panel::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--card-bg);
}

/* Tab 导航 */
.reward-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--hr-border);
  padding-bottom: 8px;
}

.reward-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--font-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.reward-tab:hover {
  background: var(--btn-bg);
}

.reward-tab.active {
  background: var(--btn-bg);
  color: var(--btn-hover-color);
  font-weight: 600;
}

.reward-tab i {
  font-size: 14px;
}

/* Tab 内容区 */
.reward-tab-content {
  min-height: 230px;
  position: relative;
}

.reward-content {
  display: none;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.reward-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Ko-fi 大按钮 */
.kofi-button-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #29abe0 0%, #00b9fe 100%);
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(41, 171, 224, 0.35);
  transition: all 0.3s ease;
}

.kofi-button-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(41, 171, 224, 0.5);
  background: linear-gradient(135deg, #00b9fe 0%, #29abe0 100%);
  color: #fff !important;
}

.kofi-button-large i {
  font-size: 18px;
}

/* 二维码图片尺寸优化 */
.reward-content img {
  width: 180px !important;
  height: 180px !important;
}

/* 响应式 */
@media (max-width: 768px) {
  .reward-panel {
    width: 92%;
    max-width: 320px;
  }
  
  .reward-tabs {
    gap: 5px;
  }
  
  .reward-tab {
    padding: 10px 8px;
    font-size: 13px;
  }
  
  .reward-tab i {
    font-size: 13px;
  }
  
  .kofi-button-large {
    padding: 12px 24px;
    font-size: 15px;
  }
  
  .reward-content img {
    width: 160px !important;
    height: 160px !important;
  }
}

/* 暗色模式适配 */
[data-theme="dark"] .reward-trigger-button {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .reward-panel {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ===== 邮件订阅卡片 ===== */

.card-subscribe {
  margin-bottom: 20px;
}

.card-subscribe .item-headline {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hr-border);
  font-weight: 600;
  font-size: 16px;
}

.card-subscribe .item-headline i {
  margin-right: 8px;
  color: #ff6b6b;
}

.subscribe-content {
  padding: 20px;
}

.subscribe-desc {
  margin-bottom: 16px;
  color: var(--font-color);
  font-size: 14px;
  line-height: 1.6;
}

.buttondown-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subscribe-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--hr-border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--font-color);
  font-size: 14px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.subscribe-input:focus {
  outline: none;
  border-color: #49B1F5;
  box-shadow: 0 0 0 3px rgba(73, 177, 245, 0.1);
}

.subscribe-button {
  width: 100%;
  padding: 10px 20px;
  background: #8b6f47;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.subscribe-button:hover {
  transform: translateY(-2px);
  background: #7a6040;
  box-shadow: 0 4px 12px rgba(139, 111, 71, 0.3);
}

.subscribe-button i {
  font-size: 13px;
}

.subscribe-note {
  margin-top: 12px;
  font-size: 12px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 4px;
}

.subscribe-note i {
  font-size: 11px;
}

/* 暗色模式适配 */
[data-theme="dark"] .subscribe-input {
  background: var(--text-bg-hover);
}

[data-theme="dark"] .subscribe-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}









/* 语言选择器样式 */
.lang-selector {
  padding: 4px 28px 4px 10px !important;
  border: 1px solid #c8bfb0 !important;
  border-radius: 6px !important;
  background: #faf8f4 !important;
  color: #3a3128 !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  margin-left: 6px !important;
  vertical-align: middle !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b6f47' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.lang-selector:hover {
  border-color: #8b6f47 !important;
  box-shadow: 0 0 0 2px rgba(139, 111, 71, 0.12) !important;
}

.lang-selector:focus {
  outline: none !important;
  border-color: #8b6f47 !important;
  box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.15) !important;
}

/* 确保菜单项中的选择器正常显示 */
#nav .menus_item .lang-selector,
#sidebar-menus .menus_item .lang-selector {
  display: inline-block !important;
}

/* ── 多语言文章过滤（CSS驱动，不依赖JS display:none）── */

/* 默认显示中文，隐藏英文和日文 */
html[data-lang="zh-CN"] [data-lang="en"],
html[data-lang="zh-CN"] [data-lang="ja"] { display: none !important; }

/* 英文模式：只显示英文 */
html[data-lang="en"] [data-lang="zh-CN"],
html[data-lang="en"] [data-lang="ja"]    { display: none !important; }

/* 日文模式：只显示日文 */
html[data-lang="ja"] [data-lang="zh-CN"],
html[data-lang="ja"] [data-lang="en"]    { display: none !important; }
