/* ========================================
   Custom Light Warm Aesthetic - 孤舸博客
   学术清新风 + 毛主席背景图主题（浅色版）
   ======================================== */

/* === CSS 变量覆盖 (Light Warm Mode) === */
[data-theme="dark"] {
  --global-bg: transparent;
  --card-bg: rgba(255, 255, 255, 0.82);
  --sidebar-bg: rgba(255, 255, 255, 0.88);
  --sidebar-menu-bg: rgba(255, 255, 255, 0.9);
  --font-color: #2d1f14;
  --light-grey: #6b5744;
  --white: #2d1f14;
  --text-highlight-color: #2a1c12;
  --toc-link-color: #6b5744;
  --hr-color: #d7c2ac;
  --hr-border: #d7c2ac;
  --hr-before-color: #8c5a3a;
  --hl-bg: #1f2430;
  --hl-color: #e6edf3;
  --hlnumber-bg: rgba(0, 0, 0, 0.14);
  --hlnumber-color: #99aab7;
  --hljs-bg: #faf5ef;
  --pseudo-hover: #b8764e;
  --btn-hover-color: #8c3a2b;
  --btn-bg: rgba(255, 255, 255, 0.7);
  --text-bg-hover: rgba(212, 165, 116, 0.12);
  --tab-button-bg: rgba(255, 255, 255, 0.7);
  --tab-botton-color: #6b5744;
  --card-border: 1px solid rgba(180, 130, 80, 0.12);
}

/* === 全局背景（毛主席图片） === */
#web_bg {
  background: url('/img/background.jpg') center center / cover no-repeat fixed !important;
}

/* 全局浅色遮罩 — 用 body::after 叠加在图片上，让背景图自然透出 */
body {
  background: transparent !important;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(250, 246, 240, 0.2);
  pointer-events: none;
  z-index: -1;
}

/* === 导航栏 === */
#nav {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid rgba(180, 130, 80, 0.15);
}

#nav a {
  color: #3d2b1a !important;
  transition: color 0.3s, text-shadow 0.3s;
}

#nav a:hover {
  color: #b8764e !important;
  text-shadow: 0 0 8px rgba(184, 118, 78, 0.3);
}

/* 搜索图标 + 文字 */
#search-button {
  color: #3d2b1a !important;
}
#search-button span.site-page,
#search-button span.site-page span,
#search-button span.site-page i {
  color: #3d2b1a !important;
}
#search-button:hover,
#search-button:hover span.site-page,
#search-button:hover span.site-page span,
#search-button:hover span.site-page i {
  color: #8c3a2b !important;
}

/* === 首页 Hero — 保留背景图，只清除背景色 === */
#page-header {
  background-color: transparent !important;
  background-size: cover !important;
  background-position: center center !important;
  min-height: 70vh;
}

/* 首页 Hero 底部渐变遮罩，浅色过渡到内容区 */
#page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(250, 246, 240, 0.05) 50%,
    rgba(250, 246, 240, 0.3) 100%
  );
  pointer-events: none;
}

#page-header #site-title {
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 30px rgba(212, 165, 116, 0.3);
  font-weight: 700;
  letter-spacing: 4px;
}

#page-header #site-subtitle {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* 打字机效果光标 */
#subtitle .typed-cursor {
  color: #b8764e !important;
}

/* === 内页（文章页、归档页等）浅色遮罩 === */
#page-header:not(.full_page) {
  background-color: rgba(250, 246, 240, 0.5) !important;
}

#page-header:not(.full_page)::before {
  background: rgba(250, 246, 240, 0.3) !important;
}

/* 内页文章头图文字可读性 */
#page-header.post-bg::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.34) 100%) !important;
}

#post-info #post-meta,
#post-info #post-meta a {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* 内页内容区域底层模糊，提升可读性 */
#content-inner {
  position: relative;
}

/* === 卡片通用样式 === */
.card-widget,
#aside-content .card-widget,
.recent-post-item,
#post {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(180, 130, 80, 0.1) !important;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.recent-post-item:hover {
  border-color: rgba(184, 118, 78, 0.25) !important;
  box-shadow: 0 4px 16px rgba(180, 130, 80, 0.12);
  transform: translateY(-2px);
}

/* === 文章卡片封面 === */
.recent-post-item .post_cover img {
  transition: transform 0.5s ease, filter 0.3s ease;
}

