/* ============================================================
   Lusu · 极简学术风自定义样式
   - 纸张网格背景 + 纯 CSS banner 层次
   - 衬线正文 + 无衬线标题
   - 柔化卡片阴影、增加正文留白
   - 亮 / 暗双模式，跟随系统
   ============================================================ */

/* ---------- 1. 全站背景与 Banner 层次（覆盖 Fluid 的背景图） ---------- */

html, body {
  min-height: 100%;
}

body {
  background-color: #f6f1e8 !important;
  background-image:
    linear-gradient(115deg, rgba(166, 111, 74, 0.10) 0%, rgba(166, 111, 74, 0) 36%),
    linear-gradient(245deg, rgba(73, 104, 122, 0.08) 0%, rgba(73, 104, 122, 0) 42%),
    repeating-linear-gradient(0deg, rgba(120, 94, 65, 0.045) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(120, 94, 65, 0.035) 0 1px, transparent 1px 34px) !important;
  background-attachment: fixed, fixed, fixed, fixed !important;
}

[data-user-color-scheme="dark"] body,
html[data-user-color-scheme="dark"] body {
  background-color: #15191f !important;
  background-image:
    linear-gradient(115deg, rgba(201, 162, 130, 0.08) 0%, rgba(201, 162, 130, 0) 36%),
    linear-gradient(245deg, rgba(86, 126, 155, 0.10) 0%, rgba(86, 126, 155, 0) 44%),
    repeating-linear-gradient(0deg, rgba(232, 230, 226, 0.035) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(232, 230, 226, 0.025) 0 1px, transparent 1px 34px) !important;
  background-attachment: fixed, fixed, fixed, fixed !important;
}

@media (prefers-color-scheme: dark) {
  html:not([data-user-color-scheme="light"]) body {
    background-color: #15191f !important;
    background-image:
      linear-gradient(115deg, rgba(201, 162, 130, 0.08) 0%, rgba(201, 162, 130, 0) 36%),
      linear-gradient(245deg, rgba(86, 126, 155, 0.10) 0%, rgba(86, 126, 155, 0) 44%),
      repeating-linear-gradient(0deg, rgba(232, 230, 226, 0.035) 0 1px, transparent 1px 34px),
      repeating-linear-gradient(90deg, rgba(232, 230, 226, 0.025) 0 1px, transparent 1px 34px) !important;
    background-attachment: fixed, fixed, fixed, fixed !important;
  }
}

/* 亮色：warm paper + muted clay + faint grid */
.banner {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 32%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 18px),
    linear-gradient(135deg,
      #f6ead3 0%,
      #e8d0ad 48%,
      #c99b74 100%) !important;
  background-size: cover !important;
}

/* 暗色：deep ink + blue graphite + low-contrast grid */
[data-user-color-scheme="dark"] .banner,
html[data-user-color-scheme="dark"] .banner {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 34%),
    repeating-linear-gradient(115deg, rgba(232, 230, 226, 0.055) 0 1px, transparent 1px 18px),
    linear-gradient(135deg,
      #151a23 0%,
      #242b38 50%,
      #334052 100%) !important;
}

/* 跟随系统暗色（用户未手动切换时） */
@media (prefers-color-scheme: dark) {
  html:not([data-user-color-scheme="light"]) .banner {
    background:
      linear-gradient(120deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 34%),
      repeating-linear-gradient(115deg, rgba(232, 230, 226, 0.055) 0 1px, transparent 1px 18px),
      linear-gradient(135deg,
        #151a23 0%,
        #242b38 50%,
        #334052 100%) !important;
  }
}

/* banner 上的黑色蒙版调淡（_config.fluid.yml 已设 0.15，这里再轻一点） */
.banner .mask {
  background-color: rgba(0, 0, 0, 0.1) !important;
}

[data-user-color-scheme="dark"] .banner .mask,
html[data-user-color-scheme="dark"] .banner .mask {
  background-color: rgba(0, 0, 0, 0.2) !important;
}

/* banner 文字微调 —— 首页用 Lusu 艺术字作主视觉，其他页面仍保持清爽标题 */
#subtitle {
  font-weight: 400;
  letter-spacing: 0.04em;
}

#subtitle[data-typed-text="Learning · Ideas · Notes · Making"] {
  display: inline-block;
  max-width: min(92vw, 760px);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 0;
  font-weight: 500;
}

#subtitle[data-typed-text="Learning · Ideas · Notes · Making"] + .typed-cursor {
  display: none;
}

#subtitle[data-typed-text="Learning · Ideas · Notes · Making"]::before {
  content: "Lusu";
  display: block;
  margin-bottom: 0.45rem;
  font-family: "Didot", "Bodoni 72", "Baskerville", "Times New Roman", serif;
  font-size: 6rem;
  font-style: italic;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #f7f9fb;
  background: linear-gradient(105deg, #ffffff 0%, #dce4ec 42%, #8f9aa6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 12px 28px rgba(74, 45, 25, 0.25);
}

#subtitle[data-typed-text="Learning · Ideas · Notes · Making"]::after {
  content: "Learning · Ideas · Notes · Making";
  display: block;
  color: rgba(255, 253, 249, 0.88);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  text-transform: uppercase;
}


/* ---------- 2. 字体细节 ---------- */

/* 全局衬线（已在 _config.fluid.yml font_family 设定，此处加 fallback 与渲染优化） */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* 标题用无衬线，与衬线正文形成对比，更学术 */
h1, h2, h3, h4, h5, h6,
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6,
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 600;
  letter-spacing: 0.005em;
}

