/* ==========================================================================
   paper-theme.css · 暖纸刊物主题质感层
   --------------------------------------------------------------------------
   设计语言：暖纸米底 #F5F2ED + 墨棕文字 #241F1A + 焦糖橙 #C05B26 点缀。
   本文件只做「颜色 / 质感 / 字体族」层面的统一，不声明任何布局尺寸、
   间距、定位与排版结构，保证页面布局、组件与功能完全不变。
   加载位置：header（尽早，避免闪烁）+ footer（最末，保证层叠优先级）。
   ========================================================================== */

:root {
    --paper-serif: "Noto Serif SC", "Songti SC", "STSong", "LXGW WenKai Screen", serif;
    --paper-grain: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 1. 纸张颗粒：固定覆盖、不拦截点击、不引起重排 ---------- */
html[data-blog-theme] body.airjournal-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
    background-image: var(--paper-grain);
    background-size: 180px 180px;
    opacity: .035;
    mix-blend-mode: multiply;
}

html[data-blog-theme="dark"] body.airjournal-page::before {
    opacity: .05;
    mix-blend-mode: screen;
}

/* 弹层（z-index ≥ 99999）自然盖在纸纹之上，无需额外处理。 */

/* ---------- 2. 刊物衬线标题：只换字体族，字号字重行高保持原样 ---------- */
.airjournal-page :is(
    h1, h2, h3,
    .post-title,
    .archive-index-year-title strong,
    .archive-index-month-head h2 strong,
    .cat-hero-title,
    .air-side-card h3,
    .air-page-head h1
) {
    font-family: var(--paper-serif);
}

/* ---------- 3. 文本选中色 ---------- */
.airjournal-page ::selection {
    background: rgba(192, 91, 38, .22);
}
html[data-blog-theme="dark"] .airjournal-page ::selection {
    background: rgba(208, 112, 58, .30);
}

/* ---------- 4. 滚动条（WebKit）暖纸化：只改颜色，不声明尺寸 ---------- */
.airjournal-page::-webkit-scrollbar-thumb,
.airjournal-page *::-webkit-scrollbar-thumb {
    background: #d8cfc1;
    background-clip: padding-box;
    border-radius: 99px;
}
.airjournal-page::-webkit-scrollbar-thumb:hover,
.airjournal-page *::-webkit-scrollbar-thumb:hover {
    background: #c05b26;
    background-clip: padding-box;
}
html[data-blog-theme="dark"] .airjournal-page::-webkit-scrollbar-thumb,
html[data-blog-theme="dark"] .airjournal-page *::-webkit-scrollbar-thumb {
    background: #4a4236;
    background-clip: padding-box;
}
.airjournal-page::-webkit-scrollbar-track,
.airjournal-page *::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- 5. Spotlight 搜索弹层（header.html 内联样式覆盖） ---------- */
.search-overlay .search-dialog {
    background: #fffdf9 !important;
    box-shadow: 0 25px 80px rgba(43, 35, 24, .28), 0 0 0 1px rgba(43, 35, 24, .06) !important;
}
.search-overlay .search-input-area {
    border-bottom-color: #e6dfd4 !important;
}
.search-overlay .search-input-icon {
    color: #a39a8e !important;
}
.search-overlay .search-input-field {
    color: #241f1a !important;
}
.search-overlay .search-input-field::placeholder {
    color: #a39a8e !important;
}
.search-overlay .search-submit-btn {
    background: #c05b26 !important;
}
.search-overlay .search-submit-btn:hover {
    background: #9c4719 !important;
}
.search-overlay .search-clear-btn {
    background: #f1ece3 !important;
    color: #6b6258 !important;
}
.search-overlay .search-clear-btn:hover {
    background: #e6dfd4 !important;
    color: #241f1a !important;
}
html[data-blog-theme="dark"] .search-overlay .search-dialog {
    background: #2b261f !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06) !important;
}
html[data-blog-theme="dark"] .search-overlay .search-input-area {
    border-bottom-color: #3a342b !important;
}
html[data-blog-theme="dark"] .search-overlay .search-input-icon {
    color: #7a7165 !important;
}
html[data-blog-theme="dark"] .search-overlay .search-input-field {
    color: #ede5d8 !important;
}
html[data-blog-theme="dark"] .search-overlay .search-input-field::placeholder {
    color: #7a7165 !important;
}
html[data-blog-theme="dark"] .search-overlay .search-clear-btn {
    background: #3a342b !important;
    color: #a79d8f !important;
}
html[data-blog-theme="dark"] .search-overlay .search-clear-btn:hover {
    background: #4a4236 !important;
    color: #ede5d8 !important;
}

/* ---------- 6. 占位文字暖灰（只改颜色，不动焦点轮廓以保留键盘可达性） ---------- */
.airjournal-page input::placeholder,
.airjournal-page textarea::placeholder {
    color: #a39a8e;
}
html[data-blog-theme="dark"] .airjournal-page input::placeholder,
html[data-blog-theme="dark"] .airjournal-page textarea::placeholder {
    color: #7a7165;
}

/* ---------- 7. 文章代码块：偏暖的深纸色，替代偏冷的原子暗 ---------- */
.airjournal-article .post-content pre,
.airjournal-article .article-content-full pre,
.airjournal-article #article-content pre,
.airjournal-article .code-wrapper .code-body {
    background: #241f1a;
}
html[data-blog-theme="dark"] .airjournal-article .post-content pre,
html[data-blog-theme="dark"] .airjournal-article .article-content-full pre,
html[data-blog-theme="dark"] .airjournal-article #article-content pre,
html[data-blog-theme="dark"] .airjournal-article .code-wrapper .code-body {
    background: #17130f;
}

/* ---------- 8. 减少动效偏好下纸纹也不做变化（静态纹理，本无动画） ---------- */
@media (prefers-reduced-motion: reduce) {
    html[data-blog-theme] body.airjournal-page::before {
        transition: none;
    }
}