.recent-post-item:hover .post_cover img {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* === 侧边栏 === */
#aside-content .card-widget {
  border: 1px solid rgba(180, 130, 80, 0.1) !important;
}

#aside-content .card-info .author-info__name {
  color: #2d1f14 !important;
}

#aside-content .card-info .author-info__description {
  color: #6b5744 !important;
  font-style: italic;
}

/* 头像光晕 */
#aside-content .card-info .card-info-avatar .avatar-img {
  box-shadow: 0 2px 12px rgba(180, 130, 80, 0.2);
  border: 2px solid rgba(212, 165, 116, 0.4);
}

/* 标签云 */
#aside-content .card-tag-cloud a {
  transition: all 0.3s ease;
}

#aside-content .card-tag-cloud a:hover {
  color: #b8764e !important;
  text-shadow: 0 0 8px rgba(184, 118, 78, 0.3);
}

/* === 文章卡片标题 === */
.recent-post-info .article-title {
  color: #2d1f14 !important;
  font-weight: 600;
}

.recent-post-info .article-title:hover {
  color: #8c3a2b !important;
}

/* === 侧边栏统计数字加深 === */
.site-data a {
  color: #3d2b1a !important;
}
.site-data .headline {
  color: #5a4332 !important;
}

.site-data .length-num {
  color: #2d1f14 !important;
  font-weight: 700;
}
.site-data a:hover {
  color: #8c3a2b !important;
}
/* === 侧边栏统计数字（5/16/2）进一步加深 === */
.site-data-align .headline {
  color: #2d1f14 !important;
  font-weight: 600;
}

/* === Follow Me 按钮文字加深 === */
#aside-content .card-info a[href*='github'] {
  color: #3d2b1a !important;
  border-color: rgba(180, 130, 80, 0.3) !important;
}
#aside-content .card-info a[href*='github']:hover {
  color: #fff !important;
  background: linear-gradient(135deg, #d4a574, #b8764e) !important;
  border-color: #b8764e !important;
}

/* === 文章元信息（发表于/更新于/分类/标签）加深 === */
.recent-post-info .article-meta-wrap,
.recent-post-info .article-meta-wrap a,
.recent-post-info .post-meta-date,
.recent-post-info .post-meta-categories a,
.recent-post-info .article-meta__separator {
  color: #6b5744 !important;
}

.recent-post-info .article-meta-wrap a:hover {
  color: #8c3a2b !important;
}

/* === 文章摘要文字 === */
.recent-post-info .content {
  color: #4a3828 !important;
}

/* === 文章正文可读性兜底（修复发白文字） === */
#post,
#post #article-container,
#post #article-container p,
#post #article-container li,
#post #article-container td,
#post #article-container th,
#post #article-container blockquote,
#post #article-container .note,
#post #article-container .tip,
#post #article-container .warning,
#post #article-container .danger {
  color: #2d241b !important;
}

#post #article-container h1,
#post #article-container h2,
#post #article-container h3,
#post #article-container h4,
#post #article-container h5,
#post #article-container h6 {
  color: #2a1c12 !important;
}

#post #article-container strong,
#post #article-container b {
  color: #2a1c12 !important;
}

/* === 最新文章小部件日期加深 === */
#aside-content .aside-list .aside-list-item .content time,
#aside-content .aside-list-item .content time {
  color: #8a7460 !important;
}

/* === 侧边栏社交图标 === */
#aside-content .card-info .card-info-social-icons a {
  color: #5a4332 !important;
  transition: color 0.3s;
}
#aside-content .card-info .card-info-social-icons a:hover {
  color: #b8764e !important;
}

/* === 链接样式 === */
a:not(.btn):not(.site-page):not(.tag):not([class*='social']) {
  color: #9c6540;
  transition: color 0.3s, text-shadow 0.3s;
}

a:not(.btn):not(.site-page):not(.tag):not([class*='social']):hover {
  color: #b8764e;
  text-shadow: 0 0 8px rgba(184, 118, 78, 0.25);
}

/* === 代码块 === */
figure.highlight,
pre {
  background: #1f2430 !important;
  border: 1px solid rgba(180, 130, 80, 0.22) !important;
  border-radius: 8px;
}

