/* ============================================================
   潇洒自由浪漫 · 水墨国风  ink.css
   宣纸米白 / 浓淡墨 / 大留白 / 墨染山水 / 毛笔与印章
   仅用 CSS 变量与选择器覆盖，不改动主题源码
   ============================================================ */

/* ---------- 1. 墨阶配色变量 ---------- */
:root {
  --global-bg: #f4f1e8;              /* 宣纸米白·底 */
  --font-color: #2a2a2a;             /* 墨色正文 */
  --card-bg: #fdfcf8;                /* 卡片·暖白纸 */
  --card-meta: #8a8578;              /* 元信息·暖灰 */
  --text-highlight-color: #161616;   /* 标题·浓墨 */
  --light-grey: #e6e1d6;             /* 淡墨分线 */
  --dark-grey: #b5aea1;
  --white: #fdfcf8;
  --blockquote-color: #5a564d;
  --blockquote-bg: rgba(120, 110, 90, .045);
  --toc-link-color: #565248;
  --hr-border: #e0dacd;
  --hr-before-color: #b5aea1;
  --card-box-shadow: 0 6px 26px rgba(60, 50, 30, .05);
  --card-hover-box-shadow: 0 16px 44px rgba(60, 50, 30, .11);
  --scrollbar-color: #c4bdb0;
  --btn-bg: #161616;
  --btn-hover-color: #000000;
  --text-bg-hover: rgba(22, 22, 22, .09);
  --pseudo-hover: #000000;
  --default-bg-color: #161616;
  --search-bg: #efe9dd;
  --headline-presudo: #d8d1c2;
  --sidebar-bg: #fdfcf8;

  /* 封面去色：saturate(0) 黑白 / saturate(1) 彩色 */
  --ink-cover-filter: saturate(0) contrast(1.04);
}

/* 选中：淡墨底 · 浓墨字 */
*::selection {
  background: #ddd6c6;
  color: #111111;
}

/* ---------- 2. 字体：宋体正文 + 毛笔/清秀标题 ---------- */
body,
#article-container {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", "宋体", serif;
  letter-spacing: .022em;
  line-height: 1.95;
}

/* 正文标题：站酷小薇（清秀） */
h1, h2, h3, h4, h5, h6,
#article-container h1, #article-container h2,
#article-container h3, #article-container h4, #article-container h5 {
  font-family: "ZCOOL XiaoWei", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Songti SC", serif;
  letter-spacing: .1em;
  font-weight: 400;
}

/* 站点名：马善政毛笔楷书（潇洒） */
#site-title {
  font-family: "Ma Shan Zheng", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif !important;
  font-weight: 400;
}

#site-subtitle, .site-name,
#aside-content .author-info-name, #aside-content .author-info-description,
#nav .site-page {
  font-family: "ZCOOL XiaoWei", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
  letter-spacing: .18em;
}

/* 站点名：大字、墨重、居中、微倾，如题一笔 */
#site-title {
  font-size: 4.4rem !important;
  letter-spacing: .14em !important;
  text-indent: .14em;
  color: #f8f6ef !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6), 0 0 44px rgba(0, 0, 0, .3);
  transform: skewX(-3deg);
}
#site-subtitle {
  font-size: 1rem !important;
  letter-spacing: .34em;
  opacity: .92;
  color: #f8f6ef !important;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
}

/* ---------- 3. 宣纸质感背景（微纹理 + 柔光 + 淡墨晕染） ---------- */
body {
  background-color: var(--global-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 58% 46% at 10% 14%, rgba(80, 70, 50, .022), transparent 36%),
    radial-gradient(ellipse 46% 56% at 90% 86%, rgba(80, 70, 50, .018), transparent 38%),
    radial-gradient(ellipse 72% 42% at 52% 46%, rgba(80, 70, 50, .014), transparent 44%),
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, .5), transparent 42%),
    radial-gradient(circle at 86% 82%, rgba(255, 255, 255, .34), transparent 46%);
  background-attachment: fixed;
}

/* ---------- 4. 墨染头图（深色底 + 白字） ---------- */
#page-header {
  background-color: #0f0f0f !important;
  background-image:
    linear-gradient(180deg, rgba(20, 20, 20, .32) 0%, rgba(15, 15, 15, .58) 50%, rgba(5, 5, 5, .9) 100%),
    url('/img/A_wide_panoramic_Chinese_ink_w_2026-10-12T11-56-17.webp') !important;
  background-size: cover;
  background-position: center 58%;
  background-repeat: no-repeat;
}

/* 头图区文字：白字 + 墨影 */
#nav a,
#nav .site-page,
#nav .site-name,
#page-header .nav-fixed a {
  color: #f8f6ef !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