/* 导航栏（顶栏）也用无衬线 */
.navbar, .navbar-brand, .nav-link {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif !important;
}

.navbar-brand strong {
  font-family: "Didot", "Bodoni 72", "Baskerville", "Times New Roman", serif !important;
  font-size: 1.55rem;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f7f9fb;
  background: linear-gradient(105deg, #ffffff 0%, #dce4ec 48%, #9aa5b1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
}

/* 正文行距更舒展（衬线字体需要更宽行距） */
.markdown-body, .post-content {
  line-height: 1.85;
}

.markdown-body p, .post-content p {
  margin-bottom: 1.2em;
}

/* 代码块仍然用等宽字体（覆盖衬线继承） */
code, pre, kbd, samp,
.highlight, .highlight * {
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", Menlo,
               Consolas, "Courier New", monospace !important;
  letter-spacing: 0 !important;
}


/* ---------- 3. 卡片与板块柔化 ---------- */

/* 主板块阴影更轻 */
#board {
  background: rgba(255, 253, 249, 0.92) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04),
              0 12px 32px rgba(113, 84, 52, 0.08) !important;
  border: 1px solid rgba(138, 79, 58, 0.08);
  border-radius: 6px;
}

[data-user-color-scheme="dark"] #board,
html[data-user-color-scheme="dark"] #board {
  background: rgba(29, 33, 42, 0.90) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3),
              0 14px 34px rgba(0, 0, 0, 0.32) !important;
  border-color: rgba(201, 162, 130, 0.10);
}

/* 文章列表项之间的分隔线更柔和 */
.post-list-item {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}


/* ---------- 4. 链接与强调色 ---------- */

/* 内联链接加下划线（学术阅读习惯） */
.markdown-body a:not(.headerlink):not(.btn),
.post-content a:not(.headerlink):not(.btn) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(138, 79, 58, 0.4);
  transition: text-decoration-color 0.2s, color 0.2s;
}

.markdown-body a:not(.headerlink):not(.btn):hover,
.post-content a:not(.headerlink):not(.btn):hover {
  text-decoration-color: currentColor;
}

[data-user-color-scheme="dark"] .markdown-body a:not(.headerlink):not(.btn),
html[data-user-color-scheme="dark"] .post-content a:not(.headerlink):not(.btn) {
  text-decoration-color: rgba(201, 162, 130, 0.4);
}


/* ---------- 5. blockquote 学术引用样式 ---------- */

.markdown-body blockquote,
.post-content blockquote {
  border-left: 3px solid #8a4f3a;
  background: rgba(138, 79, 58, 0.05);
  padding: 0.6em 1.2em;
  margin: 1.2em 0;
  color: #5a5046;
  font-style: italic;
}

[data-user-color-scheme="dark"] .markdown-body blockquote,
html[data-user-color-scheme="dark"] .post-content blockquote {
  border-left-color: #c9a282;
  background: rgba(201, 162, 130, 0.06);
  color: #b8b3a8;
}


/* ---------- 6. 代码块圆角与边框 ---------- */

.highlight, pre.highlight, pre > code {
  border-radius: 5px;
}

.highlight {
  border: 1px solid #e6dfd4;
}

[data-user-color-scheme="dark"] .highlight,
html[data-user-color-scheme="dark"] .highlight {
  border-color: #2e3340;
}


/* ---------- 7. 移除/淡化部分装饰 ---------- */

/* footer 字号小一点，颜色淡一点 */
footer {
  font-size: 0.88em;
  opacity: 0.75;
}

/* TOC 字号更小，更不抢戏 */
#toc {
  font-size: 0.92em;
}


/* ---------- 8. 移动端微调 ---------- */

@media (max-width: 768px) {
  .markdown-body, .post-content {
    line-height: 1.78;
  }
  #subtitle[data-typed-text="Learning · Ideas · Notes · Making"] {
    max-width: 88vw;
  }
  #subtitle[data-typed-text="Learning · Ideas · Notes · Making"]::before {
    font-size: 4rem;
    letter-spacing: 0.06em;
  }
  #subtitle[data-typed-text="Learning · Ideas · Notes · Making"]::after {
    font-size: 0.82rem;
    letter-spacing: 0.11em;
  }
  .banner {
    /* 移动端 banner 变化方向，避免视觉太满 */
    background:
      linear-gradient(140deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 34%),
      repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 18px),
      linear-gradient(160deg,
        #f6ead3 0%,
        #e8d0ad 60%,
        #c99b74 100%) !important;
  }
  [data-user-color-scheme="dark"] .banner,
  html[data-user-color-scheme="dark"] .banner {
    background:
      linear-gradient(140deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 34%),
      repeating-linear-gradient(115deg, rgba(232, 230, 226, 0.045) 0 1px, transparent 1px 18px),
      linear-gradient(160deg,
        #151a23 0%,
        #242b38 60%,
        #334052 100%) !important;
  }
  @media (prefers-color-scheme: dark) {
    html:not([data-user-color-scheme="light"]) .banner {
      background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 34%),
        repeating-linear-gradient(115deg, rgba(232, 230, 226, 0.045) 0 1px, transparent 1px 18px),
        linear-gradient(160deg,
          #151a23 0%,
          #242b38 60%,
          #334052 100%) !important;
    }
  }
}