figure.highlight,
figure.highlight .highlight-tools,
figure.highlight .gutter,
figure.highlight .code,
figure.highlight .line,
figure.highlight .line span,
figure.highlight .line .attr,
figure.highlight .line .name,
figure.highlight .line .title,
figure.highlight .line .class,
figure.highlight .line .built_in,
figure.highlight .line .string,
figure.highlight .line .number,
figure.highlight .line .comment,
figure.highlight .line .keyword,
figure.highlight .line .meta,
figure.highlight .line .params,
figure.highlight .line .literal,
figure.highlight .line .operator,
figure.highlight .line .selector-tag,
figure.highlight .line .selector-class,
figure.highlight .line .selector-id,
figure.highlight .line .type,
figure.highlight .line .function {
  color: #e6edf3 !important;
}

figure.highlight .line .comment,
figure.highlight .line .quote {
  color: #9fb0c3 !important;
}

figure.highlight .line .keyword,
figure.highlight .line .selector-tag,
figure.highlight .line .operator {
  color: #ffb86c !important;
}

figure.highlight .line .name,
figure.highlight .line .title,
figure.highlight .line .class,
figure.highlight .line .type,
figure.highlight .line .built_in {
  color: #8be9fd !important;
}

figure.highlight .line .string,
figure.highlight .line .attr {
  color: #a5e27c !important;
}

figure.highlight .line .number,
figure.highlight .line .literal,
figure.highlight .line .meta {
  color: #f7c6ff !important;
}

figure.highlight .gutter {
  color: #90a0b2 !important;
  background: rgba(0, 0, 0, 0.12) !important;
}

figure.highlight .highlight-tools {
  background: rgba(0, 0, 0, 0.18) !important;
}

/* 强制覆盖 Hexo/Butterfly 代码块真实结构，避免出现黑底黑字 */
#article-container figure.highlight,
#article-container figure.highlight table,
#article-container figure.highlight tr,
#article-container figure.highlight td,
#article-container figure.highlight pre,
#article-container figure.highlight pre span,
#article-container figure.highlight .code pre,
#article-container figure.highlight .code pre span {
  color: #eaf2ff !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

#article-container figure.highlight .gutter pre,
#article-container figure.highlight .gutter pre span,
#article-container figure.highlight .gutter .line {
  color: #9fb0c3 !important;
}

#article-container figure.highlight .code pre,
#article-container figure.highlight .code pre .line {
  color: #eaf2ff !important;
}

#article-container figure.highlight pre .comment,
#article-container figure.highlight pre .quote {
  color: #9fb0c3 !important;
}

#article-container figure.highlight pre .keyword,
#article-container figure.highlight pre .selector-tag,
#article-container figure.highlight pre .operator {
  color: #ffb86c !important;
}

#article-container figure.highlight pre .title,
#article-container figure.highlight pre .name,
#article-container figure.highlight pre .class,
#article-container figure.highlight pre .type,
#article-container figure.highlight pre .built_in,
#article-container figure.highlight pre .function {
  color: #8be9fd !important;
}

#article-container figure.highlight pre .string,
#article-container figure.highlight pre .attr,
#article-container figure.highlight pre .attribute {
  color: #a5e27c !important;
}

#article-container figure.highlight pre .number,
#article-container figure.highlight pre .literal,
#article-container figure.highlight pre .meta,
#article-container figure.highlight pre .params {
  color: #f7c6ff !important;
}

/* 行内 code：浅底深字，覆盖正文与标题中的 code */
#article-container code {
  color: #4b2f1d !important;
  background: #f3e6d7 !important;
  border: 1px solid rgba(180, 130, 80, 0.35) !important;
  border-radius: 6px;
  padding: 2px 6px;
}

/* 代码块内 code 保持语法高亮，不套行内样式 */
#article-container pre code,
#article-container figure.highlight code,
#article-container figure.highlight pre code,
#article-container figure.highlight pre span {
  color: inherit !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

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

::-webkit-scrollbar-track {
  background: #f5ebe0;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #b8956a;
}

/* === 页脚 === */
#footer {
  background: rgba(255, 255, 255, 0.9) !important;
  border-top: 1px solid rgba(180, 130, 80, 0.12);
}

#footer,
#footer .footer-other,
#footer .footer-copyright,
#footer .footer_custom_text {
  color: #5a4332 !important;
}

#footer a {
  color: #9c6540 !important;
  transition: color 0.3s;
}
#footer a:hover {
  color: #b8764e !important;
}

/* === TOC 目录 === */
.toc-link.active {
  color: #b8764e !important;
}

.toc-link:hover {
  color: #9c6540 !important;
}