/* 覆盖 custom.css 的透明遮罩，让墨染底完整显示 */
#page-header.post-bg:before,
#page-header:not(.not-top-img):before {
  background-color: transparent !important;
}

/* 滚动后导航栏：浓墨半透明 + 强毛玻璃 */
#nav.show {
  background-color: rgba(18, 18, 18, .8) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}

/* ---------- 5. 下拉菜单：宣纸白底 + 墨字（无边框，靠阴影分层） ---------- */
#nav .menus_items .menus_item .menus_item_child {
  background-color: var(--sidebar-bg) !important;
  border: none;
  box-shadow: 0 10px 32px -8px rgba(40, 32, 16, .28);
  border-radius: 5px;
  padding: 6px 0;
}

#nav .menus_items .menus_item .menus_item_child li a {
  color: #2a2a2a !important;
  text-shadow: none !important;
  font-family: "ZCOOL XiaoWei", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
  letter-spacing: .1em;
  padding: 11px 24px;
  transition: all .25s ease;
}

#nav .menus_items .menus_item .menus_item_child li:hover {
  background-color: rgba(120, 110, 90, .08) !important;
}

/* ---------- 6. 卡片：无边框，暖白纸 + 柔和淡影 ---------- */
#recent-posts > .recent-post-item,
#aside-content .card-widget,
#post, #page {
  border: none;
  background-color: var(--card-bg);
  border-radius: 4px;
  box-shadow: var(--card-box-shadow);
}

#recent-posts > .recent-post-item {
  transition: box-shadow .4s cubic-bezier(.22, .61, .36, 1), transform .4s cubic-bezier(.22, .61, .36, 1);
}

#recent-posts > .recent-post-item:hover {
  box-shadow: var(--card-hover-box-shadow);
  transform: translateY(-4px);
}

/* ---------- 7. 封面：去色（变量控制） ---------- */
#recent-posts > .recent-post-item .post_cover img {
  filter: var(--ink-cover-filter);
  transition: filter .7s ease, transform .7s ease;
}
#recent-posts > .recent-post-item:hover .post_cover img {
  filter: var(--ink-cover-filter) brightness(.95);
  transform: scale(1.02);
}

/* ---------- 8. 正文标题：淡墨写意，大留白 ---------- */
#article-container h1 {
  text-align: center;
  margin: 1.6em 0 1.5em;
  font-size: 2.15em;
  letter-spacing: .14em;
}
#article-container h1::after {
  content: "";
  display: block;
  margin: .8em auto 0;
  width: 5.5rem;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(22, 22, 22, .5) 38%, rgba(22, 22, 22, .5) 62%, transparent 100%);
  border-radius: 50%;
}

#article-container h2 {
  border-left: none;
  padding-left: 0;
  margin: 2.2em 0 1.1em;
  padding-bottom: .4em;
  border-bottom: 1px solid rgba(80, 70, 50, .1);
  position: relative;
  letter-spacing: .12em;
}
#article-container h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 3.8rem;
  height: 2px;
  background: rgba(22, 22, 22, .72);
  border-radius: 2px;
  transform: skewX(-14deg);
  transform-origin: left center;
}

#article-container h3 {
  padding-left: 0;
  margin: 1.7em 0 .8em;
  color: #3a3a3a;
  letter-spacing: .1em;
}

/* 段落间距：更宽松的呼吸感 */
#article-container p {
  margin: 1.1em 0;
}

/* ---------- 9. 正文链接：墨线 ---------- */
#article-container a {
  color: #3a3a3a;
  border-bottom: 1px solid rgba(80, 70, 50, .28);
  transition: all .25s ease;
}
#article-container a:hover {
  color: #000000;
  border-bottom-color: #000000;
}

/* ---------- 10. 引用块：传统批注（竖线为必要标识） ---------- */
#article-container blockquote {
  border-left: 3px solid #b5aea1;
  background-color: rgba(120, 110, 90, .04);
  border-radius: 0 4px 4px 0;
  padding: .9em 1.1em .9em 1.3em;
  font-style: italic;
}

/* ---------- 11. 代码块：墨块 ---------- */
#article-container figure.highlight,
#article-container pre {
  background: #2c2a26;
  color: #e8e4dc;
  border: none;
  border-radius: 5px;
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", "Source Code Pro", Consolas, monospace;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .25), 0 6px 20px rgba(60, 50, 30, .08);
}

#article-container figure.highlight .highlight-tools {
  background: #252320 !important;
  color: #8a8a8a !important;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

#article-container figure.highlight .highlight-tools .macStyle {
  display: none !important;
}

#article-container figure.highlight table,
#article-container figure.highlight .gutter,
#article-container figure.highlight .code {
  background: transparent;
}

#article-container figure.highlight .gutter {
  color: #6a6a6a;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

#article-container figure.highlight .code {
  padding-left: 12px;
  color: #e8e4dc;
}

/* ---------- 12. 表格：水墨细线（表格必需） ---------- */
#article-container table th {
  background-color: rgba(120, 110, 90, .06);
}
#article-container table th,
#article-container table td {
  border: 1px solid #e6e1d6;
}

/* ---------- 13. 按钮：墨块无框 ---------- */
#pagination .page-number,
#pagination .extend,
#pagination .space {
  border: none;
  border-radius: 4px;
  transition: all .25s ease;
}
#pagination .page-number.current {
  background: #161616;
  color: #f8f6ef;
}

/* ---------- 14. 标签：无边框无背景，纯文字 ---------- */
#post .tag_share .post-meta__tags,
#post .tag_share .post-meta__tags span,
#aside-content .card-tag-cloud a {
  border: none;
  border-radius: 3px;
  background: transparent;
  padding: 2px 6px;
  margin: 3px;
  color: #5a564d;
  transition: all .22s ease;
}
#aside-content .card-tag-cloud a:hover,
#post .tag_share .post-meta__tags:hover {
  background: #161616;
  border-radius: 3px;
  color: #f8f6ef !important;
}

/* ---------- 14b. 侧边栏分类：扁平列表 ---------- */
#aside-content .card-categories ul.card-category-list {
  padding: 0;
}
#aside-content .card-categories ul.card-category-list > .card-category-list-item a {
  background: transparent;
  border-radius: 0;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(120, 110, 90, .08);
  color: #4a463d;
  transition: all .22s ease;
}
#aside-content .card-categories ul.card-category-list > .card-category-list-item:last-child > a {
  border-bottom: none;
}
#aside-content .card-categories ul.card-category-list > .card-category-list-item a:hover {
  background: transparent;
  color: #000000;
  padding-left: 9px;
}
#aside-content .card-categories .card-category-list-name {
  font-family: "ZCOOL XiaoWei", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
  letter-spacing: .06em;
}

/* 归档列表同样扁平 */
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a {
  background: transparent;
  border-radius: 0;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(120, 110, 90, .08);
  color: #4a463d;
}
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item:last-child > a {
  border-bottom: none;
}
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a:hover {
  background: transparent;
  color: #000000;
  padding-left: 9px;
}

/* ---------- 15. 侧边栏：标题下淡墨线 ---------- */
#aside-content .card-widget .item-headline {
  border-bottom: 1px solid rgba(120, 110, 90, .12);
  padding-bottom: .5rem;
  margin-bottom: .7rem;
  font-family: "ZCOOL XiaoWei", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
  letter-spacing: .14em;
}
#aside-content .card-widget .item-headline span {
  padding-left: .3em;
}

/* ---------- 16. 页脚：无边框，淡墨山影 ---------- */
#footer {
  border-top: none;
  background: transparent !important;
  color: #8a8578;
  position: relative;
}
#footer::before {
  background: transparent !important;
}
#footer::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background:
    radial-gradient(ellipse 30% 20% at 20% 100%, rgba(60, 50, 30, .07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 25% at 55% 100%, rgba(60, 50, 30, .09) 0%, transparent 70%),
    radial-gradient(ellipse 35% 20% at 85% 100%, rgba(60, 50, 30, .07) 0%, transparent 70%);
  pointer-events: none;
}

/* ---------- 17. 暗色模式：墨玉夜 ---------- */
[data-theme="dark"] {
  --global-bg: #141414;
  --font-color: #cfcbc2;
  --card-bg: #1c1b19;
  --card-meta: #8f8a80;
  --text-highlight-color: #f2efe7;
  --light-grey: #2e2d2a;
  --dark-grey: #3d3b37;
  --white: #1c1b19;
  --blockquote-color: #a3a09a;
  --blockquote-bg: rgba(255, 255, 255, .04);
  --toc-link-color: #a8a49c;
  --hr-border: #33322e;
  --hr-before-color: #4d4b46;
  --card-box-shadow: 0 6px 26px rgba(0, 0, 0, .38);
  --card-hover-box-shadow: 0 16px 44px rgba(0, 0, 0, .5);
  --scrollbar-color: #3d3b37;
  --btn-bg: #cfcbc2;
  --btn-hover-color: #ffffff;
  --default-bg-color: #cfcbc2;
  --search-bg: #232220;
  --headline-presudo: #4d4b46;
  --sidebar-bg: #1c1b19;
}

[data-theme="dark"] body {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 58% 46% at 10% 14%, rgba(255, 255, 255, .022), transparent 36%),
    radial-gradient(ellipse 46% 56% at 90% 86%, rgba(255, 255, 255, .018), transparent 38%),
    radial-gradient(ellipse 72% 42% at 52% 46%, rgba(255, 255, 255, .014), transparent 44%);
}