#aside-content #card-toc,
#aside-content #card-toc .toc-content {
  background: rgba(255, 255, 255, 0.88) !important;
}

#aside-content #card-toc .toc-percentage {
  color: #8a7460 !important;
}

#aside-content #card-toc .toc-content .toc-link {
  color: #6b5744 !important;
}

#aside-content #card-toc .toc-content .toc-link:hover {
  color: #8c5a3a !important;
  background: rgba(212, 165, 116, 0.14) !important;
}

#aside-content #card-toc .toc-content .toc-link.active {
  color: #ffffff !important;
  background: #9a623f !important;
}

/* 移动端侧边菜单与目录文字可读性 */
#sidebar #sidebar-menus,
#sidebar #sidebar-menus .menus_items {
  background: rgba(255, 255, 255, 0.94) !important;
}

#sidebar #sidebar-menus .site-data .headline,
#sidebar #sidebar-menus .site-data .length-num,
#sidebar #sidebar-menus .menus_items .site-page,
#sidebar #sidebar-menus .menus_items .menus_item_child .site-page {
  color: #3d2b1a !important;
}

#sidebar #sidebar-menus .menus_items .site-page:hover {
  color: #2d1f14 !important;
}

/* === 分页器 === */
#pagination .page-number.current {
  background: linear-gradient(135deg, #d4a574 0%, #b8764e 100%) !important;
  color: #fff !important;
  border: none !important;
}

#pagination .page-number {
  color: #6b5744 !important;
  border: 1px solid rgba(180, 130, 80, 0.2) !important;
  transition: all 0.3s ease;
}

#pagination .page-number:hover {
  border-color: #b8764e !important;
  color: #b8764e !important;
}

/* === 右侧按钮组 === */
#rightside > div > button,
#rightside > div > a {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(180, 130, 80, 0.15) !important;
  color: #6b5744 !important;
  transition: all 0.3s ease;
}

#rightside > div > button:hover,
#rightside > div > a:hover {
  border-color: #b8764e !important;
  color: #b8764e !important;
  box-shadow: 0 2px 10px rgba(184, 118, 78, 0.15);
}

/* === 引用块 === */
blockquote {
  background: rgba(212, 165, 116, 0.08) !important;
  border-left: 4px solid #c4956a !important;
  color: #3d2b1a;
}

/* === 选中文本 === */
::selection {
  background: rgba(212, 165, 116, 0.35);
  color: #2d1f14;
}

/* === 搜索弹窗 === */
.search-dialog {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(180, 130, 80, 0.15) !important;
  backdrop-filter: blur(20px);
}

.search-dialog input {
  background: rgba(250, 246, 240, 0.8) !important;
  border: 1px solid rgba(180, 130, 80, 0.2) !important;
  color: #2d1f14 !important;
}

.search-dialog input:focus {
  border-color: #b8764e !important;
  box-shadow: 0 0 12px rgba(184, 118, 78, 0.12);
}

/* === 美化: 文章标题前缀图标 === */
.beautify h2::before {
  color: #b8764e !important;
}

/* === 移动端侧边栏 === */
#sidebar_mobile_data {
  background: rgba(255, 255, 255, 0.96) !important;
}

/* === 文章版权信息 === */
.post-copyright {
  background: rgba(250, 246, 240, 0.7) !important;
  border-left: 4px solid #d4a574 !important;
}

/* === 相关推荐 === */
.relatedPosts .relatedPosts-list > .relatedPosts-item {
  border: 1px solid rgba(180, 130, 80, 0.1);
  transition: all 0.3s ease;
}

.relatedPosts .relatedPosts-list > .relatedPosts-item:hover {
  border-color: rgba(184, 118, 78, 0.25);
  transform: translateY(-2px);
}

/* === 侧边栏精简：隐藏不需要的卡片 === */
#aside-content .card-announcement,
#aside-content .card-categories,
#aside-content .card-tags,
#aside-content .card-archives,
#aside-content .card-webinfo {
  display: none !important;
}

/* === 隐藏暗色模式切换按钮（博客仅用浅色主题） === */
#darkmode {
  display: none !important;
}

/* === 独立教程页：隐藏右侧作者/公告栏，仅保留左目录 + 正文 === */
body.opencode-standalone-page #aside-content {
  display: none !important;
}

body.opencode-standalone-page .layout {
  max-width: 1240px !important;
}

body.opencode-standalone-page .layout > div:first-child {
  width: 100% !important;
}