[data-theme="dark"] #page-header {
  background-image:
    linear-gradient(180deg, rgba(10, 10, 10, .4) 0%, rgba(8, 8, 8, .7) 50%, rgba(0, 0, 0, .92) 100%),
    url('/img/A_wide_panoramic_Chinese_ink_w_2026-10-12T11-56-17.webp') !important;
}

[data-theme="dark"] #site-title,
[data-theme="dark"] #site-subtitle {
  color: #f2efe7 !important;
}

[data-theme="dark"] #nav.show {
  background-color: rgba(10, 10, 10, .92) !important;
}

[data-theme="dark"] #nav .menus_items .menus_item .menus_item_child {
  background-color: var(--sidebar-bg) !important;
}
[data-theme="dark"] #nav .menus_items .menus_item .menus_item_child li a {
  color: #dedad2 !important;
}
[data-theme="dark"] #nav .menus_items .menus_item .menus_item_child li:hover {
  background-color: rgba(255, 255, 255, .08) !important;
}

[data-theme="dark"] #article-container h1::after {
  background: linear-gradient(90deg, transparent 0%, rgba(207, 203, 194, .5) 38%, rgba(207, 203, 194, .5) 62%, transparent 100%);
}
[data-theme="dark"] #article-container h2 {
  border-bottom-color: rgba(255, 255, 255, .08);
}
[data-theme="dark"] #article-container h2::after {
  background: rgba(207, 203, 194, .62);
}
[data-theme="dark"] #article-container h3 {
  color: #d0ccc4;
}

[data-theme="dark"] #aside-content .card-widget .item-headline {
  border-bottom-color: rgba(255, 255, 255, .08);
}

[data-theme="dark"] *::selection {
  background: #3d3b37;
  color: #f2efe7;
}

[data-theme="dark"] #article-container figure.highlight,
[data-theme="dark"] #article-container pre {
  background: #232220;
  color: #cfcbc2;
}
[data-theme="dark"] #article-container figure.highlight .highlight-tools {
  background: #2b2a27 !important;
  color: #9a9a9a !important;
  border-bottom-color: rgba(255, 255, 255, .05);
}
[data-theme="dark"] #article-container figure.highlight .gutter {
  color: #888;
  border-right-color: rgba(255, 255, 255, .05);
}

[data-theme="dark"] #aside-content .card-tag-cloud a,
[data-theme="dark"] #post .tag_share .post-meta__tags {
  color: #a8a49c;
}
[data-theme="dark"] #aside-content .card-tag-cloud a:hover,
[data-theme="dark"] #post .tag_share .post-meta__tags:hover {
  background: #cfcbc2;
  color: #141414 !important;
}

[data-theme="dark"] #aside-content .card-categories ul.card-category-list > .card-category-list-item a,
[data-theme="dark"] #aside-content .card-archives ul.card-archive-list > .card-archive-list-item a {
  color: #b8b4ac;
  border-bottom-color: rgba(255, 255, 255, .06);
}
[data-theme="dark"] #aside-content .card-categories ul.card-category-list > .card-category-list-item a:hover,
[data-theme="dark"] #aside-content .card-archives ul.card-archive-list > .card-archive-list-item a:hover {
  color: #f2efe7;
}

/* ---------- 18. 豆瓣书影音页面：水墨化（覆盖 idouban 内置样式） ---------- */
#idouban .idouban-tabs {
  border-bottom: none;
}
#idouban .idouban-tab {
  font-family: "ZCOOL XiaoWei", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
  letter-spacing: .08em;
  color: #6a665c;
  border-radius: 4px;
  padding: 5px 12px;
}
#idouban .idouban-tab-active {
  background: #161616 !important;
  color: #f8f6ef !important;
}
#idouban .idouban-item {
  border-bottom: 1px solid #e6e1d6;
}
#idouban .idouban-picture img {
  filter: var(--ink-cover-filter);
  border-radius: 3px;
}
#idouban a {
  color: #3a3a3a;
}
#idouban .title a,
#idouban .idouban-info .title {
  color: #161616;
  font-family: "ZCOOL XiaoWei", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
  letter-spacing: .05em;
}
#idouban .idouban-meta,
#idouban .idouban-comment {
  color: #6a665c;
}

[data-theme="dark"] #idouban .idouban-item {
  border-bottom-color: #2e2d2a;
}
[data-theme="dark"] #idouban .idouban-tab-active {
  background: #cfcbc2 !important;
  color: #141414 !important;
}
[data-theme="dark"] #idouban a,
[data-theme="dark"] #idouban .idouban-info .title {
  color: #cfcbc2;
}
[data-theme="dark"] #idouban .idouban-meta,
[data-theme="dark"] #idouban .idouban-comment {
  color: #9a968e;
}
